1(function() { 2 try { 3 var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; 4 e.SENTRY_RELEASE = { id: "b96dc26" }; 5 var n = new e.Error().stack; 6 n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "17594bc2-8af0-4b09-9a4f-81b17d2bb892", e._sentryDebugIdIdentifier = "sentry-dbid-17594bc2-8af0-4b09-9a4f-81b17d2bb892"); 7 } catch (e) {} 8})(); 9import { n as __esmMin } from "./rolldown-runtime-sLwMD6dS.js"; 10//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/array.mjs 11function addUniqueItem(arr, item) { 12 if (arr.indexOf(item) === -1) arr.push(item); 13} 14function removeItem(arr, item) { 15 const index = arr.indexOf(item); 16 if (index > -1) arr.splice(index, 1); 17} 18function init_array() { 19 return (init_array = __esmMin((() => {})))(); 20} 21//#endregion 22//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/clamp.mjs 23var clamp; 24function init_clamp() { 25 return (init_clamp = __esmMin((() => { 26 clamp = (min, max, v) => { 27 if (v > max) return max; 28 if (v < min) return min; 29 return v; 30 }; 31 })))(); 32} 33//#endregion 34//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/errors.mjs 35var warning, invariant; 36function init_errors() { 37 return (init_errors = __esmMin((() => { 38 warning = () => {}; 39 invariant = () => {}; 40 })))(); 41} 42//#endregion 43//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/global-config.mjs 44var MotionGlobalConfig; 45function init_global_config() { 46 return (init_global_config = __esmMin((() => { 47 MotionGlobalConfig = {}; 48 })))(); 49} 50//#endregion 51//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/is-numerical-string.mjs 52var isNumericalString; 53function init_is_numerical_string() { 54 return (init_is_numerical_string = __esmMin((() => { 55 isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v); 56 })))(); 57} 58//#endregion 59//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/is-object.mjs 60var isObject; 61function init_is_object() { 62 return (init_is_object = __esmMin((() => { 63 isObject = (value) => typeof value === "object" && value !== null; 64 })))(); 65} 66//#endregion 67//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/is-zero-value-string.mjs 68var isZeroValueString; 69function init_is_zero_value_string() { 70 return (init_is_zero_value_string = __esmMin((() => { 71 isZeroValueString = (v) => /^0[^.\s]+$/u.test(v); 72 })))(); 73} 74//#endregion 75//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/memo.mjs 76/*#__NO_SIDE_EFFECTS__*/ 77function memo(callback) { 78 let result; 79 return () => { 80 if (result === void 0) result = callback(); 81 return result; 82 }; 83} 84//#endregion 85//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/noop.mjs 86var noop; 87function init_noop() { 88 return (init_noop = __esmMin((() => { 89 noop = /* @__NO_SIDE_EFFECTS__ */ (any) => any; 90 })))(); 91} 92//#endregion 93//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/pipe.mjs 94var pipe; 95function init_pipe() { 96 return (init_pipe = __esmMin((() => { 97 pipe = (...transformers) => transformers.reduce((a, b) => (v) => b(a(v))); 98 })))(); 99} 100//#endregion 101//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/progress.mjs 102var progress; 103function init_progress() { 104 return (init_progress = __esmMin((() => { 105 progress = /* @__NO_SIDE_EFFECTS__ */ (from, to, value) => { 106 const range = to - from; 107 return range ? (value - from) / range : 1; 108 }; 109 })))(); 110} 111//#endregion 112//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/subscription-manager.mjs 113var SubscriptionManager; 114function init_subscription_manager() { 115 return (init_subscription_manager = __esmMin((() => { 116 SubscriptionManager = class { 117 constructor() { 118 this.subscriptions = []; 119 } 120 add(handler) { 121 addUniqueItem(this.subscriptions, handler); 122 return () => this.remove(handler); 123 } 124 remove(handler) { 125 removeItem(this.subscriptions, handler); 126 } 127 notify(a, b, c) { 128 const numSubscriptions = this.subscriptions.length; 129 if (!numSubscriptions) return; 130 if (numSubscriptions === 1) 131 /** 132 * If there's only a single handler we can just call it without invoking a loop. 133 */ 134 this.subscriptions[0](a, b, c); 135 else for (let i = 0; i < numSubscriptions; i++) { 136 /** 137 * Check whether the handler exists before firing as it's possible 138 * the subscriptions were modified during this loop running. 139 */ 140 const handler = this.subscriptions[i]; 141 handler && handler(a, b, c); 142 } 143 } 144 getSize() { 145 return this.subscriptions.length; 146 } 147 clear() { 148 this.subscriptions.length = 0; 149 } 150 }; 151 })))(); 152} 153//#endregion 154//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/time-conversion.mjs 155var secondsToMilliseconds, millisecondsToSeconds; 156function init_time_conversion() { 157 return (init_time_conversion = __esmMin((() => { 158 secondsToMilliseconds = /* @__NO_SIDE_EFFECTS__ */ (seconds) => seconds * 1e3; 159 millisecondsToSeconds = /* @__NO_SIDE_EFFECTS__ */ (milliseconds) => milliseconds / 1e3; 160 })))(); 161} 162//#endregion 163//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/velocity-per-second.mjs 164var velocityPerSecond; 165function init_velocity_per_second() { 166 return (init_velocity_per_second = __esmMin((() => { 167 velocityPerSecond = /* @__NO_SIDE_EFFECTS__ */ (velocity, frameDuration) => frameDuration ? velocity * (1e3 / frameDuration) : 0; 168 })))(); 169} 170//#endregion 171//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs 172function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) { 173 let currentX; 174 let currentT; 175 let i = 0; 176 do { 177 currentT = lowerBound + (upperBound - lowerBound) / 2; 178 currentX = calcBezier(currentT, mX1, mX2) - x; 179 if (currentX > 0) upperBound = currentT; 180 else lowerBound = currentT; 181 } while (Math.abs(currentX) > subdivisionPrecision && ++i < subdivisionMaxIterations); 182 return currentT; 183} 184/*#__NO_SIDE_EFFECTS__*/ 185function cubicBezier(mX1, mY1, mX2, mY2) { 186 if (mX1 === mY1 && mX2 === mY2) return noop; 187 const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); 188 return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); 189} 190var calcBezier, subdivisionPrecision, subdivisionMaxIterations; 191function init_cubic_bezier() { 192 return (init_cubic_bezier = __esmMin((() => { 193 init_noop(); 194 calcBezier = (t, a1, a2) => (((1 - 3 * a2 + 3 * a1) * t + (3 * a2 - 6 * a1)) * t + 3 * a1) * t; 195 subdivisionPrecision = 1e-7; 196 subdivisionMaxIterations = 12; 197 })))(); 198} 199//#endregion 200//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs 201var mirrorEasing; 202function init_mirror() { 203 return (init_mirror = __esmMin((() => { 204 mirrorEasing = /* @__NO_SIDE_EFFECTS__ */ (easing) => (p) => p <= .5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; 205 })))(); 206} 207//#endregion 208//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs 209var reverseEasing; 210function init_reverse() { 211 return (init_reverse = __esmMin((() => { 212 reverseEasing = /* @__NO_SIDE_EFFECTS__ */ (easing) => (p) => 1 - easing(1 - p); 213 })))(); 214} 215//#endregion 216//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/easing/back.mjs 217var backOut, backIn, backInOut; 218function init_back() { 219 return (init_back = __esmMin((() => { 220 init_cubic_bezier(); 221 init_mirror(); 222 init_reverse(); 223 backOut = /*@__PURE__*/ cubicBezier(.33, 1.53, .69, .99); 224 backIn = /*@__PURE__*/ reverseEasing(backOut); 225 backInOut = /*@__PURE__*/ mirrorEasing(backIn); 226 })))(); 227} 228//#endregion 229//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/easing/anticipate.mjs 230var anticipate; 231function init_anticipate() { 232 return (init_anticipate = __esmMin((() => { 233 init_back(); 234 anticipate = (p) => p >= 1 ? 1 : (p *= 2) < 1 ? .5 * backIn(p) : .5 * (2 - Math.pow(2, -10 * (p - 1))); 235 })))(); 236} 237//#endregion 238//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/easing/circ.mjs 239var circIn, circOut, circInOut; 240function init_circ() { 241 return (init_circ = __esmMin((() => { 242 init_mirror(); 243 init_reverse(); 244 circIn = (p) => 1 - Math.sin(Math.acos(p)); 245 circOut = reverseEasing(circIn); 246 circInOut = mirrorEasing(circIn); 247 })))(); 248} 249//#endregion 250//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/easing/ease.mjs 251var easeIn, easeOut, easeInOut; 252function init_ease() { 253 return (init_ease = __esmMin((() => { 254 init_cubic_bezier(); 255 easeIn = /*@__PURE__*/ cubicBezier(.42, 0, 1, 1); 256 easeOut = /*@__PURE__*/ cubicBezier(0, 0, .58, 1); 257 easeInOut = /*@__PURE__*/ cubicBezier(.42, 0, .58, 1); 258 })))(); 259} 260//#endregion 261//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs 262var isEasingArray; 263function init_is_easing_array() { 264 return (init_is_easing_array = __esmMin((() => { 265 isEasingArray = /* @__NO_SIDE_EFFECTS__ */ (ease) => { 266 return Array.isArray(ease) && typeof ease[0] !== "number"; 267 }; 268 })))(); 269} 270//#endregion 271//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs 272var isBezierDefinition; 273function init_is_bezier_definition() { 274 return (init_is_bezier_definition = __esmMin((() => { 275 isBezierDefinition = /* @__NO_SIDE_EFFECTS__ */ (easing) =>
275 Array.isArray(easing) && typeof easing[0] === "number"; 276 })))(); 277} 278//#endregion 279//#region node_modules/.pnpm/[email protected]/node_modules/motion-utils/dist/es/easing/utils/map.mjs 280var easingLookup, isValidEasing, easingDefinitionToFunction; 281function init_map() { 282 return (init_map = __esmMin((() => { 283 init_errors(); 284 init_noop(); 285 init_anticipate(); 286 init_back(); 287 init_circ(); 288 init_cubic_bezier(); 289 init_ease(); 290 init_is_bezier_definition(); 291 easingLookup = { 292 linear: noop, 293 easeIn, 294 easeInOut, 295 easeOut, 296 circIn, 297 circInOut, 298 circOut, 299 backIn, 300 backInOut, 301 backOut, 302 anticipate 303 }; 304 isValidEasing = (easing) => { 305 return typeof easing === "string"; 306 }; 307 easingDefinitionToFunction = (definition) => { 308 if (isBezierDefinition(definition)) { 309 invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, "cubic-bezier-length"); 310 const [x1, y1, x2, y2] = definition; 311 return /* @__PURE__ */ cubicBezier(x1, y1, x2, y2); 312 } else if (isValidEasing(definition)) { 313 invariant(easingLookup[definition] !== void 0, `Invalid easing type '${definition}'`, "invalid-easing-type"); 314 return easingLookup[definition]; 315 } 316 return definition; 317 }; 318 })))(); 319} 320//#endregion 321//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/frameloop/order.mjs 322var stepsOrder; 323function init_order() { 324 return (init_order = __esmMin((() => { 325 stepsOrder = [ 326 "setup", 327 "read", 328 "resolveKeyframes", 329 "preUpdate", 330 "update", 331 "preRender", 332 "render", 333 "postRender" 334 ]; 335 })))(); 336} 337//#endregion 338//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/frameloop/render-step.mjs 339function createRenderStep(runNextFrame) { 340 /** 341 * We create and reuse two queues, one to queue jobs for the current frame 342 * and one for the next. We reuse to avoid triggering GC after x frames. 343 */ 344 let thisFrame = /* @__PURE__ */ new Set(); 345 let nextFrame = /* @__PURE__ */ new Set(); 346 /** 347 * Track whether we're currently processing jobs in this step. This way 348 * we can decide whether to schedule new jobs for this frame or next. 349 */ 350 let isProcessing = false; 351 let flushNextFrame = false; 352 /** 353 * A set of processes which were marked keepAlive when scheduled. 354 * A keepAlive process is always also held by a frame queue until 355 * it's cancelled, so a Set has the same lifetime semantics as a 356 * WeakSet here while being considerably faster to query every frame. 357 */ 358 const toKeepAlive = /* @__PURE__ */ new Set(); 359 let latestFrameData = { 360 delta: 0, 361 timestamp: 0, 362 isProcessing: false 363 }; 364 function triggerCallback(callback) { 365 if (toKeepAlive.has(callback)) { 366 nextFrame.add(callback); 367 runNextFrame(); 368 } 369 callback(latestFrameData); 370 } 371 const step = { 372 /** 373 * Schedule a process to run on the next frame. 374 */ 375 schedule: (callback, keepAlive = false, immediate = false) => { 376 const queue = immediate && isProcessing ? thisFrame : nextFrame; 377 if (keepAlive) toKeepAlive.add(callback); 378 queue.add(callback); 379 return callback; 380 }, 381 /** 382 * Cancel the provided callback from running on the next frame. 383 */ 384 cancel: (callback) => { 385 nextFrame.delete(callback); 386 toKeepAlive.delete(callback); 387 }, 388 /** 389 * Execute all schedule callbacks. 390 */ 391 process: (frameData) => { 392 latestFrameData = frameData; 393 /** 394 * If we're already processing we've probably been triggered by a flushSync 395 * inside an existing process. Instead of executing, mark flushNextFrame 396 * as true and ensure we flush the following frame at the end of this one. 397 */ 398 if (isProcessing) { 399 flushNextFrame = true; 400 return; 401 } 402 isProcessing = true; 403 const prevFrame = thisFrame; 404 thisFrame = nextFrame; 405 nextFrame = prevFrame; 406 thisFrame.forEach(triggerCallback); 407 thisFrame.clear(); 408 isProcessing = false; 409 if (flushNextFrame) { 410 flushNextFrame = false; 411 step.process(frameData); 412 } 413 } 414 }; 415 return step; 416} 417//#endregion 418//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/frameloop/batcher.mjs 419function createRenderBatcher(scheduleNextBatch, allowKeepAlive) { 420 let runNextFrame = false;
421 let useDefaultElapsed = true; 422 const state = { 423 delta: 0, 424 timestamp: 0, 425 isProcessing: false 426 }; 427 const flagRunNextFrame = () => runNextFrame = true; 428 const steps = stepsOrder.reduce((acc, key) => { 429 acc[key] = createRenderStep(flagRunNextFrame); 430 return acc; 431 }, {}); 432 const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender } = steps; 433 const processBatch = () => { 434 const useManualTiming = MotionGlobalConfig.useManualTiming; 435 const timestamp = useManualTiming ? state.timestamp : performance.now(); 436 runNextFrame = false; 437 if (!useManualTiming) state.delta = useDefaultElapsed ? 1e3 / 60 : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1); 438 state.timestamp = timestamp; 439 state.isProcessing = true; 440 setup.process(state); 441 read.process(state); 442 resolveKeyframes.process(state); 443 preUpdate.process(state); 444 update.process(state); 445 preRender.process(state); 446 render.process(state); 447 postRender.process(state); 448 state.isProcessing = false; 449 if (runNextFrame && allowKeepAlive) { 450 useDefaultElapsed = false; 451 scheduleNextBatch(processBatch); 452 } 453 }; 454 const wake = () => { 455 runNextFrame = true; 456 useDefaultElapsed = true; 457 if (!state.isProcessing) scheduleNextBatch(processBatch); 458 }; 459 const schedule = stepsOrder.reduce((acc, key) => { 460 const step = steps[key]; 461 acc[key] = (process, keepAlive = false, immediate = false) => { 462 if (!runNextFrame) wake(); 463 return step.schedule(process, keepAlive, immediate); 464 }; 465 return acc; 466 }, {}); 467 const cancel = (process) => { 468 for (let i = 0; i < stepsOrder.length; i++) steps[stepsOrder[i]].cancel(process); 469 }; 470 return { 471 schedule, 472 cancel, 473 state, 474 steps 475 }; 476} 477var maxElapsed; 478function init_batcher() { 479 return (init_batcher = __esmMin((() => { 480 init_global_config(); 481 init_order(); 482 maxElapsed = 40; 483 })))(); 484} 485//#endregion 486//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/frameloop/frame.mjs 487var frame, cancelFrame, frameData, frameSteps; 488function init_frame() { 489 return (init_frame = __esmMin((() => { 490 init_noop(); 491 init_batcher(); 492 ({schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps} = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop, true)); 493 })))(); 494} 495//#endregion 496//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs 497function clearTime() { 498 now = void 0; 499} 500var now, time; 501function init_sync_time() { 502 return (init_sync_time = __esmMin((() => { 503 init_global_config(); 504 init_frame(); 505 time = { 506 now: () => { 507 if (now === void 0) time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming ? frameData.timestamp : performance.now()); 508 return now; 509 }, 510 set: (newTime) => { 511 now = newTime; 512 queueMicrotask(clearTime); 513 } 514 }; 515 })))(); 516} 517//#endregion 518//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs 519var sanitize; 520function init_sanitize() { 521 return (init_sanitize = __esmMin((() => { 522 sanitize = (v) => Math.round(v * 1e5) / 1e5; 523 })))(); 524} 525//#endregion 526//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs 527/** 528* Check if a value contains a CSS variable anywhere (e.g. inside calc()). 529* Unlike isCSSVariableToken which checks if the value IS a var() token, 530* this checks if the value CONTAINS var() somewhere in the string. 531*/ 532function containsCSSVariable(value) { 533 if (typeof value !== "string") return false; 534 return value.split("/*")[0].includes("var(--"); 535} 536var checkStringStartsWith, isCSSVariableName, startsAsVariableToken, isCSSVariableToken, singleCssVariableRegex; 537function init_is_css_variable() { 538 return (init_is_css_variable = __esmMin((() => { 539 checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token); 540 isCSSVariableName = /*@__PURE__*/ checkStringStartsWith("--"); 541 startsAsVariableToken = /*@__PURE__*/ checkStringStartsWith("var(--"); 542 isCSSVariableToken = (value) => { 543 if (!startsAsVariableToken(value)) return false;
544 return singleCssVariableRegex.test(value.split("/*")[0].trim()); 545 }; 546 singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu; 547 })))(); 548} 549//#endregion 550//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs 551var number, alpha, scale; 552function init_numbers() { 553 return (init_numbers = __esmMin((() => { 554 init_clamp(); 555 number = { 556 test: (v) => typeof v === "number", 557 parse: parseFloat, 558 transform: (v) => v 559 }; 560 alpha = { 561 ...number, 562 transform: (v) => clamp(0, 1, v) 563 }; 564 scale = { 565 ...number, 566 default: 1 567 }; 568 })))(); 569} 570//#endregion 571//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs 572var floatRegex; 573function init_float_regex() { 574 return (init_float_regex = __esmMin((() => { 575 floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu; 576 })))(); 577} 578//#endregion 579//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs 580function isNullish(v) { 581 return v == null; 582} 583//#endregion 584//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs 585var singleColorRegex; 586function init_single_color_regex() { 587 return (init_single_color_regex = __esmMin((() => { 588 singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu; 589 })))(); 590} 591//#endregion 592//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/color/utils.mjs 593var isColorString, splitColor; 594function init_utils() { 595 return (init_utils = __esmMin((() => { 596 init_float_regex(); 597 init_single_color_regex(); 598 isColorString = (type, testProp) => (v) => { 599 return Boolean(typeof v === "string" && singleColorRegex.test(v) && v.startsWith(type) || testProp && !isNullish(v) && Object.prototype.hasOwnProperty.call(v, testProp)); 600 }; 601 splitColor = (aName, bName, cName) => (v) => { 602 if (typeof v !== "string") return v; 603 const [a, b, c, alpha] = v.match(floatRegex); 604 return { 605 [aName]: parseFloat(a), 606 [bName]: parseFloat(b), 607 [cName]: parseFloat(c), 608 alpha: alpha !== void 0 ? parseFloat(alpha) : 1 609 }; 610 }; 611 })))(); 612} 613//#endregion 614//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs 615var clampRgbUnit, rgbUnit, rgba; 616function init_rgba() { 617 return (init_rgba = __esmMin((() => { 618 init_clamp(); 619 init_numbers(); 620 init_sanitize(); 621 init_utils(); 622 clampRgbUnit = (v) => clamp(0, 255, v); 623 rgbUnit = { 624 ...number, 625 transform: (v) => Math.round(clampRgbUnit(v)) 626 }; 627 rgba = { 628 test: /*@__PURE__*/ isColorString("rgb", "red"), 629 parse: /*@__PURE__*/ splitColor("red", "green", "blue"), 630 transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + rgbUnit.transform(red) + ", " + rgbUnit.transform(green) + ", " + rgbUnit.transform(blue) + ", " + sanitize(alpha.transform(alpha$1)) + ")" 631 }; 632 })))(); 633} 634//#endregion 635//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/color/hex.mjs 636function parseHex(v) { 637 let r = ""; 638 let g = ""; 639 let b = ""; 640 let a = ""; 641 if (v.length > 5) { 642 r = v.substring(1, 3); 643 g = v.substring(3, 5); 644 b = v.substring(5, 7); 645 a = v.substring(7, 9); 646 } else { 647 r = v.substring(1, 2); 648 g = v.substring(2, 3); 649 b = v.substring(3, 4); 650 a = v.substring(4, 5); 651 r += r; 652 g += g; 653 b += b; 654 a += a; 655 } 656 return { 657 red: parseInt(r, 16), 658 green: parseInt(g, 16), 659 blue: parseInt(b, 16),
660 alpha: a ? parseInt(a, 16) / 255 : 1 661 }; 662} 663var hex; 664function init_hex() { 665 return (init_hex = __esmMin((() => { 666 init_rgba(); 667 init_utils(); 668 hex = { 669 test: /*@__PURE__*/ isColorString("#"), 670 parse: parseHex, 671 transform: rgba.transform 672 }; 673 })))(); 674} 675//#endregion 676//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs 677var createUnitType, degrees, percent, px, vh, vw, progressPercentage; 678function init_units() { 679 return (init_units = __esmMin((() => { 680 createUnitType = /* @__NO_SIDE_EFFECTS__ */ (unit) => ({ 681 test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1, 682 parse: parseFloat, 683 transform: (v) => `${v}${unit}` 684 }); 685 degrees = /*@__PURE__*/ createUnitType("deg"); 686 percent = /*@__PURE__*/ createUnitType("%"); 687 px = /*@__PURE__*/ createUnitType("px"); 688 vh = /*@__PURE__*/ createUnitType("vh"); 689 vw = /*@__PURE__*/ createUnitType("vw"); 690 progressPercentage = /*@__PURE__*/ (() => ({ 691 ...percent, 692 parse: (v) => percent.parse(v) / 100, 693 transform: (v) => percent.transform(v * 100) 694 }))(); 695 })))(); 696} 697//#endregion 698//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs 699var hsla; 700function init_hsla() { 701 return (init_hsla = __esmMin((() => { 702 init_numbers(); 703 init_units(); 704 init_sanitize(); 705 init_utils(); 706 hsla = { 707 test: /*@__PURE__*/ isColorString("hsl", "hue"), 708 parse: /*@__PURE__*/ splitColor("hue", "saturation", "lightness"), 709 transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { 710 return "hsla(" + Math.round(hue) + ", " + percent.transform(sanitize(saturation)) + ", " + percent.transform(sanitize(lightness)) + ", " + sanitize(alpha.transform(alpha$1)) + ")"; 711 } 712 }; 713 })))(); 714} 715//#endregion 716//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/color/index.mjs 717var color; 718function init_color() { 719 return (init_color = __esmMin((() => { 720 init_hex(); 721 init_hsla(); 722 init_rgba(); 723 color = { 724 test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v), 725 parse: (v) => { 726 if (rgba.test(v)) return rgba.parse(v); 727 else if (hsla.test(v)) return hsla.parse(v); 728 else return hex.parse(v); 729 }, 730 transform: (v) => { 731 return typeof v === "string" ? v : v.hasOwnProperty("red") ? rgba.transform(v) : hsla.transform(v); 732 }, 733 getAnimatableNone: (v) => { 734 const parsed = color.parse(v); 735 parsed.alpha = 0; 736 return color.transform(parsed); 737 } 738 }; 739 })))(); 740} 741//#endregion 742//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs 743var colorRegex; 744function init_color_regex() { 745 return (init_color_regex = __esmMin((() => { 746 colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu; 747 })))(); 748} 749//#endregion 750//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/complex/index.mjs 751function test(v) { 752 return isNaN(v) && typeof v === "string" && (hasFloat.test(v) || hasColor.test(v)); 753} 754/** 755* Whether analyseComplexValue(value) would find any values, without 756* tokenising the string. CSS variables are resolved before this is 757* used, so it's enough to look for a number or a color. 758*/ 759function hasComplexValues(value) { 760 const asString = value.toString(); 761 return hasFloat.test(asString) || hasColor.test(asString); 762} 763function analyseComplexValue(value) { 764 const originalValue = value.toString(); 765 const values = []; 766 const indexes = { 767 color: [], 768 number: [], 769 var: [] 770 }; 771 const types = []; 772 let i = 0; 773 return { 774 values, 775 split: originalValue.replace(complexRegex, (parsedValue) => { 776 if (color.test(parsedValue)) { 777 indexes.color.push(i); 778 types.push(COLOR_TOKEN); 779 values.push(color.parse(parsedValue)); 780 } else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) { 781 indexes.var.push(i); 782 types.push(VAR_TOKEN); 783 values.push(parsedValue); 784 } else { 785 indexes.number.push(i); 786 types.push(NUMBER_TOKEN); 787 values.push(parseFloat(parsedValue)); 788 } 789 ++i; 790 return SPLIT_TOKEN; 791 }).split(SPLIT_TOKEN), 792 indexes, 793 types 794 }; 795} 796function parseComplexValue(v) { 797 return analyseComplexValue(v).values; 798} 799function buildTransformer({ split, types }) { 800 const numSections = split.length; 801 return (v) => { 802 let output = ""; 803 for (let i = 0; i < numSections; i++) { 804 output += split[i]; 805 if (v[i] !== void 0) { 806 const type = types[i]; 807 if (type === NUMBER_TOKEN) output += sanitize(v[i]); 808 else if (type === COLOR_TOKEN) output += color.transform(v[i]); 809 else output += v[i]; 810 } 811 } 812 return output; 813 }; 814} 815function createTransformer(source) { 816 return buildTransformer(analyseComplexValue(source)); 817} 818function getAnimatableNone$1(v) { 819 const info = analyseComplexValue(v); 820 return buildTransformer(info)(info.values.map((value, i) => convertToZero(value, info.split[i]))); 821} 822var hasFloat, hasColor, NUMBER_TOKEN, COLOR_TOKEN, VAR_TOKEN, VAR_FUNCTION_TOKEN, SPLIT_TOKEN, complexRegex, convertNumbersToZero, convertToZero, complex; 823function init_complex() { 824 return (init_complex = __esmMin((() => { 825 init_color(); 826 init_color_regex(); 827 init_float_regex(); 828 init_sanitize(); 829 hasFloat = /*@__PURE__*/ new RegExp(floatRegex.source); 830 hasColor = /*@__PURE__*/ new RegExp(colorRegex.source, "i"); 831 NUMBER_TOKEN = "number"; 832 COLOR_TOKEN = "color"; 833 VAR_TOKEN = "var"; 834 VAR_FUNCTION_TOKEN = "var("; 835 SPLIT_TOKEN = "${}"; 836 complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu; 837 convertNumbersToZero = (v) => typeof v === "number" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v; 838 convertToZero = (value, splitBefore) => { 839 if (typeof value === "number") return splitBefore?.trim().endsWith("/") ? value : 0; 840 return convertNumbersToZero(value); 841 }; 842 complex = { 843 test, 844 parse: parseComplexValue, 845 createTransformer, 846 getAnimatableNone: getAnimatableNone$1 847 }; 848 })))(); 849} 850//#endregion 851//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs 852function hueToRgb(p, q, t) { 853 if (t < 0) t += 1; 854 if (t > 1) t -= 1; 855 if (t < 1 / 6) return p + (q - p) * 6 * t; 856 if (t < 1 / 2) return q; 857 if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6; 858 return p; 859} 860function hslaToRgba({ hue, saturation, lightness, alpha }) { 861 hue /= 360; 862 saturation /= 100; 863 lightness /= 100; 864 let red = 0; 865 let green = 0; 866 let blue = 0; 867 if (!saturation) red = green = blue = lightness; 868 else { 869 const q = lightness < .5 ? lightness * (1 + saturation) : lightness + saturation - lightness * saturation; 870 const p = 2 * lightness - q; 871 red = hueToRgb(p, q, hue + 1 / 3); 872 green = hueToRgb(p, q, hue); 873 blue = hueToRgb(p, q, hue - 1 / 3); 874 } 875 return { 876 red: Math.round(red * 255), 877 green: Math.round(green * 255), 878 blue: Math.round(blue * 255), 879 alpha 880 }; 881} 882//#endregion 883//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs 884function mixImmediate(a, b) { 885 return (p) => p > 0 ? b : a; 886} 887//#endregion 888//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/utils/mix/number.mjs 889var mixNumber$1; 890function init_number() { 891 return (init_number = __esmMin((() => { 892 mixNumber$1 = (from, to, progress) => { 893 return from + (to - from) * progress; 894 }; 895 })))(); 896} 897//#endregion 898//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/utils/mix/color.mjs 899function asRGBA(color) { 900 const type = getColorType(color); 901 if (!type) { 902 warning(false, `'${color}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"); 903 return false;
904 } 905 let model = type.parse(color); 906 if (type === hsla) model = hslaToRgba(model); 907 return model; 908} 909var mixLinearColor, colorTypes, getColorType, mixColor; 910function init_color$1() { 911 return (init_color$1 = __esmMin((() => { 912 init_errors(); 913 init_hex(); 914 init_hsla(); 915 init_rgba(); 916 init_number(); 917 mixLinearColor = (from, to, v) => { 918 const fromExpo = from * from; 919 const expo = v * (to * to - fromExpo) + fromExpo; 920 return expo < 0 ? 0 : Math.sqrt(expo); 921 }; 922 colorTypes = [ 923 hex, 924 rgba, 925 hsla 926 ]; 927 getColorType = (v) => colorTypes.find((type) => type.test(v)); 928 mixColor = (from, to) => { 929 const fromRGBA = asRGBA(from); 930 const toRGBA = asRGBA(to); 931 if (!fromRGBA || !toRGBA) return mixImmediate(from, to); 932 const blended = { ...fromRGBA }; 933 return (v) => { 934 blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v); 935 blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v); 936 blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v); 937 blended.alpha = mixNumber$1(fromRGBA.alpha, toRGBA.alpha, v); 938 return rgba.transform(blended); 939 }; 940 }; 941 })))(); 942} 943//#endregion 944//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs 945/** 946* Returns a function that, when provided a progress value between 0 and 1, 947* will return the "none" or "hidden" string only when the progress is that of 948* the origin or target. 949*/ 950function mixVisibility(origin, target) { 951 if (invisibleValues.has(origin)) return (p) => p <= 0 ? origin : target; 952 else return (p) => p >= 1 ? target : origin; 953} 954var invisibleValues; 955function init_visibility() { 956 return (init_visibility = __esmMin((() => { 957 invisibleValues = /* @__PURE__ */ new Set(["none", "hidden"]); 958 })))(); 959} 960//#endregion 961//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/utils/mix/complex.mjs 962function mixNumber(a, b) { 963 return (p) => mixNumber$1(a, b, p); 964} 965function getMixer(a) { 966 if (typeof a === "number") return mixNumber; 967 else if (typeof a === "string") return isCSSVariableToken(a) ? mixImmediate : color.test(a) ? mixColor : mixComplex; 968 else if (Array.isArray(a)) return mixArray; 969 else if (typeof a === "object") return color.test(a) ? mixColor : mixObject; 970 return mixImmediate; 971} 972function mixArray(a, b) { 973 const output = [...a]; 974 const numValues = output.length; 975 const blendValue = a.map((v, i) => getMixer(v)(v, b[i])); 976 return (p) => { 977 for (let i = 0; i < numValues; i++) output[i] = blendValue[i](p); 978 return output; 979 }; 980} 981function mixObject(a, b) { 982 const output = { 983 ...a, 984 ...b 985 }; 986 const blendValue = {}; 987 for (const key in output) if (a[key] !== void 0 && b[key] !== void 0) blendValue[key] = getMixer(a[key])(a[key], b[key]); 988 return (v) => { 989 for (const key in blendValue) output[key] = blendValue[key](v); 990 return output; 991 }; 992} 993function matchOrder(origin, target) { 994 const orderedOrigin = []; 995 const pointers = { 996 color: 0, 997 var: 0, 998 number: 0 999 }; 1000 for (let i = 0; i < target.values.length; i++) { 1001 const type = target.types[i]; 1002 const originIndex = origin.indexes[type][pointers[type]]; 1003 const originValue = origin.values[originIndex] ?? 0; 1004 orderedOrigin[i] = originValue; 1005 pointers[type]++; 1006 } 1007 return orderedOrigin; 1008} 1009var mixComplex; 1010function init_complex$1() { 1011 return (init_complex$1 = __esmMin((() => { 1012 init_pipe(), init_errors(); 1013 init_is_css_variable(); 1014 init_color(); 1015 init_complex(); 1016 init_color$1(); 1017 init_number(); 1018 init_visibility(); 1019 mixComplex = (origin, target) => { 1020 const template = complex.createTransformer(target); 1021 const originStats = analyseComplexValue(origin); 1022 const targetStats = analyseComplexValue(target); 1023 if (originStats.indexes.var.length === targetStats.indexes.var.length && originStats.indexes.color.length === targetStats.indexes.color.length && originStats.indexes.number.length >= targetStats.indexes.number.length) { 1024 if (invisibleValues.has(origin) && !targetStats.values.length || invisibleValues.has(target) && !originStats.values.length) return mixVisibility(origin, target); 1025 return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template); 1026 } else { 1027 warning(true, `Complex values '${origin}' and '${target}
1027' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"); 1028 return mixImmediate(origin, target); 1029 } 1030 }; 1031 })))(); 1032} 1033//#endregion 1034//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/utils/mix/index.mjs 1035/** 1036* Most CSS values Motion mixes are a single number with a unit. Mixing 1037* these directly produces the same output as the complex mixer 1038* ("25%", "0.33333px") without tokenising both strings. 1039*/ 1040function mixUnit(from, to) { 1041 const a = unitValue.exec(from); 1042 if (!a) return; 1043 const b = unitValue.exec(to); 1044 if (!b || a[2] !== b[2]) return; 1045 const unit = a[2]; 1046 const origin = parseFloat(a[1]); 1047 const target = parseFloat(b[1]); 1048 return (p) => sanitize(mixNumber$1(origin, target, p)) + unit; 1049} 1050function mix(from, to, p) { 1051 if (typeof from === "number" && typeof to === "number" && typeof p === "number") return mixNumber$1(from, to, p); 1052 if (typeof from === "string" && typeof to === "string") { 1053 const mixer = mixUnit(from, to); 1054 if (mixer) return mixer; 1055 } 1056 return getMixer(from)(from, to); 1057} 1058var unitValue; 1059function init_mix() { 1060 return (init_mix = __esmMin((() => { 1061 init_sanitize(); 1062 init_complex$1(); 1063 init_number(); 1064 unitValue = /^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu; 1065 })))(); 1066} 1067//#endregion 1068//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs 1069var frameloopDriver; 1070function init_frame$1() { 1071 return (init_frame$1 = __esmMin((() => { 1072 init_sync_time(); 1073 init_frame(); 1074 frameloopDriver = (update) => { 1075 const passTimestamp = ({ timestamp }) => update(timestamp); 1076 return { 1077 start: (keepAlive = true) => frame.update(passTimestamp, keepAlive), 1078 stop: () => cancelFrame(passTimestamp), 1079 /** 1080 * If we're processing this frame we can use the 1081 * framelocked timestamp to keep things in sync. 1082 */ 1083 now: () => frameData.isProcessing ? frameData.timestamp : time.now() 1084 }; 1085 }; 1086 })))(); 1087} 1088//#endregion 1089//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs 1090var generateLinearEasing; 1091function init_linear() { 1092 return (init_linear = __esmMin((() => { 1093 generateLinearEasing = (easing, duration, resolution = 10) => { 1094 let points = ""; 1095 const numPoints = Math.max(Math.round(duration / resolution), 2); 1096 for (let i = 0; i < numPoints; i++) points += Math.round(easing(i / (numPoints - 1)) * 1e4) / 1e4 + ", "; 1097 return `linear(${points.substring(0, points.length - 2)})`; 1098 }; 1099 })))(); 1100} 1101//#endregion 1102//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs 1103function calcGeneratorDuration(generator, timeStep = 50, maxDuration = maxGeneratorDuration, keyframes) { 1104 let duration = 0; 1105 let state = generator.next(duration); 1106 keyframes?.push(state.value); 1107 while (!state.done && duration < maxDuration) { 1108 duration += timeStep; 1109 state = generator.next(duration); 1110 keyframes?.push(state.value); 1111 } 1112 return duration >= maxDuration ? Infinity : duration; 1113} 1114var maxGeneratorDuration; 1115function init_calc_duration() { 1116 return (init_calc_duration = __esmMin((() => { 1117 maxGeneratorDuration = 2e4; 1118 })))(); 1119} 1120//#endregion 1121//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs 1122/** 1123* Create a progress => progress easing function from a generator. 1124*/ 1125function createGeneratorEasing(options, scale = 100, createGenerator) { 1126 const generator = createGenerator({ 1127 ...options, 1128 keyframes: [0, scale] 1129 }); 1130 const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); 1131 return { 1132 type: "keyframes", 1133 ease: (progress) => { 1134 return generator.next(duration * progress).value / scale; 1135 }, 1136 duration: millisecondsToSeconds(duration) 1137 }; 1138} 1139function init_create_generator_easing() { 1140 return (init_create_generator_easing = __esmMin((() => { 1141 init_time_conversion(); 1142 init_calc_duration(); 1143 })))(); 1144} 1145//#endregion 1146//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/generators/spring.mjs 1147function calcAngularFreq(undampedFreq, dampingRatio) { 1148 return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); 1149} 1150function approximateRoot(envelope, derivative, initialGuess) { 1151 let result = initialGuess; 1152 for (let i = 1; i < rootIterations; i++) result = result - envelope(result) / derivative(result); 1153 return result; 1154} 1155function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass }) { 1156 let envelope; 1157 let derivative; 1158 warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit"); 1159 let dampingRatio = 1 - bounce; 1160 /**
1161 * Restrict dampingRatio and duration to within acceptable ranges. 1162 */ 1163 dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio); 1164 duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration)); 1165 if (dampingRatio < 1) { 1166 /** 1167 * Underdamped spring 1168 */ 1169 envelope = (undampedFreq) => { 1170 const exponentialDecay = undampedFreq * dampingRatio; 1171 const delta = exponentialDecay * duration; 1172 const a = exponentialDecay - velocity; 1173 const b = calcAngularFreq(undampedFreq, dampingRatio); 1174 const c = Math.exp(-delta); 1175 return safeMin - a / b * c; 1176 }; 1177 derivative = (undampedFreq) => { 1178 const delta = undampedFreq * dampingRatio * duration; 1179 const d = delta * velocity + velocity; 1180 const e = dampingRatio * dampingRatio * undampedFreq * undampedFreq * duration; 1181 const f = Math.exp(-delta); 1182 const g = calcAngularFreq(undampedFreq * undampedFreq, dampingRatio); 1183 return (-envelope(undampedFreq) + safeMin > 0 ? -1 : 1) * ((d - e) * f) / g; 1184 }; 1185 } else { 1186 /** 1187 * Critically-damped spring 1188 */ 1189 envelope = (undampedFreq) => { 1190 return -.001 + Math.exp(-undampedFreq * duration) * ((undampedFreq - velocity) * duration + 1); 1191 }; 1192 derivative = (undampedFreq) => { 1193 return Math.exp(-undampedFreq * duration) * ((velocity - undampedFreq) * (duration * duration)); 1194 }; 1195 } 1196 const initialGuess = 5 / duration; 1197 const undampedFreq = approximateRoot(envelope, derivative, initialGuess); 1198 duration = secondsToMilliseconds(duration); 1199 if (isNaN(undampedFreq)) return { 1200 stiffness: springDefaults.stiffness, 1201 damping: springDefaults.damping, 1202 duration 1203 }; 1204 else { 1205 const stiffness = undampedFreq * undampedFreq * mass; 1206 return { 1207 stiffness, 1208 damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), 1209 duration 1210 }; 1211 } 1212} 1213function isSpringType(options, keys) { 1214 return keys.some((key) => options[key] !== void 0); 1215} 1216function getSpringOptions(options) { 1217 let springOptions = { 1218 velocity: springDefaults.velocity, 1219 stiffness: springDefaults.stiffness, 1220 damping: springDefaults.damping, 1221 mass: springDefaults.mass, 1222 isResolvedFromDuration: false, 1223 ...options 1224 }; 1225 if (!isSpringType(options, physicsKeys) && isSpringType(options, durationKeys)) { 1226 springOptions.velocity = 0; 1227 if (options.visualDuration) { 1228 const visualDuration = options.visualDuration; 1229 const root = 2 * Math.PI / (visualDuration * 1.2); 1230 const stiffness = root * root; 1231 const damping = 2 * clamp(.05, 1, 1 - (options.bounce || 0)) * Math.sqrt(stiffness); 1232 springOptions = { 1233 ...springOptions, 1234 mass: springDefaults.mass, 1235 stiffness, 1236 damping 1237 }; 1238 } else { 1239 const derived = findSpring({ 1240 ...options, 1241 velocity: 0 1242 }); 1243 springOptions = { 1244 ...springOptions, 1245 ...derived, 1246 mass: springDefaults.mass 1247 }; 1248 springOptions.isResolvedFromDuration = true; 1249 } 1250 } 1251 return springOptions; 1252} 1253function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) { 1254 const options = typeof optionsOrVisualDuration !== "object" ? { 1255 visualDuration: optionsOrVisualDuration, 1256 keyframes: [0, 1], 1257 bounce 1258 } : optionsOrVisualDuration; 1259 const origin = options.keyframes[0]; 1260 const target = options.keyframes[options.keyframes.length - 1]; 1261 /** 1262 * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator 1263 * to reduce GC during animation. 1264 */ 1265 const state = { 1266 done: false, 1267 value: origin 1268 }; 1269 const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration } = getSpringOptions({ 1270 ...options, 1271 velocity: -millisecondsToSeconds(options.velocity || 0) 1272 }); 1273 const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); 1274 const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass)); 1275 const decay = dampingRatio * undampedAngularFreq; 1276 /** 1277 * Everything that changes when the spring is retargeted: written by 1278 * retarget() and update(), read by the resolvers. Grouped on one object, 1279 * like the coefficients (c) below. Writing doubles to object fields 1280 * measured marginally faster than to captured let variables in optimised 1281 * code; neither allocates, so this is a grouping choice, not a GC one. 1282 */ 1283 const s = { 1284 target, 1285 delta: target - origin, 1286 velocity: velocity || 0, 1287 restSpeed: 0, 1288 restDelta: 0 1289 }; 1290 /** 1291 * If we're working on a granular scale, use smaller defaults for determining 1292 * when the spring is finished. 1293 * 1294 * These defaults have been selected emprically based on what strikes a good 1295 * ratio between feeling good and finishing as soon as changes are imperceptible. 1296 */ 1297 const setRestThresholds = () => { 1298 const isGranularScale = Math.abs(s.delta) < 5; 1299 s.restSpeed = options.restSpeed || (isGranularScale ? springDefaults.restSpeed.granular : springDefaults.restSpeed.default); 1300 s.restDelta = options.restDelta || (isGranularScale ? springDefaults.restDelta.granular : springDefaults.restDelta.default); 1301 }; 1302 setRestThresholds(); 1303 let resolveSpring; 1304 let resolveVelocity; 1305 /** 1306 * Derives the coefficients that depend on origin, target and initial 1307 * velocity. Called once now and again whenever the spring is retargeted. 1308 */ 1309 let update; 1310 if (dampingRatio < 1) { 1311 const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); 1312 /** 1313 * A is the position coefficient, sinC/cosC the coefficients of the 1314 * analytical derivative (px/ms). The exp/sin/cos terms depend only 1315 * on t, so they're memoized by t independently of the target: a 1316 * spring retargeted every frame samples the same t each frame and 1317 * skips the transcendentals entirely. 1318 */ 1319 const c = { 1320 A: 0, 1321 sinC: 0, 1322 cosC: 0, 1323 t: -1, 1324 env: 0, 1325 sin: 0, 1326 cos: 0 1327 }; 1328 update = () => { 1329 c.A = (s.velocity + decay * s.delta) / angularFreq; 1330 c.sinC = decay * c.A + s.delta * angularFreq; 1331 c.cosC = decay * s.delta - c.A * angularFreq; 1332 }; 1333 const sample = (t) => { 1334 if (t !== c.t) { 1335 c.t = t; 1336 c.env = Math.exp(-decay * t); 1337 c.sin = Math.sin(angularFreq * t); 1338 c.cos = Math.cos(angularFreq * t); 1339 } 1340 }; 1341 resolveSpring = (t) => { 1342 sample(t); 1343 return s.target - c.env * (c.A * c.sin + s.delta * c.cos); 1344 }; 1345 resolveVelocity = (t) => { 1346 sample(t); 1347 return c.env * (c.sinC * c.sin + c.cosC * c.cos); 1348 }; 1349 } else if (dampingRatio === 1) { 1350 resolveSpring = (t) => s.target - Math.exp(-undampedAngularFreq * t) * (s.delta + (s.velocity + undampedAngularFreq * s.delta) * t); 1351 const c = { C: 0 }; 1352 update = () => { 1353 c.C = s.velocity + undampedAngularFreq * s.delta; 1354 }; 1355 resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) * (undampedAngularFreq * c.C * t - s.velocity); 1356 } else { 1357 const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); 1358 resolveSpring = (t) => { 1359 const envelope = Math.exp(-decay * t); 1360 const freqForT = Math.min(dampedAngularFreq * t, 300); 1361 return s.target - envelope * ((s.velocity + decay * s.delta) * Math.sinh(freqForT) + dampedAngularFreq * s.delta * Math.cosh(freqForT)) / dampedAngularFreq; 1362 }; 1363 const c = { 1364 P: 0, 1365 sinh: 0, 1366 cosh: 0 1367 }; 1368 update = () => { 1369 c.P = (s.velocity + decay * s.delta) / dampedAngularFreq; 1370 c.sinh = decay * c.P - s.delta * dampedAngularFreq; 1371 c.cosh = decay * s.delta - c.P * dampedAngularFreq; 1372 }; 1373 resolveVelocity = (t) => { 1374 const envelope = Math.exp(-decay * t); 1375 const freqForT = Math.min(dampedAngularFreq * t, 300); 1376 return envelope * (c.sinh * Math.sinh(freqForT) + c.cosh * Math.cosh(freqForT)); 1377 }; 1378 }
1379 update(); 1380 /** 1381 * Time-defined springs ignore inherited velocity, see getSpringOptions. 1382 */ 1383 const ignoreVelocity = !isSpringType(options, physicsKeys) && isSpringType(options, durationKeys); 1384 const calculatedDuration = isResolvedFromDuration ? duration || null : null; 1385 const generator = { 1386 calculatedDuration, 1387 /** 1388 * Aim the spring at a new target from its current position and 1389 * velocity, reusing the resolved physics and closures. 1390 */ 1391 retarget: (keyframes, newVelocity) => { 1392 s.target = keyframes[keyframes.length - 1]; 1393 s.delta = s.target - keyframes[0]; 1394 s.velocity = ignoreVelocity ? 0 : -millisecondsToSeconds(newVelocity); 1395 if (!(options.restSpeed && options.restDelta)) setRestThresholds(); 1396 generator.calculatedDuration = calculatedDuration; 1397 state.done = false; 1398 update(); 1399 }, 1400 velocity: (t) => secondsToMilliseconds(resolveVelocity(t)), 1401 next: (t) => { 1402 const current = resolveSpring(t); 1403 if (!isResolvedFromDuration) { 1404 const currentVelocity = secondsToMilliseconds(resolveVelocity(t)); 1405 state.done = Math.abs(currentVelocity) <= s.restSpeed && Math.abs(s.target - current) <= s.restDelta; 1406 } else state.done = t >= duration; 1407 state.value = state.done ? s.target : current; 1408 return state; 1409 }, 1410 toString: () => { 1411 const easingDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); 1412 const easing = generateLinearEasing((progress) => generator.next(easingDuration * progress).value, easingDuration, 30); 1413 return easingDuration + "ms " + easing; 1414 }, 1415 toTransition: () => {} 1416 }; 1417 return generator; 1418} 1419var springDefaults, rootIterations, safeMin, durationKeys, physicsKeys; 1420function init_spring() { 1421 return (init_spring = __esmMin((() => { 1422 init_time_conversion(), init_clamp(), init_errors(); 1423 init_linear(); 1424 init_calc_duration(); 1425 init_create_generator_easing(); 1426 springDefaults = { 1427 stiffness: 100, 1428 damping: 10, 1429 mass: 1, 1430 velocity: 0, 1431 duration: 800, 1432 bounce: .3, 1433 visualDuration: .3, 1434 restSpeed: { 1435 granular: .01, 1436 default: 2 1437 }, 1438 restDelta: { 1439 granular: .005, 1440 default: .5 1441 }, 1442 minDuration: .01, 1443 maxDuration: 10, 1444 minDamping: .05, 1445 maxDamping: 1 1446 }; 1447 rootIterations = 12; 1448 safeMin = .001; 1449 durationKeys = ["duration", "bounce"]; 1450 physicsKeys = [ 1451 "stiffness", 1452 "damping", 1453 "mass" 1454 ]; 1455 spring.applyToOptions = (options) => { 1456 const generatorOptions = createGeneratorEasing(options, 100, spring); 1457 options.ease = generatorOptions.ease; 1458 options.duration = secondsToMilliseconds(generatorOptions.duration); 1459 options.type = "keyframes"; 1460 return options; 1461 }; 1462 })))(); 1463} 1464//#endregion 1465//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs 1466function inertia({ keyframes, velocity = 0, power = .8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = .5, restSpeed }) { 1467 const origin = keyframes[0]; 1468 const state = { 1469 done: false, 1470 value: origin 1471 }; 1472 const isOutOfBounds = (v) => v < min || v > max; 1473 const nearestBoundary = (v) => { 1474 if (min === void 0) return max; 1475 if (max === void 0) return min; 1476 return Math.abs(min - v) < Math.abs(max - v) ? min : max; 1477 }; 1478 let amplitude = power * velocity; 1479 const ideal = origin + amplitude; 1480 const target = modifyTarget === void 0 ? ideal : modifyTarget(ideal); 1481 /** 1482 * If the target has changed we need to re-calculate the amplitude, otherwise 1483 * the animation will start from the wrong position. 1484 */ 1485 if (target !== ideal) amplitude = target - origin; 1486 const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant); 1487 const applyFriction = (t) => { 1488 const delta = calcDelta(t); 1489 state.done = Math.abs(delta) <= restDelta; 1490 state.value = state.done ? target : target + delta; 1491 }; 1492 /** 1493 * Ideally this would resolve for t in a stateless way, we could 1494 * do that by always precalculating the animation but as we know 1495 * this will be done anyway we can assume that spring will 1496 * be discovered during that. 1497 */ 1498 let timeReachedBoundary; 1499 let spring$1; 1500 const checkCatchBoundary = (t) => { 1501 if (!isOutOfBounds(state.value)) return; 1502 timeReachedBoundary = t; 1503 spring$1 = spring({ 1504 keyframes: [state.value, nearestBoundary(state.value)], 1505 /** 1506 * The friction curve is target + calcDelta(t), so its exact 1507 * derivative is -calcDelta(t) / timeConstant in units/ms, 1508 * converted here to the units/second expected by spring. 1509 */ 1510 velocity: -calcDelta(t) / timeConstant * 1e3, 1511 damping: bounceDamping, 1512 stiffness: bounceStiffness, 1513 restDelta, 1514 restSpeed 1515 }); 1516 }; 1517 checkCatchBoundary(0); 1518 return { 1519 calculatedDuration: null, 1520 next: (t) => { 1521 /** 1522 * We need to resolve the friction to figure out if we need a 1523 * spring but we don't want to do this twice per frame. So here 1524 * we flag if we updated for this frame and later if we did 1525 * we can skip doing it again. 1526 */ 1527 let hasUpdatedFrame = false;
1528 if (!spring$1 && timeReachedBoundary === void 0) { 1529 hasUpdatedFrame = true; 1530 applyFriction(t); 1531 checkCatchBoundary(t); 1532 } 1533 /** 1534 * If we have a spring and the provided t is beyond the moment the friction 1535 * animation crossed the min/max boundary, use the spring. 1536 */ 1537 if (timeReachedBoundary !== void 0 && t >= timeReachedBoundary) return spring$1.next(t - timeReachedBoundary); 1538 else { 1539 !hasUpdatedFrame && applyFriction(t); 1540 return state; 1541 } 1542 } 1543 }; 1544} 1545function init_inertia() { 1546 return (init_inertia = __esmMin((() => { 1547 init_spring(); 1548 })))(); 1549} 1550//#endregion 1551//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/utils/interpolate.mjs 1552function createMixers(output, ease, customMixer) { 1553 const mixers = []; 1554 const mixerFactory = customMixer || MotionGlobalConfig.mix || mix; 1555 const numMixers = output.length - 1; 1556 for (let i = 0; i < numMixers; i++) { 1557 let mixer = mixerFactory(output[i], output[i + 1]); 1558 if (ease) { 1559 const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease; 1560 mixer = pipe(easingFunction, mixer); 1561 } 1562 mixers.push(mixer); 1563 } 1564 return mixers; 1565} 1566/** 1567* Create a function that maps from a numerical input array to a generic output array. 1568* 1569* Accepts: 1570* - Numbers 1571* - Colors (hex, hsl, hsla, rgb, rgba) 1572* - Complex (combinations of one or more numbers or strings) 1573* 1574* ```jsx 1575* const mixColor = interpolate([0, 1], ['#fff', '#000']) 1576* 1577* mixColor(0.5) // 'rgba(128, 128, 128, 1)' 1578* ``` 1579* 1580* TODO Revisit this approach once we've moved to data models for values, 1581* probably not needed to pregenerate mixer functions. 1582* 1583* @public 1584*/ 1585function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) { 1586 const inputLength = input.length; 1587 invariant(inputLength === output.length, "Both input and output ranges must be the same length", "range-length"); 1588 /** 1589 * If we're only provided a single input, we can just make a function 1590 * that returns the output. 1591 */ 1592 if (inputLength === 1) return () => output[0]; 1593 if (inputLength === 2 && output[0] === output[1]) return () => output[1]; 1594 const isZeroDeltaRange = input[0] === input[1]; 1595 if (input[0] > input[inputLength - 1]) { 1596 input = [...input].reverse(); 1597 output = [...output].reverse(); 1598 } 1599 const mixers = createMixers(output, ease, mixer); 1600 const numMixers = mixers.length; 1601 const interpolator = (v) => { 1602 if (isZeroDeltaRange && v < input[0]) return output[0]; 1603 let i = 0; 1604 if (numMixers > 1) { 1605 for (; i < input.length - 2; i++) if (v < input[i + 1]) break; 1606 } 1607 const progressInRange = progress(input[i], input[i + 1], v); 1608 return mixers[i](progressInRange); 1609 }; 1610 return isClamp ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v)) : interpolator; 1611} 1612function init_interpolate() { 1613 return (init_interpolate = __esmMin((() => { 1614 init_errors(), init_clamp(), init_global_config(), init_noop(), init_pipe(), init_progress(); 1615 init_mix(); 1616 })))(); 1617} 1618//#endregion 1619//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs 1620function fillOffset(offset, remaining) { 1621 const min = offset[offset.length - 1]; 1622 for (let i = 1; i <= remaining; i++) { 1623 const offsetProgress = progress(0, remaining, i); 1624 offset.push(mixNumber$1(min, 1, offsetProgress)); 1625 } 1626} 1627function init_fill() { 1628 return (init_fill = __esmMin((() => { 1629 init_progress(); 1630 init_number(); 1631 })))(); 1632} 1633//#endregion 1634//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs 1635function defaultOffset(arr) { 1636 const offset = [0]; 1637 fillOffset(offset, arr.length - 1); 1638 return offset; 1639} 1640function init_default() { 1641 return (init_default = __esmMin((() => { 1642 init_fill(); 1643 })))(); 1644} 1645//#endregion 1646//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs 1647function convertOffsetToTimes(offset, duration) { 1648 return offset.map((o) => o * duration); 1649} 1650//#endregion 1651//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs 1652function defaultEasing(values, easing) { 1653 return values.map(() => easing || easeInOut).splice(0, values.length - 1); 1654} 1655function keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut" }) { 1656 /** 1657 * Easing functions can be externally defined as strings. Here we convert them 1658 * into actual functions. 1659 */ 1660 const easingFunctions = isEasingArray(ease) ? ease.map(easingDefinitionToFunction) : easingDefinitionToFunction(ease); 1661 /** 1662 * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator 1663 * to reduce GC during animation. 1664 */ 1665 const state = { 1666 done: false, 1667 value: keyframeValues[0] 1668 }; 1669 /** 1670 * Fast setup path for two keyframes one easing. 1671 */ 1672 if (keyframeValues.length === 2 && !Array.isArray(easingFunctions) && (!times || times.length !== 2 || times[0] === 0 && times[1] === 1)) { 1673 const [origin, target] = keyframeValues; 1674 const mixer = origin === target ? void 0 : (MotionGlobalConfig.mix || mix)(origin, target); 1675 return { 1676 calculatedDuration: duration, 1677 next: (t) => { 1678 state.value = mixer ? mixer(easingFunctions(duration > 0 ? clamp(0, 1, t / duration) : 1)) : target; 1679 state.done = t >= duration; 1680 return state; 1681 } 1682 }; 1683 } 1684 const mapTimeToKeyframe = interpolate(convertOffsetToTimes(times && times.length === keyframeValues.length ? times : defaultOffset(keyframeValues), duration), keyframeValues, { ease: Array.isArray(easingFunctions) ? easingFunctions : defaultEasing(keyframeValues, easingFunctions) }); 1685 return { 1686 calculatedDuration: duration, 1687 next: (t) => { 1688 state.value = mapTimeToKeyframe(t); 1689 state.done = t >= duration; 1690 return state; 1691 } 1692 }; 1693} 1694function init_keyframes() {
1695 return (init_keyframes = __esmMin((() => { 1696 init_ease(), init_is_easing_array(), init_map(), init_global_config(), init_clamp(); 1697 init_interpolate(); 1698 init_mix(); 1699 init_default(); 1700 })))(); 1701} 1702//#endregion 1703//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs 1704function getGeneratorVelocity(resolveValue, t, current) { 1705 const prevT = Math.max(t - velocitySampleDuration, 0); 1706 return velocityPerSecond(current - resolveValue(prevT), t - prevT); 1707} 1708/** 1709* A generator's velocity at time t in units/second: analytical where the 1710* generator provides it (springs), otherwise by finite difference. Before 1711* the animation has started this is its initial velocity. 1712*/ 1713function calcGeneratorVelocity(generator, t, initialVelocity = 0) { 1714 if (t <= 0) return initialVelocity; 1715 return generator.velocity ? generator.velocity(t) : getGeneratorVelocity((s) => generator.next(s).value, t, generator.next(t).value); 1716} 1717var velocitySampleDuration; 1718function init_velocity() { 1719 return (init_velocity = __esmMin((() => { 1720 init_velocity_per_second(); 1721 velocitySampleDuration = 5; 1722 })))(); 1723} 1724//#endregion 1725//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs 1726function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe, speed = 1) { 1727 const resolvedKeyframes = keyframes.filter(isNotNull); 1728 const index = speed < 0 || repeat && repeatType !== "loop" && repeat % 2 === 1 ? 0 : resolvedKeyframes.length - 1; 1729 return !index || finalKeyframe === void 0 ? resolvedKeyframes[index] : finalKeyframe; 1730} 1731var isNotNull; 1732function init_get_final() { 1733 return (init_get_final = __esmMin((() => { 1734 isNotNull = (value) => value !== null; 1735 })))(); 1736} 1737//#endregion 1738//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs 1739function replaceTransitionType(transition) { 1740 if (typeof transition.type === "string") transition.type = transitionTypeMap[transition.type]; 1741} 1742var transitionTypeMap; 1743function init_replace_transition_type() { 1744 return (init_replace_transition_type = __esmMin((() => { 1745 init_inertia(); 1746 init_keyframes(); 1747 init_spring(); 1748 transitionTypeMap = { 1749 decay: inertia, 1750 inertia, 1751 tween: keyframes, 1752 keyframes, 1753 spring 1754 }; 1755 })))(); 1756} 1757//#endregion 1758//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/utils/notify-inspector.mjs 1759function baseRecord(kind, animation) { 1760 return { 1761 kind, 1762 animation, 1763 timestamp: time.now(), 1764 frameTimestamp: frameData.timestamp, 1765 frameIsProcessing: frameData.isProcessing 1766 }; 1767} 1768/** 1769* Notify an optional inspector without adding a public Motion API. 1770* 1771* The record is a raw firehose: the live animation handle, the concrete 1772* animation's internal options object untouched (timing fields in 1773* internal milliseconds, name/keyframes/element/motionValue still 1774* attached), a timestamp and the raw frameloop state at notify time. 1775* All interpretation belongs to the consumer behind 1776* globalThis.__MOTION_INSPECT__. 1777*/ 1778function notifyAnimationStart(animation, options, transition) { 1779 const notify = globalThis.__MOTION_INSPECT__; 1780 if (!notify) return; 1781 try { 1782 notify({ 1783 ...baseRecord("animation-start", animation), 1784 options: transition ? { 1785 ...options, 1786 ...transition 1787 } : options 1788 }); 1789 } catch {} 1790} 1791/** 1792* Layout animations drive a projection node's progress rather than a 1793* property, so the record forwards the live node itself: it carries the 1794* DOM instance, the layout options (layoutId) and the progress handle. 1795* Fired inside the frame.update that starts the animation, so nodes 1796* animating in the same layout commit share frameTimestamp. 1797*/ 1798function notifyLayoutAnimationStart(animation, node) { 1799 const notify = globalThis.__MOTION_INSPECT__; 1800 if (!notify) return; 1801 try { 1802 notify({ 1803 ...baseRecord("layout-animation-start", animation), 1804 node 1805 }); 1806 } catch {} 1807} 1808function init_notify_inspector() { 1809 return (init_notify_inspector = __esmMin((() => { 1810 init_frame(); 1811 init_sync_time(); 1812 })))(); 1813} 1814//#endregion 1815//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/utils/WithProm
1815ise.mjs 1816var WithPromise; 1817function init_WithPromise() { 1818 return (init_WithPromise = __esmMin((() => { 1819 WithPromise = class { 1820 constructor() { 1821 this.isResolved = false; 1822 } 1823 get finished() { 1824 if (!this._finished) this._finished = this.isResolved ? Promise.resolve() : new Promise((resolve) => { 1825 this._resolve = resolve; 1826 }); 1827 return this._finished; 1828 } 1829 updateFinished() { 1830 this._finished = this._resolve = void 0; 1831 this.isResolved = false; 1832 } 1833 notifyFinished() { 1834 this.isResolved = true; 1835 this._resolve?.(); 1836 } 1837 /** 1838 * Allows the animation to be awaited. 1839 * 1840 * @deprecated Use `finished` instead. 1841 */ 1842 then(onResolve, onReject) { 1843 return this.finished.then(onResolve, onReject); 1844 } 1845 }; 1846 })))(); 1847} 1848//#endregion 1849//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs 1850var percentToProgress, JSAnimation; 1851function init_JSAnimation() { 1852 return (init_JSAnimation = __esmMin((() => { 1853 init_pipe(), init_clamp(), init_time_conversion(); 1854 init_sync_time(); 1855 init_mix(); 1856 init_frame$1(); 1857 init_inertia(); 1858 init_keyframes(); 1859 init_calc_duration(); 1860 init_velocity(); 1861 init_get_final(); 1862 init_replace_transition_type(); 1863 init_notify_inspector(); 1864 init_WithPromise(); 1865 percentToProgress = (percent) => percent / 100; 1866 JSAnimation = class extends WithPromise { 1867 constructor(options) { 1868 super(); 1869 this.state = "idle"; 1870 this.startTime = null; 1871 this.isStopped = false; 1872 /** 1873 * The current time of the animation. 1874 */ 1875 this.currentTime = 0; 1876 /** 1877 * The time at which the animation was paused. 1878 */ 1879 this.holdTime = null; 1880 /** 1881 * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed. 1882 */ 1883 this.playbackSpeed = 1; 1884 /** 1885 * Reusable state object for the delay phase to avoid 1886 * allocating a new object every frame. 1887 */ 1888 this.delayState = { 1889 done: false, 1890 value: void 0 1891 }; 1892 /** 1893 * This method is bound to the instance to fix a pattern where 1894 * animation.stop is returned as a reference from a useEffect. 1895 */ 1896 this.stop = () => { 1897 const { motionValue } = this.options; 1898 if (motionValue && motionValue.updatedAt !== time.now()) this.tick(time.now()); 1899 this.isStopped = true; 1900 if (this.state === "idle") return; 1901 this.teardown(); 1902 this.options.onStop?.(); 1903 }; 1904 this.options = options; 1905 this.initAnimation(); 1906 this.play(); 1907 if (options.autoplay === false) this.pause(); 1908 notifyAnimationStart(this, this.options); 1909 } 1910 initAnimation() { 1911 const { options } = this; 1912 replaceTransitionType(options); 1913 const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0 } = options; 1914 let { keyframes: keyframes$1 } = options; 1915 const generatorFactory = type || keyframes; 1916 if (generatorFactory !== keyframes && typeof keyframes$1[0] !== "number") { 1917 this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1])); 1918 keyframes$1 = [0, 100]; 1919 } 1920 const generator = generatorFactory(keyframes$1 === options.keyframes ? options : { 1921 ...options, 1922 keyframes: keyframes$1 1923 }); 1924 /** 1925 * If we have a mirror repeat type we need to create a second generator that outputs the 1926 * mirrored (not reversed) animation and later ping pong between the two generators. 1927 */ 1928 if (repeatType === "mirror") this.mirroredGenerator = generatorFactory({ 1929 ...options, 1930 keyframes: [...keyframes$1].reverse(), 1931 velocity: -velocity 1932 }); 1933 /** 1934 * If duration is undefined and we have repeat options, 1935 * we need to calculate a duration from the generator. 1936 * 1937 * We set it to the generator itself to cache the duration. 1938 * Any timeline resolver will need to have already precalculated 1939 * the duration by this step. 1940 */ 1941 if (generator.calculatedDuration === null) generator.calculatedDuration = calcGeneratorDuration(generator); 1942 const { calculatedDuration } = generator; 1943 this.calculatedDuration = calculatedDuration; 1944 this.resolvedDuration = calculatedDuration + repeatDelay; 1945 this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay; 1946 this.generator = generator; 1947 } 1948 updateTime(timestamp) { 1949 const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed; 1950 if (this.holdTime !== null) this.currentTime = this.holdTime; 1951 else this.currentTime = animationTime; 1952 } 1953 tick(timestamp, sample = false) { 1954 const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration } = this; 1955 if (this.startTime === null) return generator.next(0);
1956 const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe } = this.options; 1957 /** 1958 * requestAnimationFrame timestamps can come through as lower than 1959 * the startTime as set by performance.now(). Here we prevent this, 1960 * though in the future it could be possible to make setting startTime 1961 * a pending operation that gets resolved here. 1962 */ 1963 if (this.speed > 0) this.startTime = Math.min(this.startTime, timestamp); 1964 else if (this.speed < 0) this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime); 1965 if (sample) this.currentTime = timestamp; 1966 else this.updateTime(timestamp); 1967 const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1); 1968 const isInDelayPhase = this.playbackSpeed >= 0 ? timeWithoutDelay < 0 : timeWithoutDelay > totalDuration; 1969 this.currentTime = Math.max(timeWithoutDelay, 0); 1970 if (this.state === "finished" && this.holdTime === null) this.currentTime = totalDuration; 1971 let elapsed = this.currentTime; 1972 let frameGenerator = generator; 1973 if (repeat) { 1974 /** 1975 * Get the current progress (0-1) of the animation. If t is > 1976 * than duration we'll get values like 2.5 (midway through the 1977 * third iteration) 1978 */ 1979 const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration; 1980 /** 1981 * Get the current iteration (0 indexed). For instance the floor of 1982 * 2.5 is 2. 1983 */ 1984 let currentIteration = Math.floor(progress); 1985 /** 1986 * Get the current progress of the iteration by taking the remainder 1987 * so 2.5 is 0.5 through iteration 2 1988 */ 1989 let iterationProgress = progress % 1; 1990 /** 1991 * If iteration progress is 1 we count that as the end 1992 * of the previous iteration. 1993 */ 1994 if (!iterationProgress && progress >= 1) iterationProgress = 1; 1995 iterationProgress === 1 && currentIteration--; 1996 currentIteration = Math.min(currentIteration, repeat + 1); 1997 if (Boolean(currentIteration % 2)) { 1998 if (repeatType === "reverse") { 1999 iterationProgress = 1 - iterationProgress; 2000 if (repeatDelay) iterationProgress -= repeatDelay / resolvedDuration; 2001 } else if (repeatType === "mirror") frameGenerator = mirroredGenerator; 2002 } 2003 elapsed = clamp(0, 1, iterationProgress) * resolvedDuration; 2004 } 2005 /** 2006 * If we're in negative time, set state as the initial keyframe. 2007 * This prevents delay: x, duration: 0 animations from finishing 2008 * instantly. 2009 */ 2010 let state; 2011 if (isInDelayPhase) { 2012 this.delayState.value = keyframes[0]; 2013 state = this.delayState; 2014 } else state = frameGenerator.next(elapsed); 2015 if (mixKeyframes && !isInDelayPhase) state.value = mixKeyframes(state.value); 2016 let { done } = state; 2017 if (!isInDelayPhase && calculatedDuration !== null) done = this.playbackSpeed >= 0 ? this.currentTime >= totalDuration : this.currentTime <= 0; 2018 const isAnimationFinished = this.holdTime === null && (this.state === "finished" || this.state === "running" && done); 2019 if (isAnimationFinished && type !== inertia) state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); 2020 if (onUpdate) onUpdate(state.value); 2021 if (isAnimationFinished) this.finish(); 2022 return state; 2023 } 2024 /** 2025 * Allows the returned animation to be awaited or promise-chained. Currently 2026 * resolves when the animation finishes at all but in a future update could/should 2027 * reject if its cancels. 2028 */ 2029 then(resolve, reject) { 2030 return this.finished.then(resolve, reject); 2031 } 2032 get duration() { 2033 return millisecondsToSeconds(this.calculatedDuration); 2034 } 2035 get iterationDuration() { 2036 const { delay = 0 } = this.options || {}; 2037 return this.duration + millisecondsToSeconds(delay); 2038 } 2039 get time() { 2040 return millisecondsToSeconds(this.currentTime); 2041 } 2042 set time(newTime) { 2043 newTime = secondsToMilliseconds(newTime); 2044 this.currentTime = newTime; 2045 if (this.startTime === null || this.holdTime !== null || this.playbackSpeed === 0) this.holdTime = newTime; 2046 else if (this.driver) this.startTime = this.driver.now() - newTime / this.playbackSpeed; 2047 if (this.driver) this.driver.start(false); 2048 else { 2049 this.startTime = 0; 2050 this.state = "paused"; 2051 this.holdTime = newTime; 2052 this.tick(newTime); 2053 } 2054 } 2055 /** 2056 * Returns the generator's velocity at the current time in units/second. 2057 * Uses the analytical derivative when available (springs), avoiding 2058 * the MotionValue's frame-dependent velocity estimation. 2059 */ 2060 getGeneratorVelocity() { 2061 return calcGeneratorVelocity(this.generator, this.currentTime, this.options.velocity); 2062 } 2063 get speed() { 2064 return this.playbackSpeed; 2065 } 2066 set speed(newSpeed) { 2067 const hasChanged = this.playbackSpeed !== newSpeed; 2068 if (hasChanged && this.driver) this.updateTime(time.now()); 2069 this.playbackSpeed = newSpeed; 2070 if (hasChanged && this.driver) this.time = millisecondsToSeconds(this.currentTime); 2071 } 2072 play() { 2073 if (this.isStopped) return; 2074 const { driver = frameloopDriver, startTime } = this.options; 2075 if (!this.driver) this.driver = driver((timestamp) => this.tick(timestamp)); 2076 this.options.onPlay?.(); 2077 const now = this.driver.now(); 2078 if (this.state === "finished") { 2079 this.updateFinished();
2080 this.startTime = now; 2081 } else if (this.holdTime !== null) this.startTime = now - this.holdTime; 2082 else if (!this.startTime) this.startTime = startTime ?? now; 2083 if (this.state === "finished" && this.speed < 0) this.startTime += this.calculatedDuration; 2084 this.holdTime = null; 2085 /** 2086 * Set playState to running only after we've used it in 2087 * the previous logic. 2088 */ 2089 this.state = "running"; 2090 this.driver.start(); 2091 } 2092 pause() { 2093 this.state = "paused"; 2094 this.updateTime(time.now()); 2095 this.holdTime = this.currentTime; 2096 } 2097 complete() { 2098 if (this.state !== "running") this.play(); 2099 this.state = "finished"; 2100 this.holdTime = null; 2101 } 2102 finish() { 2103 this.notifyFinished(); 2104 this.teardown(); 2105 this.state = "finished"; 2106 this.options.onComplete?.(); 2107 } 2108 cancel() { 2109 this.holdTime = null; 2110 this.startTime = 0; 2111 this.tick(0); 2112 this.teardown(); 2113 this.options.onCancel?.(); 2114 } 2115 teardown() { 2116 this.state = "idle"; 2117 this.stopDriver(); 2118 this.startTime = this.holdTime = null; 2119 } 2120 stopDriver() { 2121 if (!this.driver) return; 2122 this.driver.stop(); 2123 this.driver = void 0; 2124 } 2125 sample(sampleTime) { 2126 this.startTime = 0; 2127 return this.tick(sampleTime, true); 2128 } 2129 attachTimeline(timeline) { 2130 if (this.options.allowFlatten) { 2131 this.options.type = "keyframes"; 2132 this.options.ease = "linear"; 2133 this.initAnimation(); 2134 } 2135 this.driver?.stop(); 2136 return timeline.observe(this); 2137 } 2138 }; 2139 })))(); 2140} 2141//#endregion 2142//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs 2143function applyDefaultFilter(v) { 2144 const [name, value] = v.slice(0, -1).split("("); 2145 if (name === "drop-shadow") return v; 2146 const [number] = value.match(floatRegex) || []; 2147 if (!number) return v; 2148 const unit = value.replace(number, ""); 2149 let defaultValue = maxDefaults.has(name) ? 1 : 0; 2150 if (number !== value) defaultValue *= 100; 2151 return name + "(" + defaultValue + unit + ")"; 2152} 2153var maxDefaults, functionRegex, filter; 2154function init_filter() { 2155 return (init_filter = __esmMin((() => { 2156 init_complex(); 2157 init_float_regex(); 2158 maxDefaults = /* @__PURE__ */ new Set([ 2159 "brightness", 2160 "contrast", 2161 "saturate", 2162 "opacity" 2163 ]); 2164 functionRegex = /\b([a-z-]*)\(.*?\)/gu; 2165 filter = { 2166 ...complex, 2167 getAnimatableNone: (v) => { 2168 const functions = v.match(functionRegex); 2169 return functions ? functions.map(applyDefaultFilter).join(" ") : v; 2170 } 2171 }; 2172 })))(); 2173} 2174//#endregion 2175//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/complex/mask.mjs 2176var mask; 2177function init_mask() { 2178 return (init_mask = __esmMin((() => { 2179 init_complex(); 2180 mask = { 2181 ...complex, 2182 getAnimatableNone: (v) => { 2183 const parsed = complex.parse(v); 2184 return complex.createTransformer(v)(parsed.map((v) => typeof v === "number" ? 0 : typeof v === "object" ? { 2185 ...v, 2186 alpha: 1 2187 } : v)); 2188 } 2189 }; 2190 })))(); 2191} 2192//#endregion 2193//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/int.mjs 2194var int; 2195function init_int() { 2196 return (init_int = __esmMin((() => { 2197 init_numbers(); 2198 int = { 2199 ...number, 2200 transform: Math.round 2201 }; 2202 })))(); 2203} 2204//#endregion 2205//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs 2206var transformValueTypes; 2207function init_transform() { 2208 return (init_transform = __esmMin((() => { 2209 init_numbers(); 2210 init_units(); 2211 transformValueTypes = { 2212 rotate: degrees, 2213 /** 2214 * Internal channel for `transition.path` orientToPath. Composed onto 2215 * `rotate` at the transform-build sites so the user's `rotate` is 2216 * never read or overwritten. Not part of `transformPropOrder`. 2217 */ 2218 pathRotation: degrees, 2219 rotateX: degrees, 2220 rotateY: degrees, 2221 rotateZ: degrees, 2222 scale, 2223 scaleX: scale, 2224 scaleY: scale, 2225 scaleZ: scale, 2226 skew: degrees, 2227 skewX: degrees, 2228 skewY: degrees, 2229 distance: px, 2230 translateX: px, 2231 translateY: px, 2232 translateZ: px, 2233 x: px, 2234 y: px, 2235 z: px, 2236 perspective: px, 2237 transformPerspective: px, 2238 opacity: alpha, 2239 originX: progressPercentage, 2240 originY: progressPercentage, 2241 originZ: px 2242 }; 2243 })))(); 2244} 2245//#endregion 2246//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/maps/number.mjs 2247var numberValueTypes; 2248function init_number$1() { 2249 return (init_number$1 = __esmMin((() => { 2250 init_int(); 2251 init_numbers(); 2252 init_units(); 2253 init_transform(); 2254 numberValueTypes = { 2255 borderWidth: px, 2256 borderTopWidth: px, 2257 borderRightWidth: px, 2258 borderBottomWidth: px, 2259 borderLeftWidth: px, 2260 borderRadius: px, 2261 borderTopLeftRadius: px, 2262 borderTopRightRadius: px, 2263 borderBottomRightRadius: px, 2264 borderBottomLeftRadius: px, 2265 width: px, 2266 maxWidth: px, 2267 height: px, 2268 maxHeight: px, 2269 top: px, 2270 right: px, 2271 bottom: px, 2272 left: px, 2273 inset: px, 2274 insetBlock: px, 2275 insetBlockStart: px, 2276 insetBlockEnd: px, 2277 insetInline: px, 2278 insetInlineStart: px, 2279 insetInlineEnd: px, 2280 padding: px, 2281 paddingTop: px, 2282 paddingRight: px, 2283 paddingBottom: px, 2284 paddingLeft: px, 2285 paddingBlock: px, 2286 paddingBlockStart: px, 2287 paddingBlockEnd: px, 2288 paddingInline: px, 2289 paddingInlineStart: px, 2290 paddingInlineEnd: px, 2291 margin: px, 2292 marginTop: px, 2293 marginRight: px, 2294 marginBottom: px, 2295 marginLeft: px, 2296 marginBlock: px, 2297 marginBlockStart: px, 2298 marginBlockEnd: px, 2299 marginInline: px, 2300 marginInlineStart: px, 2301 marginInlineEnd: px, 2302 fontSize: px, 2303 backgroundPositionX: px, 2304 backgroundPositionY: px, 2305 ...transformValueTypes, 2306 zIndex: int, 2307 fillOpacity: alpha, 2308 strokeOpacity: alpha, 2309 numOctaves: int 2310 }; 2311 })))(); 2312} 2313//#endregion 2314//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs 2315var defaultValueTypes, getDefaultValueType; 2316function init_defaults() { 2317 return (init_defaults = __esmMin((() => { 2318 init_color(); 2319 init_filter(); 2320 init_mask(); 2321 init_number$1(); 2322 defaultValueTypes = { 2323 ...numberValueTypes, 2324 color, 2325 backgroundColor: color, 2326 outlineColor: color, 2327 fill: color, 2328 stroke: color, 2329 borderColor: color, 2330 borderTopColor: color, 2331 borderRightColor: color, 2332 borderBottomColor: color, 2333 borderLeftColor: color, 2334 filter, 2335 WebkitFilter: filter, 2336 mask, 2337 WebkitMask: mask 2338 }; 2339 getDefaultValueType = (key) => defaultValueTypes[key]; 2340 })))(); 2341} 2342//#endregion 2343//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs 2344function getAnimatableNone(key, value) { 2345 let defaultValueType = getDefaultValueType(key); 2346 if (!customTypes.has(defaultValueType)) defaultValueType = complex; 2347 return defaultValueType.getAnimatableNone ? defaultValueType.getAnimatableNone(value) : void 0; 2348} 2349var customTypes; 2350function init_animatable_none() { 2351 return (init_animatable_none = __esmMin((() => { 2352 init_complex(); 2353 init_filter(); 2354 init_mask(); 2355 init_defaults(); 2356 customTypes = /*@__PURE__*/ new Set([filter, mask]); 2357 })))(); 2358} 2359//#endregion 2360//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs 2361function fillWildcards(keyframes) { 2362 for (let i = 1; i < keyframes.length; i++) keyframes[i] ?? (keyframes[i] = keyframes[i - 1]); 2363} 2364//#endregion 2365//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs 2366function defaultTransformValue(name) { 2367 return name.includes("scale") ? 1 : 0; 2368} 2369function parseValueFromTransform(transform, name) { 2370 if (!transform || transform === "none") return defaultTransformValue(name); 2371 const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u); 2372 let parsers; 2373 let match; 2374 if (matrix3dMatch) { 2375 parsers = matrix3dParsers; 2376 match = matrix3dMatch; 2377 } else { 2378 const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u); 2379 parsers = matrix2dParsers; 2380 match = matrix2dMatch; 2381 } 2382 if (!match) return defaultTransformValue(name); 2383 const valueParser = parsers[name]; 2384 const values = match[1].split(",").map(convertTransformToNumber); 2385 return typeof valueParser === "function" ? valueParser(values) : values[valueParser]; 2386} 2387function convertTransformToNumber(value) { 2388 return parseFloat(value.trim()); 2389} 2390var radToDeg, rotate, matrix2dParsers, rebaseAngle, rotateZ, scaleX, scaleY, matrix3dParsers, readTransformValue; 2391function init_parse_transform() { 2392 return (init_parse_transform = __esmMin((() => { 2393 radToDeg = (rad) => rad * 180 / Math.PI; 2394 rotate = (v) => { 2395 const angle = radToDeg(Math.atan2(v[1], v[0])); 2396 return rebaseAngle(angle); 2397 }; 2398 matrix2dParsers = { 2399 x: 4, 2400 y: 5, 2401 translateX: 4, 2402 translateY: 5, 2403 scaleX: 0, 2404 scaleY: 3, 2405 scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2, 2406 rotate, 2407 rotateZ: rotate, 2408 skewX: (v) => radToDeg(Math.atan(v[1])), 2409 skewY: (v) => radToDeg(Math.atan(v[2])), 2410 skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2 2411 }; 2412 rebaseAngle = (angle) => { 2413 angle = angle % 360;
2414 if (angle < 0) angle += 360; 2415 return angle; 2416 }; 2417 rotateZ = rotate; 2418 scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]); 2419 scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]); 2420 matrix3dParsers = { 2421 x: 12, 2422 y: 13, 2423 z: 14, 2424 translateX: 12, 2425 translateY: 13, 2426 translateZ: 14, 2427 scaleX, 2428 scaleY, 2429 scale: (v) => (scaleX(v) + scaleY(v)) / 2, 2430 rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))), 2431 rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))), 2432 rotateZ, 2433 rotate: rotateZ, 2434 skewX: (v) => radToDeg(Math.atan(v[4])), 2435 skewY: (v) => radToDeg(Math.atan(v[1])), 2436 skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2 2437 }; 2438 readTransformValue = (instance, name) => { 2439 const { transform = "none" } = getComputedStyle(instance); 2440 return parseValueFromTransform(transform, name); 2441 }; 2442 })))(); 2443} 2444//#endregion 2445//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs 2446var transformPropOrder, transformProps; 2447function init_keys_transform() { 2448 return (init_keys_transform = __esmMin((() => { 2449 transformPropOrder = [ 2450 "transformPerspective", 2451 "x", 2452 "y", 2453 "z", 2454 "translateX", 2455 "translateY", 2456 "translateZ", 2457 "scale", 2458 "scaleX", 2459 "scaleY", 2460 "rotate", 2461 "rotateX", 2462 "rotateY", 2463 "rotateZ", 2464 "skew", 2465 "skewX", 2466 "skewY" 2467 ]; 2468 transformProps = /*@__PURE__*/ (() => /* @__PURE__ */ new Set([...transformPropOrder, "pathRotation"]))(); 2469 })))(); 2470} 2471//#endregion 2472//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs 2473/** 2474* Reset any bounding box-changing transforms so the element can be 2475* measured. Returns the values to restore. Values already at their 2476* default don't change the box, so they're left alone: an element with 2477* only `rotate: 0` doesn't need to be re-rendered before measuring. 2478*/ 2479function removeNonTranslationalTransform(visualElement) { 2480 const removedTransforms = []; 2481 nonTranslationalTransformKeys.forEach((key) => { 2482 const value = visualElement.getValue(key); 2483 if (value !== void 0) { 2484 const current = value.get(); 2485 const reset = key.startsWith("scale") ? 1 : 0; 2486 if (current === reset) return; 2487 removedTransforms.push([key, current]); 2488 value.set(reset); 2489 } 2490 }); 2491 return removedTransforms; 2492} 2493/** 2494* Computed width/height is already in pixels and unaffected by 2495* transforms. It's "auto" for elements without a layout box (e.g. inline), 2496* in which case we fall back to measuring the bounding box. 2497*/ 2498function measureDimension(computed, measureBox, axis, paddingStart, paddingEnd, boxSizing) { 2499 const px = parseFloat(computed); 2500 if (!isNaN(px)) return px; 2501 const { min, max } = measureBox()[axis]; 2502 const size = max - min; 2503 return boxSizing === "border-box" ? size : size - parseFloat(paddingStart) - parseFloat(paddingEnd); 2504} 2505var isNumOrPxType, transformKeys, nonTranslationalTransformKeys, boxDependentValues, positionalValues; 2506function init_unit_conversion() { 2507 return (init_unit_conversion = __esmMin((() => { 2508 init_parse_transform(); 2509 init_keys_transform(); 2510 init_numbers(); 2511 init_units(); 2512 isNumOrPxType = (v) => v === number || v === px; 2513 transformKeys = /* @__PURE__ */ new Set([ 2514 "x", 2515 "y", 2516 "z" 2517 ]); 2518 nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key)); 2519 boxDependentValues = /* @__PURE__ */ new Set(["bottom", "right"]); 2520 positionalValues = { 2521 width: ({ width, paddingLeft = "0", paddingRight = "0", boxSizing }, measureBox) => measureDimension(width, measureBox, "x", paddingLeft, paddingRight, boxSizing), 2522 height: ({ height, paddingTop = "0", paddingBottom = "0", boxSizing }, measureBox) => measureDimension(height, measureBox, "y", paddingTop, paddingBottom, boxSizing), 2523 top: ({ top }) => parseFloat(top), 2524 left: ({ left }) => parseFloat(left), 2525 bottom: ({ top }, measureBox) => { 2526 const { y } = measureBox(); 2527 return parseFloat(top) + (y.max - y.min); 2528 }, 2529 right: ({ left }, measureBox) => { 2530 const { x } = measureBox(); 2531 return parseFloat(left) + (x.max - x.min); 2532 }, 2533 x: ({ transform }) => parseValueFromTransform(transform, "x"), 2534 y: ({ transform }) => parseValueFromTransform(transform, "y") 2535 }; 2536 positionalValues.translateX = positionalValues.x; 2537 positionalValues.translateY = positionalValues.y; 2538 })))(); 2539} 2540//#endregion 2541//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs 2542function measureAllKeyframes() { 2543 if (anyNeedsMeasurement) { 2544 const resolversToMeasure = []; 2545 const elementsToMeasure = /* @__PURE__ */ new Set(); 2546 const elementsToUntransform = /* @__PURE__ */ new Set(); 2547 toResolve.forEach((resolver) => { 2548 if (!resolver.needsMeasurement) return; 2549 resolversToMeasure.push(resolver); 2550 elementsToMeasure.add(resolver.element); 2551 if (boxDependentValues.has(resolver.name)) elementsToUntransform.add(resolver.element); 2552 }); 2553 const transformsToRestore = /* @__PURE__ */ new Map(); 2554 /** 2555 * Write pass 2556 * Values measured from the bounding box need bounding box-changing 2557 * transforms removed first. Values read from computed style don't. 2558 */ 2559 elementsToUntransform.forEach((element) => { 2560 const removedTransforms = removeNonTranslationalTransform(element); 2561 if (!removedTransforms.length) return; 2562 transformsToRestore.set(element, removedTransforms); 2563 element.render(); 2564 }); 2565 resolversToMeasure.forEach((resolver) => resolver.measureInitialState()); 2566 elementsToMeasure.forEach((element) => { 2567 element.render(); 2568 const restore = transformsToRestore.get(element); 2569 if (restore) restore.forEach(([key, value]) => { 2570 element.getValue(key)?.set(value); 2571 }); 2572 }); 2573 resolversToMeasure.forEach((resolver) => resolver.measureEndState()); 2574 resolversToMeasure.forEach((resolver) => { 2575 if (resolver.suspendedScrollY !== void 0) window.scrollTo(0, resolver.suspendedScrollY); 2576 }); 2577 } 2578 anyNeedsMeasurement = false;
2579 isScheduled = false; 2580 toResolve.forEach((resolver) => resolver.complete(isForced)); 2581 toResolve.clear(); 2582} 2583function readAllKeyframes() { 2584 toResolve.forEach((resolver) => { 2585 resolver.readKeyframes(); 2586 if (resolver.needsMeasurement) anyNeedsMeasurement = true; 2587 }); 2588} 2589function flushKeyframeResolvers() { 2590 isForced = true; 2591 readAllKeyframes(); 2592 measureAllKeyframes(); 2593 isForced = false; 2594} 2595/** 2596* Normalise a value read from the subject into an animation origin: a 2597* number read as a string ("0", "200") becomes a number, and a value 2598* that isn't animatable (e.g. "none") but whose target is becomes an 2599* animatable zero in the shape of the target. 2600*/ 2601function readOrigin(value, name, target) { 2602 if (typeof value === "string") { 2603 if (isNumericalString(value) || isZeroValueString(value)) return parseFloat(value); 2604 else if (!complex.test(value) && complex.test(target)) return getAnimatableNone(name, target); 2605 } 2606 return value ?? void 0; 2607} 2608var toResolve, isScheduled, anyNeedsMeasurement, isForced, KeyframeResolver; 2609function init_KeyframesResolver() { 2610 return (init_KeyframesResolver = __esmMin((() => { 2611 init_is_numerical_string(), init_is_zero_value_string(); 2612 init_complex(); 2613 init_animatable_none(); 2614 init_unit_conversion(); 2615 init_frame(); 2616 toResolve = /* @__PURE__ */ new Set(); 2617 isScheduled = false; 2618 anyNeedsMeasurement = false; 2619 isForced = false; 2620 KeyframeResolver = class { 2621 constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) { 2622 this.state = "pending"; 2623 /** 2624 * Track whether this resolver is async. If it is, it'll be added to the 2625 * resolver queue and flushed in the next frame. Resolvers that aren't going 2626 * to trigger read/write thrashing don't need to be async. 2627 */ 2628 this.isAsync = false; 2629 /** 2630 * Track whether this resolver needs to perform a measurement 2631 * to resolve its keyframes. 2632 */ 2633 this.needsMeasurement = false; 2634 this.unresolvedKeyframes = [...unresolvedKeyframes]; 2635 this.onComplete = onComplete; 2636 this.name = name; 2637 this.motionValue = motionValue; 2638 this.element = element; 2639 this.isAsync = isAsync; 2640 } 2641 scheduleResolve() { 2642 this.state = "scheduled"; 2643 if (this.isAsync) { 2644 toResolve.add(this); 2645 if (!isScheduled) { 2646 isScheduled = true; 2647 frame.read(readAllKeyframes); 2648 frame.resolveKeyframes(measureAllKeyframes); 2649 } 2650 } else { 2651 this.readKeyframes(); 2652 this.complete(); 2653 } 2654 } 2655 readKeyframes() { 2656 const { unresolvedKeyframes, name, element, motionValue } = this; 2657 if (unresolvedKeyframes[0] === null) { 2658 const currentValue = motionValue?.get(); 2659 const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; 2660 if (currentValue !== void 0) unresolvedKeyframes[0] = currentValue; 2661 else if (element && name) { 2662 const valueAsRead = readOrigin(element.readValue(name, finalKeyframe), name, finalKeyframe); 2663 if (valueAsRead !== void 0) unresolvedKeyframes[0] = valueAsRead; 2664 } 2665 if (unresolvedKeyframes[0] === void 0) unresolvedKeyframes[0] = finalKeyframe; 2666 if (motionValue && currentValue === void 0) motionValue.set(unresolvedKeyframes[0]); 2667 } 2668 fillWildcards(unresolvedKeyframes); 2669 } 2670 setFinalKeyframe() {} 2671 measureInitialState() {} 2672 renderEndStyles() {} 2673 measureEndState() {} 2674 complete(isForcedComplete = false) { 2675 this.state = "complete"; 2676 this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete); 2677 toResolve.delete(this); 2678 } 2679 cancel() { 2680 if (this.state === "scheduled") { 2681 toResolve.delete(this); 2682 this.state = "pending"; 2683 } 2684 } 2685 resume() { 2686 if (this.state === "pending") this.scheduleResolve(); 2687 } 2688 }; 2689 })))(); 2690} 2691//#endregion 2692//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs 2693var isCSSVar; 2694function init_is_css_var() { 2695 return (init_is_css_var = __esmMin((() => { 2696 isCSSVar = (name) => name.startsWith("--"); 2697 })))(); 2698} 2699//#endregion 2700//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/render/dom/style-set.mjs 2701function setStyle(element, name, value) { 2702 isCSSVar(name) ? element.style.setProperty(name, value) : element.style[name] = value; 2703} 2704function init_style_set() { 2705 return (init_style_set = __esmMin((() => { 2706 init_is_css_var(); 2707 })))(); 2708} 2709//#endregion 2710//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/utils/supports/flags.mjs 2711var supportsFlags; 2712function init_flags() { 2713 return (init_flags = __esmMin((() => { 2714 supportsFlags = {}; 2715 })))(); 2716} 2717//#endregion 2718//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/utils/supports/memo.mjs 2719function memoSupports(callback, supportsFlag) { 2720 const memoized = /* @__PURE__ */ memo(callback); 2721 return () => supportsFlags[supportsFlag] ?? memoized(); 2722} 2723function init_memo$1() { 2724 return (init_memo$1 = __esmMin((() => { 2725 init_flags(); 2726 })))(); 2727} 2728//#endregion 2729//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs 2730var supportsScrollTimeline; 2731function init_scroll_timeline() { 2732 return (init_scroll_timeline = __esmMin((() => { 2733 init_memo$1(); 2734 supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== void 0, "scrollTimeline"); 2735 })))(); 2736} 2737//#endregion 2738//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs 2739var supportsLinearEasing; 2740function init_linear_easing() { 2741 return (init_linear_easing = __esmMin((() => { 2742 init_memo$1(); 2743 supportsLinearEasing = /*@__PURE__*/ memoSupports(() => { 2744 try { 2745 document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" }); 2746 } catch (e) { 2747 return false;
2748 } 2749 return true; 2750 }, "linearEasing"); 2751 })))(); 2752} 2753//#endregion 2754//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs 2755var cubicBezierAsString; 2756function init_cubic_bezier$1() { 2757 return (init_cubic_bezier$1 = __esmMin((() => { 2758 cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`; 2759 })))(); 2760} 2761//#endregion 2762//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs 2763var supportedWaapiEasing; 2764function init_supported() { 2765 return (init_supported = __esmMin((() => { 2766 init_cubic_bezier$1(); 2767 supportedWaapiEasing = { 2768 linear: "linear", 2769 ease: "ease", 2770 easeIn: "ease-in", 2771 easeOut: "ease-out", 2772 easeInOut: "ease-in-out", 2773 circIn: /*@__PURE__*/ cubicBezierAsString([ 2774 0, 2775 .65, 2776 .55, 2777 1 2778 ]), 2779 circOut: /*@__PURE__*/ cubicBezierAsString([ 2780 .55, 2781 0, 2782 1, 2783 .45 2784 ]), 2785 backIn: /*@__PURE__*/ cubicBezierAsString([ 2786 .31, 2787 .01, 2788 .66, 2789 -.59 2790 ]), 2791 backOut: /*@__PURE__*/ cubicBezierAsString([ 2792 .33, 2793 1.53, 2794 .69, 2795 .99 2796 ]) 2797 }; 2798 })))(); 2799} 2800//#endregion 2801//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs 2802function mapEasingToNativeEasing(easing, duration) { 2803 if (!easing) return; 2804 else if (typeof easing === "function") return supportsLinearEasing() ? generateLinearEasing(easing, duration) : "ease-out"; 2805 else if (isBezierDefinition(easing)) return cubicBezierAsString(easing); 2806 else if (Array.isArray(easing)) return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) || supportedWaapiEasing.easeOut); 2807 else return supportedWaapiEasing[easing]; 2808} 2809function init_map_easing() { 2810 return (init_map_easing = __esmMin((() => { 2811 init_is_bezier_definition(); 2812 init_linear_easing(); 2813 init_linear(); 2814 init_cubic_bezier$1(); 2815 init_supported(); 2816 })))(); 2817} 2818//#endregion 2819//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs 2820function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeOut", times } = {}, pseudoElement = void 0) { 2821 const keyframeOptions = { [valueName]: keyframes }; 2822 if (times) keyframeOptions.offset = times; 2823 const easing = mapEasingToNativeEasing(ease, duration); 2824 /** 2825 * If this is an easing array, apply to keyframes, not animation as a whole 2826 */ 2827 if (Array.isArray(easing)) keyframeOptions.easing = easing; 2828 const options = { 2829 delay, 2830 duration, 2831 easing: !Array.isArray(easing) ? easing : "linear", 2832 fill: "both", 2833 iterations: repeat + 1, 2834 direction: repeatType === "reverse" ? "alternate" : "normal" 2835 }; 2836 if (pseudoElement) options.pseudoElement = pseudoElement; 2837 return element.animate(keyframeOptions, options); 2838} 2839function init_start_waapi_animation() { 2840 return (init_start_waapi_animation = __esmMin((() => { 2841 init_map_easing(); 2842 })))(); 2843} 2844//#endregion 2845//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs 2846function isGenerator(type) { 2847 return typeof type === "function" && "applyToOptions" in type; 2848} 2849function init_is_generator() { 2850 return (init_is_generator = __esmMin((() => {})))(); 2851} 2852//#endregion 2853//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs 2854function applyGeneratorOptions({ type, ...options }) { 2855 if (isGenerator(type) && supportsLinearEasing()) return type.applyToOptions(options); 2856 else { 2857 options.duration ?? (options.duration = 300); 2858 options.ease ?? (options.ease = "easeOut"); 2859 } 2860 return options; 2861} 2862function init_apply_generator() { 2863 return (init_apply_generator = __esmMin((() => { 2864 init_linear_easing(); 2865 })))(); 2866} 2867//#endregion 2868//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs 2869var NativeAnimation; 2870function init_NativeAnimation() { 2871 return (init_NativeAnimation = __esmMin((() => { 2872 init_errors(), init_time_conversion(), init_noop(); 2873 init_style_set(); 2874 init_scroll_timeline(); 2875 init_get_final(); 2876 init_WithPromise(); 2877 init_notify_inspector(); 2878 init_start_waapi_animation(); 2879 init_apply_generator(); 2880 NativeAnimation = class extends WithPromise {
2881 constructor(options) { 2882 super(); 2883 this.finishedTime = null; 2884 this.isStopped = false; 2885 /** 2886 * Tracks a manually-set start time that takes precedence over WAAPI's 2887 * dynamic startTime. This is cleared when play() or time setter is called, 2888 * allowing WAAPI to take over timing. 2889 */ 2890 this.manualStartTime = null; 2891 if (!options) return; 2892 const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete } = options; 2893 this.isPseudoElement = Boolean(pseudoElement); 2894 this.allowFlatten = allowFlatten; 2895 this.options = options; 2896 invariant(typeof options.type !== "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring"); 2897 const transition = applyGeneratorOptions(options); 2898 this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement); 2899 if (transition.autoplay === false) this.animation.pause(); 2900 this.animation.onfinish = () => { 2901 this.finishedTime = this.time; 2902 if (!pseudoElement) { 2903 const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); 2904 if (this.updateMotionValue) this.updateMotionValue(keyframe); 2905 /** 2906 * If we can, we want to commit the final style as set by the user, 2907 * rather than the computed keyframe value supplied by the animation. 2908 * We always do this, even when a motion value is present, to prevent 2909 * a visual flash in Firefox where the WAAPI animation's fill is removed 2910 * during cancel() before the scheduled render can apply the correct value. 2911 */ 2912 setStyle(element, name, keyframe); 2913 this.animation.cancel(); 2914 } 2915 onComplete?.(); 2916 this.notifyFinished(); 2917 }; 2918 notifyAnimationStart(this, options, transition); 2919 } 2920 play() { 2921 if (this.isStopped) return; 2922 this.manualStartTime = null; 2923 this.animation.play(); 2924 if (this.state === "finished") this.updateFinished(); 2925 } 2926 pause() { 2927 this.animation.pause(); 2928 } 2929 complete() { 2930 this.animation.finish?.(); 2931 } 2932 cancel() { 2933 try { 2934 this.animation.cancel(); 2935 } catch (e) {} 2936 } 2937 stop() { 2938 if (this.isStopped) return; 2939 this.isStopped = true; 2940 const { state } = this; 2941 if (state === "idle" || state === "finished") return; 2942 if (this.updateMotionValue) this.updateMotionValue(); 2943 else this.commitStyles(); 2944 if (!this.isPseudoElement) this.cancel(); 2945 } 2946 /** 2947 * WAAPI doesn't natively have any interruption capabilities. 2948 * 2949 * In this method, we commit styles back to the DOM before cancelling 2950 * the animation. 2951 * 2952 * This is designed to be overridden by NativeAnimationExtended, which 2953 * will create a renderless JS animation and sample it twice to calculate 2954 * its current value, "previous" value, and therefore allow 2955 * Motion to also correctly calculate velocity for any subsequent animation 2956 * while deferring the commit until the next animation frame. 2957 */ 2958 commitStyles() { 2959 const element = this.options?.element; 2960 if (!this.isPseudoElement && element?.isConnected) this.animation.commitStyles?.(); 2961 } 2962 get duration() { 2963 const duration = this.animation.effect?.getComputedTiming?.().duration || 0; 2964 return millisecondsToSeconds(Number(duration)); 2965 } 2966 get iterationDuration() { 2967 const { delay = 0 } = this.options || {}; 2968 return this.duration + millisecondsToSeconds(delay); 2969 } 2970 get time() { 2971 return millisecondsToSeconds(Number(this.animation.currentTime) || 0); 2972 } 2973 set time(newTime) { 2974 const wasFinished = this.finishedTime !== null; 2975 this.manualStartTime = null; 2976 this.finishedTime = null; 2977 this.animation.currentTime = secondsToMilliseconds(newTime); 2978 if (wasFinished) this.animation.pause(); 2979 } 2980 /** 2981 * The playback speed of the animation. 2982 * 1 = normal speed, 2 = double speed, 0.5 = half speed. 2983 */ 2984 get speed() { 2985 return this.animation.playbackRate; 2986 } 2987 set speed(newSpeed) { 2988 if (newSpeed < 0) this.finishedTime = null; 2989 this.animation.playbackRate = newSpeed; 2990 } 2991 get state() { 2992 return this.finishedTime !== null ? "finished" : this.animation.playState; 2993 } 2994 get startTime() { 2995 return this.manualStartTime ?? Number(this.animation.startTime); 2996 } 2997 set startTime(newStartTime) { 2998 this.manualStartTime = this.animation.startTime = newStartTime; 2999 } 3000 /** 3001 * Attaches a timeline to the animation, for instance the `ScrollTimeline`. 3002 */ 3003 attachTimeline({ timeline, rangeStart, rangeEnd, observe }) { 3004 if (this.allowFlatten) this.animation.effect?.updateTiming({ easing: "linear" }); 3005 this.animation.onfinish = null; 3006 if (timeline && supportsScrollTimeline()) { 3007 this.animation.timeline = timeline; 3008 if (rangeStart) this.animation.rangeStart = rangeStart; 3009 if (rangeEnd) this.animation.rangeEnd = rangeEnd; 3010 return noop; 3011 } else return observe(this); 3012 } 3013 }; 3014 })))(); 3015} 3016//#endregion 3017//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs 3018function isUnsupportedEase(key) { 3019 return key in unsupportedEasingFunctions; 3020} 3021function replaceStringEasing(transition) { 3022 if (typeof transition.ease === "string" && isUnsupportedEase(transition.ease)) transition.ease = unsupportedEasingFunctions[transition.ease]; 3023} 3024var unsupportedEasingFunctions; 3025function init_unsupported_easing() { 3026 return (init_unsupported_easing = __esmMin((() => { 3027 init_circ(), init_back(), init_anticipate(); 3028 unsupportedEasingFunctions = { 3029 anticipate, 3030 backInOut, 3031 circInOut 3032 }; 3033 })))(); 3034} 3035//#endregion 3036//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs 3037var sampleDelta, NativeAnimationExtended; 3038function init_NativeAnimationExtended() { 3039 return (init_NativeAnimationExtended = __esmMin((() => { 3040 init_clamp(); 3041 init_sync_time(); 3042 init_style_set(); 3043 init_JSAnimation(); 3044 init_NativeAnimation(); 3045 init_replace_transition_type(); 3046 init_unsupported_easing(); 3047 sampleDelta = 10; 3048 NativeAnimationExtended = class extends NativeAnimation { 3049 constructor(options) { 3050 /** 3051 * The base NativeAnimation function only supports a subset 3052 * of Motion easings, and WAAPI also only supports some 3053 * easing functions via string/cubic-bezier definitions. 3054 * 3055 * This function replaces those unsupported easing functions 3056 * with a JS easing function. This will later get compiled 3057 * to a linear() easing function. 3058 */ 3059 replaceStringEasing(options); 3060 /** 3061 * Ensure we replace the transition type with a generator function 3062 * before passing to WAAPI. 3063 * 3064 * TODO: Does this have a better home? It could be shared with 3065 * JSAnimation. 3066 */ 3067 replaceTransitionType(options); 3068 super(options); 3069 /** 3070 * Only set startTime when the animation should autoplay. 3071 * Setting startTime on a paused WAAPI animation unpauses it
3072 * (per the WAAPI spec), which breaks autoplay: false. 3073 */ 3074 if (options.startTime !== void 0 && options.autoplay !== false) this.startTime = options.startTime; 3075 this.options = options; 3076 } 3077 /** 3078 * WAAPI doesn't natively have any interruption capabilities. 3079 * 3080 * Rather than read committed styles back out of the DOM, we can 3081 * create a renderless JS animation and sample it twice to calculate 3082 * its current value, "previous" value, and therefore allow 3083 * Motion to calculate velocity for any subsequent animation. 3084 */ 3085 updateMotionValue(value) { 3086 const { motionValue, onUpdate, onComplete, element, ...options } = this.options; 3087 if (!motionValue) return; 3088 if (value !== void 0) { 3089 motionValue.set(value); 3090 return; 3091 } 3092 const sampleAnimation = new JSAnimation({ 3093 ...options, 3094 autoplay: false 3095 }); 3096 /** 3097 * Use wall-clock elapsed time for sampling. 3098 * Under CPU load, WAAPI's currentTime may not reflect actual 3099 * elapsed time, causing incorrect sampling and visual jumps. 3100 */ 3101 const sampleTime = Math.max(sampleDelta, time.now() - this.startTime); 3102 const delta = clamp(0, sampleDelta, sampleTime - sampleDelta); 3103 const current = sampleAnimation.sample(sampleTime).value; 3104 /** 3105 * Write the estimated value to inline style so it persists 3106 * after cancel(), covering the async gap before the next 3107 * animation starts. 3108 */ 3109 const { name } = this.options; 3110 if (element && name) setStyle(element, name, current); 3111 motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, current, delta); 3112 sampleAnimation.stop(); 3113 } 3114 }; 3115 })))(); 3116} 3117//#endregion 3118//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs 3119var isAnimatable; 3120function init_is_animatable() { 3121 return (init_is_animatable = __esmMin((() => { 3122 init_complex(); 3123 isAnimatable = (value, name) => { 3124 if (name === "zIndex") return false; 3125 if (typeof value === "number" || Array.isArray(value)) return true; 3126 if (typeof value === "string" && (complex.test(value) || value === "0") && !value.startsWith("url(")) return true; 3127 return false; 3128 }; 3129 })))(); 3130} 3131//#endregion 3132//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs 3133function hasKeyframesChanged(keyframes) { 3134 const current = keyframes[0]; 3135 if (keyframes.length === 1) return true; 3136 for (let i = 0; i < keyframes.length; i++) if (keyframes[i] !== current) return true; 3137} 3138function canAnimate(keyframes, name, type, velocity) { 3139 /** 3140 * Check if we're able to animate between the start and end keyframes, 3141 * and throw a warning if we're attempting to animate between one that's 3142 * animatable and another that isn't. 3143 */ 3144 const originKeyframe = keyframes[0]; 3145 if (originKeyframe === null) return false; 3146 /** 3147 * These aren't traditionally animatable but we do support them. 3148 * In future we could look into making this more generic or replacing 3149 * this function with mix() === mixImmediate 3150 */ 3151 if (name === "display" || name === "visibility") return true; 3152 const targetKeyframe = keyframes[keyframes.length - 1]; 3153 const isOriginAnimatable = isAnimatable(originKeyframe, name); 3154 const isTargetAnimatable = isAnimatable(targetKeyframe, name); 3155 if (!isOriginAnimatable || !isTargetAnimatable) { 3156 isOriginAnimatable !== isTargetAnimatable && warning(false, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". "${isOriginAnimatable ? targetKeyframe : originKeyframe}" is not an animatable value.`, "value-not-animatable"); 3157 return false; 3158 } 3159 return hasKeyframesChanged(keyframes) || (type === "spring" || isGenerator(type)) && velocity; 3160} 3161function init_can_animate() { 3162 return (init_can_animate = __esmMin((() => { 3163 init_errors(); 3164 init_is_animatable(); 3165 })))(); 3166} 3167//#endregion 3168//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs 3169function makeAnimationInstant(options) { 3170 options.duration = 0; 3171 options.type = "keyframes"; 3172} 3173//#endregion 3174//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs 3175var acceleratedValues; 3176function init_accelerated_values() { 3177 return (init_accelerated_values = __esmMin((() => { 3178 acceleratedValues = /* @__PURE__ */ new Set([ 3179 "opacity", 3180 "clipPath", 3181 "filter", 3182 "transform", 3183 "backgroundColor" 3184 ]); 3185 })))(); 3186} 3187//#endregion 3188//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs 3189function hasBrowserOnlyColors(keyframes) { 3190 for (let i = 0; i < keyframes.length; i++) if (typeof keyframes[i] === "string" && browserColorFunctions.test(keyframes[i])) return true; 3191 return false;
3192} 3193var browserColorFunctions; 3194function init_is_browser_color() { 3195 return (init_is_browser_color = __esmMin((() => { 3196 browserColorFunctions = /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/; 3197 })))(); 3198} 3199//#endregion 3200//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs 3201function supportsBrowserAnimation(options) { 3202 const { motionValue, name, repeatDelay, repeatType, damping, type, keyframes } = options; 3203 /** 3204 * Most values can't be accelerated at all, so check the name before 3205 * looking at the element or its props. 3206 */ 3207 if (!name || !(acceleratedValues.has(name) || colorProperties.has(name))) return false; 3208 const subject = motionValue?.owner?.current; 3209 /** 3210 * We use instanceof checks instead of isHTMLElement()/isSVGElement() 3211 * because we explicitly **don't** want elements in different timing 3212 * contexts (i.e. popups) to be accelerated, as it's not possible to sync 3213 * these animations properly with those driven from the main window 3214 * frameloop. 3215 */ 3216 if (!(subject instanceof HTMLElement) && !(subject instanceof SVGElement)) return false; 3217 const { onUpdate, transformTemplate } = motionValue.owner.getProps(); 3218 return supportsWaapi() && (acceleratedValues.has(name) || colorProperties.has(name) && hasBrowserOnlyColors(keyframes)) && (name !== "transform" || !transformTemplate) && !onUpdate && !repeatDelay && repeatType !== "mirror" && damping !== 0 && type !== "inertia"; 3219} 3220var colorProperties, supportsWaapi; 3221function init_waapi() { 3222 return (init_waapi = __esmMin((() => { 3223 init_accelerated_values(); 3224 init_is_browser_color(); 3225 colorProperties = /* @__PURE__ */ new Set([ 3226 "color", 3227 "backgroundColor", 3228 "outlineColor", 3229 "fill", 3230 "stroke", 3231 "borderColor", 3232 "borderTopColor", 3233 "borderRightColor", 3234 "borderBottomColor", 3235 "borderLeftColor" 3236 ]); 3237 supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); 3238 })))(); 3239} 3240//#endregion 3241//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs 3242var MAX_RESOLVE_DELAY, AsyncMotionValueAnimation; 3243function init_AsyncMotionValueAnimation() { 3244 return (init_AsyncMotionValueAnimation = __esmMin((() => { 3245 init_global_config(); 3246 init_sync_time(); 3247 init_JSAnimation(); 3248 init_get_final(); 3249 init_KeyframesResolver(); 3250 init_NativeAnimationExtended(); 3251 init_can_animate(); 3252 init_WithPromise(); 3253 init_waapi(); 3254 MAX_RESOLVE_DELAY = 40; 3255 AsyncMotionValueAnimation = class extends WithPromise { 3256 constructor(options) { 3257 super(); 3258 /** 3259 * Bound to support return animation.stop pattern 3260 */ 3261 this.stop = () => { 3262 if (this._animation) { 3263 this._animation.stop(); 3264 this.stopTimeline?.(); 3265 } 3266 this.keyframeResolver?.cancel(); 3267 }; 3268 this.createdAt = time.now(); 3269 const { keyframes, name, motionValue, element } = options; 3270 /** 3271 * animateMotionValue builds a fresh options object per value, so 3272 * it's completed in place as keyframes resolve rather than copied. 3273 */ 3274 const optionsWithDefaults = options; 3275 optionsWithDefaults.autoplay ?? (optionsWithDefaults.autoplay = true); 3276 optionsWithDefaults.delay ?? (optionsWithDefaults.delay = 0); 3277 optionsWithDefaults.type ?? (optionsWithDefaults.type = "keyframes"); 3278 optionsWithDefaults.repeat ?? (optionsWithDefaults.repeat = 0); 3279 optionsWithDefaults.repeatDelay ?? (optionsWithDefaults.repeatDelay = 0); 3280 optionsWithDefaults.repeatType ?? (optionsWithDefaults.repeatType = "loop"); 3281 const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver; 3282 this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element); 3283 this.keyframeResolver?.scheduleResolve(); 3284 } 3285 onKeyframesResolved(keyframes, finalKeyframe, options, sync) { 3286 this.keyframeResolver = void 0; 3287 const { name, type, velocity, delay, isHandoff, onUpdate } = options; 3288 this.resolvedAt = time.now(); 3289 /** 3290 * If we can't animate this value with the resolved keyframes 3291 * then we should complete it immediately. 3292 */ 3293 let canAnimateValue = true; 3294 if (!canAnimate(keyframes, name, type, velocity)) { 3295 canAnimateValue = false;
3296 if (MotionGlobalConfig.instantAnimations || !delay) onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe)); 3297 keyframes[0] = keyframes[keyframes.length - 1]; 3298 makeAnimationInstant(options); 3299 options.repeat = 0; 3300 } 3301 /** 3302 * Resolve startTime for the animation. 3303 * 3304 * This method uses the createdAt and resolvedAt to calculate the 3305 * animation startTime. *Ideally*, we would use the createdAt time as t=0 3306 * as the following frame would then be the first frame of the animation in 3307 * progress, which would feel snappier. 3308 * 3309 * However, if there's a delay (main thread work) between the creation of 3310 * the animation and the first committed frame, we prefer to use resolvedAt 3311 * to avoid a sudden jump into the animation. 3312 */ 3313 const startTime = sync ? !this.resolvedAt ? this.createdAt : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY ? this.resolvedAt : this.createdAt : void 0; 3314 const { onComplete } = options; 3315 /** 3316 * A startTime passed in options (an optimised appear handoff syncing 3317 * to its WAAPI animation) takes precedence over the derived one. 3318 */ 3319 options.startTime ?? (options.startTime = startTime); 3320 options.finalKeyframe = finalKeyframe; 3321 options.keyframes = keyframes; 3322 /** 3323 * JSAnimation and NativeAnimation call onComplete exactly when 3324 * their own `finished` resolves, so this replaces a promise chain 3325 * per value with a callback. 3326 */ 3327 options.onComplete = () => { 3328 onComplete?.(); 3329 this.notifyFinished(); 3330 }; 3331 /** 3332 * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via 3333 * WAAPI. Therefore, this animation must be JS to ensure it runs "under" the 3334 * optimised animation. 3335 * 3336 * Also skip WAAPI when keyframes aren't animatable, as the resolved 3337 * values may not be valid CSS and would trigger browser warnings. 3338 */ 3339 const useWaapi = canAnimateValue && !isHandoff && supportsBrowserAnimation(options); 3340 let animation; 3341 if (useWaapi) { 3342 /** 3343 * The resolver needed the VisualElement, WAAPI needs the DOM 3344 * element. JSAnimation reads neither, so this is safe to 3345 * leave in place if we fall back to it. 3346 */ 3347 options.element = options.motionValue?.owner?.current; 3348 try { 3349 animation = new NativeAnimationExtended(options); 3350 } catch { 3351 animation = new JSAnimation(options); 3352 } 3353 } else animation = new JSAnimation(options); 3354 if (this.pendingTimeline) { 3355 this.stopTimeline = animation.attachTimeline(this.pendingTimeline); 3356 this.pendingTimeline = void 0; 3357 } 3358 this._animation = animation; 3359 } 3360 get finished() { 3361 return this._animation ? this._animation.finished : super.finished; 3362 } 3363 then(onResolve, _onReject) { 3364 return this.finished.finally(onResolve).then(() => {}); 3365 } 3366 get animation() { 3367 if (!this._animation) { 3368 this.keyframeResolver?.resume(); 3369 flushKeyframeResolvers(); 3370 } 3371 return this._animation; 3372 } 3373 get duration() { 3374 return this.animation.duration; 3375 } 3376 get iterationDuration() { 3377 return this.animation.iterationDuration; 3378 } 3379 get time() { 3380 return this.animation.time; 3381 } 3382 set time(newTime) { 3383 this.animation.time = newTime; 3384 } 3385 get speed() { 3386 return this.animation.speed; 3387 } 3388 get state() { 3389 return this.animation.state; 3390 } 3391 set speed(newSpeed) { 3392 this.animation.speed = newSpeed; 3393 } 3394 get startTime() { 3395 return this.animation.startTime; 3396 } 3397 attachTimeline(timeline) { 3398 if (this._animation) this.stopTimeline = this.animation.attachTimeline(timeline); 3399 else this.pendingTimeline = timeline; 3400 return () => this.stop(); 3401 } 3402 play() { 3403 this.animation.play(); 3404 } 3405 pause() { 3406 this.animation.pause(); 3407 } 3408 complete() { 3409 this.animation.complete(); 3410 } 3411 cancel() { 3412 if (this._animation) this.animation.cancel(); 3413 this.keyframeResolver?.cancel(); 3414 } 3415 }; 3416 })))(); 3417} 3418//#endregion 3419//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/index.mjs 3420function motionValue(init, options) { 3421 return new MotionValue(init, options); 3422} 3423var MAX_VELOCITY_DELTA, isFloat, collectMotionValues, MotionValue;
3424function init_value() { 3425 return (init_value = __esmMin((() => { 3426 init_subscription_manager(), init_velocity_per_second(); 3427 init_sync_time(); 3428 init_frame(); 3429 MAX_VELOCITY_DELTA = 30; 3430 isFloat = (value) => { 3431 return !isNaN(parseFloat(value)); 3432 }; 3433 collectMotionValues = { current: void 0 }; 3434 MotionValue = class { 3435 /** 3436 * @param init - The initiating value 3437 * @param config - Optional configuration options 3438 * 3439 * - `transformer`: A function to transform incoming values with. 3440 */ 3441 constructor(init, options = {}) { 3442 /** 3443 * Tracks whether this value can output a velocity. Currently this is only true 3444 * if the value is numerical, but we might be able to widen the scope here and support 3445 * other value types. 3446 * 3447 * @internal 3448 */ 3449 this.canTrackVelocity = null; 3450 /** 3451 * An object containing a SubscriptionManager for each active event. 3452 */ 3453 this.events = {}; 3454 this.updateAndNotify = (v) => { 3455 const currentTime = time.now(); 3456 /** 3457 * If we're updating the value during another frame or eventloop 3458 * than the previous frame, then the we set the previous frame value 3459 * to current. 3460 */ 3461 if (this.updatedAt !== currentTime) this.setPrevFrameValue(); 3462 this.prev = this.current; 3463 this.setCurrent(v); 3464 if (this.current !== this.prev) { 3465 this.notifyChange(); 3466 if (this.dependents) for (const dependent of this.dependents) depen
3466dent.dirty(); 3467 } 3468 }; 3469 this.hasAnimated = false; 3470 this.setCurrent(init); 3471 this.owner = options.owner; 3472 } 3473 setCurrent(current) { 3474 this.current = current; 3475 this.updatedAt = time.now(); 3476 if (this.canTrackVelocity === null && current !== void 0) this.canTrackVelocity = isFloat(this.current); 3477 } 3478 setPrevFrameValue(prevFrameValue = this.current) { 3479 this.prevFrameValue = prevFrameValue; 3480 this.prevUpdatedAt = this.updatedAt; 3481 } 3482 /** 3483 * Adds a function that will be notified when the `MotionValue` is updated. 3484 * 3485 * It returns a function that, when called, will cancel the subscription. 3486 * 3487 * When calling `onChange` inside a React component, it should be wrapped with the 3488 * `useEffect` hook. As it returns an unsubscribe function, this should be returned 3489 * from the `useEffect` function to ensure you don't add duplicate subscribers.. 3490 * 3491 * ```jsx 3492 * export const MyComponent = () => { 3493 * const x = useMotionValue(0) 3494 * const y = useMotionValue(0) 3495 * const opacity = useMotionValue(1) 3496 * 3497 * useEffect(() => { 3498 * function updateOpacity() { 3499 * const maxXY = Math.max(x.get(), y.get()) 3500 * const newOpacity = transform(maxXY, [0, 100], [1, 0]) 3501 * opacity.set(newOpacity) 3502 * } 3503 * 3504 * const unsubscribeX = x.on("change", updateOpacity) 3505 * const unsubscribeY = y.on("change", updateOpacity) 3506 * 3507 * return () => { 3508 * unsubscribeX() 3509 * unsubscribeY() 3510 * } 3511 * }, []) 3512 * 3513 * return <motion.div style={{ x }} /> 3514 * } 3515 * ``` 3516 * 3517 * @param subscriber - A function that receives the latest value. 3518 * @returns A function that, when called, will cancel this subscription. 3519 * 3520 * @deprecated 3521 */ 3522 onChange(subscription) { 3523 return this.on("change", subscription); 3524 } 3525 on(eventName, callback) { 3526 var _a; 3527 if (eventName === "change") return this.onChangeSubscribe(callback); 3528 return ((_a = this.events)[eventName] || (_a[eventName] = new SubscriptionManager())).add(callback); 3529 } 3530 onChangeSubscribe(callback) { 3531 const { events } = this; 3532 if (!events.change && !this.changeSubscriber) this.changeSubscriber = callback; 3533 else { 3534 if (!events.change) { 3535 events.change = new SubscriptionManager(); 3536 events.change.add(this.changeSubscriber); 3537 this.changeSubscriber = void 0; 3538 } 3539 events.change.add(callback); 3540 } 3541 return () => { 3542 if (this.changeSubscriber === callback) this.changeSubscriber = void 0; 3543 else events.change?.remove(callback); 3544 this.stopIfUnobserved(); 3545 }; 3546 } 3547 /** 3548 * If we have no more change listeners by the start 3549 * of the next frame, stop active animations. 3550 */ 3551 stopIfUnobserved() { 3552 frame.read(() => { 3553 if (!this.changeSubscriber && !this.events.change?.getSize()) this.stop(); 3554 }); 3555 } 3556 clearListeners() { 3557 this.changeSubscriber = void 0; 3558 for (const eventManagers in this.events) this.events[eventManagers].clear(); 3559 } 3560 /** 3561 * Attaches a passive effect to the `MotionValue`. 3562 */ 3563 attach(passiveEffect, stopPassiveEffect) { 3564 this.passiveEffect = passiveEffect; 3565 this.stopPassiveEffect = stopPassiveEffect; 3566 } 3567 /** 3568 * Sets the state of the `MotionValue`. 3569 * 3570 * @remarks 3571 * 3572 * ```jsx 3573 * const x = useMotionValue(0) 3574 * x.set(10) 3575 * ``` 3576 * 3577 * @param latest - Latest value to set. 3578 * @param render - Whether to notify render subscribers. Defaults to `true` 3579 * 3580 * @public 3581 */ 3582 set(v) { 3583 if (!this.passiveEffect) this.updateAndNotify(v); 3584 else this.passiveEffect(v, this.updateAndNotify); 3585 } 3586 setWithVelocity(prev, current, delta) { 3587 this.set(current); 3588 this.prev = void 0; 3589 this.prevFrameValue = prev; 3590 this.prevUpdatedAt = this.updatedAt - delta; 3591 } 3592 /** 3593 * Set the state of the `MotionValue`, stopping any active animations, 3594 * effects, and resets velocity to `0`. 3595 */ 3596 jump(v, endAnimation = true) { 3597 this.updateAndNotify(v); 3598 this.prev = v; 3599 this.prevUpdatedAt = this.prevFrameValue = void 0; 3600 endAnimation && this.stop(); 3601 if (this.stopPassiveEffect) this.stopPassiveEffect(); 3602 } 3603 dirty() { 3604 this.notifyChange(); 3605 } 3606 notifyChange() { 3607 const { current, changeSubscriber } = this; 3608 /** 3609 * One or the other exists. Subscribing during the direct
3610 * subscriber's call moves it into a new manager, which must not 3611 * then be notified for the same change. 3612 */ 3613 if (changeSubscriber) changeSubscriber(current); 3614 else this.events.change?.notify(current); 3615 } 3616 addDependent(dependent) { 3617 if (!this.dependents) this.dependents = /* @__PURE__ */ new Set(); 3618 this.dependents.add(dependent); 3619 } 3620 removeDependent(dependent) { 3621 if (this.dependents) this.dependents.delete(dependent); 3622 } 3623 /** 3624 * Returns the latest state of `MotionValue` 3625 * 3626 * @returns - The latest state of `MotionValue` 3627 * 3628 * @public 3629 */ 3630 get() { 3631 if (collectMotionValues.current) collectMotionValues.current.push(this); 3632 return this.current; 3633 } 3634 /** 3635 * @public 3636 */ 3637 getPrevious() { 3638 return this.prev; 3639 } 3640 /** 3641 * Returns the latest velocity of `MotionValue` 3642 * 3643 * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. 3644 * 3645 * @public 3646 */ 3647 getVelocity() { 3648 const currentTime = time.now(); 3649 if (!this.canTrackVelocity || this.prevFrameValue === void 0 || currentTime - this.updatedAt > MAX_VELOCITY_DELTA) return 0; 3650 const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA); 3651 return velocityPerSecond(parseFloat(this.current) - parseFloat(this.prevFrameValue), delta); 3652 } 3653 /** 3654 * Registers a new animation to control this `MotionValue`. Only one 3655 * animation can drive a `MotionValue` at one time. 3656 * 3657 * ```jsx 3658 * value.start() 3659 * ``` 3660 * 3661 * @param animation - A function that starts the provided animation 3662 */ 3663 start(startAnimation) { 3664 this.stop(); 3665 return new Promise((resolve) => { 3666 this.hasAnimated = true; 3667 /** 3668 * Complete synchronously via the callback rather than chaining a 3669 * second promise per animation. Guard against animations that 3670 * complete before startAnimation has returned. 3671 */ 3672 let isComplete = false; 3673 let animation; 3674 animation = startAnimation(() => { 3675 isComplete = true; 3676 this.events.animationComplete?.notify(); 3677 if (this.animation === animation) this.clearAnimation(); 3678 resolve(); 3679 }); 3680 if (!isComplete) this.animation = animation; 3681 this.events.animationStart?.notify(); 3682 }); 3683 } 3684 /** 3685 * Stop the currently active animation. 3686 * 3687 * @public 3688 */ 3689 stop() { 3690 if (this.animation) { 3691 this.animation.stop(); 3692 if (this.events.animationCancel) this.events.animationCancel.notify(); 3693 } 3694 this.clearAnimation(); 3695 } 3696 /** 3697 * Returns `true` if this value is currently animating. 3698 * 3699 * @public 3700 */ 3701 isAnimating() { 3702 return !!this.animation; 3703 } 3704 clearAnimation() { 3705 this.animation = void 0; 3706 } 3707 /** 3708 * Destroy and clean up subscribers to this `MotionValue`. 3709 * 3710 * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically 3711 * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually 3712 * created a `MotionValue` via the `motionValue` function. 3713 * 3714 * @public 3715 */ 3716 destroy() { 3717 this.dependents?.clear(); 3718 this.events.destroy?.notify(); 3719 this.clearListeners(); 3720 this.stop(); 3721 if (this.stopPassiveEffect) this.stopPassiveEffect(); 3722 } 3723 }; 3724 })))(); 3725} 3726//#endregion 3727//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs 3728/** 3729* If `transition` has `inherit: true`, shallow-merge it with 3730* `parentTransition` (child keys win) and strip the `inherit` key. 3731* Otherwise return `transition` unchanged. 3732*/ 3733function resolveTransition(transition, parentTransition) { 3734 if (transition?.inherit && parentTransition) { 3735 const { inherit: _, ...rest } = transition; 3736 return { 3737 ...parentTransition, 3738 ...rest 3739 }; 3740 } 3741 return transition; 3742} 3743function init_resolve_transition() { 3744 return (init_resolve_transition = __esmMin((() => {})))(); 3745} 3746//#endregion 3747//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs 3748function getValueTransition(transition, key) { 3749 const valueTransition = transition?.[key] ?? transition?.["default"] ?? transition; 3750 if (valueTransition !== transition) return resolveTransition(valueTransition, transition); 3751 return valueTransition; 3752} 3753function init_get_value_transition() { 3754 return (init_get_value_transition = __esmMin((() => {})))(); 3755} 3756//#endregion 3757//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs 3758var underDampedSpring, criticallyDampedSpring, keyframesTransition, ease, getDefaultTransition; 3759function init_default_transitions() { 3760 return (init_default_transitions = __esmMin((() => { 3761 init_keys_transform(); 3762 underDampedSpring = { 3763 type: "spring", 3764 stiffness: 500, 3765 damping: 25, 3766 restSpeed: 10 3767 }; 3768 criticallyDampedSpring = (target) => ({ 3769 type: "spring", 3770 stiffness: 550, 3771 damping: target === 0 ? 2 * Math.sqrt(550) : 30, 3772 restSpeed: 10 3773 }); 3774 keyframesTransition = { 3775 type: "keyframes", 3776 duration: .8 3777 }; 3778 ease = { 3779 type: "keyframes", 3780 ease: [ 3781 .25, 3782 .1, 3783 .35, 3784 1 3785 ], 3786 duration: .3 3787 }; 3788 getDefaultTransition = (valueKey, { keyframes }) => { 3789 if (keyframes.length > 2) return keyframesTransition; 3790 else if (transformProps.has(valueKey)) return valueKey.startsWith("scale") ? criticallyDampedSpring(keyframes[1]) : underDampedSpring; 3791 return ease; 3792 }; 3793 })))(); 3794} 3795//#endregion 3796//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs 3797/** 3798* Decide whether a transition is defined on a given Transition. 3799* This filters out orchestration options and returns true 3800* if any options are left. 3801*/ 3802function isTransitionDefined(transition) { 3803 for (const key in transition) if (!orchestrationKeys.has(key)) return true; 3804 return false;
3805} 3806var orchestrationKeys; 3807function init_is_transition_defined() { 3808 return (init_is_transition_defined = __esmMin((() => { 3809 orchestrationKeys = /* @__PURE__ */ new Set([ 3810 "when", 3811 "delay", 3812 "delayChildren", 3813 "staggerChildren", 3814 "staggerDirection", 3815 "repeat", 3816 "repeatType", 3817 "repeatDelay", 3818 "from", 3819 "elapsed" 3820 ]); 3821 })))(); 3822} 3823//#endregion 3824//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs 3825var animateMotionValue; 3826function init_motion_value() { 3827 return (init_motion_value = __esmMin((() => { 3828 init_time_conversion(), init_global_config(); 3829 init_AsyncMotionValueAnimation(); 3830 init_JSAnimation(); 3831 init_get_value_transition(); 3832 init_default_transitions(); 3833 init_get_final(); 3834 init_is_transition_defined(); 3835 init_frame(); 3836 animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => { 3837 const valueTransition = getValueTransition(transition, name) || {}; 3838 /** 3839 * Most transition values are currently completely overwritten by value-specific 3840 * transitions. In the future it'd be nicer to blend these transitions. But for now 3841 * delay actually does inherit from the root transition if not value-specific. 3842 */ 3843 const delay = valueTransition.delay || transition.delay || 0; 3844 /** 3845 * Elapsed isn't a public transition option but can be passed through from 3846 * optimized appear effects in milliseconds. 3847 */
3848 let { elapsed = 0 } = transition; 3849 elapsed = elapsed - secondsToMilliseconds(delay); 3850 const options = { 3851 keyframes: Array.isArray(target) ? target : [null, target], 3852 ease: "easeOut", 3853 velocity: value.getVelocity(), 3854 ...valueTransition, 3855 delay: -elapsed, 3856 onUpdate: (v) => { 3857 value.set(v); 3858 valueTransition.onUpdate && valueTransition.onUpdate(v); 3859 }, 3860 onComplete: () => { 3861 onComplete(); 3862 valueTransition.onComplete && valueTransition.onComplete(); 3863 }, 3864 name, 3865 motionValue: value, 3866 element: isHandoff ? void 0 : element 3867 }; 3868 /** 3869 * If there's no transition defined for this value, we can generate 3870 * unique transition settings for this value. 3871 */ 3872 if (!isTransitionDefined(valueTransition)) Object.assign(options, getDefaultTransition(name, options)); 3873 /** 3874 * Both WAAPI and our internal animation functions use durations 3875 * as defined by milliseconds, while our external API defines them 3876 * as seconds. 3877 */ 3878 options.duration && (options.duration = secondsToMilliseconds(options.duration)); 3879 options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay)); 3880 /** 3881 * Support deprecated way to set initial value. Prefer keyframe syntax. 3882 */ 3883 if (options.from !== void 0) options.keyframes[0] = options.from; 3884 let shouldSkip = false; 3885 if (options.type === false || options.duration === 0 && !options.repeatDelay) { 3886 makeAnimationInstant(options); 3887 if (options.delay === 0) shouldSkip = true; 3888 } 3889 if (MotionGlobalConfig.instantAnimations || MotionGlobalConfig.skipAnimations || element?.shouldSkipAnimations || valueTransition.skipAnimations) { 3890 shouldSkip = true; 3891 makeAnimationInstant(options); 3892 options.delay = 0; 3893 } 3894 /** 3895 * If the transition type or easing has been explicitly set by the user 3896 * then we don't want to allow flattening the animation. 3897 */ 3898 options.allowFlatten = !valueTransition.type && !valueTransition.ease; 3899 /** 3900 * If we can or must skip creating the animation, and apply only 3901 * the final keyframe, do so. We also check once keyframes are resolved but 3902 * this early check prevents the need to create an animation at all. 3903 */ 3904 if (shouldSkip && !isHandoff && value.get() !== void 0) { 3905 const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition); 3906 if (finalKeyframe !== void 0) { 3907 frame.update(() => { 3908 options.onUpdate(finalKeyframe); 3909 options.onComplete(); 3910 }); 3911 return; 3912 } 3913 } 3914 return valueTransition.isSync ? new JSAnimation(options) : new AsyncMotionValueAnimation(options); 3915 }; 3916 })))(); 3917} 3918//#endregion 3919//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs 3920function parseCSSVariable(current) { 3921 const match = splitCSSVariableRegex.exec(current); 3922 if (!match) return [,]; 3923 const [, token1, token2, fallback] = match; 3924 return [`--${token1 ?? token2}`, fallback]; 3925} 3926function getVariableValue(current, element, depth = 1) { 3927 invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`, "max-css-var-depth"); 3928 const [token, fallback] = parseCSSVariable(current); 3929 if (!token) return; 3930 const resolved = window.getComputedStyle(element).getPropertyValue(token); 3931 if (resolved) { 3932 const trimmed = resolved.trim(); 3933 return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed; 3934 } 3935 return isCSSVariableToken(fallback) ? getVariableValue(fallback, element, depth + 1) : fallback; 3936} 3937var splitCSSVariableRegex, maxDepth; 3938function init_css_variables_conversion() { 3939 return (init_css_variables_conversion = __esmMin((() => { 3940 init_errors(), init_is_numerical_string(); 3941 init_is_css_variable(); 3942 splitCSSVariableRegex = /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u; 3943 maxDepth = 4; 3944 })))(); 3945} 3946//#endregion 3947//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs 3948var positionalKeys; 3949function init_keys_position() { 3950 return (init_keys_position = __esmMin((() => { 3951 init_keys_transform(); 3952 positionalKeys = /* @__PURE__ */ new Set([ 3953 "width",
3954 "height", 3955 "top", 3956 "left", 3957 "right", 3958 "bottom", 3959 ...transformPropOrder 3960 ]); 3961 })))(); 3962} 3963//#endregion 3964//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs 3965var isMotionValue; 3966function init_is_motion_value() { 3967 return (init_is_motion_value = __esmMin((() => { 3968 isMotionValue = (value) => Boolean(value && value.getVelocity); 3969 })))(); 3970} 3971//#endregion 3972//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs 3973function camelToDash(str) { 3974 return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`); 3975} 3976function init_camel_to_dash() { 3977 return (init_camel_to_dash = __esmMin((() => {})))(); 3978} 3979//#endregion 3980//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/auto.mjs 3981var auto; 3982function init_auto() { 3983 return (init_auto = __esmMin((() => { 3984 auto = { 3985 test: (v) => v === "auto", 3986 parse: (v) => v 3987 }; 3988 })))(); 3989} 3990//#endregion 3991//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/test.mjs 3992var testValueType; 3993function init_test() { 3994 return (init_test = __esmMin((() => { 3995 testValueType = (v) => (type) => type.test(v); 3996 })))(); 3997} 3998//#endregion 3999//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/dimensions.mjs 4000var dimensionValueTypes, findDimensionValueType; 4001function init_dimensions() { 4002 return (init_dimensions = __esmMin((() => { 4003 init_auto(); 4004 init_numbers(); 4005 init_units(); 4006 init_test(); 4007 dimensionValueTypes = [ 4008 number, 4009 px, 4010 percent, 4011 degrees, 4012 vw, 4013 vh, 4014 auto 4015 ]; 4016 findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v)); 4017 })))(); 4018} 4019//#endregion 4020//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs 4021function isNone(value) { 4022 if (typeof value === "number") return value === 0; 4023 else if (value !== null) return value === "none" || value === "0" || isZeroValueString(value); 4024 else return true; 4025} 4026function init_is_none() { 4027 return (init_is_none = __esmMin((() => { 4028 init_is_zero_value_string(); 4029 })))(); 4030} 4031//#endregion 4032//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs 4033function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) { 4034 let i = 0; 4035 let animatableTemplate = void 0; 4036 while (i < unresolvedKeyframes.length && !animatableTemplate) { 4037 const keyframe = unresolvedKeyframes[i]; 4038 if (typeof keyframe === "string" && !invalidTemplates.has(keyframe) && hasComplexValues(keyframe)) animatableTemplate = unresolvedKeyframes[i]; 4039 i++; 4040 } 4041 if (animatableTemplate && name) for (const noneIndex of noneKeyframeIndexes) { 4042 /** 4043 * A zero-valued template like "0%" is already its own 4044 * animatable none, so there's nothing to derive. 4045 */ 4046 if (unresolvedKeyframes[noneIndex] === animatableTemplate) continue; 4047 unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate); 4048 } 4049} 4050var invalidTemplates; 4051function init_make_none_animatable() { 4052 return (init_make_none_animatable = __esmMin((() => { 4053 init_complex(); 4054 init_animatable_none(); 4055 invalidTemplates = /* @__PURE__ */ new Set([ 4056 "auto", 4057 "none", 4058 "0" 4059 ]); 4060 })))(); 4061} 4062//#endregion 4063//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs 4064var DOMKeyframesResolver; 4065function init_DOMKeyframesResolver() { 4066 return (init_DOMKeyframesResolver = __esmMin((() => { 4067 init_keys_position(); 4068 init_dimensions(); 4069 init_css_variables_conversion(); 4070 init_is_css_variable(); 4071 init_KeyframesResolver(); 4072 init_is_none(); 4073 init_make_none_animatable(); 4074 init_unit_conversion(); 4075 DOMKeyframesResolver = class extends KeyframeResolver {
4076 constructor(unresolvedKeyframes, onComplete, name, motionValue, element) { 4077 super(unresolvedKeyframes, onComplete, name, motionValue, element, true); 4078 } 4079 readKeyframes() { 4080 const { unresolvedKeyframes, element, name } = this; 4081 if (!element || !element.current) return; 4082 super.readKeyframes(); 4083 /** 4084 * If any keyframe is a CSS variable, we need to find its value by sampling the element 4085 */ 4086 for (let i = 0; i < unresolvedKeyframes.length; i++) { 4087 let keyframe = unresolvedKeyframes[i]; 4088 if (typeof keyframe === "string") { 4089 keyframe = keyframe.trim(); 4090 if (isCSSVariableToken(keyframe)) { 4091 const resolved = getVariableValue(keyframe, element.current); 4092 if (resolved !== void 0) unresolvedKeyframes[i] = resolved; 4093 if (i === unresolvedKeyframes.length - 1) this.finalKeyframe = keyframe; 4094 } 4095 } 4096 } 4097 /** 4098 * Resolve "none" values. We do this potentially twice - once before and once after measuring keyframes. 4099 * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which 4100 * have a far bigger performance impact. 4101 */ 4102 this.resolveNoneKeyframes(); 4103 /** 4104 * Check to see if unit type has changed. If so schedule jobs that will 4105 * temporarily set styles to the destination keyframes. 4106 * Skip if we have more than two keyframes or this isn't a positional value. 4107 * TODO: We can throw if there are multiple keyframes and the value type changes. 4108 */ 4109 if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) return; 4110 const [origin, target] = unresolvedKeyframes; 4111 if (typeof origin === "number" && typeof target === "number") return; 4112 const originType = findDimensionValueType(origin); 4113 const targetType = findDimensionValueType(target); 4114 if (containsCSSVariable(origin) !== containsCSSVariable(target) && positionalValues[name]) { 4115 this.needsMeasurement = true; 4116 return; 4117 } 4118 /** 4119 * Either we don't recognise these value types or we can animate between them. 4120 */ 4121 if (originType === targetType) return; 4122 /** 4123 * If both values are numbers or pixels, we can animate between them by 4124 * converting them to numbers. 4125 */ 4126 if (isNumOrPxType(originType) && isNumOrPxType(targetType)) for (let i = 0; i < unresolvedKeyframes.length; i++) { 4127 const value = unresolvedKeyframes[i]; 4128 if (typeof value === "string") unresolvedKeyframes[i] = parseFloat(value); 4129 } 4130 else if (positionalValues[name]) 4131 /** 4132 * Else, the only way to resolve this is by measuring the element. 4133 */ 4134 this.needsMeasurement = true; 4135 } 4136 resolveNoneKeyframes() { 4137 const { unresolvedKeyframes, name } = this; 4138 const noneKeyframeIndexes = []; 4139 for (let i = 0; i < unresolvedKeyframes.length; i++) if (unresolvedKeyframes[i] === null || isNone(unresolvedKeyframes[i])) noneKeyframeIndexes.push(i); 4140 if (noneKeyframeIndexes.length) makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name); 4141 } 4142 measure() { 4143 const { element, name } = this; 4144 return positionalValues[name](window.getComputedStyle(element.current), () => element.measureViewportBox()); 4145 } 4146 measureInitialState() { 4147 const { element, unresolvedKeyframes, name } = this; 4148 if (!element || !element.current) return; 4149 if (name === "height") this.suspendedScrollY = window.pageYOffset; 4150 this.measuredOrigin = this.measure(); 4151 unresolvedKeyframes[0] = this.measuredOrigin; 4152 const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; 4153 if (measureKeyframe !== void 0) this.motionValue?.jump(measureKeyframe, false); 4154 } 4155 measureEndState() { 4156 const { element, unresolvedKeyframes } = this; 4157 if (!element || !element.current) return; 4158 this.motionValue?.jump(this.measuredOrigin, false); 4159 const finalKeyframeIndex = unresolvedKeyframes.length - 1; 4160 const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]; 4161 unresolvedKeyframes[finalKeyframeIndex] = this.measure(); 4162 if (finalKeyframe !== null && this.finalKeyframe === void 0) this.finalKeyframe = finalKeyframe; 4163 if (this.removedTransforms?.length) this.removedTransforms.forEac
4163h(([unsetTransformName, unsetTransformValue]) => { 4164 element.getValue(unsetTransformName).set(unsetTransformValue); 4165 }); 4166 this.resolveNoneKeyframes(); 4167 } 4168 }; 4169 })))(); 4170} 4171//#endregion 4172//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/utils/is-html-element.mjs 4173/** 4174* Checks if an element is an HTML element in a way 4175* that works across iframes 4176*/ 4177function isHTMLElement(element) { 4178 return isObject(element) && "offsetHeight" in element && !("ownerSVGElement" in element); 4179} 4180function init_is_html_element() { 4181 return (init_is_html_element = __esmMin((() => { 4182 init_is_object(); 4183 })))(); 4184} 4185//#endregion 4186//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs 4187/** 4188* Checks if an element is an SVG element in a way 4189* that works across iframes 4190*/ 4191function isSVGElement(element) { 4192 return isObject(element) && "ownerSVGElement" in element; 4193} 4194function init_is_svg_element() { 4195 return (init_is_svg_element = __esmMin((() => { 4196 init_is_object(); 4197 })))(); 4198} 4199//#endregion 4200//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs 4201var getValueAsType; 4202function init_get_as_type() { 4203 return (init_get_as_type = __esmMin((() => { 4204 getValueAsType = (value, type) => { 4205 return type && typeof value === "number" ? type.transform(value) : value; 4206 }; 4207 })))(); 4208} 4209//#endregion 4210//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs 4211function resolveElements(elementOrSelector, scope, selectorCache) { 4212 if (elementOrSelector == null) return []; 4213 if (elementOrSelector instanceof EventTarget) return [elementOrSelector]; 4214 else if (typeof elementOrSelector === "string") { 4215 let root = document; 4216 if (scope) root = scope.current; 4217 const elements = selectorCache?.[elementOrSelector] ?? root.querySelectorAll(elementOrSelector); 4218 return elements ? Array.from(elements) : []; 4219 } 4220 return Array.from(elementOrSelector).filter((element) => element != null); 4221} 4222function init_resolve_elements() { 4223 return (init_resolve_elements = __esmMin((() => {})))(); 4224} 4225//#endregion 4226//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs 4227/** 4228* Build a CSS transform style from individual x/y/scale etc properties. 4229* 4230* This outputs with a default order of transforms/scales/rotations, this can be customised by 4231* providing a transformTemplate function. 4232*/ 4233function buildTransform(latestValues, transform, transformTemplate) { 4234 let transformString = ""; 4235 let transformIsDefault = true; 4236 /** 4237 * Loop over all possible transforms in order, adding the ones that 4238 * are present to the transform string. 4239 */ 4240 for (let i = 0; i < numTransforms; i++) { 4241 const key = transformPropOrder[i]; 4242 const value = latestValues[key]; 4243 if (value === void 0) continue; 4244 let valueIsDefault = true; 4245 if (typeof value === "number") valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); 4246 else { 4247 const parsed = parseFloat(value); 4248 valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; 4249 } 4250 if (!valueIsDefault || transformTemplate) { 4251 const valueAsType = getValueAsType(value, numberValueTypes[key]); 4252 if (!valueIsDefault) { 4253 transformIsDefault = false;
4254 const transformName = translateAlias[key] || key; 4255 transformString += `${transformName}(${valueAsType}) `; 4256 } 4257 if (transformTemplate) transform[key] = valueAsType; 4258 } 4259 } 4260 const pathRotation = latestValues.pathRotation; 4261 if (pathRotation) { 4262 transformIsDefault = false; 4263 transformString += `rotate(${getValueAsType(pathRotation, numberValueTypes.pathRotation)}) `; 4264 } 4265 transformString = transformString.trim(); 4266 if (transformTemplate) transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); 4267 else if (transformIsDefault) transformString = "none"; 4268 return transformString; 4269} 4270var translateAlias, numTransforms; 4271function init_build_transform() { 4272 return (init_build_transform = __esmMin((() => { 4273 init_get_as_type(); 4274 init_number$1(); 4275 init_keys_transform(); 4276 translateAlias = { 4277 x: "translateX", 4278 y: "translateY", 4279 z: "translateZ", 4280 transformPerspective: "perspective" 4281 }; 4282 numTransforms = transformPropOrder.length; 4283 })))(); 4284} 4285//#endregion 4286//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs 4287function buildHTMLStyles(state, latestValues, transformTemplate) { 4288 const { style, vars, transformOrigin } = state; 4289 let hasTransform = false; 4290 let hasTransformOrigin = false; 4291 /** 4292 * Loop over all our latest animated values and decide whether to handle them 4293 * as a style or CSS variable. 4294 * 4295 * Transforms and transform origins are kept separately for further processing. 4296 */ 4297 for (const key in latestValues) { 4298 const value = latestValues[key]; 4299 if (transformProps.has(key)) { 4300 hasTransform = true; 4301 continue; 4302 } else if (isCSSVariableName(key)) { 4303 vars[key] = value; 4304 continue; 4305 } else { 4306 const valueAsType = getValueAsType(value, numberValueTypes[key]); 4307 if (key.startsWith("origin")) { 4308 hasTransformOrigin = true; 4309 transformOrigin[key] = valueAsType; 4310 } else style[key] = valueAsType; 4311 } 4312 } 4313 if (!latestValues.transform) { 4314 if (hasTransform || transformTemplate) style.transform = buildTransform(latestValues, state.transform, transformTemplate); 4315 else if (style.transform) 4316 /** 4317 * If we have previously created a transform but currently don't have any, 4318 * reset transform style to none. 4319 */ 4320 style.transform = "none"; 4321 } 4322 /** 4323 * Build a transformOrigin style. Uses the same defaults as the browser for 4324 * undefined origins. 4325 */ 4326 if (hasTransformOrigin) { 4327 const { originX = "50%", originY = "50%", originZ = 0 } = transformOrigin; 4328 style.transformOrigin = `${originX} ${originY} ${originZ}`; 4329 } 4330} 4331function init_build_styles() { 4332 return (init_build_styles = __esmMin((() => { 4333 init_get_as_type(); 4334 init_number$1(); 4335 init_keys_transform(); 4336 init_is_css_variable(); 4337 init_build_transform(); 4338 })))(); 4339} 4340//#endregion 4341//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs 4342/** 4343* Build SVG path properties. Uses the path's measured length to convert 4344* our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset 4345* and stroke-dasharray attributes. 4346* 4347* This function is mutative to reduce per-frame GC. 4348* 4349* Note: We use unitless values for stroke-dasharray and stroke-dashoffset 4350* because Safari incorrectly scales px values when the page is zoomed. 4351*/ 4352function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) { 4353 attrs.pathLength = 1; 4354 const keys = useDashCase ? dashKeys : camelKeys; 4355 attrs[keys.offset] = `${-offset}`; 4356 attrs[keys.array] = `${length} ${spacing}`; 4357} 4358var dashKeys, camelKeys; 4359function init_path() { 4360 return (init_path = __esmMin((() => { 4361 dashKeys = { 4362 offset: "stroke-dashoffset", 4363 array: "stroke-dasharray" 4364 }; 4365 camelKeys = { 4366 offset: "strokeDashoffset", 4367 array: "strokeDasharray" 4368 }; 4369 })))(); 4370} 4371//#endregion 4372//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs 4373/** 4374* Build SVG visual attributes, like cx and style.transform 4375*/ 4376function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, ...latest }, isSVGTag, transformTemplate, styleProp) { 4377 buildHTMLStyles(state, latest, transformTemplate); 4378 /** 4379 * For svg tags we just want to make sure viewBox is animatable and treat all the styles 4380 * as normal HTML tags. 4381 */ 4382 if (isSVGTag) {
4383 if (state.style.viewBox) state.attrs.viewBox = state.style.viewBox; 4384 return; 4385 } 4386 state.attrs = state.style; 4387 state.style = {}; 4388 const { attrs, style } = state; 4389 for (const key of cssStyleProperties) if (attrs[key] !== void 0) { 4390 style[key] = attrs[key]; 4391 delete attrs[key]; 4392 } 4393 if (style.transform || attrs.transformOrigin) { 4394 style.transformOrigin = attrs.transformOrigin ?? "50% 50%"; 4395 delete attrs.transformOrigin; 4396 } 4397 if (style.transform) { 4398 /** 4399 * SVG's element transform-origin uses its own median as a reference. 4400 * Therefore, transformBox becomes a fill-box 4401 */ 4402 style.transformBox = styleProp?.transformBox ?? "fill-box"; 4403 delete attrs.transformBox; 4404 } 4405 if (attrX !== void 0) attrs.x = attrX; 4406 if (attrY !== void 0) attrs.y = attrY; 4407 if (attrScale !== void 0) attrs.scale = attrScale; 4408 if (pathLength !== void 0) buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); 4409} 4410var cssStyleProperties; 4411function init_build_attrs() { 4412 return (init_build_attrs = __esmMin((() => { 4413 init_build_styles(); 4414 init_path(); 4415 cssStyleProperties = [ 4416 "transform", 4417 "opacity", 4418 "offsetDistance", 4419 "offsetPath", 4420 "offsetRotate", 4421 "offsetAnchor" 4422 ]; 4423 })))(); 4424} 4425//#endregion 4426//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs 4427/** 4428* Bounding boxes tend to be defined as top, left, right, bottom. For various operations 4429* it's easier to consider each axis individually. This function returns a bounding box 4430* as a map of single-axis min/max values. 4431*/ 4432function convertBoundingBoxToBox({ top, left, right, bottom }) { 4433 return { 4434 x: { 4435 min: left, 4436 max: right 4437 }, 4438 y: { 4439 min: top, 4440 max: bottom 4441 } 4442 }; 4443} 4444function convertBoxToBoundingBox({ x, y }) { 4445 return { 4446 top: y.min, 4447 right: x.max, 4448 bottom: y.max, 4449 left: x.min 4450 }; 4451} 4452/** 4453* Applies a TransformPoint function to a bounding box. TransformPoint is usually a function 4454* provided by Framer to allow measured points to be corrected for device scaling. This is used 4455* when measuring DOM elements and DOM event points. 4456*/ 4457function transformBoxPoints(point, transformPoint) { 4458 if (!transformPoint) return point; 4459 const topLeft = transformPoint({ 4460 x: point.left, 4461 y: point.top 4462 }); 4463 const bottomRight = transformPoint({ 4464 x: point.right, 4465 y: point.bottom 4466 }); 4467 return { 4468 top: topLeft.y, 4469 left: topLeft.x, 4470 bottom: bottomRight.y, 4471 right: bottomRight.x 4472 }; 4473} 4474function init_conversion() { 4475 return (init_conversion = __esmMin((() => {})))(); 4476} 4477//#endregion 4478//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs 4479function isIdentityScale(scale) { 4480 return scale === void 0 || scale === 1; 4481} 4482function hasScale({ scale, scaleX, scaleY }) { 4483 return !isIdentityScale(scale) || !isIdentityScale(scaleX) || !isIdentityScale(scaleY); 4484} 4485function hasTransform(values) { 4486 return hasScale(values) || has2DTranslate(values) || values.z || values.rotate || values.rotateX || values.rotateY || values.skewX || values.skewY; 4487} 4488function has2DTranslate(values) { 4489 return is2DTranslate(values.x) || is2DTranslate(values.y); 4490} 4491function is2DTranslate(value) { 4492 return value && value !== "0%"; 4493} 4494function init_has_transform() { 4495 return (init_has_transform = __esmMin((() => {})))(); 4496} 4497//#endregion 4498//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs 4499/** 4500* Scales a point based on a factor and an originPoint 4501*/ 4502function scalePoint(point, scale, originPoint) { 4503 return originPoint + scale * (point - originPoint); 4504} 4505/** 4506* Applies a translate/scale delta to a point 4507*/ 4508function applyPointDelta(point, translate, scale, originPoint, boxScale) { 4509 if (boxScale !== void 0) point = scalePoint(point, boxScale, originPoint); 4510 return scalePoint(point, scale, originPoint) + translate; 4511} 4512/** 4513* Applies a translate/scale delta to an axis 4514*/ 4515function applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) { 4516 axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); 4517 axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); 4518} 4519/** 4520* Applies a translate/scale delta to a box 4521*/ 4522function applyBoxDelta(box, { x, y }) { 4523 applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); 4524 applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); 4525} 4526/** 4527* Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms 4528* in a tree upon our box before then calculating how to project it into our desired viewport-relative box 4529* 4530* This is the final nested loop within updateLayoutDelta for future refactoring 4531*/ 4532function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) { 4533 const treeLength = treePath.length; 4534 if (!treeLength) return; 4535 treeScale.x = treeScale.y = 1; 4536 let node; 4537 let delta; 4538 for (let i = 0; i < treeLength; i++) { 4539 node = treePath[i]; 4540 delta = node.projectionDelta; 4541 /** 4542 * TODO: Prefer to remove this, but currently we have motion components with 4543 * display: contents in Framer. 4544 */ 4545 const { visualElement } = node.options; 4546 if (visualElement && visualElement.props.style && visualElement.props.style.display === "contents") continue; 4547 if (isSharedTransition && node.options.layoutScroll && node.scroll && node !== no
4547de.root) { 4548 translateAxis(box.x, -node.scroll.offset.x); 4549 translateAxis(box.y, -node.scroll.offset.y); 4550 } 4551 if (delta) { 4552 treeScale.x *= delta.x.scale; 4553 treeScale.y *= delta.y.scale; 4554 applyBoxDelta(box, delta); 4555 } 4556 if (isSharedTransition && hasTransform(node.latestValues)) transformBox(box, node.latestValues, node.layout?.layoutBox); 4557 } 4558 /** 4559 * Snap tree scale back to 1 if it's within a non-perceivable threshold. 4560 * This will help reduce useless scales getting rendered. 4561 */ 4562 if (treeScale.x < TREE_SCALE_SNAP_MAX && treeScale.x > TREE_SCALE_SNAP_MIN) treeScale.x = 1; 4563 if (treeScale.y < TREE_SCALE_SNAP_MAX && treeScale.y > TREE_SCALE_SNAP_MIN) treeScale.y = 1; 4564} 4565function translateAxis(axis, distance) { 4566 axis.min += distance; 4567 axis.max += distance; 4568} 4569/** 4570* Apply a transform to an axis from the latest resolved motion values. 4571* This function basically acts as a bridge between a flat motion value map 4572* and applyAxisDelta 4573*/ 4574function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = .5) { 4575 applyAxisDelta(axis, axisTranslate, axisScale, mixNumber$1(axis.min, axis.max, axisOrigin), boxScale); 4576} 4577function resolveAxisTranslate(value, axis) { 4578 if (typeof value === "string") return parseFloat(value) / 100 * (axis.max - axis.min); 4579 return value; 4580} 4581/** 4582* Apply a transform to a box from the latest resolved motion values. 4583*/ 4584function transformBox(box, transform, sourceBox) { 4585 const resolveBox = sourceBox ?? box; 4586 transformAxis(box.x, resolveAxisTranslate(transform.x, resolveBox.x), transform.scaleX, transform.scale, transform.originX); 4587 transformAxis(box.y, resolveAxisTranslate(transform.y, resolveBox.y), transform.scaleY, transform.scale, transform.originY); 4588} 4589var TREE_SCALE_SNAP_MIN, TREE_SCALE_SNAP_MAX; 4590function init_delta_apply() { 4591 return (init_delta_apply = __esmMin((() => { 4592 init_number(); 4593 TREE_SCALE_SNAP_MIN = .999999999999; 4594 TREE_SCALE_SNAP_MAX = 1.0000000000001; 4595 })))(); 4596} 4597//#endregion 4598//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/projection/utils/measure.mjs 4599function measureViewportBox(instance, transformPoint) { 4600 return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint)); 4601} 4602function measurePageBox(element, rootProjectionNode, transformPagePoint) { 4603 const viewportBox = measureViewportBox(element, transformPagePoint); 4604 const { scroll } = rootProjectionNode; 4605 if (scroll) { 4606 translateAxis(viewportBox.x, scroll.offset.x); 4607 translateAxis(viewportBox.y, scroll.offset.y); 4608 } 4609 return viewportBox; 4610} 4611function init_measure() { 4612 return (init_measure = __esmMin((() => { 4613 init_delta_apply(); 4614 })))(); 4615} 4616//#endregion 4617//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/render/store.mjs 4618var visualElementStore; 4619function init_store() { 4620 return (init_store = __esmMin((() => { 4621 visualElementStore = /* @__PURE__ */ new WeakMap(); 4622 })))(); 4623} 4624//#endregion 4625//#region node_modules/.pnpm/[email protected]/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs 4626function animateSingleValue(value, keyframes, options) { 4627 const motionValue$1 = isMotionValue(value) ? value : motionValue(value); 4628 motionValue$1.start(animateMotionValue("", motionValue$1, keyframes, options)); 4629 return motionValue$1.animation; 4630} 4631function init_single_value() { 4632 return (init_single_value = __esmMin((() => { 4633 init_motion_value(); 4634 init_value(); 4635 init_is_motion_value(); 4636 })))(); 4637} 4638//#endregion 4639export { NativeAnimation as $, circOut as $t, init_is_svg_element as A, init_create_generator_easing as At, init_keys_position as B, init_sync_time as Bt, init_build_attrs as C, invariant as Cn, defaultOffset as Ct, resolveElements as D, addUniqueItem as Dn, init_spring as Dt, init_resolve_elements as E, init_clamp as En, init_fill as Et, init_DOMKeyframesResolver as F, init_units as Ft, init_get_value_transition as G, frameSteps as Gt, animateMotionValue as H, cancelFrame as Ht, camelToDash as I, percent as It, MotionValue as J, init_batcher as Jt, init_resolve_transition as K, init_frame as Kt, init_camel_to_dash as L, px as Lt, init_is_html_element as M, mixNumber$1 as Mt, isHTMLElement as N, complex as Nt, getValueAsType as O, init_array as On, spring as Ot, DOMKeyframesResolver as P, init_complex as Pt, init_accelerated_values as Q, isEasingArray as Qt, init_is_motion_value as R, init_is_css_variable as Rt, cssStyleProperties as S, init_errors as Sn, notifyLayoutAnimationStart as St, init_build_styles as T, clamp as Tn, fillOffset as Tt, init_motion_value as U, frame as Ut, positionalKeys as V, time as Vt, getValueTransition as W, frameData as Wt, motionValue as X, init_map as Xt, init_value as Y, easingDefinitionToFunction as Yt, acceleratedValues as Z, init_is_easing_array as Zt, init_has_transform as _, isObject as _n, init_number$1 as _t, init_measure as a, secondsToMilliseconds as an, KeyframeResolver as at, init_conversion as b, MotionGlobalConfig as bn, transformValueTypes as bt, applyBoxDelta as c, init_progress as cn, transformPropOrder as ct, scalePoint as d, pipe as dn, init_parse_transform as dt, init_circ as en, init_NativeAnimation as et, transformBox as f, init_noop as fn, readTransformValue as ft, hasTransform as g, init_is_object as gn, init_defaults as gt, hasScale as h, isZeroValueString as hn, getDefaultValueType as ht, visualElementStore as i, millisecondsToSeconds as in, isCSSVar as it, isSVGElement as j, init_number as jt, init_get_as_type as k, removeItem as kn, createGeneratorEasing as kt, applyTreeDeltas as l, progress as ln, transformProps as lt, has2DTranslate as m, init_is_zero_value_string as mn, init_animatable_none as mt, init_single_value as n, reverseEasing as nn, isGenerator as nt, measurePageBox as o, SubscriptionManager as on, init_KeyframesResolver as ot, translateAxis as p, noop as pn, getAnimatableNone as pt, resolveTransition as q, createRenderBatcher as qt, init_store as r, init_time_conversion as rn, init_is_css_var as rt, measureViewportBox as s, init_subscription_manager as sn, init_keys_transform as st, animateSingleValue as t, init_reverse as tn, init_is_generator as tt, init_delta_apply as u, init_pipe as un, defaultTransformValue as ut, convertBoundingBoxToBox as v, init_is_numerical_string as vn, numberValueTypes as vt, buildHTMLStyles as w, warning as wn, init_default as wt, buildSVGAttrs as x, init_global_config as xn, init_notify_inspector as xt, convertBoxToBoundingBox as y, isNumericalString as yn, init_transform as yt, isMotionValue as z, isCSSVariableName as zt };
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.