{"version":3,"file":"js/4029.41320035.js","sources":["../../frontend/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js","../../frontend/node_modules/@xstate/react/dist/xstate-react.esm.js","../../frontend/node_modules/property-expr/index.js","../../frontend/node_modules/tiny-case/index.js","../../frontend/node_modules/toposort/index.js","../../frontend/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","../../frontend/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js","../../frontend/node_modules/use-sync-external-store/shim/index.js","../../frontend/node_modules/use-sync-external-store/shim/with-selector.js","../../frontend/node_modules/xstate/dist/assign-54f9e2d3.esm.js","../../frontend/node_modules/xstate/dist/xstate-dev.esm.js","../../frontend/node_modules/xstate/dist/xstate.esm.js","../../frontend/node_modules/xstate/dist/log-66075555.esm.js","../../frontend/node_modules/xstate/dist/StateMachine-28a9f50e.esm.js","../../frontend/node_modules/@hookform/resolvers/dist/resolvers.mjs","../../frontend/node_modules/@hookform/resolvers/yup/dist/yup.mjs","../../frontend/node_modules/@zag-js/avatar/dist/avatar.anatomy.mjs","../../frontend/node_modules/@zag-js/avatar/dist/avatar.connect.mjs","../../frontend/node_modules/@zag-js/avatar/dist/avatar.dom.mjs","../../frontend/node_modules/@zag-js/avatar/dist/avatar.machine.mjs","../../frontend/node_modules/@zag-js/core/dist/merge-props.mjs","../../frontend/node_modules/@zag-js/dom-query/dist/mutation-observer.mjs","../../frontend/node_modules/@zag-js/dom-query/dist/navigate.mjs","../../frontend/node_modules/@zag-js/dom-query/dist/query.mjs","../../frontend/node_modules/@zag-js/dom-query/dist/raf.mjs"],"sourcesContent":["import { useLayoutEffect } from 'react';\n\nvar index = useLayoutEffect ;\n\nexport { index as default };\n","import * as React from 'react';\nimport { useEffect, useState, useCallback } from 'react';\nimport useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect';\nimport { toObserver, createActor } from 'xstate';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\n\nconst forEachActor = (actorRef, callback) => {\n  callback(actorRef);\n  const children = actorRef.getSnapshot().children;\n  if (children) {\n    Object.values(children).forEach(child => {\n      forEachActor(child, callback);\n    });\n  }\n};\nfunction stopRootWithRehydration(actorRef) {\n  // persist snapshot here in a custom way allows us to persist inline actors and to preserve actor references\n  // we do it to avoid setState in useEffect when the effect gets \"reconnected\"\n  // this currently only happens in Strict Effects but it simulates the Offscreen aka Activity API\n  // it also just allows us to end up with a somewhat more predictable behavior for the users\n  const persistedSnapshots = [];\n  forEachActor(actorRef, ref => {\n    persistedSnapshots.push([ref, ref.getSnapshot()]);\n    // muting observers allow us to avoid `useSelector` from being notified about the stopped snapshot\n    // React reconnects its subscribers (from the useSyncExternalStore) on its own\n    // and userland subscribers should basically always do the same anyway\n    // as each subscription should have its own cleanup logic and that should be called each such reconnect\n    ref.observers = new Set();\n  });\n  const systemSnapshot = actorRef.system.getSnapshot?.();\n  actorRef.stop();\n  actorRef.system._snapshot = systemSnapshot;\n  persistedSnapshots.forEach(([ref, snapshot]) => {\n    ref._processingStatus = 0;\n    ref._snapshot = snapshot;\n  });\n}\n\nfunction useIdleActorRef(logic, ...[options]) {\n  let [[currentConfig, actorRef], setCurrent] = useState(() => {\n    const actorRef = createActor(logic, options);\n    return [logic.config, actorRef];\n  });\n  if (logic.config !== currentConfig) {\n    const newActorRef = createActor(logic, {\n      ...options,\n      snapshot: actorRef.getPersistedSnapshot({\n        __unsafeAllowInlineActors: true\n      })\n    });\n    setCurrent([logic.config, newActorRef]);\n    actorRef = newActorRef;\n  }\n\n  // TODO: consider using `useAsapEffect` that would do this in `useInsertionEffect` is that's available\n  useIsomorphicLayoutEffect(() => {\n    actorRef.logic.implementations = logic.implementations;\n  });\n  return actorRef;\n}\nfunction useActorRef(machine, ...[options, observerOrListener]) {\n  const actorRef = useIdleActorRef(machine, options);\n  useEffect(() => {\n    if (!observerOrListener) {\n      return;\n    }\n    const sub = actorRef.subscribe(toObserver(observerOrListener));\n    return () => {\n      sub.unsubscribe();\n    };\n  }, [observerOrListener]);\n  useEffect(() => {\n    actorRef.start();\n    return () => {\n      stopRootWithRehydration(actorRef);\n    };\n  }, [actorRef]);\n  return actorRef;\n}\n\nfunction defaultCompare(a, b) {\n  return a === b;\n}\nfunction useSelector(actor, selector, compare = defaultCompare) {\n  const subscribe = useCallback(handleStoreChange => {\n    if (!actor) {\n      return () => {};\n    }\n    const {\n      unsubscribe\n    } = actor.subscribe({\n      next: handleStoreChange,\n      error: handleStoreChange\n    });\n    return unsubscribe;\n  }, [actor]);\n  const boundGetSnapshot = useCallback(() => {\n    const snapshot = actor?.getSnapshot();\n    if (snapshot && 'status' in snapshot && snapshot.status === 'error') {\n      throw snapshot.error;\n    }\n    return snapshot;\n  }, [actor]);\n  const selectedSnapshot = useSyncExternalStoreWithSelector(subscribe, boundGetSnapshot, boundGetSnapshot, selector, compare);\n  return selectedSnapshot;\n}\n\nfunction createActorContext(actorLogic, actorOptions) {\n  const ReactContext = /*#__PURE__*/React.createContext(null);\n  const OriginalProvider = ReactContext.Provider;\n  function Provider({\n    children,\n    logic: providedLogic = actorLogic,\n    machine,\n    options: providedOptions\n  }) {\n    if (machine) {\n      throw new Error(`The \"machine\" prop has been deprecated. Please use \"logic\" instead.`);\n    }\n    const actor = useActorRef(providedLogic, {\n      ...actorOptions,\n      ...providedOptions\n    });\n    return /*#__PURE__*/React.createElement(OriginalProvider, {\n      value: actor,\n      children\n    });\n  }\n\n  // TODO: add properties to actor ref to make more descriptive\n  Provider.displayName = `ActorProvider`;\n  function useContext() {\n    const actor = React.useContext(ReactContext);\n    if (!actor) {\n      throw new Error(`You used a hook from \"${Provider.displayName}\" but it's not inside a <${Provider.displayName}> component.`);\n    }\n    return actor;\n  }\n  function useSelector$1(selector, compare) {\n    const actor = useContext();\n    return useSelector(actor, selector, compare);\n  }\n  return {\n    Provider: Provider,\n    useActorRef: useContext,\n    useSelector: useSelector$1\n  };\n}\n\n// From https://github.com/reduxjs/react-redux/blob/720f0ba79236cdc3e1115f4ef9a7760a21784b48/src/utils/shallowEqual.ts\nfunction is(x, y) {\n  if (x === y) {\n    return x !== 0 || y !== 0 || 1 / x === 1 / y;\n  } else {\n    return x !== x && y !== y;\n  }\n}\nfunction shallowEqual(objA, objB) {\n  if (is(objA, objB)) return true;\n  if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n    return false;\n  }\n  const keysA = Object.keys(objA);\n  const keysB = Object.keys(objB);\n  if (keysA.length !== keysB.length) return false;\n  for (let i = 0; i < keysA.length; i++) {\n    if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n      return false;\n    }\n  }\n  return true;\n}\n\nfunction useActor(logic, ...[options]) {\n  const actorRef = useIdleActorRef(logic, options);\n  const getSnapshot = useCallback(() => {\n    return actorRef.getSnapshot();\n  }, [actorRef]);\n  const subscribe = useCallback(handleStoreChange => {\n    const {\n      unsubscribe\n    } = actorRef.subscribe({\n      next: handleStoreChange,\n      error: handleStoreChange\n    });\n    return unsubscribe;\n  }, [actorRef]);\n  const actorSnapshot = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);\n  const snapshotWithStatus = 'status' in actorSnapshot ? actorSnapshot : undefined;\n  if (snapshotWithStatus?.status === 'error') {\n    throw snapshotWithStatus.error;\n  }\n  useEffect(() => {\n    actorRef.start();\n    return () => {\n      stopRootWithRehydration(actorRef);\n    };\n  }, [actorRef]);\n  return [actorSnapshot, actorRef.send, actorRef];\n}\n\n/** @alias useActor */\nfunction useMachine(machine, ...[options]) {\n  return useActor(machine, options);\n}\n\nexport { createActorContext, shallowEqual, useActor, useActorRef, useMachine, useSelector };\n","/**\n * Based on Kendo UI Core expression code <https://github.com/telerik/kendo-ui-core#license-information>\n */\n'use strict'\n\nfunction Cache(maxSize) {\n  this._maxSize = maxSize\n  this.clear()\n}\nCache.prototype.clear = function () {\n  this._size = 0\n  this._values = Object.create(null)\n}\nCache.prototype.get = function (key) {\n  return this._values[key]\n}\nCache.prototype.set = function (key, value) {\n  this._size >= this._maxSize && this.clear()\n  if (!(key in this._values)) this._size++\n\n  return (this._values[key] = value)\n}\n\nvar SPLIT_REGEX = /[^.^\\]^[]+|(?=\\[\\]|\\.\\.)/g,\n  DIGIT_REGEX = /^\\d+$/,\n  LEAD_DIGIT_REGEX = /^\\d/,\n  SPEC_CHAR_REGEX = /[~`!#$%\\^&*+=\\-\\[\\]\\\\';,/{}|\\\\\":<>\\?]/g,\n  CLEAN_QUOTES_REGEX = /^\\s*(['\"]?)(.*?)(\\1)\\s*$/,\n  MAX_CACHE_SIZE = 512\n\nvar pathCache = new Cache(MAX_CACHE_SIZE),\n  setCache = new Cache(MAX_CACHE_SIZE),\n  getCache = new Cache(MAX_CACHE_SIZE)\n\nvar config\n\nmodule.exports = {\n  Cache: Cache,\n\n  split: split,\n\n  normalizePath: normalizePath,\n\n  setter: function (path) {\n    var parts = normalizePath(path)\n\n    return (\n      setCache.get(path) ||\n      setCache.set(path, function setter(obj, value) {\n        var index = 0\n        var len = parts.length\n        var data = obj\n\n        while (index < len - 1) {\n          var part = parts[index]\n          if (\n            part === '__proto__' ||\n            part === 'constructor' ||\n            part === 'prototype'\n          ) {\n            return obj\n          }\n\n          data = data[parts[index++]]\n        }\n        data[parts[index]] = value\n      })\n    )\n  },\n\n  getter: function (path, safe) {\n    var parts = normalizePath(path)\n    return (\n      getCache.get(path) ||\n      getCache.set(path, function getter(data) {\n        var index = 0,\n          len = parts.length\n        while (index < len) {\n          if (data != null || !safe) data = data[parts[index++]]\n          else return\n        }\n        return data\n      })\n    )\n  },\n\n  join: function (segments) {\n    return segments.reduce(function (path, part) {\n      return (\n        path +\n        (isQuoted(part) || DIGIT_REGEX.test(part)\n          ? '[' + part + ']'\n          : (path ? '.' : '') + part)\n      )\n    }, '')\n  },\n\n  forEach: function (path, cb, thisArg) {\n    forEach(Array.isArray(path) ? path : split(path), cb, thisArg)\n  },\n}\n\nfunction normalizePath(path) {\n  return (\n    pathCache.get(path) ||\n    pathCache.set(\n      path,\n      split(path).map(function (part) {\n        return part.replace(CLEAN_QUOTES_REGEX, '$2')\n      })\n    )\n  )\n}\n\nfunction split(path) {\n  return path.match(SPLIT_REGEX) || ['']\n}\n\nfunction forEach(parts, iter, thisArg) {\n  var len = parts.length,\n    part,\n    idx,\n    isArray,\n    isBracket\n\n  for (idx = 0; idx < len; idx++) {\n    part = parts[idx]\n\n    if (part) {\n      if (shouldBeQuoted(part)) {\n        part = '\"' + part + '\"'\n      }\n\n      isBracket = isQuoted(part)\n      isArray = !isBracket && /^\\d+$/.test(part)\n\n      iter.call(thisArg, part, isBracket, isArray, idx, parts)\n    }\n  }\n}\n\nfunction isQuoted(str) {\n  return (\n    typeof str === 'string' && str && [\"'\", '\"'].indexOf(str.charAt(0)) !== -1\n  )\n}\n\nfunction hasLeadingNumber(part) {\n  return part.match(LEAD_DIGIT_REGEX) && !part.match(DIGIT_REGEX)\n}\n\nfunction hasSpecialChars(part) {\n  return SPEC_CHAR_REGEX.test(part)\n}\n\nfunction shouldBeQuoted(part) {\n  return !isQuoted(part) && (hasLeadingNumber(part) || hasSpecialChars(part))\n}\n","const reWords = /[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+|(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?)*/g\n\nconst words = (str) => str.match(reWords) || []\n\nconst upperFirst = (str) => str[0].toUpperCase() + str.slice(1)\n\nconst join = (str, d) => words(str).join(d).toLowerCase()\n\nconst camelCase = (str) =>\n  words(str).reduce(\n    (acc, next) =>\n      `${acc}${\n        !acc\n          ? next.toLowerCase()\n          : next[0].toUpperCase() + next.slice(1).toLowerCase()\n      }`,\n    '',\n  )\n\nconst pascalCase = (str) => upperFirst(camelCase(str))\n\nconst snakeCase = (str) => join(str, '_')\n\nconst kebabCase = (str) => join(str, '-')\n\nconst sentenceCase = (str) => upperFirst(join(str, ' '))\n\nconst titleCase = (str) => words(str).map(upperFirst).join(' ')\n\nmodule.exports = {\n  words,\n  upperFirst,\n  camelCase,\n  pascalCase,\n  snakeCase,\n  kebabCase,\n  sentenceCase,\n  titleCase,\n}\n","\n/**\n * Topological sorting function\n *\n * @param {Array} edges\n * @returns {Array}\n */\n\nmodule.exports = function(edges) {\n  return toposort(uniqueNodes(edges), edges)\n}\n\nmodule.exports.array = toposort\n\nfunction toposort(nodes, edges) {\n  var cursor = nodes.length\n    , sorted = new Array(cursor)\n    , visited = {}\n    , i = cursor\n    // Better data structures make algorithm much faster.\n    , outgoingEdges = makeOutgoingEdges(edges)\n    , nodesHash = makeNodesHash(nodes)\n\n  // check for unknown nodes\n  edges.forEach(function(edge) {\n    if (!nodesHash.has(edge[0]) || !nodesHash.has(edge[1])) {\n      throw new Error('Unknown node. There is an unknown node in the supplied edges.')\n    }\n  })\n\n  while (i--) {\n    if (!visited[i]) visit(nodes[i], i, new Set())\n  }\n\n  return sorted\n\n  function visit(node, i, predecessors) {\n    if(predecessors.has(node)) {\n      var nodeRep\n      try {\n        nodeRep = \", node was:\" + JSON.stringify(node)\n      } catch(e) {\n        nodeRep = \"\"\n      }\n      throw new Error('Cyclic dependency' + nodeRep)\n    }\n\n    if (!nodesHash.has(node)) {\n      throw new Error('Found unknown node. Make sure to provided all involved nodes. Unknown node: '+JSON.stringify(node))\n    }\n\n    if (visited[i]) return;\n    visited[i] = true\n\n    var outgoing = outgoingEdges.get(node) || new Set()\n    outgoing = Array.from(outgoing)\n\n    if (i = outgoing.length) {\n      predecessors.add(node)\n      do {\n        var child = outgoing[--i]\n        visit(child, nodesHash.get(child), predecessors)\n      } while (i)\n      predecessors.delete(node)\n    }\n\n    sorted[--cursor] = node\n  }\n}\n\nfunction uniqueNodes(arr){\n  var res = new Set()\n  for (var i = 0, len = arr.length; i < len; i++) {\n    var edge = arr[i]\n    res.add(edge[0])\n    res.add(edge[1])\n  }\n  return Array.from(res)\n}\n\nfunction makeOutgoingEdges(arr){\n  var edges = new Map()\n  for (var i = 0, len = arr.length; i < len; i++) {\n    var edge = arr[i]\n    if (!edges.has(edge[0])) edges.set(edge[0], new Set())\n    if (!edges.has(edge[1])) edges.set(edge[1], new Set())\n    edges.get(edge[0]).add(edge[1])\n  }\n  return edges\n}\n\nfunction makeNodesHash(arr){\n  var res = new Map()\n  for (var i = 0, len = arr.length; i < len; i++) {\n    res.set(arr[i], i)\n  }\n  return res\n}\n","/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n  return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n  useState = React.useState,\n  useEffect = React.useEffect,\n  useLayoutEffect = React.useLayoutEffect,\n  useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n  var value = getSnapshot(),\n    _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n    inst = _useState[0].inst,\n    forceUpdate = _useState[1];\n  useLayoutEffect(\n    function () {\n      inst.value = value;\n      inst.getSnapshot = getSnapshot;\n      checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n    },\n    [subscribe, value, getSnapshot]\n  );\n  useEffect(\n    function () {\n      checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n      return subscribe(function () {\n        checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n      });\n    },\n    [subscribe]\n  );\n  useDebugValue(value);\n  return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n  var latestGetSnapshot = inst.getSnapshot;\n  inst = inst.value;\n  try {\n    var nextValue = latestGetSnapshot();\n    return !objectIs(inst, nextValue);\n  } catch (error) {\n    return !0;\n  }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n  return getSnapshot();\n}\nvar shim =\n  \"undefined\" === typeof window ||\n  \"undefined\" === typeof window.document ||\n  \"undefined\" === typeof window.document.createElement\n    ? useSyncExternalStore$1\n    : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n  void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\"),\n  shim = require(\"use-sync-external-store/shim\");\nfunction is(x, y) {\n  return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n  useSyncExternalStore = shim.useSyncExternalStore,\n  useRef = React.useRef,\n  useEffect = React.useEffect,\n  useMemo = React.useMemo,\n  useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n  subscribe,\n  getSnapshot,\n  getServerSnapshot,\n  selector,\n  isEqual\n) {\n  var instRef = useRef(null);\n  if (null === instRef.current) {\n    var inst = { hasValue: !1, value: null };\n    instRef.current = inst;\n  } else inst = instRef.current;\n  instRef = useMemo(\n    function () {\n      function memoizedSelector(nextSnapshot) {\n        if (!hasMemo) {\n          hasMemo = !0;\n          memoizedSnapshot = nextSnapshot;\n          nextSnapshot = selector(nextSnapshot);\n          if (void 0 !== isEqual && inst.hasValue) {\n            var currentSelection = inst.value;\n            if (isEqual(currentSelection, nextSnapshot))\n              return (memoizedSelection = currentSelection);\n          }\n          return (memoizedSelection = nextSnapshot);\n        }\n        currentSelection = memoizedSelection;\n        if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n        var nextSelection = selector(nextSnapshot);\n        if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n          return (memoizedSnapshot = nextSnapshot), currentSelection;\n        memoizedSnapshot = nextSnapshot;\n        return (memoizedSelection = nextSelection);\n      }\n      var hasMemo = !1,\n        memoizedSnapshot,\n        memoizedSelection,\n        maybeGetServerSnapshot =\n          void 0 === getServerSnapshot ? null : getServerSnapshot;\n      return [\n        function () {\n          return memoizedSelector(getSnapshot());\n        },\n        null === maybeGetServerSnapshot\n          ? void 0\n          : function () {\n              return memoizedSelector(maybeGetServerSnapshot());\n            }\n      ];\n    },\n    [getSnapshot, getServerSnapshot, selector, isEqual]\n  );\n  var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n  useEffect(\n    function () {\n      inst.hasValue = !0;\n      inst.value = value;\n    },\n    [value]\n  );\n  useDebugValue(value);\n  return value;\n};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n  module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n  module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n  module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js');\n} else {\n  module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n","import { a0 as ProcessingStatus, Y as resolveReferencedActor, c as createActor, R as cloneMachineSnapshot } from './raise-8dd8aaec.esm.js';\n\nfunction createSpawner(actorScope, {\n  machine,\n  context\n}, event, spawnedChildren) {\n  const spawn = (src, options) => {\n    if (typeof src === 'string') {\n      const logic = resolveReferencedActor(machine, src);\n      if (!logic) {\n        throw new Error(`Actor logic '${src}' not implemented in machine '${machine.id}'`);\n      }\n      const actorRef = createActor(logic, {\n        id: options?.id,\n        parent: actorScope.self,\n        syncSnapshot: options?.syncSnapshot,\n        input: typeof options?.input === 'function' ? options.input({\n          context,\n          event,\n          self: actorScope.self\n        }) : options?.input,\n        src,\n        systemId: options?.systemId\n      });\n      spawnedChildren[actorRef.id] = actorRef;\n      return actorRef;\n    } else {\n      const actorRef = createActor(src, {\n        id: options?.id,\n        parent: actorScope.self,\n        syncSnapshot: options?.syncSnapshot,\n        input: options?.input,\n        src,\n        systemId: options?.systemId\n      });\n      return actorRef;\n    }\n  };\n  return (src, options) => {\n    const actorRef = spawn(src, options); // TODO: fix types\n    spawnedChildren[actorRef.id] = actorRef;\n    actorScope.defer(() => {\n      if (actorRef._processingStatus === ProcessingStatus.Stopped) {\n        return;\n      }\n      actorRef.start();\n    });\n    return actorRef;\n  };\n}\n\nfunction resolveAssign(actorScope, snapshot, actionArgs, actionParams, {\n  assignment\n}) {\n  if (!snapshot.context) {\n    throw new Error('Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.');\n  }\n  const spawnedChildren = {};\n  const assignArgs = {\n    context: snapshot.context,\n    event: actionArgs.event,\n    spawn: createSpawner(actorScope, snapshot, actionArgs.event, spawnedChildren),\n    self: actorScope.self,\n    system: actorScope.system\n  };\n  let partialUpdate = {};\n  if (typeof assignment === 'function') {\n    partialUpdate = assignment(assignArgs, actionParams);\n  } else {\n    for (const key of Object.keys(assignment)) {\n      const propAssignment = assignment[key];\n      partialUpdate[key] = typeof propAssignment === 'function' ? propAssignment(assignArgs, actionParams) : propAssignment;\n    }\n  }\n  const updatedContext = Object.assign({}, snapshot.context, partialUpdate);\n  return [cloneMachineSnapshot(snapshot, {\n    context: updatedContext,\n    children: Object.keys(spawnedChildren).length ? {\n      ...snapshot.children,\n      ...spawnedChildren\n    } : snapshot.children\n  }), undefined, undefined];\n}\n/**\n * Updates the current context of the machine.\n *\n * @example\n *\n * ```ts\n * import { createMachine, assign } from 'xstate';\n *\n * const countMachine = createMachine({\n *   context: {\n *     count: 0,\n *     message: ''\n *   },\n *   on: {\n *     inc: {\n *       actions: assign({\n *         count: ({ context }) => context.count + 1\n *       })\n *     },\n *     updateMessage: {\n *       actions: assign(({ context, event }) => {\n *         return {\n *           message: event.message.trim()\n *         };\n *       })\n *     }\n *   }\n * });\n * ```\n *\n * @param assignment An object that represents the partial context to update, or\n *   a function that returns an object that represents the partial context to\n *   update.\n */\nfunction assign(assignment) {\n  function assign(_args, _params) {\n  }\n  assign.type = 'xstate.assign';\n  assign.assignment = assignment;\n  assign.resolve = resolveAssign;\n  return assign;\n}\n\nexport { assign as a };\n","// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis\nfunction getGlobal() {\n  if (typeof globalThis !== 'undefined') {\n    return globalThis;\n  }\n  if (typeof self !== 'undefined') {\n    return self;\n  }\n  if (typeof window !== 'undefined') {\n    return window;\n  }\n  if (typeof global !== 'undefined') {\n    return global;\n  }\n}\nfunction getDevTools() {\n  const w = getGlobal();\n  if (w.__xstate__) {\n    return w.__xstate__;\n  }\n  return undefined;\n}\nfunction registerService(service) {\n  if (typeof window === 'undefined') {\n    return;\n  }\n  const devTools = getDevTools();\n  if (devTools) {\n    devTools.register(service);\n  }\n}\nconst devToolsAdapter = service => {\n  if (typeof window === 'undefined') {\n    return;\n  }\n  const devTools = getDevTools();\n  if (devTools) {\n    devTools.register(service);\n  }\n};\n\nexport { devToolsAdapter, getGlobal, registerService };\n","export { createEmptyActor, fromCallback, fromEventObservable, fromObservable, fromPromise, fromTransition } from './xstate-actors.esm.js';\nimport { m as matchesEventDescriptor, t as toArray, i as isAtomicStateNode, c as createActor, a as createSystem, r as raise, b as cancel, s as stopChild, d as spawnChild, e as macrostep, f as createInitEvent, g as initialMicrostep, h as getProperAncestors } from './raise-8dd8aaec.esm.js';\nexport { A as Actor, u as __unsafe_getAllOwnEventDescriptors, k as and, b as cancel, c as createActor, q as getStateNodes, j as interpret, p as isMachineSnapshot, v as matchesState, n as not, o as or, w as pathToStateValue, r as raise, d as spawnChild, l as stateIn, y as stop, s as stopChild, x as toObserver } from './raise-8dd8aaec.esm.js';\nimport { S as StateMachine } from './StateMachine-28a9f50e.esm.js';\nexport { S as StateMachine, a as StateNode } from './StateMachine-28a9f50e.esm.js';\nimport { a as assign } from './assign-54f9e2d3.esm.js';\nexport { a as assign } from './assign-54f9e2d3.esm.js';\nimport { s as sendTo, l as log, e as enqueueActions, a as emit } from './log-66075555.esm.js';\nexport { S as SpecialTargets, a as emit, e as enqueueActions, f as forwardTo, l as log, b as sendParent, s as sendTo } from './log-66075555.esm.js';\nimport './xstate-dev.esm.js';\n\n/**\n * Asserts that the given event object is of the specified type or types. Throws\n * an error if the event object is not of the specified types.\n *\n * @example\n *\n * ```ts\n * // ...\n * entry: ({ event }) => {\n *   assertEvent(event, 'doNothing');\n *   // event is { type: 'doNothing' }\n * },\n * // ...\n * exit: ({ event }) => {\n *   assertEvent(event, 'greet');\n *   // event is { type: 'greet'; message: string }\n *\n *   assertEvent(event, ['greet', 'notify']);\n *   // event is { type: 'greet'; message: string }\n *   // or { type: 'notify'; message: string; level: 'info' | 'error' }\n * },\n * ```\n */\nfunction assertEvent(event, type) {\n  const types = toArray(type);\n  const matches = types.some(descriptor => matchesEventDescriptor(event.type, descriptor));\n  if (!matches) {\n    const typesText = types.length === 1 ? `type matching \"${types[0]}\"` : `one of types matching \"${types.join('\", \"')}\"`;\n    throw new Error(`Expected event ${JSON.stringify(event)} to have ${typesText}`);\n  }\n}\n\n/**\n * Creates a state machine (statechart) with the given configuration.\n *\n * The state machine represents the pure logic of a state machine actor.\n *\n * @example\n *\n * ```ts\n * import { createMachine } from 'xstate';\n *\n * const lightMachine = createMachine({\n *   id: 'light',\n *   initial: 'green',\n *   states: {\n *     green: {\n *       on: {\n *         TIMER: { target: 'yellow' }\n *       }\n *     },\n *     yellow: {\n *       on: {\n *         TIMER: { target: 'red' }\n *       }\n *     },\n *     red: {\n *       on: {\n *         TIMER: { target: 'green' }\n *       }\n *     }\n *   }\n * });\n *\n * const lightActor = createActor(lightMachine);\n * lightActor.start();\n *\n * lightActor.send({ type: 'TIMER' });\n * ```\n *\n * @param config The state machine configuration.\n * @param options DEPRECATED: use `setup({ ... })` or `machine.provide({ ... })`\n *   to provide machine implementations instead.\n */\nfunction createMachine(config, implementations) {\n  return new StateMachine(config, implementations);\n}\n\n/**\n * A mapper object that defines how to transform a snapshot based on its state.\n * Can be nested to match the state hierarchy of the machine.\n */\n\n/**\n * Maps a machine snapshot to an array of result objects based on active states.\n *\n * Traverses all active state nodes (from atomic/leaf states up to root) and\n * collects results from matching `map` functions in the mapper object. Results\n * are ordered leaf-to-root (most specific state first).\n */\nfunction mapState(snapshot, mapper) {\n  const results = [];\n  const findMapper = (currentMapper, nodePath) => {\n    let mapper = currentMapper;\n    for (const key of nodePath) {\n      if (!mapper?.states) {\n        return undefined;\n      }\n      const states = mapper.states;\n      if (!(key in states)) {\n        return undefined;\n      }\n      mapper = states[key];\n    }\n    return mapper;\n  };\n  const visited = new Set();\n  for (const atomicNode of snapshot._nodes.filter(isAtomicStateNode)) {\n    let current = atomicNode;\n    while (current && !visited.has(current)) {\n      visited.add(current);\n      const nodeMapper = findMapper(mapper, current.path);\n      if (nodeMapper?.map) {\n        results.push({\n          stateNode: current,\n          result: nodeMapper.map(snapshot)\n        });\n      }\n      current = current.parent;\n    }\n  }\n  return results;\n}\n\n/** @internal */\nfunction createInertActorScope(actorLogic) {\n  const self = createActor(actorLogic);\n  // The Actor constructor eagerly calls `getInitialSnapshot` during `_initState`,\n  // which can register child actors with `systemId` in `self.system`.\n  // Replace `self.system` with a fresh system so that child actors spawned by\n  // the *caller's* explicit `getInitialSnapshot` / `transition` call register\n  // into a clean system and do not collide with those from the eager\n  // construction call.  This is what makes `initialTransition(machine)` safe\n  // even when invoked actors carry a `systemId`.\n  const freshSystem = createSystem(self, {\n    clock: self.system._clock,\n    logger: self.system._logger\n  });\n  self.system = freshSystem;\n  const inertActorScope = {\n    self,\n    defer: () => {},\n    id: '',\n    logger: () => {},\n    sessionId: '',\n    stopChild: () => {},\n    system: freshSystem,\n    emit: () => {},\n    actionExecutor: () => {}\n  };\n  return inertActorScope;\n}\n\n/** @deprecated Use `initialTransition(…)` instead. */\nfunction getInitialSnapshot(actorLogic, ...[input]) {\n  const actorScope = createInertActorScope(actorLogic);\n  return actorLogic.getInitialSnapshot(actorScope, input);\n}\n\n/**\n * Determines the next snapshot for the given `actorLogic` based on the given\n * `snapshot` and `event`.\n *\n * If the `snapshot` is `undefined`, the initial snapshot of the `actorLogic` is\n * used.\n *\n * @deprecated Use `transition(…)` instead.\n * @example\n *\n * ```ts\n * import { getNextSnapshot } from 'xstate';\n * import { trafficLightMachine } from './trafficLightMachine.ts';\n *\n * const nextSnapshot = getNextSnapshot(\n *   trafficLightMachine, // actor logic\n *   undefined, // snapshot (or initial state if undefined)\n *   { type: 'TIMER' }\n * ); // event object\n *\n * console.log(nextSnapshot.value);\n * // => 'yellow'\n *\n * const nextSnapshot2 = getNextSnapshot(\n *   trafficLightMachine, // actor logic\n *   nextSnapshot, // snapshot\n *   { type: 'TIMER' }\n * ); // event object\n *\n * console.log(nextSnapshot2.value);\n * // =>'red'\n * ```\n */\nfunction getNextSnapshot(actorLogic, snapshot, event) {\n  const inertActorScope = createInertActorScope(actorLogic);\n  inertActorScope.self._snapshot = snapshot;\n  return actorLogic.transition(snapshot, event, inertActorScope);\n}\n\n// at the moment we allow extra actors - ones that are not specified by `children`\n// this could be reconsidered in the future\n\n// used to keep only StateSchema relevant keys\n// this helps with type serialization as it makes the inferred type much shorter when dealing with huge configs\n\n// Extract { [invokeId]: src } mappings from a machine config's invoke entries.\n// This allows createMachine to infer TChildrenMap from the invoke config\n// when types.children is not explicitly provided.\n\nfunction setup({\n  schemas,\n  actors,\n  actions,\n  guards,\n  delays\n}) {\n  return {\n    assign,\n    sendTo,\n    raise,\n    log,\n    cancel,\n    stopChild,\n    enqueueActions,\n    emit,\n    spawnChild,\n    createStateConfig: config => config,\n    createAction: fn => fn,\n    createMachine: config => createMachine({\n      ...config,\n      schemas\n    }, {\n      actors,\n      actions,\n      guards,\n      delays\n    }),\n    extend: extended => setup({\n      schemas,\n      actors,\n      actions: {\n        ...actions,\n        ...extended.actions\n      },\n      guards: {\n        ...guards,\n        ...extended.guards\n      },\n      delays: {\n        ...delays,\n        ...extended.delays\n      }\n    })\n  };\n}\n\n// oxlint-disable-next-line typescript/no-unsafe-declaration-merging\n\nclass SimulatedClock {\n  constructor() {\n    this.timeouts = new Map();\n    this._now = 0;\n    this._id = 0;\n    this._flushing = false;\n    this._flushingInvalidated = false;\n  }\n  now() {\n    return this._now;\n  }\n  getId() {\n    return this._id++;\n  }\n  setTimeout(fn, timeout) {\n    this._flushingInvalidated = this._flushing;\n    const id = this.getId();\n    this.timeouts.set(id, {\n      start: this.now(),\n      timeout,\n      fn\n    });\n    return id;\n  }\n  clearTimeout(id) {\n    this._flushingInvalidated = this._flushing;\n    this.timeouts.delete(id);\n  }\n  set(time) {\n    if (this._now > time) {\n      throw new Error('Unable to travel back in time');\n    }\n    this._now = time;\n    this.flushTimeouts();\n  }\n  flushTimeouts() {\n    if (this._flushing) {\n      this._flushingInvalidated = true;\n      return;\n    }\n    this._flushing = true;\n    const sorted = [...this.timeouts].sort(([_idA, timeoutA], [_idB, timeoutB]) => {\n      const endA = timeoutA.start + timeoutA.timeout;\n      const endB = timeoutB.start + timeoutB.timeout;\n      return endB > endA ? -1 : 1;\n    });\n    for (const [id, timeout] of sorted) {\n      if (this._flushingInvalidated) {\n        this._flushingInvalidated = false;\n        this._flushing = false;\n        this.flushTimeouts();\n        return;\n      }\n      if (this.now() - timeout.start >= timeout.timeout) {\n        this.timeouts.delete(id);\n        timeout.fn.call(null);\n      }\n    }\n    this._flushing = false;\n  }\n  increment(ms) {\n    this._now += ms;\n    this.flushTimeouts();\n  }\n}\n\n/**\n * Returns a promise that resolves to the `output` of the actor when it is done.\n *\n * @example\n *\n * ```ts\n * const machine = createMachine({\n *   // ...\n *   output: {\n *     count: 42\n *   }\n * });\n *\n * const actor = createActor(machine);\n *\n * actor.start();\n *\n * const output = await toPromise(actor);\n *\n * console.log(output);\n * // logs { count: 42 }\n * ```\n */\nfunction toPromise(actor) {\n  return new Promise((resolve, reject) => {\n    actor.subscribe({\n      complete: () => {\n        resolve(actor.getSnapshot().output);\n      },\n      error: reject\n    });\n  });\n}\n\n/**\n * Given actor `logic`, a `snapshot`, and an `event`, returns a tuple of the\n * `nextSnapshot` and `actions` to execute.\n *\n * This is a pure function that does not execute `actions`.\n */\nfunction transition(logic, snapshot, event) {\n  const executableActions = [];\n  const actorScope = createInertActorScope(logic);\n  actorScope.actionExecutor = action => {\n    executableActions.push(action);\n  };\n  const nextSnapshot = logic.transition(snapshot, event, actorScope);\n  return [nextSnapshot, executableActions];\n}\n\n/**\n * Given actor `logic` and optional `input`, returns a tuple of the\n * `nextSnapshot` and `actions` to execute from the initial transition (no\n * previous state).\n *\n * This is a pure function that does not execute `actions`.\n */\nfunction initialTransition(logic, ...[input]) {\n  const executableActions = [];\n  const actorScope = createInertActorScope(logic);\n  actorScope.actionExecutor = action => {\n    executableActions.push(action);\n  };\n  const nextSnapshot = logic.getInitialSnapshot(actorScope, input);\n  return [nextSnapshot, executableActions];\n}\n\n/**\n * Given a state `machine`, a `snapshot`, and an `event`, returns an array of\n * microsteps, where each microstep is a tuple of `[snapshot, actions]`.\n *\n * This is a pure function that does not execute `actions`.\n */\nfunction getMicrosteps(machine, snapshot, event) {\n  const actorScope = createInertActorScope(machine);\n  const {\n    microsteps\n  } = macrostep(snapshot, event, actorScope, []);\n  return microsteps;\n}\n\n/**\n * Given a state `machine` and optional `input`, returns an array of microsteps\n * from the initial transition, where each microstep is a tuple of `[snapshot,\n * actions]`.\n *\n * This is a pure function that does not execute `actions`.\n */\nfunction getInitialMicrosteps(machine, ...[input]) {\n  const actorScope = createInertActorScope(machine);\n  const initEvent = createInitEvent(input);\n  const internalQueue = [];\n  const preInitialSnapshot = machine._getPreInitialState(actorScope, initEvent, internalQueue);\n  const first = initialMicrostep(machine.root, preInitialSnapshot, actorScope, initEvent, internalQueue);\n  const {\n    microsteps\n  } = macrostep(first[0], initEvent, actorScope, internalQueue);\n  return [first, ...microsteps];\n}\n\n/**\n * Gets all potential next transitions from the current state.\n *\n * Returns all transitions that are available from the current state, including:\n *\n * - All transitions from atomic states (leaf states in the current state\n *   configuration)\n * - All transitions from ancestor states (parent states that may handle events)\n * - All guarded transitions (regardless of whether their guards would pass)\n * - Always (eventless) transitions\n * - After (delayed) transitions\n *\n * The order of transitions is deterministic:\n *\n * 1. Atomic states are processed in document order\n * 2. For each atomic state, transitions are collected from the state itself first,\n *    then its ancestors\n * 3. Within each state node, transitions are in the order they appear in the state\n *    definition\n *\n * @param state - The current machine snapshot\n * @returns Array of transition definitions from the current state, in\n *   deterministic order\n */\nfunction getNextTransitions(state) {\n  const potentialTransitions = [];\n  const atomicStates = state._nodes.filter(isAtomicStateNode);\n  const visited = new Set();\n\n  // Collect all transitions from atomic states and their ancestors\n  // Process atomic states in document order (as they appear in state._nodes)\n  for (const stateNode of atomicStates) {\n    // For each atomic state, process the state itself first, then its ancestors\n    // This ensures child state transitions come before parent state transitions\n    for (const s of [stateNode].concat(getProperAncestors(stateNode, undefined))) {\n      if (visited.has(s.id)) {\n        continue;\n      }\n      visited.add(s.id);\n\n      // Get all transitions for each event type\n      // Include ALL transitions, even if the same event type appears in multiple state nodes\n      // This is important for guarded transitions - all are \"potential\" regardless of guard evaluation\n      for (const [, transitions] of s.transitions) {\n        potentialTransitions.push(...transitions);\n      }\n\n      // Also include always (eventless) transitions\n      if (s.always) {\n        potentialTransitions.push(...s.always);\n      }\n    }\n  }\n  return potentialTransitions;\n}\n\nconst defaultWaitForOptions = {\n  timeout: Infinity // much more than 10 seconds\n};\n\n/**\n * Subscribes to an actor ref and waits for its emitted value to satisfy a\n * predicate, and then resolves with that value. Will throw if the desired state\n * is not reached after an optional timeout. (defaults to Infinity).\n *\n * @example\n *\n * ```js\n * const state = await waitFor(someService, (state) => {\n *   return state.hasTag('loaded');\n * });\n *\n * state.hasTag('loaded'); // true\n * ```\n *\n * @param actorRef The actor ref to subscribe to\n * @param predicate Determines if a value matches the condition to wait for\n * @param options\n * @returns A promise that eventually resolves to the emitted value that matches\n *   the condition\n */\nfunction waitFor(actorRef, predicate, options) {\n  const resolvedOptions = {\n    ...defaultWaitForOptions,\n    ...options\n  };\n  return new Promise((res, rej) => {\n    const {\n      signal\n    } = resolvedOptions;\n    if (signal?.aborted) {\n      // oxlint-disable-next-line typescript/prefer-promise-reject-errors\n      rej(signal.reason);\n      return;\n    }\n    let done = false;\n    const handle = resolvedOptions.timeout === Infinity ? undefined : setTimeout(() => {\n      dispose();\n      rej(new Error(`Timeout of ${resolvedOptions.timeout} ms exceeded`));\n    }, resolvedOptions.timeout);\n    const dispose = () => {\n      clearTimeout(handle);\n      done = true;\n      sub?.unsubscribe();\n      if (abortListener) {\n        signal.removeEventListener('abort', abortListener);\n      }\n    };\n    function checkEmitted(emitted) {\n      if (predicate(emitted)) {\n        dispose();\n        res(emitted);\n      }\n    }\n\n    /**\n     * If the `signal` option is provided, this will be the listener for its\n     * `abort` event\n     */\n    let abortListener;\n    // oxlint-disable-next-line prefer-const\n    let sub; // avoid TDZ when disposing synchronously\n\n    // See if the current snapshot already matches the predicate\n    checkEmitted(actorRef.getSnapshot());\n    if (done) {\n      return;\n    }\n\n    // only define the `abortListener` if the `signal` option is provided\n    if (signal) {\n      abortListener = () => {\n        dispose();\n        // XState does not \"own\" the signal, so we should reject with its reason (if any)\n        // oxlint-disable-next-line typescript/prefer-promise-reject-errors\n        rej(signal.reason);\n      };\n      signal.addEventListener('abort', abortListener);\n    }\n    sub = actorRef.subscribe({\n      next: checkEmitted,\n      error: err => {\n        dispose();\n        // oxlint-disable-next-line typescript/prefer-promise-reject-errors\n        rej(err);\n      },\n      complete: () => {\n        dispose();\n        rej(new Error(`Actor terminated without satisfying predicate`));\n      }\n    });\n    if (done) {\n      sub.unsubscribe();\n    }\n  });\n}\n\nexport { SimulatedClock, assertEvent, createMachine, getInitialMicrosteps, getInitialSnapshot, getMicrosteps, getNextSnapshot, getNextTransitions, initialTransition, mapState, setup, toPromise, transition, waitFor };\n","import { Z as XSTATE_ERROR, _ as createErrorActorEvent, E as evaluateGuard, b as cancel, r as raise, d as spawnChild, s as stopChild } from './raise-8dd8aaec.esm.js';\nimport { a as assign } from './assign-54f9e2d3.esm.js';\n\nfunction resolveEmit(_, snapshot, args, actionParams, {\n  event: eventOrExpr\n}) {\n  const resolvedEvent = typeof eventOrExpr === 'function' ? eventOrExpr(args, actionParams) : eventOrExpr;\n  return [snapshot, {\n    event: resolvedEvent\n  }, undefined];\n}\nfunction executeEmit(actorScope, {\n  event\n}) {\n  actorScope.defer(() => actorScope.emit(event));\n}\n/**\n * Emits an event to event handlers registered on the actor via `actor.on(event,\n * handler)`.\n *\n * @example\n *\n * ```ts\n * import { emit } from 'xstate';\n *\n * const machine = createMachine({\n *   // ...\n *   on: {\n *     something: {\n *       actions: emit({\n *         type: 'emitted',\n *         some: 'data'\n *       })\n *     }\n *   }\n *   // ...\n * });\n *\n * const actor = createActor(machine).start();\n *\n * actor.on('emitted', (event) => {\n *   console.log(event);\n * });\n *\n * actor.send({ type: 'something' });\n * // logs:\n * // {\n * //   type: 'emitted',\n * //   some: 'data'\n * // }\n * ```\n */\nfunction emit(/** The event to emit, or an expression that returns an event to emit. */\neventOrExpr) {\n  function emit(_args, _params) {\n  }\n  emit.type = 'xstate.emit';\n  emit.event = eventOrExpr;\n  emit.resolve = resolveEmit;\n  emit.execute = executeEmit;\n  return emit;\n}\n\n// this is needed to make JSDoc `@link` work properly\n// oxlint-disable-next-line no-unused-vars\n\n/**\n * @remarks\n * `T | unknown` reduces to `unknown` and that can be problematic when it comes\n * to contextual typing. It especially is a problem when the union has a\n * function member, like here:\n *\n * ```ts\n * declare function test(\n *   cbOrVal: ((arg: number) => unknown) | unknown\n * ): void;\n * test((arg) => {}); // oops, implicit any\n * ```\n *\n * This type can be used to avoid this problem. This union represents the same\n * value space as `unknown`.\n */\n\n// https://github.com/microsoft/TypeScript/issues/23182#issuecomment-379091887\n\n// @TODO: we can't use native `NoInfer` as we need those:\n// https://github.com/microsoft/TypeScript/pull/61092\n// https://github.com/microsoft/TypeScript/pull/61077\n// but even with those fixes native NoInfer still doesn't work - further issues have to be reproduced and fixed\n\n/** @deprecated Use the built-in `NoInfer` type instead */\n\n/** The full definition of an event, with a string `type`. */\n\n/**\n * The string or object representing the state value relative to the parent\n * state node.\n *\n * @remarks\n * - For a child atomic state node, this is a string, e.g., `\"pending\"`.\n * - For complex state nodes, this is an object, e.g., `{ success:\n *   \"someChildState\" }`.\n */\n\n/** @deprecated Use `AnyMachineSnapshot` instead */\n\n// TODO: possibly refactor this somehow, use even a simpler type, and maybe even make `machine.options` private or something\n/** @ignore */\n\n/**\n * Runtime options for state machine execution.\n *\n * @example\n *\n * ```ts\n * const machine = createMachine({\n *   // ... machine config\n *   options: {\n *     maxIterations: 5000\n *     // other runtime options can be added here\n *   }\n * });\n * ```\n */\n\nlet SpecialTargets = /*#__PURE__*/function (SpecialTargets) {\n  SpecialTargets[\"Parent\"] = \"#_parent\";\n  SpecialTargets[\"Internal\"] = \"#_internal\";\n  return SpecialTargets;\n}({});\n\n/** @deprecated Use `AnyActor` instead. */\n\n// Based on RxJS types\n\n// TODO: in v6, this should only accept AnyActorLogic, like ActorRefFromLogic\n\n/** @deprecated Use `Actor<T>` instead. */\n\n/**\n * Represents logic which can be used by an actor.\n *\n * @template TSnapshot - The type of the snapshot.\n * @template TEvent - The type of the event object.\n * @template TInput - The type of the input.\n * @template TSystem - The type of the actor system.\n */\n\n// Actors that don't have literal string IDs — these are the only ones\n// that should appear in the index signature fallback, since actors with\n// literal IDs are already covered by ToConcreteChildren.\n\n/** @deprecated */\n\n// TODO: cover all that can be actually returned\n\nfunction resolveSendTo(actorScope, snapshot, args, actionParams, {\n  to,\n  event: eventOrExpr,\n  id,\n  delay\n}, extra) {\n  const delaysMap = snapshot.machine.implementations.delays;\n  if (typeof eventOrExpr === 'string') {\n    throw new Error(\n    // oxlint-disable-next-line typescript/restrict-template-expressions\n    `Only event objects may be used with sendTo; use sendTo({ type: \"${eventOrExpr}\" }) instead`);\n  }\n  const resolvedEvent = typeof eventOrExpr === 'function' ? eventOrExpr(args, actionParams) : eventOrExpr;\n  let resolvedDelay;\n  if (typeof delay === 'string') {\n    const configDelay = delaysMap && delaysMap[delay];\n    resolvedDelay = typeof configDelay === 'function' ? configDelay(args, actionParams) : configDelay;\n  } else {\n    resolvedDelay = typeof delay === 'function' ? delay(args, actionParams) : delay;\n  }\n  const resolvedTarget = typeof to === 'function' ? to(args, actionParams) : to;\n  let targetActorRef;\n  if (typeof resolvedTarget === 'string') {\n    // oxlint-disable-next-line typescript/no-unsafe-enum-comparison\n    if (resolvedTarget === SpecialTargets.Parent) {\n      targetActorRef = actorScope.self._parent;\n    }\n    // oxlint-disable-next-line typescript/no-unsafe-enum-comparison\n    else if (resolvedTarget === SpecialTargets.Internal) {\n      targetActorRef = actorScope.self;\n    } else if (resolvedTarget.startsWith('#_')) {\n      // SCXML compatibility: https://www.w3.org/TR/scxml/#SCXMLEventProcessor\n      // #_invokeid. If the target is the special term '#_invokeid', where invokeid is the invokeid of an SCXML session that the sending session has created by <invoke>, the Processor must add the event to the external queue of that session.\n      targetActorRef = snapshot.children[resolvedTarget.slice(2)];\n    } else {\n      targetActorRef = extra.deferredActorIds?.includes(resolvedTarget) ? resolvedTarget : snapshot.children[resolvedTarget];\n    }\n    if (!targetActorRef) {\n      throw new Error(`Unable to send event to actor '${resolvedTarget}' from machine '${snapshot.machine.id}'.`);\n    }\n  } else {\n    targetActorRef = resolvedTarget || actorScope.self;\n  }\n  return [snapshot, {\n    to: targetActorRef,\n    targetId: typeof resolvedTarget === 'string' ? resolvedTarget : undefined,\n    event: resolvedEvent,\n    id,\n    delay: resolvedDelay\n  }, undefined];\n}\nfunction retryResolveSendTo(_, snapshot, params) {\n  if (typeof params.to === 'string') {\n    params.to = snapshot.children[params.to];\n  }\n}\nfunction executeSendTo(actorScope, params) {\n  // this forms an outgoing events queue\n  // thanks to that the recipient actors are able to read the *updated* snapshot value of the sender\n  actorScope.defer(() => {\n    const {\n      to,\n      event,\n      delay,\n      id\n    } = params;\n    if (typeof delay === 'number') {\n      actorScope.system.scheduler.schedule(actorScope.self, to, event, delay, id);\n      return;\n    }\n    actorScope.system._relay(actorScope.self,\n    // at this point, in a deferred task, it should already be mutated by retryResolveSendTo\n    // if it initially started as a string\n    to, event.type === XSTATE_ERROR ? createErrorActorEvent(actorScope.self.id, event.data) : event);\n  });\n}\n/**\n * Sends an event to an actor.\n *\n * @param actor The `ActorRef` to send the event to.\n * @param event The event to send, or an expression that evaluates to the event\n *   to send\n * @param options Send action options\n *\n *   - `id` - The unique send event identifier (used with `cancel()`).\n *   - `delay` - The number of milliseconds to delay the sending of the event.\n */\nfunction sendTo(to, eventOrExpr, options) {\n  function sendTo(_args, _params) {\n  }\n  sendTo.type = 'xstate.sendTo';\n  sendTo.to = to;\n  sendTo.event = eventOrExpr;\n  sendTo.id = options?.id;\n  sendTo.delay = options?.delay;\n  sendTo.resolve = resolveSendTo;\n  sendTo.retryResolve = retryResolveSendTo;\n  sendTo.execute = executeSendTo;\n  return sendTo;\n}\n\n/**\n * Sends an event to this machine's parent.\n *\n * @param event The event to send to the parent machine.\n * @param options Options to pass into the send event.\n */\nfunction sendParent(event, options) {\n  return sendTo(SpecialTargets.Parent, event, options);\n}\n/**\n * Forwards (sends) an event to the `target` actor.\n *\n * @param target The target actor to forward the event to.\n * @param options Options to pass into the send action creator.\n */\nfunction forwardTo(target, options) {\n  return sendTo(target, ({\n    event\n  }) => event, options);\n}\n\nfunction resolveEnqueueActions(actorScope, snapshot, args, actionParams, {\n  collect\n}) {\n  const actions = [];\n  const enqueue = function enqueue(action) {\n    actions.push(action);\n  };\n  enqueue.assign = (...args) => {\n    actions.push(assign(...args));\n  };\n  enqueue.cancel = (...args) => {\n    actions.push(cancel(...args));\n  };\n  enqueue.raise = (...args) => {\n    // for some reason it fails to infer `TDelay` from `...args` here and picks its default (`never`)\n    // then it fails to typecheck that because `...args` use `string` in place of `TDelay`\n    actions.push(raise(...args));\n  };\n  enqueue.sendTo = (...args) => {\n    // for some reason it fails to infer `TDelay` from `...args` here and picks its default (`never`)\n    // then it fails to typecheck that because `...args` use `string` in place of `TDelay\n    actions.push(sendTo(...args));\n  };\n  enqueue.sendParent = (...args) => {\n    actions.push(sendParent(...args));\n  };\n  enqueue.spawnChild = (...args) => {\n    actions.push(spawnChild(...args));\n  };\n  enqueue.stopChild = (...args) => {\n    actions.push(stopChild(...args));\n  };\n  enqueue.emit = (...args) => {\n    actions.push(emit(...args));\n  };\n  collect({\n    context: args.context,\n    event: args.event,\n    enqueue,\n    check: guard => evaluateGuard(guard, snapshot.context, args.event, snapshot),\n    self: actorScope.self,\n    system: actorScope.system\n  }, actionParams);\n  return [snapshot, undefined, actions];\n}\n/**\n * Creates an action object that will execute actions that are queued by the\n * `enqueue(action)` function.\n *\n * @example\n *\n * ```ts\n * import { createMachine, enqueueActions } from 'xstate';\n *\n * const machine = createMachine({\n *   entry: enqueueActions(({ enqueue, check }) => {\n *     enqueue.assign({ count: 0 });\n *\n *     if (check('someGuard')) {\n *       enqueue.assign({ count: 1 });\n *     }\n *\n *     enqueue('someAction');\n *   })\n * });\n * ```\n */\nfunction enqueueActions(collect) {\n  function enqueueActions(_args, _params) {\n  }\n  enqueueActions.type = 'xstate.enqueueActions';\n  enqueueActions.collect = collect;\n  enqueueActions.resolve = resolveEnqueueActions;\n  return enqueueActions;\n}\n\nfunction resolveLog(_, snapshot, actionArgs, actionParams, {\n  value,\n  label\n}) {\n  return [snapshot, {\n    value: typeof value === 'function' ? value(actionArgs, actionParams) : value,\n    label\n  }, undefined];\n}\nfunction executeLog({\n  logger\n}, {\n  value,\n  label\n}) {\n  if (label) {\n    logger(label, value);\n  } else {\n    logger(value);\n  }\n}\n/**\n * @param expr The expression function to evaluate which will be logged. Takes\n *   in 2 arguments:\n *\n *   - `ctx` - the current state context\n *   - `event` - the event that caused this action to be executed.\n *\n * @param label The label to give to the logged expression.\n */\nfunction log(value = ({\n  context,\n  event\n}) => ({\n  context,\n  event\n}), label) {\n  function log(_args, _params) {\n  }\n  log.type = 'xstate.log';\n  log.value = value;\n  log.label = label;\n  log.resolve = resolveLog;\n  log.execute = executeLog;\n  return log;\n}\n\nexport { SpecialTargets as S, emit as a, sendParent as b, enqueueActions as e, forwardTo as f, log as l, sendTo as s };\n","import { S as STATE_DELIMITER, z as mapValues, t as toArray, B as formatTransitions, C as toTransitionConfigArray, D as formatTransition, N as NULL_EVENT, E as evaluateGuard, F as createInvokeId, G as getDelayedTransitions, H as formatInitialTransition, I as getCandidates, J as formatRouteTransitions, K as resolveStateValue, L as getAllStateNodes, q as getStateNodes, M as createMachineSnapshot, O as isInFinalState, e as macrostep, P as transitionNode, Q as resolveActionsAndContext, f as createInitEvent, g as initialMicrostep, R as cloneMachineSnapshot, T as toStatePath, U as isStateId, V as getStateNodeByPath, W as getPersistedSnapshot, Y as resolveReferencedActor, c as createActor, $ as $$ACTOR_TYPE } from './raise-8dd8aaec.esm.js';\nimport { a as assign } from './assign-54f9e2d3.esm.js';\n\nconst cache = new WeakMap();\nfunction memo(object, key, fn) {\n  let memoizedData = cache.get(object);\n  if (!memoizedData) {\n    memoizedData = {\n      [key]: fn()\n    };\n    cache.set(object, memoizedData);\n  } else if (!(key in memoizedData)) {\n    memoizedData[key] = fn();\n  }\n  return memoizedData[key];\n}\n\nconst EMPTY_OBJECT = {};\nconst toSerializableAction = action => {\n  if (typeof action === 'string') {\n    return {\n      type: action\n    };\n  }\n  if (typeof action === 'function') {\n    if ('resolve' in action) {\n      return {\n        type: action.type\n      };\n    }\n    return {\n      type: action.name\n    };\n  }\n  return action;\n};\nclass StateNode {\n  constructor(/** The raw config used to create the machine. */\n  config, options) {\n    this.config = config;\n    /**\n     * The relative key of the state node, which represents its location in the\n     * overall state value.\n     */\n    this.key = void 0;\n    /** The unique ID of the state node. */\n    this.id = void 0;\n    /**\n     * The type of this state node:\n     *\n     * - `'atomic'` - no child state nodes\n     * - `'compound'` - nested child state nodes (XOR)\n     * - `'parallel'` - orthogonal nested child state nodes (AND)\n     * - `'history'` - history state node\n     * - `'final'` - final state node\n     */\n    this.type = void 0;\n    /** The string path from the root machine node to this node. */\n    this.path = void 0;\n    /** The child state nodes. */\n    this.states = void 0;\n    /**\n     * The type of history on this state node. Can be:\n     *\n     * - `'shallow'` - recalls only top-level historical state value\n     * - `'deep'` - recalls historical state value at all levels\n     */\n    this.history = void 0;\n    /** The action(s) to be executed upon entering the state node. */\n    this.entry = void 0;\n    /** The action(s) to be executed upon exiting the state node. */\n    this.exit = void 0;\n    /** The parent state node. */\n    this.parent = void 0;\n    /** The root machine node. */\n    this.machine = void 0;\n    /**\n     * The meta data associated with this state node, which will be returned in\n     * State instances.\n     */\n    this.meta = void 0;\n    /**\n     * The output data sent with the \"xstate.done.state._id_\" event if this is a\n     * final state node.\n     */\n    this.output = void 0;\n    /**\n     * The order this state node appears. Corresponds to the implicit document\n     * order.\n     */\n    this.order = -1;\n    this.description = void 0;\n    this.tags = [];\n    this.transitions = void 0;\n    this.always = void 0;\n    this.parent = options._parent;\n    this.key = options._key;\n    this.machine = options._machine;\n    this.path = this.parent ? this.parent.path.concat(this.key) : [];\n    this.id = this.config.id || [this.machine.id, ...this.path].join(STATE_DELIMITER);\n    this.type = this.config.type || (this.config.states && Object.keys(this.config.states).length ? 'compound' : this.config.history ? 'history' : 'atomic');\n    this.description = this.config.description;\n    this.order = this.machine.idMap.size;\n    this.machine.idMap.set(this.id, this);\n    this.states = this.config.states ? mapValues(this.config.states, (stateConfig, key) => {\n      const stateNode = new StateNode(stateConfig, {\n        _parent: this,\n        _key: key,\n        _machine: this.machine\n      });\n      return stateNode;\n    }) : EMPTY_OBJECT;\n    if (this.type === 'compound' && !this.config.initial) {\n      throw new Error(`No initial state specified for compound state node \"#${this.id}\". Try adding { initial: \"${Object.keys(this.states)[0]}\" } to the state config.`);\n    }\n\n    // History config\n    this.history = this.config.history === true ? 'shallow' : this.config.history || false;\n    this.entry = toArray(this.config.entry).slice();\n    this.exit = toArray(this.config.exit).slice();\n    this.meta = this.config.meta;\n    this.output = this.type === 'final' || !this.parent ? this.config.output : undefined;\n    this.tags = toArray(config.tags).slice();\n  }\n\n  /** @internal */\n  _initialize() {\n    this.transitions = formatTransitions(this);\n    if (this.config.always) {\n      this.always = toTransitionConfigArray(this.config.always).map(t => formatTransition(this, NULL_EVENT, t));\n    }\n    Object.keys(this.states).forEach(key => {\n      this.states[key]._initialize();\n    });\n  }\n\n  /** The well-structured state node definition. */\n  get definition() {\n    return {\n      id: this.id,\n      key: this.key,\n      version: this.machine.version,\n      type: this.type,\n      initial: this.initial ? {\n        target: this.initial.target,\n        source: this,\n        actions: this.initial.actions.map(toSerializableAction),\n        eventType: null,\n        reenter: false,\n        toJSON: () => ({\n          target: this.initial.target.map(t => `#${t.id}`),\n          source: `#${this.id}`,\n          actions: this.initial.actions.map(toSerializableAction),\n          eventType: null\n        })\n      } : undefined,\n      history: this.history,\n      states: mapValues(this.states, state => {\n        return state.definition;\n      }),\n      on: this.on,\n      transitions: [...this.transitions.values()].flat().map(t => ({\n        ...t,\n        actions: t.actions.map(toSerializableAction)\n      })),\n      entry: this.entry.map(toSerializableAction),\n      exit: this.exit.map(toSerializableAction),\n      meta: this.meta,\n      order: this.order || -1,\n      output: this.output,\n      invoke: this.invoke,\n      description: this.description,\n      tags: this.tags\n    };\n  }\n\n  /** @internal */\n  toJSON() {\n    return this.definition;\n  }\n\n  /** The logic invoked as actors by this state node. */\n  get invoke() {\n    return memo(this, 'invoke', () => toArray(this.config.invoke).map((invokeConfig, i) => {\n      const {\n        src,\n        systemId\n      } = invokeConfig;\n      const resolvedId = invokeConfig.id ?? createInvokeId(this.id, i);\n      const sourceName = typeof src === 'string' ? src : `xstate.invoke.${createInvokeId(this.id, i)}`;\n      return {\n        ...invokeConfig,\n        src: sourceName,\n        id: resolvedId,\n        systemId: systemId,\n        toJSON() {\n          const {\n            onDone,\n            onError,\n            ...invokeDefValues\n          } = invokeConfig;\n          return {\n            ...invokeDefValues,\n            type: 'xstate.invoke',\n            src: sourceName,\n            id: resolvedId\n          };\n        }\n      };\n    }));\n  }\n\n  /** The mapping of events to transitions. */\n  get on() {\n    return memo(this, 'on', () => {\n      const transitions = this.transitions;\n      return [...transitions].flatMap(([descriptor, t]) => t.map(t => [descriptor, t])).reduce((map, [descriptor, transition]) => {\n        map[descriptor] = map[descriptor] || [];\n        map[descriptor].push(transition);\n        return map;\n      }, {});\n    });\n  }\n  get after() {\n    return memo(this, 'delayedTransitions', () => getDelayedTransitions(this));\n  }\n  get initial() {\n    return memo(this, 'initial', () => formatInitialTransition(this, this.config.initial));\n  }\n\n  /** @internal */\n  next(snapshot, event) {\n    const eventType = event.type;\n    const actions = [];\n    let selectedTransition;\n    const candidates = memo(this, `candidates-${eventType}`, () => getCandidates(this, eventType));\n    for (const candidate of candidates) {\n      const {\n        guard\n      } = candidate;\n      const resolvedContext = snapshot.context;\n      let guardPassed = false;\n      try {\n        guardPassed = !guard || evaluateGuard(guard, resolvedContext, event, snapshot);\n      } catch (err) {\n        const guardType = typeof guard === 'string' ? guard : typeof guard === 'object' ? guard.type : undefined;\n        throw new Error(`Unable to evaluate guard ${guardType ? `'${guardType}' ` : ''}in transition for event '${eventType}' in state node '${this.id}':\\n${err.message}`);\n      }\n      if (guardPassed) {\n        actions.push(...candidate.actions);\n        selectedTransition = candidate;\n        break;\n      }\n    }\n    return selectedTransition ? [selectedTransition] : undefined;\n  }\n\n  /** All the event types accepted by this state node and its descendants. */\n  get events() {\n    return memo(this, 'events', () => {\n      const {\n        states\n      } = this;\n      const events = new Set(this.ownEvents);\n      if (states) {\n        for (const stateId of Object.keys(states)) {\n          const state = states[stateId];\n          if (state.states) {\n            for (const event of state.events) {\n              events.add(`${event}`);\n            }\n          }\n        }\n      }\n      return Array.from(events);\n    });\n  }\n\n  /**\n   * All the events that have transitions directly from this state node.\n   *\n   * Excludes any inert events.\n   */\n  get ownEvents() {\n    const keys = Object.keys(Object.fromEntries(this.transitions));\n    const events = new Set(keys.filter(descriptor => {\n      return this.transitions.get(descriptor).some(transition => !(!transition.target && !transition.actions.length && !transition.reenter));\n    }));\n    return Array.from(events);\n  }\n}\n\nconst STATE_IDENTIFIER = '#';\nclass StateMachine {\n  constructor(/** The raw config used to create the machine. */\n  config, implementations) {\n    this.config = config;\n    /** The machine's own version. */\n    this.version = void 0;\n    this.schemas = void 0;\n    this.implementations = void 0;\n    /** Runtime options for machine execution. */\n    this.options = void 0;\n    /** @internal */\n    this.__xstatenode = true;\n    /** @internal */\n    this.idMap = new Map();\n    this.root = void 0;\n    this.id = void 0;\n    this.states = void 0;\n    this.events = void 0;\n    this.id = config.id || '(machine)';\n    this.implementations = {\n      actors: implementations?.actors ?? {},\n      actions: implementations?.actions ?? {},\n      delays: implementations?.delays ?? {},\n      guards: implementations?.guards ?? {}\n    };\n    this.version = this.config.version;\n    this.schemas = this.config.schemas;\n    this.options = {\n      maxIterations: Infinity,\n      ...this.config.options\n    };\n    this.transition = this.transition.bind(this);\n    this.getInitialSnapshot = this.getInitialSnapshot.bind(this);\n    this.getPersistedSnapshot = this.getPersistedSnapshot.bind(this);\n    this.restoreSnapshot = this.restoreSnapshot.bind(this);\n    this.start = this.start.bind(this);\n    this.root = new StateNode(config, {\n      _key: this.id,\n      _machine: this\n    });\n    this.root._initialize();\n    formatRouteTransitions(this.root);\n    this.states = this.root.states; // TODO: remove!\n    this.events = this.root.events;\n  }\n\n  /**\n   * Clones this state machine with the provided implementations.\n   *\n   * @param implementations Options (`actions`, `guards`, `actors`, `delays`) to\n   *   recursively merge with the existing options.\n   * @returns A new `StateMachine` instance with the provided implementations.\n   */\n  provide(implementations) {\n    const {\n      actions,\n      guards,\n      actors,\n      delays\n    } = this.implementations;\n    return new StateMachine(this.config, {\n      actions: {\n        ...actions,\n        ...implementations.actions\n      },\n      guards: {\n        ...guards,\n        ...implementations.guards\n      },\n      actors: {\n        ...actors,\n        ...implementations.actors\n      },\n      delays: {\n        ...delays,\n        ...implementations.delays\n      }\n    });\n  }\n  resolveState(config) {\n    const resolvedStateValue = resolveStateValue(this.root, config.value);\n    const nodeSet = getAllStateNodes(getStateNodes(this.root, resolvedStateValue));\n    return createMachineSnapshot({\n      _nodes: [...nodeSet],\n      context: config.context || {},\n      children: {},\n      status: isInFinalState(nodeSet, this.root) ? 'done' : config.status || 'active',\n      output: config.output,\n      error: config.error,\n      historyValue: config.historyValue\n    }, this);\n  }\n\n  /**\n   * Determines the next snapshot given the current `snapshot` and received\n   * `event`. Calculates a full macrostep from all microsteps.\n   *\n   * @param snapshot The current snapshot\n   * @param event The received event\n   */\n  transition(snapshot, event, actorScope) {\n    return macrostep(snapshot, event, actorScope, []).snapshot;\n  }\n\n  /**\n   * Determines the next state given the current `state` and `event`. Calculates\n   * a microstep.\n   *\n   * @param state The current state\n   * @param event The received event\n   */\n  microstep(snapshot, event, actorScope) {\n    return macrostep(snapshot, event, actorScope, []).microsteps.map(([s]) => s);\n  }\n  getTransitionData(snapshot, event) {\n    return transitionNode(this.root, snapshot.value, snapshot, event) || [];\n  }\n\n  /**\n   * The initial state _before_ evaluating any microsteps. This \"pre-initial\"\n   * state is provided to initial actions executed in the initial state.\n   *\n   * @internal\n   */\n  _getPreInitialState(actorScope, initEvent, internalQueue) {\n    const {\n      context\n    } = this.config;\n    const preInitial = createMachineSnapshot({\n      context: typeof context !== 'function' && context ? context : {},\n      _nodes: [this.root],\n      children: {},\n      status: 'active'\n    }, this);\n    if (typeof context === 'function') {\n      const assignment = ({\n        spawn,\n        event,\n        self\n      }) => context({\n        spawn,\n        input: event.input,\n        self\n      });\n      return resolveActionsAndContext(preInitial, initEvent, actorScope, [assign(assignment)], internalQueue, undefined);\n    }\n    return preInitial;\n  }\n\n  /**\n   * Returns the initial `State` instance, with reference to `self` as an\n   * `ActorRef`.\n   */\n  getInitialSnapshot(actorScope, input) {\n    const initEvent = createInitEvent(input); // TODO: fix;\n    const internalQueue = [];\n    let snapshot = createMachineSnapshot({\n      context: typeof this.config.context !== 'function' && this.config.context ? this.config.context : {},\n      _nodes: [this.root],\n      children: {},\n      status: 'active'\n    }, this);\n    try {\n      snapshot = this._getPreInitialState(actorScope, initEvent, internalQueue);\n      const [nextState] = initialMicrostep(this.root, snapshot, actorScope, initEvent, internalQueue);\n      const {\n        snapshot: macroState\n      } = macrostep(nextState, initEvent, actorScope, internalQueue);\n      return macroState;\n    } catch (error) {\n      return cloneMachineSnapshot(snapshot, {\n        status: 'error',\n        error\n      });\n    }\n  }\n  start(snapshot) {\n    Object.values(snapshot.children).forEach(child => {\n      if (child.getSnapshot().status === 'active') {\n        child.start();\n      }\n    });\n  }\n  getStateNodeById(stateId) {\n    const fullPath = toStatePath(stateId);\n    const relativePath = fullPath.slice(1);\n    const resolvedStateId = isStateId(fullPath[0]) ? fullPath[0].slice(STATE_IDENTIFIER.length) : fullPath[0];\n    const stateNode = this.idMap.get(resolvedStateId);\n    if (!stateNode) {\n      throw new Error(`Child state node '#${resolvedStateId}' does not exist on machine '${this.id}'`);\n    }\n    return getStateNodeByPath(stateNode, relativePath);\n  }\n  get definition() {\n    return this.root.definition;\n  }\n  toJSON() {\n    return this.definition;\n  }\n  getPersistedSnapshot(snapshot, options) {\n    return getPersistedSnapshot(snapshot, options);\n  }\n  restoreSnapshot(snapshot, _actorScope) {\n    const children = {};\n    const snapshotChildren = snapshot.children;\n    Object.keys(snapshotChildren).forEach(actorId => {\n      const actorData = snapshotChildren[actorId];\n      const childState = actorData.snapshot;\n      const src = actorData.src;\n      const logic = typeof src === 'string' ? resolveReferencedActor(this, src) : src;\n      if (!logic) {\n        return;\n      }\n      const actorRef = createActor(logic, {\n        id: actorId,\n        parent: _actorScope.self,\n        syncSnapshot: actorData.syncSnapshot,\n        snapshot: childState,\n        src,\n        systemId: actorData.systemId\n      });\n      children[actorId] = actorRef;\n    });\n    function resolveHistoryReferencedState(root, referenced) {\n      if (referenced instanceof StateNode) {\n        return referenced;\n      }\n      try {\n        return root.machine.getStateNodeById(referenced.id);\n      } catch {\n      }\n    }\n    function reviveHistoryValue(root, historyValue) {\n      if (!historyValue || typeof historyValue !== 'object') {\n        return {};\n      }\n      const revived = {};\n      for (const key in historyValue) {\n        const arr = historyValue[key];\n        for (const item of arr) {\n          const resolved = resolveHistoryReferencedState(root, item);\n          if (!resolved) {\n            continue;\n          }\n          revived[key] ??= [];\n          revived[key].push(resolved);\n        }\n      }\n      return revived;\n    }\n    const revivedHistoryValue = reviveHistoryValue(this.root, snapshot.historyValue);\n    const restoredSnapshot = createMachineSnapshot({\n      ...snapshot,\n      children,\n      _nodes: Array.from(getAllStateNodes(getStateNodes(this.root, snapshot.value))),\n      historyValue: revivedHistoryValue\n    }, this);\n    const seen = new Set();\n    function reviveContext(contextPart, children) {\n      if (seen.has(contextPart)) {\n        return;\n      }\n      seen.add(contextPart);\n      for (const key in contextPart) {\n        const value = contextPart[key];\n        if (value && typeof value === 'object') {\n          if ('xstate$$type' in value && value.xstate$$type === $$ACTOR_TYPE) {\n            contextPart[key] = children[value.id];\n            continue;\n          }\n          reviveContext(value, children);\n        }\n      }\n    }\n    reviveContext(restoredSnapshot.context, children);\n    return restoredSnapshot;\n  }\n}\n\nexport { StateMachine as S, StateNode as a };\n","import{get as e,set as r}from\"react-hook-form\";const t=(r,t,s)=>{if(r&&\"reportValidity\"in r){const o=e(s,t);r.setCustomValidity(o&&o.message||\"\"),r.reportValidity()}},s=(e,r)=>{for(const s in r.fields){const o=r.fields[s];o&&o.ref&&\"reportValidity\"in o.ref?t(o.ref,s,e):o&&o.refs&&o.refs.forEach(r=>t(r,s,e))}},o=(t,o)=>{o.shouldUseNativeValidation&&s(t,o);const n={};for(const s in t){const f=e(o.fields,s),c=Object.assign(t[s]||{},{ref:f&&f.refs?f.refs[0]:f&&f.ref});if(i(o.names||Object.keys(t),s)){const t=Object.assign({},e(n,s));r(t,\"root\",c),r(n,s,t)}else r(n,s,c)}return n},i=(e,r)=>{const t=n(r).replace(/[.*+?^${}()|\\\\]/g,\"\\\\$&\");return e.some(e=>n(e).match(`^${t}\\\\.\\\\d+`))};function n(e){return e.replace(/\\[(\\d+)]/g,\".$1\").replace(/[[\\]]/g,\"\")}export{o as toNestErrors,s as validateFieldsNatively};\n//# sourceMappingURL=resolvers.mjs.map\n","import{validateFieldsNatively as e,toNestErrors as t}from\"@hookform/resolvers\";import{appendErrors as r}from\"react-hook-form\";function o(o,n,a){return void 0===a&&(a={}),function(s,i,c){try{return Promise.resolve(function(t,r){try{var u=(null!=n&&n.context&&\"development\"===process.env.NODE_ENV&&console.warn(\"You should not used the yup options context. Please, use the 'useForm' context object instead\"),Promise.resolve(o[\"sync\"===a.mode?\"validateSync\":\"validate\"](s,Object.assign({abortEarly:!1},n,{context:i}))).then(function(t){return c.shouldUseNativeValidation&&e({},c),{values:a.raw?Object.assign({},s):t,errors:{}}}))}catch(e){return r(e)}return u&&u.then?u.then(void 0,r):u}(0,function(e){if(!e.inner)throw e;return{values:{},errors:t((o=e,n=!c.shouldUseNativeValidation&&\"all\"===c.criteriaMode,(o.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var o=e[t.path].types,a=o&&o[t.type];e[t.path]=r(t.path,n,e,t.type,a?[].concat(a,t.message):t.message)}return e},Object.create(null))),c)};var o,n}))}catch(e){return Promise.reject(e)}}}export{o as yupResolver};\n//# sourceMappingURL=yup.module.js.map\n","// src/avatar.anatomy.ts\nimport { createAnatomy } from \"@zag-js/anatomy\";\nvar anatomy = createAnatomy(\"avatar\").parts(\"root\", \"image\", \"fallback\");\nvar parts = anatomy.build();\nexport {\n  anatomy,\n  parts\n};\n","// src/avatar.connect.ts\nimport { parts } from \"./avatar.anatomy.mjs\";\nimport * as dom from \"./avatar.dom.mjs\";\nfunction connect(service, normalize) {\n  const { state, send, prop, scope } = service;\n  const loaded = state.matches(\"loaded\");\n  return {\n    loaded,\n    setSrc(src) {\n      const img = dom.getImageEl(scope);\n      img?.setAttribute(\"src\", src);\n    },\n    setLoaded() {\n      send({ type: \"img.loaded\", src: \"api\" });\n    },\n    setError() {\n      send({ type: \"img.error\", src: \"api\" });\n    },\n    getRootProps() {\n      return normalize.element({\n        ...parts.root.attrs,\n        dir: prop(\"dir\"),\n        id: dom.getRootId(scope)\n      });\n    },\n    getImageProps() {\n      return normalize.img({\n        ...parts.image.attrs,\n        hidden: !loaded,\n        dir: prop(\"dir\"),\n        id: dom.getImageId(scope),\n        \"data-state\": loaded ? \"visible\" : \"hidden\",\n        onLoad() {\n          send({ type: \"img.loaded\", src: \"element\" });\n        },\n        onError() {\n          send({ type: \"img.error\", src: \"element\" });\n        }\n      });\n    },\n    getFallbackProps() {\n      return normalize.element({\n        ...parts.fallback.attrs,\n        dir: prop(\"dir\"),\n        id: dom.getFallbackId(scope),\n        hidden: loaded,\n        \"data-state\": loaded ? \"hidden\" : \"visible\"\n      });\n    }\n  };\n}\nexport {\n  connect\n};\n","// src/avatar.dom.ts\nvar getRootId = (ctx) => ctx.ids?.root ?? `avatar:${ctx.id}`;\nvar getImageId = (ctx) => ctx.ids?.image ?? `avatar:${ctx.id}:image`;\nvar getFallbackId = (ctx) => ctx.ids?.fallback ?? `avatar:${ctx.id}:fallback`;\nvar getRootEl = (ctx) => ctx.getById(getRootId(ctx));\nvar getImageEl = (ctx) => ctx.getById(getImageId(ctx));\nexport {\n  getFallbackId,\n  getImageEl,\n  getImageId,\n  getRootEl,\n  getRootId\n};\n","// src/avatar.machine.ts\nimport { observeAttributes, observeChildren } from \"@zag-js/dom-query\";\nimport { createMachine } from \"@zag-js/core\";\nimport * as dom from \"./avatar.dom.mjs\";\nvar machine = createMachine({\n  initialState() {\n    return \"loading\";\n  },\n  effects: [\"trackImageRemoval\", \"trackSrcChange\"],\n  on: {\n    \"src.change\": {\n      target: \"loading\"\n    },\n    \"img.unmount\": {\n      target: \"error\"\n    }\n  },\n  states: {\n    loading: {\n      entry: [\"checkImageStatus\"],\n      on: {\n        \"img.loaded\": {\n          target: \"loaded\",\n          actions: [\"invokeOnLoad\"]\n        },\n        \"img.error\": {\n          target: \"error\",\n          actions: [\"invokeOnError\"]\n        }\n      }\n    },\n    error: {\n      on: {\n        \"img.loaded\": {\n          target: \"loaded\",\n          actions: [\"invokeOnLoad\"]\n        }\n      }\n    },\n    loaded: {\n      on: {\n        \"img.error\": {\n          target: \"error\",\n          actions: [\"invokeOnError\"]\n        }\n      }\n    }\n  },\n  implementations: {\n    actions: {\n      invokeOnLoad({ prop }) {\n        prop(\"onStatusChange\")?.({ status: \"loaded\" });\n      },\n      invokeOnError({ prop }) {\n        prop(\"onStatusChange\")?.({ status: \"error\" });\n      },\n      checkImageStatus({ send, scope }) {\n        const imageEl = dom.getImageEl(scope);\n        if (!imageEl?.complete) return;\n        const type = hasLoaded(imageEl) ? \"img.loaded\" : \"img.error\";\n        send({ type, src: \"ssr\" });\n      }\n    },\n    effects: {\n      trackImageRemoval({ send, scope }) {\n        const rootEl = dom.getRootEl(scope);\n        return observeChildren(rootEl, {\n          callback(records) {\n            const removedNodes = Array.from(records[0].removedNodes);\n            const removed = removedNodes.find(\n              (node) => node.nodeType === Node.ELEMENT_NODE && node.matches(\"[data-scope=avatar][data-part=image]\")\n            );\n            if (removed) {\n              send({ type: \"img.unmount\" });\n            }\n          }\n        });\n      },\n      trackSrcChange({ send, scope }) {\n        const imageEl = dom.getImageEl(scope);\n        return observeAttributes(imageEl, {\n          attributes: [\"src\", \"srcset\"],\n          callback() {\n            send({ type: \"src.change\" });\n          }\n        });\n      }\n    }\n  }\n});\nfunction hasLoaded(image) {\n  return image.complete && image.naturalWidth !== 0 && image.naturalHeight !== 0;\n}\nexport {\n  machine\n};\n","// src/merge-props.ts\nimport { callAll, isString } from \"@zag-js/utils\";\nvar clsx = (...args) => args.map((str) => str?.trim?.()).filter(Boolean).join(\" \");\nvar ownedBy = (...args) => Array.from(\n  new Set(\n    clsx(...args).split(/\\s+/).filter(Boolean)\n  )\n).join(\" \");\nvar CSS_REGEX = /((?:--)?(?:\\w+-?)+)\\s*:\\s*([^;]*)/g;\nvar serialize = (style) => {\n  const res = {};\n  let match;\n  while (match = CSS_REGEX.exec(style)) {\n    res[match[1]] = match[2];\n  }\n  return res;\n};\nvar css = (a, b) => {\n  if (isString(a)) {\n    if (isString(b)) return `${a};${b}`;\n    a = serialize(a);\n  } else if (isString(b)) {\n    b = serialize(b);\n  }\n  return Object.assign({}, a ?? {}, b ?? {});\n};\nfunction mergeProps(...args) {\n  let result = {};\n  for (let props of args) {\n    if (!props) continue;\n    for (let key in result) {\n      if (key.startsWith(\"on\") && typeof result[key] === \"function\" && typeof props[key] === \"function\") {\n        result[key] = callAll(props[key], result[key]);\n        continue;\n      }\n      if (key === \"className\" || key === \"class\") {\n        result[key] = clsx(result[key], props[key]);\n        continue;\n      }\n      if (key === \"style\") {\n        result[key] = css(result[key], props[key]);\n        continue;\n      }\n      if (key === \"data-ownedby\") {\n        result[key] = ownedBy(result[key], props[key]);\n        continue;\n      }\n      result[key] = props[key] !== void 0 ? props[key] : result[key];\n    }\n    for (let key in props) {\n      if (result[key] === void 0) {\n        result[key] = props[key];\n      }\n    }\n    const symbols = Object.getOwnPropertySymbols(props);\n    for (let symbol of symbols) {\n      result[symbol] = props[symbol];\n    }\n  }\n  return result;\n}\nexport {\n  mergeProps\n};\n","import \"./chunk-QZ7TP4HQ.mjs\";\n\n// src/mutation-observer.ts\nimport { raf } from \"./raf.mjs\";\nfunction observeAttributesImpl(node, options) {\n  if (!node) return;\n  const { attributes, callback: fn } = options;\n  const win = node.ownerDocument.defaultView || window;\n  const obs = new win.MutationObserver((changes) => {\n    for (const change of changes) {\n      if (change.type === \"attributes\" && change.attributeName && attributes.includes(change.attributeName)) {\n        fn(change);\n      }\n    }\n  });\n  obs.observe(node, { attributes: true, attributeFilter: attributes });\n  return () => obs.disconnect();\n}\nfunction observeAttributes(nodeOrFn, options) {\n  const { defer } = options;\n  const func = defer ? raf : (v) => v();\n  const cleanups = [];\n  cleanups.push(\n    func(() => {\n      const node = typeof nodeOrFn === \"function\" ? nodeOrFn() : nodeOrFn;\n      cleanups.push(observeAttributesImpl(node, options));\n    })\n  );\n  return () => {\n    cleanups.forEach((fn) => fn?.());\n  };\n}\nfunction observeChildrenImpl(node, options) {\n  const { callback: fn } = options;\n  if (!node) return;\n  const win = node.ownerDocument.defaultView || window;\n  const obs = new win.MutationObserver(fn);\n  obs.observe(node, { childList: true, subtree: true });\n  return () => obs.disconnect();\n}\nfunction observeChildren(nodeOrFn, options) {\n  const { defer } = options;\n  const func = defer ? raf : (v) => v();\n  const cleanups = [];\n  cleanups.push(\n    func(() => {\n      const node = typeof nodeOrFn === \"function\" ? nodeOrFn() : nodeOrFn;\n      cleanups.push(observeChildrenImpl(node, options));\n    })\n  );\n  return () => {\n    cleanups.forEach((fn) => fn?.());\n  };\n}\nexport {\n  observeAttributes,\n  observeChildren\n};\n","import \"./chunk-QZ7TP4HQ.mjs\";\n\n// src/navigate.ts\nimport { getWindow } from \"./node.mjs\";\nimport { isFirefox } from \"./platform.mjs\";\nimport { queueBeforeEvent } from \"./raf.mjs\";\nfunction navigate(items, current, options = {}) {\n  if (!current) return null;\n  const { orientation = \"both\", loop = true, dir = \"ltr\", key } = options;\n  if (!items.length || !key) return null;\n  const isVertical = key === \"ArrowUp\" || key === \"ArrowDown\";\n  const isHorizontal = key === \"ArrowLeft\" || key === \"ArrowRight\";\n  if (!isVertical && !isHorizontal && key !== \"Home\" && key !== \"End\") return null;\n  if (orientation === \"vertical\" && isHorizontal || orientation === \"horizontal\" && isVertical) return null;\n  if (key === \"Home\") return items[0] || null;\n  if (key === \"End\") return items[items.length - 1] || null;\n  const idx = items.indexOf(current);\n  if (idx === -1) return null;\n  let isForward;\n  if (orientation === \"both\") {\n    isForward = key === \"ArrowDown\" || (dir === \"ltr\" ? key === \"ArrowRight\" : key === \"ArrowLeft\");\n  } else {\n    isForward = isVertical ? key === \"ArrowDown\" : dir === \"ltr\" ? key === \"ArrowRight\" : key === \"ArrowLeft\";\n  }\n  const nextIdx = isForward ? loop ? (idx + 1) % items.length : Math.min(idx + 1, items.length - 1) : loop ? (idx - 1 + items.length) % items.length : Math.max(0, idx - 1);\n  return items[nextIdx] || null;\n}\nfunction clickIfLink(el) {\n  const click = () => {\n    const win = getWindow(el);\n    el.dispatchEvent(new win.MouseEvent(\"click\"));\n  };\n  if (isFirefox()) {\n    queueBeforeEvent(el, \"keyup\", click);\n  } else {\n    queueMicrotask(click);\n  }\n}\nexport {\n  clickIfLink,\n  navigate\n};\n","import \"./chunk-QZ7TP4HQ.mjs\";\n\n// src/query.ts\nfunction queryAll(root, selector) {\n  return Array.from(root?.querySelectorAll(selector) ?? []);\n}\nfunction query(root, selector) {\n  return root?.querySelector(selector) ?? null;\n}\nvar defaultItemToId = (v) => v.id;\nfunction itemById(v, id, itemToId = defaultItemToId) {\n  return v.find((item) => itemToId(item) === id);\n}\nfunction indexOfId(v, id, itemToId = defaultItemToId) {\n  const item = itemById(v, id, itemToId);\n  return item ? v.indexOf(item) : -1;\n}\nfunction nextById(v, id, loop = true) {\n  let idx = indexOfId(v, id);\n  idx = loop ? (idx + 1) % v.length : Math.min(idx + 1, v.length - 1);\n  return v[idx];\n}\nfunction prevById(v, id, loop = true) {\n  let idx = indexOfId(v, id);\n  if (idx === -1) return loop ? v[v.length - 1] : null;\n  idx = loop ? (idx - 1 + v.length) % v.length : Math.max(0, idx - 1);\n  return v[idx];\n}\nexport {\n  defaultItemToId,\n  indexOfId,\n  itemById,\n  nextById,\n  prevById,\n  query,\n  queryAll\n};\n","import {\n  __publicField\n} from \"./chunk-QZ7TP4HQ.mjs\";\n\n// src/raf.ts\nvar AnimationFrame = class _AnimationFrame {\n  constructor() {\n    __publicField(this, \"id\", null);\n    __publicField(this, \"fn_cleanup\");\n    __publicField(this, \"cleanup\", () => {\n      this.cancel();\n    });\n  }\n  static create() {\n    return new _AnimationFrame();\n  }\n  request(fn) {\n    this.cancel();\n    this.id = globalThis.requestAnimationFrame(() => {\n      this.id = null;\n      this.fn_cleanup = fn?.();\n    });\n  }\n  cancel() {\n    if (this.id !== null) {\n      globalThis.cancelAnimationFrame(this.id);\n      this.id = null;\n    }\n    this.fn_cleanup?.();\n    this.fn_cleanup = void 0;\n  }\n  isActive() {\n    return this.id !== null;\n  }\n};\nfunction raf(fn) {\n  const frame = AnimationFrame.create();\n  frame.request(fn);\n  return frame.cleanup;\n}\nfunction nextTick(fn) {\n  const set = /* @__PURE__ */ new Set();\n  function raf2(fn2) {\n    const id = globalThis.requestAnimationFrame(fn2);\n    set.add(() => globalThis.cancelAnimationFrame(id));\n  }\n  raf2(() => raf2(fn));\n  return function cleanup() {\n    set.forEach((fn2) => fn2());\n  };\n}\nfunction queueBeforeEvent(el, type, cb) {\n  const cancelTimer = raf(() => {\n    el.removeEventListener(type, exec, true);\n    cb();\n  });\n  const exec = () => {\n    cancelTimer();\n    cb();\n  };\n  el.addEventListener(type, exec, { once: true, capture: true });\n  return cancelTimer;\n}\nexport {\n  AnimationFrame,\n  nextTick,\n  queueBeforeEvent,\n  raf\n};\n"],"names":["Object","i","n","Set","Array","e","o","Map","Error","JSON","u","c","window","f","r","s","globalThis","self","WeakMap","t","d","a","Promise","Node","Boolean","queueMicrotask"],"mappings":";+JAEI,EAAQ,iBAAe,kCCK3B,IAAM,EAAe,CAAC,EAAU,KAC9B,EAAS,GACT,IAAM,EAAW,EAAS,WAAW,GAAG,QAAQ,AAC5C,IACFA,OAAO,MAAM,CAAC,GAAU,OAAO,CAAC,IAC9B,EAAa,EAAO,EACtB,EAEJ,EAkEA,SAAS,EAAe,CAAC,CAAE,CAAC,EAC1B,OAAO,IAAM,CACf,CACA,SAAS,EAAY,CAAK,CAAE,CAAQ,CAAE,EAAU,CAAc,EAC5D,IAAM,EAAY,kBAAY,IAC5B,GAAI,CAAC,EACH,MAAO,KAAO,EAEhB,GAAM,CACJ,aAAW,CACZ,CAAG,EAAM,SAAS,CAAC,CAClB,KAAM,EACN,MAAO,CACT,GACA,OAAO,CACT,EAAG,CAAC,EAAM,EACJ,EAAmB,kBAAY,KACnC,IAAM,EAAW,GAAO,cACxB,GAAI,GAAY,WAAY,GAAY,AAAoB,UAApB,EAAS,MAAM,CACrD,MAAM,EAAS,KAAK,CAEtB,OAAO,CACT,EAAG,CAAC,EAAM,EAEV,MADyB,uCAAiC,EAAW,EAAkB,EAAkB,EAAU,EAErH,CA6CA,SAAS,EAAG,CAAC,CAAE,CAAC,SACd,AAAI,IAAM,EACD,AAAM,IAAN,GAAW,AAAM,IAAN,GAAW,EAAI,GAAM,EAAI,EAEpC,GAAM,GAAK,GAAM,CAE5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