{"version":3,"file":"index.mjs","sources":["../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../node_modules/@tanstack/query-core/build/lib/subscribable.mjs","../node_modules/@tanstack/query-core/build/lib/utils.mjs","../node_modules/@tanstack/query-core/build/lib/focusManager.mjs","../node_modules/@tanstack/query-core/build/lib/onlineManager.mjs","../node_modules/@tanstack/query-core/build/lib/retryer.mjs","../node_modules/@tanstack/query-core/build/lib/logger.mjs","../node_modules/@tanstack/query-core/build/lib/notifyManager.mjs","../node_modules/@tanstack/query-core/build/lib/removable.mjs","../node_modules/@tanstack/query-core/build/lib/query.mjs","../node_modules/@tanstack/query-core/build/lib/queryCache.mjs","../node_modules/@tanstack/query-core/build/lib/mutation.mjs","../node_modules/@tanstack/query-core/build/lib/mutationCache.mjs","../node_modules/@tanstack/query-core/build/lib/infiniteQueryBehavior.mjs","../node_modules/@tanstack/query-core/build/lib/queryClient.mjs","../node_modules/@tanstack/query-core/build/lib/queryObserver.mjs","../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js","../node_modules/use-sync-external-store/shim/index.js","../node_modules/@tanstack/react-query/build/lib/useSyncExternalStore.mjs","../node_modules/@tanstack/react-query/build/lib/QueryClientProvider.mjs","../node_modules/@tanstack/react-query/build/lib/isRestoring.mjs","../node_modules/@tanstack/react-query/build/lib/QueryErrorResetBoundary.mjs","../node_modules/@tanstack/react-query/build/lib/utils.mjs","../node_modules/@tanstack/react-query/build/lib/errorBoundaryUtils.mjs","../node_modules/@tanstack/react-query/build/lib/suspense.mjs","../node_modules/@tanstack/react-query/build/lib/useBaseQuery.mjs","../node_modules/@tanstack/react-query/build/lib/useQuery.mjs","../node_modules/@remix-run/router/dist/router.js","../node_modules/react-router/dist/index.js","../node_modules/react-router-dom/dist/index.js","../node_modules/lucide-react/dist/esm/defaultAttributes.js","../node_modules/lucide-react/dist/esm/createLucideIcon.js","../node_modules/lucide-react/dist/esm/icons/activity.js","../node_modules/lucide-react/dist/esm/icons/alert-circle.js","../node_modules/lucide-react/dist/esm/icons/alert-triangle.js","../node_modules/lucide-react/dist/esm/icons/arrow-right.js","../node_modules/lucide-react/dist/esm/icons/bar-chart-3.js","../node_modules/lucide-react/dist/esm/icons/bug.js","../node_modules/lucide-react/dist/esm/icons/calendar.js","../node_modules/lucide-react/dist/esm/icons/check-circle.js","../node_modules/lucide-react/dist/esm/icons/check-square.js","../node_modules/lucide-react/dist/esm/icons/circle.js","../node_modules/lucide-react/dist/esm/icons/clock.js","../node_modules/lucide-react/dist/esm/icons/cpu.js","../node_modules/lucide-react/dist/esm/icons/dollar-sign.js","../node_modules/lucide-react/dist/esm/icons/external-link.js","../node_modules/lucide-react/dist/esm/icons/filter.js","../node_modules/lucide-react/dist/esm/icons/folder-open.js","../node_modules/lucide-react/dist/esm/icons/git-branch.js","../node_modules/lucide-react/dist/esm/icons/hard-drive.js","../node_modules/lucide-react/dist/esm/icons/home.js","../node_modules/lucide-react/dist/esm/icons/key.js","../node_modules/lucide-react/dist/esm/icons/maximize-2.js","../node_modules/lucide-react/dist/esm/icons/monitor-speaker.js","../node_modules/lucide-react/dist/esm/icons/pause.js","../node_modules/lucide-react/dist/esm/icons/play.js","../node_modules/lucide-react/dist/esm/icons/refresh-cw.js","../node_modules/lucide-react/dist/esm/icons/rocket.js","../node_modules/lucide-react/dist/esm/icons/rotate-ccw.js","../node_modules/lucide-react/dist/esm/icons/search.js","../node_modules/lucide-react/dist/esm/icons/server.js","../node_modules/lucide-react/dist/esm/icons/square.js","../node_modules/lucide-react/dist/esm/icons/target.js","../node_modules/lucide-react/dist/esm/icons/trending-up.js","../node_modules/lucide-react/dist/esm/icons/user.js","../node_modules/lucide-react/dist/esm/icons/users.js","../node_modules/lucide-react/dist/esm/icons/wifi-off.js","../node_modules/lucide-react/dist/esm/icons/wifi.js","../node_modules/lucide-react/dist/esm/icons/zap.js","../src/services/aiTrackdownBackend.ts","../src/services/aiTrackdownApi.ts","../src/services/agentService.ts","../src/services/claudePmService.ts","../src/hooks/useClaudePm.ts","../src/services/keyManagementService.ts","../src/components/Dashboard.tsx","../src/components/KeyManagement.tsx","../src/components/Layout.tsx","../node_modules/@babel/runtime/helpers/esm/typeof.js","../node_modules/date-fns/esm/_lib/requiredArgs/index.js","../node_modules/date-fns/esm/toDate/index.js","../node_modules/date-fns/esm/_lib/defaultOptions/index.js","../node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js","../node_modules/date-fns/esm/compareAsc/index.js","../node_modules/date-fns/esm/differenceInCalendarMonths/index.js","../node_modules/date-fns/esm/differenceInMilliseconds/index.js","../node_modules/date-fns/esm/_lib/roundingMethods/index.js","../node_modules/date-fns/esm/endOfDay/index.js","../node_modules/date-fns/esm/endOfMonth/index.js","../node_modules/date-fns/esm/isLastDayOfMonth/index.js","../node_modules/date-fns/esm/differenceInMonths/index.js","../node_modules/date-fns/esm/differenceInSeconds/index.js","../node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js","../node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js","../node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js","../node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js","../node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js","../node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js","../node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js","../node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js","../node_modules/date-fns/esm/locale/en-US/_lib/match/index.js","../node_modules/date-fns/esm/locale/en-US/index.js","../node_modules/date-fns/esm/_lib/assign/index.js","../node_modules/date-fns/esm/_lib/cloneObject/index.js","../node_modules/date-fns/esm/formatDistance/index.js","../node_modules/date-fns/esm/formatDistanceToNow/index.js","../src/components/AgentInfo/AgentCard.tsx","../src/components/AgentInfo/AgentGrid.tsx","../src/components/AgentInfo/AgentAssignments.tsx","../src/components/AgentInfo/AgentInfo.tsx","../src/components/ProjectDetail.tsx","../src/components/ProjectList.tsx","../src/services/processTrackerService.ts","../src/components/ProcessTracker.tsx","../src/components/ResponseTicker.tsx","../src/components/ProcessControls.tsx","../src/components/ProcessDashboard.tsx","../src/services/vercelService.ts","../src/components/VercelDeployments.tsx","../src/App.tsx","../src/hooks/useWebSocket.ts","../src/components/ProcessMonitor/ProcessActions.tsx","../src/components/ProcessMonitor/ProcessTable.tsx","../src/components/ProcessMonitor/ActivityFeed.tsx","../src/components/ProcessMonitor/SystemMetrics.tsx","../src/components/ProcessMonitor/ProcessMonitor.tsx","../src/index.ts"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its 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'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its 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';\n\nif (process.env.NODE_ENV !== \"production\") {\n  (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n  if (maybeIterable === null || typeof maybeIterable !== 'object') {\n    return null;\n  }\n\n  var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n  if (typeof maybeIterator === 'function') {\n    return maybeIterator;\n  }\n\n  return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n  {\n    {\n      for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n        args[_key2 - 1] = arguments[_key2];\n      }\n\n      printWarning('error', format, args);\n    }\n  }\n}\n\nfunction printWarning(level, format, args) {\n  // When changing this logic, you might want to also\n  // update consoleWithStackDev.www.js as well.\n  {\n    var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n    var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n    if (stack !== '') {\n      format += '%s';\n      args = args.concat([stack]);\n    } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n    var argsWithFormat = args.map(function (item) {\n      return String(item);\n    }); // Careful: RN currently depends on this prefix\n\n    argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n    // breaks IE9: https://github.com/facebook/react/issues/13610\n    // eslint-disable-next-line react-internal/no-production-logging\n\n    Function.prototype.apply.call(console[level], console, argsWithFormat);\n  }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n  REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n  if (typeof type === 'string' || typeof type === 'function') {\n    return true;\n  } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n  if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing  || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden  || type === REACT_OFFSCREEN_TYPE || enableScopeAPI  || enableCacheElement  || enableTransitionTracing ) {\n    return true;\n  }\n\n  if (typeof type === 'object' && type !== null) {\n    if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n    // types supported by any Flight configuration anywhere since\n    // we don't know which Flight build this will end up being used\n    // with.\n    type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n      return true;\n    }\n  }\n\n  return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n  var displayName = outerType.displayName;\n\n  if (displayName) {\n    return displayName;\n  }\n\n  var functionName = innerType.displayName || innerType.name || '';\n  return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n  return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n  if (type == null) {\n    // Host root, text node or just invalid type.\n    return null;\n  }\n\n  {\n    if (typeof type.tag === 'number') {\n      error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n    }\n  }\n\n  if (typeof type === 'function') {\n    return type.displayName || type.name || null;\n  }\n\n  if (typeof type === 'string') {\n    return type;\n  }\n\n  switch (type) {\n    case REACT_FRAGMENT_TYPE:\n      return 'Fragment';\n\n    case REACT_PORTAL_TYPE:\n      return 'Portal';\n\n    case REACT_PROFILER_TYPE:\n      return 'Profiler';\n\n    case REACT_STRICT_MODE_TYPE:\n      return 'StrictMode';\n\n    case REACT_SUSPENSE_TYPE:\n      return 'Suspense';\n\n    case REACT_SUSPENSE_LIST_TYPE:\n      return 'SuspenseList';\n\n  }\n\n  if (typeof type === 'object') {\n    switch (type.$$typeof) {\n      case REACT_CONTEXT_TYPE:\n        var context = type;\n        return getContextName(context) + '.Consumer';\n\n      case REACT_PROVIDER_TYPE:\n        var provider = type;\n        return getContextName(provider._context) + '.Provider';\n\n      case REACT_FORWARD_REF_TYPE:\n        return getWrappedName(type, type.render, 'ForwardRef');\n\n      case REACT_MEMO_TYPE:\n        var outerName = type.displayName || null;\n\n        if (outerName !== null) {\n          return outerName;\n        }\n\n        return getComponentNameFromType(type.type) || 'Memo';\n\n      case REACT_LAZY_TYPE:\n        {\n          var lazyComponent = type;\n          var payload = lazyComponent._payload;\n          var init = lazyComponent._init;\n\n          try {\n            return getComponentNameFromType(init(payload));\n          } catch (x) {\n            return null;\n          }\n        }\n\n      // eslint-disable-next-line no-fallthrough\n    }\n  }\n\n  return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n  {\n    if (disabledDepth === 0) {\n      /* eslint-disable react-internal/no-production-logging */\n      prevLog = console.log;\n      prevInfo = console.info;\n      prevWarn = console.warn;\n      prevError = console.error;\n      prevGroup = console.group;\n      prevGroupCollapsed = console.groupCollapsed;\n      prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n      var props = {\n        configurable: true,\n        enumerable: true,\n        value: disabledLog,\n        writable: true\n      }; // $FlowFixMe Flow thinks console is immutable.\n\n      Object.defineProperties(console, {\n        info: props,\n        log: props,\n        warn: props,\n        error: props,\n        group: props,\n        groupCollapsed: props,\n        groupEnd: props\n      });\n      /* eslint-enable react-internal/no-production-logging */\n    }\n\n    disabledDepth++;\n  }\n}\nfunction reenableLogs() {\n  {\n    disabledDepth--;\n\n    if (disabledDepth === 0) {\n      /* eslint-disable react-internal/no-production-logging */\n      var props = {\n        configurable: true,\n        enumerable: true,\n        writable: true\n      }; // $FlowFixMe Flow thinks console is immutable.\n\n      Object.defineProperties(console, {\n        log: assign({}, props, {\n          value: prevLog\n        }),\n        info: assign({}, props, {\n          value: prevInfo\n        }),\n        warn: assign({}, props, {\n          value: prevWarn\n        }),\n        error: assign({}, props, {\n          value: prevError\n        }),\n        group: assign({}, props, {\n          value: prevGroup\n        }),\n        groupCollapsed: assign({}, props, {\n          value: prevGroupCollapsed\n        }),\n        groupEnd: assign({}, props, {\n          value: prevGroupEnd\n        })\n      });\n      /* eslint-enable react-internal/no-production-logging */\n    }\n\n    if (disabledDepth < 0) {\n      error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n    }\n  }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n  {\n    if (prefix === undefined) {\n      // Extract the VM specific prefix used by each line.\n      try {\n        throw Error();\n      } catch (x) {\n        var match = x.stack.trim().match(/\\n( *(at )?)/);\n        prefix = match && match[1] || '';\n      }\n    } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n    return '\\n' + prefix + name;\n  }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n  var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n  componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n  // If something asked for a stack inside a fake render, it should get ignored.\n  if ( !fn || reentry) {\n    return '';\n  }\n\n  {\n    var frame = componentFrameCache.get(fn);\n\n    if (frame !== undefined) {\n      return frame;\n    }\n  }\n\n  var control;\n  reentry = true;\n  var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n  Error.prepareStackTrace = undefined;\n  var previousDispatcher;\n\n  {\n    previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n    // for warnings.\n\n    ReactCurrentDispatcher.current = null;\n    disableLogs();\n  }\n\n  try {\n    // This should throw.\n    if (construct) {\n      // Something should be setting the props in the constructor.\n      var Fake = function () {\n        throw Error();\n      }; // $FlowFixMe\n\n\n      Object.defineProperty(Fake.prototype, 'props', {\n        set: function () {\n          // We use a throwing setter instead of frozen or non-writable props\n          // because that won't throw in a non-strict mode function.\n          throw Error();\n        }\n      });\n\n      if (typeof Reflect === 'object' && Reflect.construct) {\n        // We construct a different control for this case to include any extra\n        // frames added by the construct call.\n        try {\n          Reflect.construct(Fake, []);\n        } catch (x) {\n          control = x;\n        }\n\n        Reflect.construct(fn, [], Fake);\n      } else {\n        try {\n          Fake.call();\n        } catch (x) {\n          control = x;\n        }\n\n        fn.call(Fake.prototype);\n      }\n    } else {\n      try {\n        throw Error();\n      } catch (x) {\n        control = x;\n      }\n\n      fn();\n    }\n  } catch (sample) {\n    // This is inlined manually because closure doesn't do it for us.\n    if (sample && control && typeof sample.stack === 'string') {\n      // This extracts the first frame from the sample that isn't also in the control.\n      // Skipping one frame that we assume is the frame that calls the two.\n      var sampleLines = sample.stack.split('\\n');\n      var controlLines = control.stack.split('\\n');\n      var s = sampleLines.length - 1;\n      var c = controlLines.length - 1;\n\n      while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n        // We expect at least one stack frame to be shared.\n        // Typically this will be the root most one. However, stack frames may be\n        // cut off due to maximum stack limits. In this case, one maybe cut off\n        // earlier than the other. We assume that the sample is longer or the same\n        // and there for cut off earlier. So we should find the root most frame in\n        // the sample somewhere in the control.\n        c--;\n      }\n\n      for (; s >= 1 && c >= 0; s--, c--) {\n        // Next we find the first one that isn't the same which should be the\n        // frame that called our sample function and the control.\n        if (sampleLines[s] !== controlLines[c]) {\n          // In V8, the first line is describing the message but other VMs don't.\n          // If we're about to return the first line, and the control is also on the same\n          // line, that's a pretty good indicator that our sample threw at same line as\n          // the control. I.e. before we entered the sample frame. So we ignore this result.\n          // This can happen if you passed a class to function component, or non-function.\n          if (s !== 1 || c !== 1) {\n            do {\n              s--;\n              c--; // We may still have similar intermediate frames from the construct call.\n              // The next one that isn't the same should be our match though.\n\n              if (c < 0 || sampleLines[s] !== controlLines[c]) {\n                // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n                var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n                // but we have a user-provided \"displayName\"\n                // splice it in to make the stack more readable.\n\n\n                if (fn.displayName && _frame.includes('<anonymous>')) {\n                  _frame = _frame.replace('<anonymous>', fn.displayName);\n                }\n\n                {\n                  if (typeof fn === 'function') {\n                    componentFrameCache.set(fn, _frame);\n                  }\n                } // Return the line we found.\n\n\n                return _frame;\n              }\n            } while (s >= 1 && c >= 0);\n          }\n\n          break;\n        }\n      }\n    }\n  } finally {\n    reentry = false;\n\n    {\n      ReactCurrentDispatcher.current = previousDispatcher;\n      reenableLogs();\n    }\n\n    Error.prepareStackTrace = previousPrepareStackTrace;\n  } // Fallback to just using the name if we couldn't make it throw.\n\n\n  var name = fn ? fn.displayName || fn.name : '';\n  var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n  {\n    if (typeof fn === 'function') {\n      componentFrameCache.set(fn, syntheticFrame);\n    }\n  }\n\n  return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n  {\n    return describeNativeComponentFrame(fn, false);\n  }\n}\n\nfunction shouldConstruct(Component) {\n  var prototype = Component.prototype;\n  return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n  if (type == null) {\n    return '';\n  }\n\n  if (typeof type === 'function') {\n    {\n      return describeNativeComponentFrame(type, shouldConstruct(type));\n    }\n  }\n\n  if (typeof type === 'string') {\n    return describeBuiltInComponentFrame(type);\n  }\n\n  switch (type) {\n    case REACT_SUSPENSE_TYPE:\n      return describeBuiltInComponentFrame('Suspense');\n\n    case REACT_SUSPENSE_LIST_TYPE:\n      return describeBuiltInComponentFrame('SuspenseList');\n  }\n\n  if (typeof type === 'object') {\n    switch (type.$$typeof) {\n      case REACT_FORWARD_REF_TYPE:\n        return describeFunctionComponentFrame(type.render);\n\n      case REACT_MEMO_TYPE:\n        // Memo may contain any component type so we recursively resolve it.\n        return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n      case REACT_LAZY_TYPE:\n        {\n          var lazyComponent = type;\n          var payload = lazyComponent._payload;\n          var init = lazyComponent._init;\n\n          try {\n            // Lazy may contain any component type so we recursively resolve it.\n            return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n          } catch (x) {}\n        }\n    }\n  }\n\n  return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n  {\n    if (element) {\n      var owner = element._owner;\n      var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n      ReactDebugCurrentFrame.setExtraStackFrame(stack);\n    } else {\n      ReactDebugCurrentFrame.setExtraStackFrame(null);\n    }\n  }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n  {\n    // $FlowFixMe This is okay but Flow doesn't know it.\n    var has = Function.call.bind(hasOwnProperty);\n\n    for (var typeSpecName in typeSpecs) {\n      if (has(typeSpecs, typeSpecName)) {\n        var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n        // fail the render phase where it didn't fail before. So we log it.\n        // After these have been cleaned up, we'll let them throw.\n\n        try {\n          // This is intentionally an invariant that gets caught. It's the same\n          // behavior as without this statement except with a better message.\n          if (typeof typeSpecs[typeSpecName] !== 'function') {\n            // eslint-disable-next-line react-internal/prod-error-codes\n            var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n            err.name = 'Invariant Violation';\n            throw err;\n          }\n\n          error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n        } catch (ex) {\n          error$1 = ex;\n        }\n\n        if (error$1 && !(error$1 instanceof Error)) {\n          setCurrentlyValidatingElement(element);\n\n          error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n          setCurrentlyValidatingElement(null);\n        }\n\n        if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n          // Only monitor this failure once because there tends to be a lot of the\n          // same error.\n          loggedTypeFailures[error$1.message] = true;\n          setCurrentlyValidatingElement(element);\n\n          error('Failed %s type: %s', location, error$1.message);\n\n          setCurrentlyValidatingElement(null);\n        }\n      }\n    }\n  }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n  return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n  {\n    // toStringTag is needed for namespaced types like Temporal.Instant\n    var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n    var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n    return type;\n  }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n  {\n    try {\n      testStringCoercion(value);\n      return false;\n    } catch (e) {\n      return true;\n    }\n  }\n}\n\nfunction testStringCoercion(value) {\n  // If you ended up here by following an exception call stack, here's what's\n  // happened: you supplied an object or symbol value to React (as a prop, key,\n  // DOM attribute, CSS property, string ref, etc.) and when React tried to\n  // coerce it to a string using `'' + value`, an exception was thrown.\n  //\n  // The most common types that will cause this exception are `Symbol` instances\n  // and Temporal objects like `Temporal.Instant`. But any object that has a\n  // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n  // exception. (Library authors do this to prevent users from using built-in\n  // numeric operators like `+` or comparison operators like `>=` because custom\n  // methods are needed to perform accurate arithmetic or comparison.)\n  //\n  // To fix the problem, coerce this object or symbol value to a string before\n  // passing it to React. The most reliable way is usually `String(value)`.\n  //\n  // To find which value is throwing, check the browser or debugger console.\n  // Before this exception was thrown, there should be `console.error` output\n  // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n  // problem and how that type was used: key, atrribute, input value prop, etc.\n  // In most cases, this console output also shows the component and its\n  // ancestor components where the exception happened.\n  //\n  // eslint-disable-next-line react-internal/safe-string-coercion\n  return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n  {\n    if (willCoercionThrow(value)) {\n      error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n      return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n    }\n  }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n  key: true,\n  ref: true,\n  __self: true,\n  __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n  didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n  {\n    if (hasOwnProperty.call(config, 'ref')) {\n      var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n      if (getter && getter.isReactWarning) {\n        return false;\n      }\n    }\n  }\n\n  return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n  {\n    if (hasOwnProperty.call(config, 'key')) {\n      var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n      if (getter && getter.isReactWarning) {\n        return false;\n      }\n    }\n  }\n\n  return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n  {\n    if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n      var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n      if (!didWarnAboutStringRefs[componentName]) {\n        error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n        didWarnAboutStringRefs[componentName] = true;\n      }\n    }\n  }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n  {\n    var warnAboutAccessingKey = function () {\n      if (!specialPropKeyWarningShown) {\n        specialPropKeyWarningShown = true;\n\n        error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n      }\n    };\n\n    warnAboutAccessingKey.isReactWarning = true;\n    Object.defineProperty(props, 'key', {\n      get: warnAboutAccessingKey,\n      configurable: true\n    });\n  }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n  {\n    var warnAboutAccessingRef = function () {\n      if (!specialPropRefWarningShown) {\n        specialPropRefWarningShown = true;\n\n        error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n      }\n    };\n\n    warnAboutAccessingRef.isReactWarning = true;\n    Object.defineProperty(props, 'ref', {\n      get: warnAboutAccessingRef,\n      configurable: true\n    });\n  }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n  var element = {\n    // This tag allows us to uniquely identify this as a React Element\n    $$typeof: REACT_ELEMENT_TYPE,\n    // Built-in properties that belong on the element\n    type: type,\n    key: key,\n    ref: ref,\n    props: props,\n    // Record the component responsible for creating this element.\n    _owner: owner\n  };\n\n  {\n    // The validation flag is currently mutative. We put it on\n    // an external backing store so that we can freeze the whole object.\n    // This can be replaced with a WeakMap once they are implemented in\n    // commonly used development environments.\n    element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n    // the validation flag non-enumerable (where possible, which should\n    // include every environment we run tests in), so the test framework\n    // ignores it.\n\n    Object.defineProperty(element._store, 'validated', {\n      configurable: false,\n      enumerable: false,\n      writable: true,\n      value: false\n    }); // self and source are DEV only properties.\n\n    Object.defineProperty(element, '_self', {\n      configurable: false,\n      enumerable: false,\n      writable: false,\n      value: self\n    }); // Two elements created in two different places should be considered\n    // equal for testing purposes and therefore we hide it from enumeration.\n\n    Object.defineProperty(element, '_source', {\n      configurable: false,\n      enumerable: false,\n      writable: false,\n      value: source\n    });\n\n    if (Object.freeze) {\n      Object.freeze(element.props);\n      Object.freeze(element);\n    }\n  }\n\n  return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n  {\n    var propName; // Reserved names are extracted\n\n    var props = {};\n    var key = null;\n    var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n    // issue if key is also explicitly declared (ie. <div {...props} key=\"Hi\" />\n    // or <div key=\"Hi\" {...props} /> ). We want to deprecate key spread,\n    // but as an intermediary step, we will use jsxDEV for everything except\n    // <div {...props} key=\"Hi\" />, because we aren't currently able to tell if\n    // key is explicitly declared to be undefined or not.\n\n    if (maybeKey !== undefined) {\n      {\n        checkKeyStringCoercion(maybeKey);\n      }\n\n      key = '' + maybeKey;\n    }\n\n    if (hasValidKey(config)) {\n      {\n        checkKeyStringCoercion(config.key);\n      }\n\n      key = '' + config.key;\n    }\n\n    if (hasValidRef(config)) {\n      ref = config.ref;\n      warnIfStringRefCannotBeAutoConverted(config, self);\n    } // Remaining properties are added to a new props object\n\n\n    for (propName in config) {\n      if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n        props[propName] = config[propName];\n      }\n    } // Resolve default props\n\n\n    if (type && type.defaultProps) {\n      var defaultProps = type.defaultProps;\n\n      for (propName in defaultProps) {\n        if (props[propName] === undefined) {\n          props[propName] = defaultProps[propName];\n        }\n      }\n    }\n\n    if (key || ref) {\n      var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n      if (key) {\n        defineKeyPropWarningGetter(props, displayName);\n      }\n\n      if (ref) {\n        defineRefPropWarningGetter(props, displayName);\n      }\n    }\n\n    return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n  }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n  {\n    if (element) {\n      var owner = element._owner;\n      var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n      ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n    } else {\n      ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n    }\n  }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n  propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n  {\n    return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n  }\n}\n\nfunction getDeclarationErrorAddendum() {\n  {\n    if (ReactCurrentOwner$1.current) {\n      var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n      if (name) {\n        return '\\n\\nCheck the render method of `' + name + '`.';\n      }\n    }\n\n    return '';\n  }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n  {\n    if (source !== undefined) {\n      var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n      var lineNumber = source.lineNumber;\n      return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n    }\n\n    return '';\n  }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n  {\n    var info = getDeclarationErrorAddendum();\n\n    if (!info) {\n      var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n      if (parentName) {\n        info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n      }\n    }\n\n    return info;\n  }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n  {\n    if (!element._store || element._store.validated || element.key != null) {\n      return;\n    }\n\n    element._store.validated = true;\n    var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n    if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n      return;\n    }\n\n    ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n    // property, it may be the creator of the child that's responsible for\n    // assigning it a key.\n\n    var childOwner = '';\n\n    if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n      // Give the component that originally created this child.\n      childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n    }\n\n    setCurrentlyValidatingElement$1(element);\n\n    error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n    setCurrentlyValidatingElement$1(null);\n  }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n  {\n    if (typeof node !== 'object') {\n      return;\n    }\n\n    if (isArray(node)) {\n      for (var i = 0; i < node.length; i++) {\n        var child = node[i];\n\n        if (isValidElement(child)) {\n          validateExplicitKey(child, parentType);\n        }\n      }\n    } else if (isValidElement(node)) {\n      // This element was passed in a valid location.\n      if (node._store) {\n        node._store.validated = true;\n      }\n    } else if (node) {\n      var iteratorFn = getIteratorFn(node);\n\n      if (typeof iteratorFn === 'function') {\n        // Entry iterators used to provide implicit keys,\n        // but now we print a separate warning for them later.\n        if (iteratorFn !== node.entries) {\n          var iterator = iteratorFn.call(node);\n          var step;\n\n          while (!(step = iterator.next()).done) {\n            if (isValidElement(step.value)) {\n              validateExplicitKey(step.value, parentType);\n            }\n          }\n        }\n      }\n    }\n  }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n  {\n    var type = element.type;\n\n    if (type === null || type === undefined || typeof type === 'string') {\n      return;\n    }\n\n    var propTypes;\n\n    if (typeof type === 'function') {\n      propTypes = type.propTypes;\n    } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n    // Inner props are checked in the reconciler.\n    type.$$typeof === REACT_MEMO_TYPE)) {\n      propTypes = type.propTypes;\n    } else {\n      return;\n    }\n\n    if (propTypes) {\n      // Intentionally inside to avoid triggering lazy initializers:\n      var name = getComponentNameFromType(type);\n      checkPropTypes(propTypes, element.props, 'prop', name, element);\n    } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n      propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n      var _name = getComponentNameFromType(type);\n\n      error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n    }\n\n    if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n      error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n    }\n  }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n  {\n    var keys = Object.keys(fragment.props);\n\n    for (var i = 0; i < keys.length; i++) {\n      var key = keys[i];\n\n      if (key !== 'children' && key !== 'key') {\n        setCurrentlyValidatingElement$1(fragment);\n\n        error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n        setCurrentlyValidatingElement$1(null);\n        break;\n      }\n    }\n\n    if (fragment.ref !== null) {\n      setCurrentlyValidatingElement$1(fragment);\n\n      error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n      setCurrentlyValidatingElement$1(null);\n    }\n  }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n  {\n    var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n    // succeed and there will likely be errors in render.\n\n    if (!validType) {\n      var info = '';\n\n      if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n        info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n      }\n\n      var sourceInfo = getSourceInfoErrorAddendum(source);\n\n      if (sourceInfo) {\n        info += sourceInfo;\n      } else {\n        info += getDeclarationErrorAddendum();\n      }\n\n      var typeString;\n\n      if (type === null) {\n        typeString = 'null';\n      } else if (isArray(type)) {\n        typeString = 'array';\n      } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n        typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n        info = ' Did you accidentally export a JSX literal instead of a component?';\n      } else {\n        typeString = typeof type;\n      }\n\n      error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n    }\n\n    var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n    // TODO: Drop this when these are no longer allowed as the type argument.\n\n    if (element == null) {\n      return element;\n    } // Skip key warning if the type isn't valid since our key validation logic\n    // doesn't expect a non-string/function type and can throw confusing errors.\n    // We don't want exception behavior to differ between dev and prod.\n    // (Rendering will throw with a helpful message and as soon as the type is\n    // fixed, the key warnings will appear.)\n\n\n    if (validType) {\n      var children = props.children;\n\n      if (children !== undefined) {\n        if (isStaticChildren) {\n          if (isArray(children)) {\n            for (var i = 0; i < children.length; i++) {\n              validateChildKeys(children[i], type);\n            }\n\n            if (Object.freeze) {\n              Object.freeze(children);\n            }\n          } else {\n            error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n          }\n        } else {\n          validateChildKeys(children, type);\n        }\n      }\n    }\n\n    {\n      if (hasOwnProperty.call(props, 'key')) {\n        var componentName = getComponentNameFromType(type);\n        var keys = Object.keys(props).filter(function (k) {\n          return k !== 'key';\n        });\n        var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n        if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n          var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n          error('A props object containing a \"key\" prop is being spread into JSX:\\n' + '  let props = %s;\\n' + '  <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + '  let props = %s;\\n' + '  <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n          didWarnAboutKeySpread[componentName + beforeExample] = true;\n        }\n      }\n    }\n\n    if (type === REACT_FRAGMENT_TYPE) {\n      validateFragmentProps(element);\n    } else {\n      validatePropTypes(element);\n    }\n\n    return element;\n  }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n  {\n    return jsxWithValidation(type, props, key, true);\n  }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n  {\n    return jsxWithValidation(type, props, key, false);\n  }\n}\n\nvar jsx =  jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs =  jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n  })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n  module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n  module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","class Subscribable {\n  constructor() {\n    this.listeners = new Set();\n    this.subscribe = this.subscribe.bind(this);\n  }\n\n  subscribe(listener) {\n    const identity = {\n      listener\n    };\n    this.listeners.add(identity);\n    this.onSubscribe();\n    return () => {\n      this.listeners.delete(identity);\n      this.onUnsubscribe();\n    };\n  }\n\n  hasListeners() {\n    return this.listeners.size > 0;\n  }\n\n  onSubscribe() {// Do nothing\n  }\n\n  onUnsubscribe() {// Do nothing\n  }\n\n}\n\nexport { Subscribable };\n//# sourceMappingURL=subscribable.mjs.map\n","// TYPES\n// UTILS\nconst isServer = typeof window === 'undefined' || 'Deno' in window;\nfunction noop() {\n  return undefined;\n}\nfunction functionalUpdate(updater, input) {\n  return typeof updater === 'function' ? updater(input) : updater;\n}\nfunction isValidTimeout(value) {\n  return typeof value === 'number' && value >= 0 && value !== Infinity;\n}\nfunction difference(array1, array2) {\n  return array1.filter(x => !array2.includes(x));\n}\nfunction replaceAt(array, index, value) {\n  const copy = array.slice(0);\n  copy[index] = value;\n  return copy;\n}\nfunction timeUntilStale(updatedAt, staleTime) {\n  return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);\n}\nfunction parseQueryArgs(arg1, arg2, arg3) {\n  if (!isQueryKey(arg1)) {\n    return arg1;\n  }\n\n  if (typeof arg2 === 'function') {\n    return { ...arg3,\n      queryKey: arg1,\n      queryFn: arg2\n    };\n  }\n\n  return { ...arg2,\n    queryKey: arg1\n  };\n}\nfunction parseMutationArgs(arg1, arg2, arg3) {\n  if (isQueryKey(arg1)) {\n    if (typeof arg2 === 'function') {\n      return { ...arg3,\n        mutationKey: arg1,\n        mutationFn: arg2\n      };\n    }\n\n    return { ...arg2,\n      mutationKey: arg1\n    };\n  }\n\n  if (typeof arg1 === 'function') {\n    return { ...arg2,\n      mutationFn: arg1\n    };\n  }\n\n  return { ...arg1\n  };\n}\nfunction parseFilterArgs(arg1, arg2, arg3) {\n  return isQueryKey(arg1) ? [{ ...arg2,\n    queryKey: arg1\n  }, arg3] : [arg1 || {}, arg2];\n}\nfunction parseMutationFilterArgs(arg1, arg2, arg3) {\n  return isQueryKey(arg1) ? [{ ...arg2,\n    mutationKey: arg1\n  }, arg3] : [arg1 || {}, arg2];\n}\nfunction matchQuery(filters, query) {\n  const {\n    type = 'all',\n    exact,\n    fetchStatus,\n    predicate,\n    queryKey,\n    stale\n  } = filters;\n\n  if (isQueryKey(queryKey)) {\n    if (exact) {\n      if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n        return false;\n      }\n    } else if (!partialMatchKey(query.queryKey, queryKey)) {\n      return false;\n    }\n  }\n\n  if (type !== 'all') {\n    const isActive = query.isActive();\n\n    if (type === 'active' && !isActive) {\n      return false;\n    }\n\n    if (type === 'inactive' && isActive) {\n      return false;\n    }\n  }\n\n  if (typeof stale === 'boolean' && query.isStale() !== stale) {\n    return false;\n  }\n\n  if (typeof fetchStatus !== 'undefined' && fetchStatus !== query.state.fetchStatus) {\n    return false;\n  }\n\n  if (predicate && !predicate(query)) {\n    return false;\n  }\n\n  return true;\n}\nfunction matchMutation(filters, mutation) {\n  const {\n    exact,\n    fetching,\n    predicate,\n    mutationKey\n  } = filters;\n\n  if (isQueryKey(mutationKey)) {\n    if (!mutation.options.mutationKey) {\n      return false;\n    }\n\n    if (exact) {\n      if (hashQueryKey(mutation.options.mutationKey) !== hashQueryKey(mutationKey)) {\n        return false;\n      }\n    } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n      return false;\n    }\n  }\n\n  if (typeof fetching === 'boolean' && mutation.state.status === 'loading' !== fetching) {\n    return false;\n  }\n\n  if (predicate && !predicate(mutation)) {\n    return false;\n  }\n\n  return true;\n}\nfunction hashQueryKeyByOptions(queryKey, options) {\n  const hashFn = (options == null ? void 0 : options.queryKeyHashFn) || hashQueryKey;\n  return hashFn(queryKey);\n}\n/**\n * Default query keys hash function.\n * Hashes the value into a stable hash.\n */\n\nfunction hashQueryKey(queryKey) {\n  return JSON.stringify(queryKey, (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {\n    result[key] = val[key];\n    return result;\n  }, {}) : val);\n}\n/**\n * Checks if key `b` partially matches with key `a`.\n */\n\nfunction partialMatchKey(a, b) {\n  return partialDeepEqual(a, b);\n}\n/**\n * Checks if `b` partially matches with `a`.\n */\n\nfunction partialDeepEqual(a, b) {\n  if (a === b) {\n    return true;\n  }\n\n  if (typeof a !== typeof b) {\n    return false;\n  }\n\n  if (a && b && typeof a === 'object' && typeof b === 'object') {\n    return !Object.keys(b).some(key => !partialDeepEqual(a[key], b[key]));\n  }\n\n  return false;\n}\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between JSON values for example.\n */\n\nfunction replaceEqualDeep(a, b) {\n  if (a === b) {\n    return a;\n  }\n\n  const array = isPlainArray(a) && isPlainArray(b);\n\n  if (array || isPlainObject(a) && isPlainObject(b)) {\n    const aSize = array ? a.length : Object.keys(a).length;\n    const bItems = array ? b : Object.keys(b);\n    const bSize = bItems.length;\n    const copy = array ? [] : {};\n    let equalItems = 0;\n\n    for (let i = 0; i < bSize; i++) {\n      const key = array ? i : bItems[i];\n      copy[key] = replaceEqualDeep(a[key], b[key]);\n\n      if (copy[key] === a[key]) {\n        equalItems++;\n      }\n    }\n\n    return aSize === bSize && equalItems === aSize ? a : copy;\n  }\n\n  return b;\n}\n/**\n * Shallow compare objects. Only works with objects that always have the same properties.\n */\n\nfunction shallowEqualObjects(a, b) {\n  if (a && !b || b && !a) {\n    return false;\n  }\n\n  for (const key in a) {\n    if (a[key] !== b[key]) {\n      return false;\n    }\n  }\n\n  return true;\n}\nfunction isPlainArray(value) {\n  return Array.isArray(value) && value.length === Object.keys(value).length;\n} // Copied from: https://github.com/jonschlinkert/is-plain-object\n\nfunction isPlainObject(o) {\n  if (!hasObjectPrototype(o)) {\n    return false;\n  } // If has modified constructor\n\n\n  const ctor = o.constructor;\n\n  if (typeof ctor === 'undefined') {\n    return true;\n  } // If has modified prototype\n\n\n  const prot = ctor.prototype;\n\n  if (!hasObjectPrototype(prot)) {\n    return false;\n  } // If constructor does not have an Object-specific method\n\n\n  if (!prot.hasOwnProperty('isPrototypeOf')) {\n    return false;\n  } // Most likely a plain Object\n\n\n  return true;\n}\n\nfunction hasObjectPrototype(o) {\n  return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nfunction isQueryKey(value) {\n  return Array.isArray(value);\n}\nfunction isError(value) {\n  return value instanceof Error;\n}\nfunction sleep(timeout) {\n  return new Promise(resolve => {\n    setTimeout(resolve, timeout);\n  });\n}\n/**\n * Schedules a microtask.\n * This can be useful to schedule state updates after rendering.\n */\n\nfunction scheduleMicrotask(callback) {\n  sleep(0).then(callback);\n}\nfunction getAbortController() {\n  if (typeof AbortController === 'function') {\n    return new AbortController();\n  }\n\n  return;\n}\nfunction replaceData(prevData, data, options) {\n  // Use prev data if an isDataEqual function is defined and returns `true`\n  if (options.isDataEqual != null && options.isDataEqual(prevData, data)) {\n    return prevData;\n  } else if (typeof options.structuralSharing === 'function') {\n    return options.structuralSharing(prevData, data);\n  } else if (options.structuralSharing !== false) {\n    // Structurally share data between prev and new data if needed\n    return replaceEqualDeep(prevData, data);\n  }\n\n  return data;\n}\n\nexport { difference, functionalUpdate, getAbortController, hashQueryKey, hashQueryKeyByOptions, isError, isPlainArray, isPlainObject, isQueryKey, isServer, isValidTimeout, matchMutation, matchQuery, noop, parseFilterArgs, parseMutationArgs, parseMutationFilterArgs, parseQueryArgs, partialDeepEqual, partialMatchKey, replaceAt, replaceData, replaceEqualDeep, scheduleMicrotask, shallowEqualObjects, sleep, timeUntilStale };\n//# sourceMappingURL=utils.mjs.map\n","import { Subscribable } from './subscribable.mjs';\nimport { isServer } from './utils.mjs';\n\nclass FocusManager extends Subscribable {\n  constructor() {\n    super();\n\n    this.setup = onFocus => {\n      // addEventListener does not exist in React Native, but window does\n      // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n      if (!isServer && window.addEventListener) {\n        const listener = () => onFocus(); // Listen to visibillitychange and focus\n\n\n        window.addEventListener('visibilitychange', listener, false);\n        window.addEventListener('focus', listener, false);\n        return () => {\n          // Be sure to unsubscribe if a new handler is set\n          window.removeEventListener('visibilitychange', listener);\n          window.removeEventListener('focus', listener);\n        };\n      }\n\n      return;\n    };\n  }\n\n  onSubscribe() {\n    if (!this.cleanup) {\n      this.setEventListener(this.setup);\n    }\n  }\n\n  onUnsubscribe() {\n    if (!this.hasListeners()) {\n      var _this$cleanup;\n\n      (_this$cleanup = this.cleanup) == null ? void 0 : _this$cleanup.call(this);\n      this.cleanup = undefined;\n    }\n  }\n\n  setEventListener(setup) {\n    var _this$cleanup2;\n\n    this.setup = setup;\n    (_this$cleanup2 = this.cleanup) == null ? void 0 : _this$cleanup2.call(this);\n    this.cleanup = setup(focused => {\n      if (typeof focused === 'boolean') {\n        this.setFocused(focused);\n      } else {\n        this.onFocus();\n      }\n    });\n  }\n\n  setFocused(focused) {\n    const changed = this.focused !== focused;\n\n    if (changed) {\n      this.focused = focused;\n      this.onFocus();\n    }\n  }\n\n  onFocus() {\n    this.listeners.forEach(({\n      listener\n    }) => {\n      listener();\n    });\n  }\n\n  isFocused() {\n    if (typeof this.focused === 'boolean') {\n      return this.focused;\n    } // document global can be unavailable in react native\n\n\n    if (typeof document === 'undefined') {\n      return true;\n    }\n\n    return [undefined, 'visible', 'prerender'].includes(document.visibilityState);\n  }\n\n}\nconst focusManager = new FocusManager();\n\nexport { FocusManager, focusManager };\n//# sourceMappingURL=focusManager.mjs.map\n","import { Subscribable } from './subscribable.mjs';\nimport { isServer } from './utils.mjs';\n\nconst onlineEvents = ['online', 'offline'];\nclass OnlineManager extends Subscribable {\n  constructor() {\n    super();\n\n    this.setup = onOnline => {\n      // addEventListener does not exist in React Native, but window does\n      // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n      if (!isServer && window.addEventListener) {\n        const listener = () => onOnline(); // Listen to online\n\n\n        onlineEvents.forEach(event => {\n          window.addEventListener(event, listener, false);\n        });\n        return () => {\n          // Be sure to unsubscribe if a new handler is set\n          onlineEvents.forEach(event => {\n            window.removeEventListener(event, listener);\n          });\n        };\n      }\n\n      return;\n    };\n  }\n\n  onSubscribe() {\n    if (!this.cleanup) {\n      this.setEventListener(this.setup);\n    }\n  }\n\n  onUnsubscribe() {\n    if (!this.hasListeners()) {\n      var _this$cleanup;\n\n      (_this$cleanup = this.cleanup) == null ? void 0 : _this$cleanup.call(this);\n      this.cleanup = undefined;\n    }\n  }\n\n  setEventListener(setup) {\n    var _this$cleanup2;\n\n    this.setup = setup;\n    (_this$cleanup2 = this.cleanup) == null ? void 0 : _this$cleanup2.call(this);\n    this.cleanup = setup(online => {\n      if (typeof online === 'boolean') {\n        this.setOnline(online);\n      } else {\n        this.onOnline();\n      }\n    });\n  }\n\n  setOnline(online) {\n    const changed = this.online !== online;\n\n    if (changed) {\n      this.online = online;\n      this.onOnline();\n    }\n  }\n\n  onOnline() {\n    this.listeners.forEach(({\n      listener\n    }) => {\n      listener();\n    });\n  }\n\n  isOnline() {\n    if (typeof this.online === 'boolean') {\n      return this.online;\n    }\n\n    if (typeof navigator === 'undefined' || typeof navigator.onLine === 'undefined') {\n      return true;\n    }\n\n    return navigator.onLine;\n  }\n\n}\nconst onlineManager = new OnlineManager();\n\nexport { OnlineManager, onlineManager };\n//# sourceMappingURL=onlineManager.mjs.map\n","import { focusManager } from './focusManager.mjs';\nimport { onlineManager } from './onlineManager.mjs';\nimport { sleep } from './utils.mjs';\n\nfunction defaultRetryDelay(failureCount) {\n  return Math.min(1000 * 2 ** failureCount, 30000);\n}\n\nfunction canFetch(networkMode) {\n  return (networkMode != null ? networkMode : 'online') === 'online' ? onlineManager.isOnline() : true;\n}\nclass CancelledError {\n  constructor(options) {\n    this.revert = options == null ? void 0 : options.revert;\n    this.silent = options == null ? void 0 : options.silent;\n  }\n\n}\nfunction isCancelledError(value) {\n  return value instanceof CancelledError;\n}\nfunction createRetryer(config) {\n  let isRetryCancelled = false;\n  let failureCount = 0;\n  let isResolved = false;\n  let continueFn;\n  let promiseResolve;\n  let promiseReject;\n  const promise = new Promise((outerResolve, outerReject) => {\n    promiseResolve = outerResolve;\n    promiseReject = outerReject;\n  });\n\n  const cancel = cancelOptions => {\n    if (!isResolved) {\n      reject(new CancelledError(cancelOptions));\n      config.abort == null ? void 0 : config.abort();\n    }\n  };\n\n  const cancelRetry = () => {\n    isRetryCancelled = true;\n  };\n\n  const continueRetry = () => {\n    isRetryCancelled = false;\n  };\n\n  const shouldPause = () => !focusManager.isFocused() || config.networkMode !== 'always' && !onlineManager.isOnline();\n\n  const resolve = value => {\n    if (!isResolved) {\n      isResolved = true;\n      config.onSuccess == null ? void 0 : config.onSuccess(value);\n      continueFn == null ? void 0 : continueFn();\n      promiseResolve(value);\n    }\n  };\n\n  const reject = value => {\n    if (!isResolved) {\n      isResolved = true;\n      config.onError == null ? void 0 : config.onError(value);\n      continueFn == null ? void 0 : continueFn();\n      promiseReject(value);\n    }\n  };\n\n  const pause = () => {\n    return new Promise(continueResolve => {\n      continueFn = value => {\n        const canContinue = isResolved || !shouldPause();\n\n        if (canContinue) {\n          continueResolve(value);\n        }\n\n        return canContinue;\n      };\n\n      config.onPause == null ? void 0 : config.onPause();\n    }).then(() => {\n      continueFn = undefined;\n\n      if (!isResolved) {\n        config.onContinue == null ? void 0 : config.onContinue();\n      }\n    });\n  }; // Create loop function\n\n\n  const run = () => {\n    // Do nothing if already resolved\n    if (isResolved) {\n      return;\n    }\n\n    let promiseOrValue; // Execute query\n\n    try {\n      promiseOrValue = config.fn();\n    } catch (error) {\n      promiseOrValue = Promise.reject(error);\n    }\n\n    Promise.resolve(promiseOrValue).then(resolve).catch(error => {\n      var _config$retry, _config$retryDelay;\n\n      // Stop if the fetch is already resolved\n      if (isResolved) {\n        return;\n      } // Do we need to retry the request?\n\n\n      const retry = (_config$retry = config.retry) != null ? _config$retry : 3;\n      const retryDelay = (_config$retryDelay = config.retryDelay) != null ? _config$retryDelay : defaultRetryDelay;\n      const delay = typeof retryDelay === 'function' ? retryDelay(failureCount, error) : retryDelay;\n      const shouldRetry = retry === true || typeof retry === 'number' && failureCount < retry || typeof retry === 'function' && retry(failureCount, error);\n\n      if (isRetryCancelled || !shouldRetry) {\n        // We are done if the query does not need to be retried\n        reject(error);\n        return;\n      }\n\n      failureCount++; // Notify on fail\n\n      config.onFail == null ? void 0 : config.onFail(failureCount, error); // Delay\n\n      sleep(delay) // Pause if the document is not visible or when the device is offline\n      .then(() => {\n        if (shouldPause()) {\n          return pause();\n        }\n\n        return;\n      }).then(() => {\n        if (isRetryCancelled) {\n          reject(error);\n        } else {\n          run();\n        }\n      });\n    });\n  }; // Start loop\n\n\n  if (canFetch(config.networkMode)) {\n    run();\n  } else {\n    pause().then(run);\n  }\n\n  return {\n    promise,\n    cancel,\n    continue: () => {\n      const didContinue = continueFn == null ? void 0 : continueFn();\n      return didContinue ? promise : Promise.resolve();\n    },\n    cancelRetry,\n    continueRetry\n  };\n}\n\nexport { CancelledError, canFetch, createRetryer, isCancelledError };\n//# sourceMappingURL=retryer.mjs.map\n","const defaultLogger = console;\n\nexport { defaultLogger };\n//# sourceMappingURL=logger.mjs.map\n","import { scheduleMicrotask } from './utils.mjs';\n\nfunction createNotifyManager() {\n  let queue = [];\n  let transactions = 0;\n\n  let notifyFn = callback => {\n    callback();\n  };\n\n  let batchNotifyFn = callback => {\n    callback();\n  };\n\n  const batch = callback => {\n    let result;\n    transactions++;\n\n    try {\n      result = callback();\n    } finally {\n      transactions--;\n\n      if (!transactions) {\n        flush();\n      }\n    }\n\n    return result;\n  };\n\n  const schedule = callback => {\n    if (transactions) {\n      queue.push(callback);\n    } else {\n      scheduleMicrotask(() => {\n        notifyFn(callback);\n      });\n    }\n  };\n  /**\n   * All calls to the wrapped function will be batched.\n   */\n\n\n  const batchCalls = callback => {\n    return (...args) => {\n      schedule(() => {\n        callback(...args);\n      });\n    };\n  };\n\n  const flush = () => {\n    const originalQueue = queue;\n    queue = [];\n\n    if (originalQueue.length) {\n      scheduleMicrotask(() => {\n        batchNotifyFn(() => {\n          originalQueue.forEach(callback => {\n            notifyFn(callback);\n          });\n        });\n      });\n    }\n  };\n  /**\n   * Use this method to set a custom notify function.\n   * This can be used to for example wrap notifications with `React.act` while running tests.\n   */\n\n\n  const setNotifyFunction = fn => {\n    notifyFn = fn;\n  };\n  /**\n   * Use this method to set a custom function to batch notifications together into a single tick.\n   * By default React Query will use the batch function provided by ReactDOM or React Native.\n   */\n\n\n  const setBatchNotifyFunction = fn => {\n    batchNotifyFn = fn;\n  };\n\n  return {\n    batch,\n    batchCalls,\n    schedule,\n    setNotifyFunction,\n    setBatchNotifyFunction\n  };\n} // SINGLETON\n\nconst notifyManager = createNotifyManager();\n\nexport { createNotifyManager, notifyManager };\n//# sourceMappingURL=notifyManager.mjs.map\n","import { isValidTimeout, isServer } from './utils.mjs';\n\nclass Removable {\n  destroy() {\n    this.clearGcTimeout();\n  }\n\n  scheduleGc() {\n    this.clearGcTimeout();\n\n    if (isValidTimeout(this.cacheTime)) {\n      this.gcTimeout = setTimeout(() => {\n        this.optionalRemove();\n      }, this.cacheTime);\n    }\n  }\n\n  updateCacheTime(newCacheTime) {\n    // Default to 5 minutes (Infinity for server-side) if no cache time is set\n    this.cacheTime = Math.max(this.cacheTime || 0, newCacheTime != null ? newCacheTime : isServer ? Infinity : 5 * 60 * 1000);\n  }\n\n  clearGcTimeout() {\n    if (this.gcTimeout) {\n      clearTimeout(this.gcTimeout);\n      this.gcTimeout = undefined;\n    }\n  }\n\n}\n\nexport { Removable };\n//# sourceMappingURL=removable.mjs.map\n","import { replaceData, noop, timeUntilStale, getAbortController } from './utils.mjs';\nimport { defaultLogger } from './logger.mjs';\nimport { notifyManager } from './notifyManager.mjs';\nimport { createRetryer, isCancelledError, canFetch } from './retryer.mjs';\nimport { Removable } from './removable.mjs';\n\n// CLASS\nclass Query extends Removable {\n  constructor(config) {\n    super();\n    this.abortSignalConsumed = false;\n    this.defaultOptions = config.defaultOptions;\n    this.setOptions(config.options);\n    this.observers = [];\n    this.cache = config.cache;\n    this.logger = config.logger || defaultLogger;\n    this.queryKey = config.queryKey;\n    this.queryHash = config.queryHash;\n    this.initialState = config.state || getDefaultState(this.options);\n    this.state = this.initialState;\n    this.scheduleGc();\n  }\n\n  get meta() {\n    return this.options.meta;\n  }\n\n  setOptions(options) {\n    this.options = { ...this.defaultOptions,\n      ...options\n    };\n    this.updateCacheTime(this.options.cacheTime);\n  }\n\n  optionalRemove() {\n    if (!this.observers.length && this.state.fetchStatus === 'idle') {\n      this.cache.remove(this);\n    }\n  }\n\n  setData(newData, options) {\n    const data = replaceData(this.state.data, newData, this.options); // Set data and mark it as cached\n\n    this.dispatch({\n      data,\n      type: 'success',\n      dataUpdatedAt: options == null ? void 0 : options.updatedAt,\n      manual: options == null ? void 0 : options.manual\n    });\n    return data;\n  }\n\n  setState(state, setStateOptions) {\n    this.dispatch({\n      type: 'setState',\n      state,\n      setStateOptions\n    });\n  }\n\n  cancel(options) {\n    var _this$retryer;\n\n    const promise = this.promise;\n    (_this$retryer = this.retryer) == null ? void 0 : _this$retryer.cancel(options);\n    return promise ? promise.then(noop).catch(noop) : Promise.resolve();\n  }\n\n  destroy() {\n    super.destroy();\n    this.cancel({\n      silent: true\n    });\n  }\n\n  reset() {\n    this.destroy();\n    this.setState(this.initialState);\n  }\n\n  isActive() {\n    return this.observers.some(observer => observer.options.enabled !== false);\n  }\n\n  isDisabled() {\n    return this.getObserversCount() > 0 && !this.isActive();\n  }\n\n  isStale() {\n    return this.state.isInvalidated || !this.state.dataUpdatedAt || this.observers.some(observer => observer.getCurrentResult().isStale);\n  }\n\n  isStaleByTime(staleTime = 0) {\n    return this.state.isInvalidated || !this.state.dataUpdatedAt || !timeUntilStale(this.state.dataUpdatedAt, staleTime);\n  }\n\n  onFocus() {\n    var _this$retryer2;\n\n    const observer = this.observers.find(x => x.shouldFetchOnWindowFocus());\n\n    if (observer) {\n      observer.refetch({\n        cancelRefetch: false\n      });\n    } // Continue fetch if currently paused\n\n\n    (_this$retryer2 = this.retryer) == null ? void 0 : _this$retryer2.continue();\n  }\n\n  onOnline() {\n    var _this$retryer3;\n\n    const observer = this.observers.find(x => x.shouldFetchOnReconnect());\n\n    if (observer) {\n      observer.refetch({\n        cancelRefetch: false\n      });\n    } // Continue fetch if currently paused\n\n\n    (_this$retryer3 = this.retryer) == null ? void 0 : _this$retryer3.continue();\n  }\n\n  addObserver(observer) {\n    if (!this.observers.includes(observer)) {\n      this.observers.push(observer); // Stop the query from being garbage collected\n\n      this.clearGcTimeout();\n      this.cache.notify({\n        type: 'observerAdded',\n        query: this,\n        observer\n      });\n    }\n  }\n\n  removeObserver(observer) {\n    if (this.observers.includes(observer)) {\n      this.observers = this.observers.filter(x => x !== observer);\n\n      if (!this.observers.length) {\n        // If the transport layer does not support cancellation\n        // we'll let the query continue so the result can be cached\n        if (this.retryer) {\n          if (this.abortSignalConsumed) {\n            this.retryer.cancel({\n              revert: true\n            });\n          } else {\n            this.retryer.cancelRetry();\n          }\n        }\n\n        this.scheduleGc();\n      }\n\n      this.cache.notify({\n        type: 'observerRemoved',\n        query: this,\n        observer\n      });\n    }\n  }\n\n  getObserversCount() {\n    return this.observers.length;\n  }\n\n  invalidate() {\n    if (!this.state.isInvalidated) {\n      this.dispatch({\n        type: 'invalidate'\n      });\n    }\n  }\n\n  fetch(options, fetchOptions) {\n    var _this$options$behavio, _context$fetchOptions;\n\n    if (this.state.fetchStatus !== 'idle') {\n      if (this.state.dataUpdatedAt && fetchOptions != null && fetchOptions.cancelRefetch) {\n        // Silently cancel current fetch if the user wants to cancel refetches\n        this.cancel({\n          silent: true\n        });\n      } else if (this.promise) {\n        var _this$retryer4;\n\n        // make sure that retries that were potentially cancelled due to unmounts can continue\n        (_this$retryer4 = this.retryer) == null ? void 0 : _this$retryer4.continueRetry(); // Return current promise if we are already fetching\n\n        return this.promise;\n      }\n    } // Update config if passed, otherwise the config from the last execution is used\n\n\n    if (options) {\n      this.setOptions(options);\n    } // Use the options from the first observer with a query function if no function is found.\n    // This can happen when the query is hydrated or created with setQueryData.\n\n\n    if (!this.options.queryFn) {\n      const observer = this.observers.find(x => x.options.queryFn);\n\n      if (observer) {\n        this.setOptions(observer.options);\n      }\n    }\n\n    if (process.env.NODE_ENV !== 'production') {\n      if (!Array.isArray(this.options.queryKey)) {\n        this.logger.error(\"As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']\");\n      }\n    }\n\n    const abortController = getAbortController(); // Create query function context\n\n    const queryFnContext = {\n      queryKey: this.queryKey,\n      pageParam: undefined,\n      meta: this.meta\n    }; // Adds an enumerable signal property to the object that\n    // which sets abortSignalConsumed to true when the signal\n    // is read.\n\n    const addSignalProperty = object => {\n      Object.defineProperty(object, 'signal', {\n        enumerable: true,\n        get: () => {\n          if (abortController) {\n            this.abortSignalConsumed = true;\n            return abortController.signal;\n          }\n\n          return undefined;\n        }\n      });\n    };\n\n    addSignalProperty(queryFnContext); // Create fetch function\n\n    const fetchFn = () => {\n      if (!this.options.queryFn) {\n        return Promise.reject(\"Missing queryFn for queryKey '\" + this.options.queryHash + \"'\");\n      }\n\n      this.abortSignalConsumed = false;\n      return this.options.queryFn(queryFnContext);\n    }; // Trigger behavior hook\n\n\n    const context = {\n      fetchOptions,\n      options: this.options,\n      queryKey: this.queryKey,\n      state: this.state,\n      fetchFn\n    };\n    addSignalProperty(context);\n    (_this$options$behavio = this.options.behavior) == null ? void 0 : _this$options$behavio.onFetch(context); // Store state in case the current fetch needs to be reverted\n\n    this.revertState = this.state; // Set to fetching state if not already in it\n\n    if (this.state.fetchStatus === 'idle' || this.state.fetchMeta !== ((_context$fetchOptions = context.fetchOptions) == null ? void 0 : _context$fetchOptions.meta)) {\n      var _context$fetchOptions2;\n\n      this.dispatch({\n        type: 'fetch',\n        meta: (_context$fetchOptions2 = context.fetchOptions) == null ? void 0 : _context$fetchOptions2.meta\n      });\n    }\n\n    const onError = error => {\n      // Optimistically update state if needed\n      if (!(isCancelledError(error) && error.silent)) {\n        this.dispatch({\n          type: 'error',\n          error: error\n        });\n      }\n\n      if (!isCancelledError(error)) {\n        var _this$cache$config$on, _this$cache$config, _this$cache$config$on2, _this$cache$config2;\n\n        // Notify cache callback\n        (_this$cache$config$on = (_this$cache$config = this.cache.config).onError) == null ? void 0 : _this$cache$config$on.call(_this$cache$config, error, this);\n        (_this$cache$config$on2 = (_this$cache$config2 = this.cache.config).onSettled) == null ? void 0 : _this$cache$config$on2.call(_this$cache$config2, this.state.data, error, this);\n\n        if (process.env.NODE_ENV !== 'production') {\n          this.logger.error(error);\n        }\n      }\n\n      if (!this.isFetchingOptimistic) {\n        // Schedule query gc after fetching\n        this.scheduleGc();\n      }\n\n      this.isFetchingOptimistic = false;\n    }; // Try to fetch the data\n\n\n    this.retryer = createRetryer({\n      fn: context.fetchFn,\n      abort: abortController == null ? void 0 : abortController.abort.bind(abortController),\n      onSuccess: data => {\n        var _this$cache$config$on3, _this$cache$config3, _this$cache$config$on4, _this$cache$config4;\n\n        if (typeof data === 'undefined') {\n          if (process.env.NODE_ENV !== 'production') {\n            this.logger.error(\"Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: \" + this.queryHash);\n          }\n\n          onError(new Error(this.queryHash + \" data is undefined\"));\n          return;\n        }\n\n        this.setData(data); // Notify cache callback\n\n        (_this$cache$config$on3 = (_this$cache$config3 = this.cache.config).onSuccess) == null ? void 0 : _this$cache$config$on3.call(_this$cache$config3, data, this);\n        (_this$cache$config$on4 = (_this$cache$config4 = this.cache.config).onSettled) == null ? void 0 : _this$cache$config$on4.call(_this$cache$config4, data, this.state.error, this);\n\n        if (!this.isFetchingOptimistic) {\n          // Schedule query gc after fetching\n          this.scheduleGc();\n        }\n\n        this.isFetchingOptimistic = false;\n      },\n      onError,\n      onFail: (failureCount, error) => {\n        this.dispatch({\n          type: 'failed',\n          failureCount,\n          error\n        });\n      },\n      onPause: () => {\n        this.dispatch({\n          type: 'pause'\n        });\n      },\n      onContinue: () => {\n        this.dispatch({\n          type: 'continue'\n        });\n      },\n      retry: context.options.retry,\n      retryDelay: context.options.retryDelay,\n      networkMode: context.options.networkMode\n    });\n    this.promise = this.retryer.promise;\n    return this.promise;\n  }\n\n  dispatch(action) {\n    const reducer = state => {\n      var _action$meta, _action$dataUpdatedAt;\n\n      switch (action.type) {\n        case 'failed':\n          return { ...state,\n            fetchFailureCount: action.failureCount,\n            fetchFailureReason: action.error\n          };\n\n        case 'pause':\n          return { ...state,\n            fetchStatus: 'paused'\n          };\n\n        case 'continue':\n          return { ...state,\n            fetchStatus: 'fetching'\n          };\n\n        case 'fetch':\n          return { ...state,\n            fetchFailureCount: 0,\n            fetchFailureReason: null,\n            fetchMeta: (_action$meta = action.meta) != null ? _action$meta : null,\n            fetchStatus: canFetch(this.options.networkMode) ? 'fetching' : 'paused',\n            ...(!state.dataUpdatedAt && {\n              error: null,\n              status: 'loading'\n            })\n          };\n\n        case 'success':\n          return { ...state,\n            data: action.data,\n            dataUpdateCount: state.dataUpdateCount + 1,\n            dataUpdatedAt: (_action$dataUpdatedAt = action.dataUpdatedAt) != null ? _action$dataUpdatedAt : Date.now(),\n            error: null,\n            isInvalidated: false,\n            status: 'success',\n            ...(!action.manual && {\n              fetchStatus: 'idle',\n              fetchFailureCount: 0,\n              fetchFailureReason: null\n            })\n          };\n\n        case 'error':\n          const error = action.error;\n\n          if (isCancelledError(error) && error.revert && this.revertState) {\n            return { ...this.revertState,\n              fetchStatus: 'idle'\n            };\n          }\n\n          return { ...state,\n            error: error,\n            errorUpdateCount: state.errorUpdateCount + 1,\n            errorUpdatedAt: Date.now(),\n            fetchFailureCount: state.fetchFailureCount + 1,\n            fetchFailureReason: error,\n            fetchStatus: 'idle',\n            status: 'error'\n          };\n\n        case 'invalidate':\n          return { ...state,\n            isInvalidated: true\n          };\n\n        case 'setState':\n          return { ...state,\n            ...action.state\n          };\n      }\n    };\n\n    this.state = reducer(this.state);\n    notifyManager.batch(() => {\n      this.observers.forEach(observer => {\n        observer.onQueryUpdate(action);\n      });\n      this.cache.notify({\n        query: this,\n        type: 'updated',\n        action\n      });\n    });\n  }\n\n}\n\nfunction getDefaultState(options) {\n  const data = typeof options.initialData === 'function' ? options.initialData() : options.initialData;\n  const hasData = typeof data !== 'undefined';\n  const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === 'function' ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;\n  return {\n    data,\n    dataUpdateCount: 0,\n    dataUpdatedAt: hasData ? initialDataUpdatedAt != null ? initialDataUpdatedAt : Date.now() : 0,\n    error: null,\n    errorUpdateCount: 0,\n    errorUpdatedAt: 0,\n    fetchFailureCount: 0,\n    fetchFailureReason: null,\n    fetchMeta: null,\n    isInvalidated: false,\n    status: hasData ? 'success' : 'loading',\n    fetchStatus: 'idle'\n  };\n}\n\nexport { Query };\n//# sourceMappingURL=query.mjs.map\n","import { hashQueryKeyByOptions, parseFilterArgs, matchQuery } from './utils.mjs';\nimport { Query } from './query.mjs';\nimport { notifyManager } from './notifyManager.mjs';\nimport { Subscribable } from './subscribable.mjs';\n\n// CLASS\nclass QueryCache extends Subscribable {\n  constructor(config) {\n    super();\n    this.config = config || {};\n    this.queries = [];\n    this.queriesMap = {};\n  }\n\n  build(client, options, state) {\n    var _options$queryHash;\n\n    const queryKey = options.queryKey;\n    const queryHash = (_options$queryHash = options.queryHash) != null ? _options$queryHash : hashQueryKeyByOptions(queryKey, options);\n    let query = this.get(queryHash);\n\n    if (!query) {\n      query = new Query({\n        cache: this,\n        logger: client.getLogger(),\n        queryKey,\n        queryHash,\n        options: client.defaultQueryOptions(options),\n        state,\n        defaultOptions: client.getQueryDefaults(queryKey)\n      });\n      this.add(query);\n    }\n\n    return query;\n  }\n\n  add(query) {\n    if (!this.queriesMap[query.queryHash]) {\n      this.queriesMap[query.queryHash] = query;\n      this.queries.push(query);\n      this.notify({\n        type: 'added',\n        query\n      });\n    }\n  }\n\n  remove(query) {\n    const queryInMap = this.queriesMap[query.queryHash];\n\n    if (queryInMap) {\n      query.destroy();\n      this.queries = this.queries.filter(x => x !== query);\n\n      if (queryInMap === query) {\n        delete this.queriesMap[query.queryHash];\n      }\n\n      this.notify({\n        type: 'removed',\n        query\n      });\n    }\n  }\n\n  clear() {\n    notifyManager.batch(() => {\n      this.queries.forEach(query => {\n        this.remove(query);\n      });\n    });\n  }\n\n  get(queryHash) {\n    return this.queriesMap[queryHash];\n  }\n\n  getAll() {\n    return this.queries;\n  }\n\n  /**\n   * @deprecated This method should be used with only one object argument.\n   */\n  find(arg1, arg2) {\n    const [filters] = parseFilterArgs(arg1, arg2);\n\n    if (typeof filters.exact === 'undefined') {\n      filters.exact = true;\n    }\n\n    return this.queries.find(query => matchQuery(filters, query));\n  }\n\n  /**\n   * @deprecated This method should be used with only one object argument.\n   */\n  findAll(arg1, arg2) {\n    const [filters] = parseFilterArgs(arg1, arg2);\n    return Object.keys(filters).length > 0 ? this.queries.filter(query => matchQuery(filters, query)) : this.queries;\n  }\n\n  notify(event) {\n    notifyManager.batch(() => {\n      this.listeners.forEach(({\n        listener\n      }) => {\n        listener(event);\n      });\n    });\n  }\n\n  onFocus() {\n    notifyManager.batch(() => {\n      this.queries.forEach(query => {\n        query.onFocus();\n      });\n    });\n  }\n\n  onOnline() {\n    notifyManager.batch(() => {\n      this.queries.forEach(query => {\n        query.onOnline();\n      });\n    });\n  }\n\n}\n\nexport { QueryCache };\n//# sourceMappingURL=queryCache.mjs.map\n","import { defaultLogger } from './logger.mjs';\nimport { notifyManager } from './notifyManager.mjs';\nimport { Removable } from './removable.mjs';\nimport { createRetryer, canFetch } from './retryer.mjs';\n\n// CLASS\nclass Mutation extends Removable {\n  constructor(config) {\n    super();\n    this.defaultOptions = config.defaultOptions;\n    this.mutationId = config.mutationId;\n    this.mutationCache = config.mutationCache;\n    this.logger = config.logger || defaultLogger;\n    this.observers = [];\n    this.state = config.state || getDefaultState();\n    this.setOptions(config.options);\n    this.scheduleGc();\n  }\n\n  setOptions(options) {\n    this.options = { ...this.defaultOptions,\n      ...options\n    };\n    this.updateCacheTime(this.options.cacheTime);\n  }\n\n  get meta() {\n    return this.options.meta;\n  }\n\n  setState(state) {\n    this.dispatch({\n      type: 'setState',\n      state\n    });\n  }\n\n  addObserver(observer) {\n    if (!this.observers.includes(observer)) {\n      this.observers.push(observer); // Stop the mutation from being garbage collected\n\n      this.clearGcTimeout();\n      this.mutationCache.notify({\n        type: 'observerAdded',\n        mutation: this,\n        observer\n      });\n    }\n  }\n\n  removeObserver(observer) {\n    this.observers = this.observers.filter(x => x !== observer);\n    this.scheduleGc();\n    this.mutationCache.notify({\n      type: 'observerRemoved',\n      mutation: this,\n      observer\n    });\n  }\n\n  optionalRemove() {\n    if (!this.observers.length) {\n      if (this.state.status === 'loading') {\n        this.scheduleGc();\n      } else {\n        this.mutationCache.remove(this);\n      }\n    }\n  }\n\n  continue() {\n    var _this$retryer$continu, _this$retryer;\n\n    return (_this$retryer$continu = (_this$retryer = this.retryer) == null ? void 0 : _this$retryer.continue()) != null ? _this$retryer$continu : this.execute();\n  }\n\n  async execute() {\n    const executeMutation = () => {\n      var _this$options$retry;\n\n      this.retryer = createRetryer({\n        fn: () => {\n          if (!this.options.mutationFn) {\n            return Promise.reject('No mutationFn found');\n          }\n\n          return this.options.mutationFn(this.state.variables);\n        },\n        onFail: (failureCount, error) => {\n          this.dispatch({\n            type: 'failed',\n            failureCount,\n            error\n          });\n        },\n        onPause: () => {\n          this.dispatch({\n            type: 'pause'\n          });\n        },\n        onContinue: () => {\n          this.dispatch({\n            type: 'continue'\n          });\n        },\n        retry: (_this$options$retry = this.options.retry) != null ? _this$options$retry : 0,\n        retryDelay: this.options.retryDelay,\n        networkMode: this.options.networkMode\n      });\n      return this.retryer.promise;\n    };\n\n    const restored = this.state.status === 'loading';\n\n    try {\n      var _this$mutationCache$c3, _this$mutationCache$c4, _this$options$onSucce, _this$options2, _this$mutationCache$c5, _this$mutationCache$c6, _this$options$onSettl, _this$options3;\n\n      if (!restored) {\n        var _this$mutationCache$c, _this$mutationCache$c2, _this$options$onMutat, _this$options;\n\n        this.dispatch({\n          type: 'loading',\n          variables: this.options.variables\n        }); // Notify cache callback\n\n        await ((_this$mutationCache$c = (_this$mutationCache$c2 = this.mutationCache.config).onMutate) == null ? void 0 : _this$mutationCache$c.call(_this$mutationCache$c2, this.state.variables, this));\n        const context = await ((_this$options$onMutat = (_this$options = this.options).onMutate) == null ? void 0 : _this$options$onMutat.call(_this$options, this.state.variables));\n\n        if (context !== this.state.context) {\n          this.dispatch({\n            type: 'loading',\n            context,\n            variables: this.state.variables\n          });\n        }\n      }\n\n      const data = await executeMutation(); // Notify cache callback\n\n      await ((_this$mutationCache$c3 = (_this$mutationCache$c4 = this.mutationCache.config).onSuccess) == null ? void 0 : _this$mutationCache$c3.call(_this$mutationCache$c4, data, this.state.variables, this.state.context, this));\n      await ((_this$options$onSucce = (_this$options2 = this.options).onSuccess) == null ? void 0 : _this$options$onSucce.call(_this$options2, data, this.state.variables, this.state.context)); // Notify cache callback\n\n      await ((_this$mutationCache$c5 = (_this$mutationCache$c6 = this.mutationCache.config).onSettled) == null ? void 0 : _this$mutationCache$c5.call(_this$mutationCache$c6, data, null, this.state.variables, this.state.context, this));\n      await ((_this$options$onSettl = (_this$options3 = this.options).onSettled) == null ? void 0 : _this$options$onSettl.call(_this$options3, data, null, this.state.variables, this.state.context));\n      this.dispatch({\n        type: 'success',\n        data\n      });\n      return data;\n    } catch (error) {\n      try {\n        var _this$mutationCache$c7, _this$mutationCache$c8, _this$options$onError, _this$options4, _this$mutationCache$c9, _this$mutationCache$c10, _this$options$onSettl2, _this$options5;\n\n        // Notify cache callback\n        await ((_this$mutationCache$c7 = (_this$mutationCache$c8 = this.mutationCache.config).onError) == null ? void 0 : _this$mutationCache$c7.call(_this$mutationCache$c8, error, this.state.variables, this.state.context, this));\n\n        if (process.env.NODE_ENV !== 'production') {\n          this.logger.error(error);\n        }\n\n        await ((_this$options$onError = (_this$options4 = this.options).onError) == null ? void 0 : _this$options$onError.call(_this$options4, error, this.state.variables, this.state.context)); // Notify cache callback\n\n        await ((_this$mutationCache$c9 = (_this$mutationCache$c10 = this.mutationCache.config).onSettled) == null ? void 0 : _this$mutationCache$c9.call(_this$mutationCache$c10, undefined, error, this.state.variables, this.state.context, this));\n        await ((_this$options$onSettl2 = (_this$options5 = this.options).onSettled) == null ? void 0 : _this$options$onSettl2.call(_this$options5, undefined, error, this.state.variables, this.state.context));\n        throw error;\n      } finally {\n        this.dispatch({\n          type: 'error',\n          error: error\n        });\n      }\n    }\n  }\n\n  dispatch(action) {\n    const reducer = state => {\n      switch (action.type) {\n        case 'failed':\n          return { ...state,\n            failureCount: action.failureCount,\n            failureReason: action.error\n          };\n\n        case 'pause':\n          return { ...state,\n            isPaused: true\n          };\n\n        case 'continue':\n          return { ...state,\n            isPaused: false\n          };\n\n        case 'loading':\n          return { ...state,\n            context: action.context,\n            data: undefined,\n            failureCount: 0,\n            failureReason: null,\n            error: null,\n            isPaused: !canFetch(this.options.networkMode),\n            status: 'loading',\n            variables: action.variables\n          };\n\n        case 'success':\n          return { ...state,\n            data: action.data,\n            failureCount: 0,\n            failureReason: null,\n            error: null,\n            status: 'success',\n            isPaused: false\n          };\n\n        case 'error':\n          return { ...state,\n            data: undefined,\n            error: action.error,\n            failureCount: state.failureCount + 1,\n            failureReason: action.error,\n            isPaused: false,\n            status: 'error'\n          };\n\n        case 'setState':\n          return { ...state,\n            ...action.state\n          };\n      }\n    };\n\n    this.state = reducer(this.state);\n    notifyManager.batch(() => {\n      this.observers.forEach(observer => {\n        observer.onMutationUpdate(action);\n      });\n      this.mutationCache.notify({\n        mutation: this,\n        type: 'updated',\n        action\n      });\n    });\n  }\n\n}\nfunction getDefaultState() {\n  return {\n    context: undefined,\n    data: undefined,\n    error: null,\n    failureCount: 0,\n    failureReason: null,\n    isPaused: false,\n    status: 'idle',\n    variables: undefined\n  };\n}\n\nexport { Mutation, getDefaultState };\n//# sourceMappingURL=mutation.mjs.map\n","import { notifyManager } from './notifyManager.mjs';\nimport { Mutation } from './mutation.mjs';\nimport { matchMutation, noop } from './utils.mjs';\nimport { Subscribable } from './subscribable.mjs';\n\n// CLASS\nclass MutationCache extends Subscribable {\n  constructor(config) {\n    super();\n    this.config = config || {};\n    this.mutations = [];\n    this.mutationId = 0;\n  }\n\n  build(client, options, state) {\n    const mutation = new Mutation({\n      mutationCache: this,\n      logger: client.getLogger(),\n      mutationId: ++this.mutationId,\n      options: client.defaultMutationOptions(options),\n      state,\n      defaultOptions: options.mutationKey ? client.getMutationDefaults(options.mutationKey) : undefined\n    });\n    this.add(mutation);\n    return mutation;\n  }\n\n  add(mutation) {\n    this.mutations.push(mutation);\n    this.notify({\n      type: 'added',\n      mutation\n    });\n  }\n\n  remove(mutation) {\n    this.mutations = this.mutations.filter(x => x !== mutation);\n    this.notify({\n      type: 'removed',\n      mutation\n    });\n  }\n\n  clear() {\n    notifyManager.batch(() => {\n      this.mutations.forEach(mutation => {\n        this.remove(mutation);\n      });\n    });\n  }\n\n  getAll() {\n    return this.mutations;\n  }\n\n  find(filters) {\n    if (typeof filters.exact === 'undefined') {\n      filters.exact = true;\n    }\n\n    return this.mutations.find(mutation => matchMutation(filters, mutation));\n  }\n\n  findAll(filters) {\n    return this.mutations.filter(mutation => matchMutation(filters, mutation));\n  }\n\n  notify(event) {\n    notifyManager.batch(() => {\n      this.listeners.forEach(({\n        listener\n      }) => {\n        listener(event);\n      });\n    });\n  }\n\n  resumePausedMutations() {\n    var _this$resuming;\n\n    this.resuming = ((_this$resuming = this.resuming) != null ? _this$resuming : Promise.resolve()).then(() => {\n      const pausedMutations = this.mutations.filter(x => x.state.isPaused);\n      return notifyManager.batch(() => pausedMutations.reduce((promise, mutation) => promise.then(() => mutation.continue().catch(noop)), Promise.resolve()));\n    }).then(() => {\n      this.resuming = undefined;\n    });\n    return this.resuming;\n  }\n\n}\n\nexport { MutationCache };\n//# sourceMappingURL=mutationCache.mjs.map\n","function infiniteQueryBehavior() {\n  return {\n    onFetch: context => {\n      context.fetchFn = () => {\n        var _context$fetchOptions, _context$fetchOptions2, _context$fetchOptions3, _context$fetchOptions4, _context$state$data, _context$state$data2;\n\n        const refetchPage = (_context$fetchOptions = context.fetchOptions) == null ? void 0 : (_context$fetchOptions2 = _context$fetchOptions.meta) == null ? void 0 : _context$fetchOptions2.refetchPage;\n        const fetchMore = (_context$fetchOptions3 = context.fetchOptions) == null ? void 0 : (_context$fetchOptions4 = _context$fetchOptions3.meta) == null ? void 0 : _context$fetchOptions4.fetchMore;\n        const pageParam = fetchMore == null ? void 0 : fetchMore.pageParam;\n        const isFetchingNextPage = (fetchMore == null ? void 0 : fetchMore.direction) === 'forward';\n        const isFetchingPreviousPage = (fetchMore == null ? void 0 : fetchMore.direction) === 'backward';\n        const oldPages = ((_context$state$data = context.state.data) == null ? void 0 : _context$state$data.pages) || [];\n        const oldPageParams = ((_context$state$data2 = context.state.data) == null ? void 0 : _context$state$data2.pageParams) || [];\n        let newPageParams = oldPageParams;\n        let cancelled = false;\n\n        const addSignalProperty = object => {\n          Object.defineProperty(object, 'signal', {\n            enumerable: true,\n            get: () => {\n              var _context$signal;\n\n              if ((_context$signal = context.signal) != null && _context$signal.aborted) {\n                cancelled = true;\n              } else {\n                var _context$signal2;\n\n                (_context$signal2 = context.signal) == null ? void 0 : _context$signal2.addEventListener('abort', () => {\n                  cancelled = true;\n                });\n              }\n\n              return context.signal;\n            }\n          });\n        }; // Get query function\n\n\n        const queryFn = context.options.queryFn || (() => Promise.reject(\"Missing queryFn for queryKey '\" + context.options.queryHash + \"'\"));\n\n        const buildNewPages = (pages, param, page, previous) => {\n          newPageParams = previous ? [param, ...newPageParams] : [...newPageParams, param];\n          return previous ? [page, ...pages] : [...pages, page];\n        }; // Create function to fetch a page\n\n\n        const fetchPage = (pages, manual, param, previous) => {\n          if (cancelled) {\n            return Promise.reject('Cancelled');\n          }\n\n          if (typeof param === 'undefined' && !manual && pages.length) {\n            return Promise.resolve(pages);\n          }\n\n          const queryFnContext = {\n            queryKey: context.queryKey,\n            pageParam: param,\n            meta: context.options.meta\n          };\n          addSignalProperty(queryFnContext);\n          const queryFnResult = queryFn(queryFnContext);\n          const promise = Promise.resolve(queryFnResult).then(page => buildNewPages(pages, param, page, previous));\n          return promise;\n        };\n\n        let promise; // Fetch first page?\n\n        if (!oldPages.length) {\n          promise = fetchPage([]);\n        } // Fetch next page?\n        else if (isFetchingNextPage) {\n          const manual = typeof pageParam !== 'undefined';\n          const param = manual ? pageParam : getNextPageParam(context.options, oldPages);\n          promise = fetchPage(oldPages, manual, param);\n        } // Fetch previous page?\n        else if (isFetchingPreviousPage) {\n          const manual = typeof pageParam !== 'undefined';\n          const param = manual ? pageParam : getPreviousPageParam(context.options, oldPages);\n          promise = fetchPage(oldPages, manual, param, true);\n        } // Refetch pages\n        else {\n          newPageParams = [];\n          const manual = typeof context.options.getNextPageParam === 'undefined';\n          const shouldFetchFirstPage = refetchPage && oldPages[0] ? refetchPage(oldPages[0], 0, oldPages) : true; // Fetch first page\n\n          promise = shouldFetchFirstPage ? fetchPage([], manual, oldPageParams[0]) : Promise.resolve(buildNewPages([], oldPageParams[0], oldPages[0])); // Fetch remaining pages\n\n          for (let i = 1; i < oldPages.length; i++) {\n            promise = promise.then(pages => {\n              const shouldFetchNextPage = refetchPage && oldPages[i] ? refetchPage(oldPages[i], i, oldPages) : true;\n\n              if (shouldFetchNextPage) {\n                const param = manual ? oldPageParams[i] : getNextPageParam(context.options, pages);\n                return fetchPage(pages, manual, param);\n              }\n\n              return Promise.resolve(buildNewPages(pages, oldPageParams[i], oldPages[i]));\n            });\n          }\n        }\n\n        const finalPromise = promise.then(pages => ({\n          pages,\n          pageParams: newPageParams\n        }));\n        return finalPromise;\n      };\n    }\n  };\n}\nfunction getNextPageParam(options, pages) {\n  return options.getNextPageParam == null ? void 0 : options.getNextPageParam(pages[pages.length - 1], pages);\n}\nfunction getPreviousPageParam(options, pages) {\n  return options.getPreviousPageParam == null ? void 0 : options.getPreviousPageParam(pages[0], pages);\n}\n/**\n * Checks if there is a next page.\n * Returns `undefined` if it cannot be determined.\n */\n\nfunction hasNextPage(options, pages) {\n  if (options.getNextPageParam && Array.isArray(pages)) {\n    const nextPageParam = getNextPageParam(options, pages);\n    return typeof nextPageParam !== 'undefined' && nextPageParam !== null && nextPageParam !== false;\n  }\n\n  return;\n}\n/**\n * Checks if there is a previous page.\n * Returns `undefined` if it cannot be determined.\n */\n\nfunction hasPreviousPage(options, pages) {\n  if (options.getPreviousPageParam && Array.isArray(pages)) {\n    const previousPageParam = getPreviousPageParam(options, pages);\n    return typeof previousPageParam !== 'undefined' && previousPageParam !== null && previousPageParam !== false;\n  }\n\n  return;\n}\n\nexport { getNextPageParam, getPreviousPageParam, hasNextPage, hasPreviousPage, infiniteQueryBehavior };\n//# sourceMappingURL=infiniteQueryBehavior.mjs.map\n","import { parseFilterArgs, parseQueryArgs, functionalUpdate, noop, hashQueryKey, partialMatchKey, hashQueryKeyByOptions } from './utils.mjs';\nimport { QueryCache } from './queryCache.mjs';\nimport { MutationCache } from './mutationCache.mjs';\nimport { focusManager } from './focusManager.mjs';\nimport { onlineManager } from './onlineManager.mjs';\nimport { notifyManager } from './notifyManager.mjs';\nimport { infiniteQueryBehavior } from './infiniteQueryBehavior.mjs';\nimport { defaultLogger } from './logger.mjs';\n\n// CLASS\nclass QueryClient {\n  constructor(config = {}) {\n    this.queryCache = config.queryCache || new QueryCache();\n    this.mutationCache = config.mutationCache || new MutationCache();\n    this.logger = config.logger || defaultLogger;\n    this.defaultOptions = config.defaultOptions || {};\n    this.queryDefaults = [];\n    this.mutationDefaults = [];\n    this.mountCount = 0;\n\n    if (process.env.NODE_ENV !== 'production' && config.logger) {\n      this.logger.error(\"Passing a custom logger has been deprecated and will be removed in the next major version.\");\n    }\n  }\n\n  mount() {\n    this.mountCount++;\n    if (this.mountCount !== 1) return;\n    this.unsubscribeFocus = focusManager.subscribe(() => {\n      if (focusManager.isFocused()) {\n        this.resumePausedMutations();\n        this.queryCache.onFocus();\n      }\n    });\n    this.unsubscribeOnline = onlineManager.subscribe(() => {\n      if (onlineManager.isOnline()) {\n        this.resumePausedMutations();\n        this.queryCache.onOnline();\n      }\n    });\n  }\n\n  unmount() {\n    var _this$unsubscribeFocu, _this$unsubscribeOnli;\n\n    this.mountCount--;\n    if (this.mountCount !== 0) return;\n    (_this$unsubscribeFocu = this.unsubscribeFocus) == null ? void 0 : _this$unsubscribeFocu.call(this);\n    this.unsubscribeFocus = undefined;\n    (_this$unsubscribeOnli = this.unsubscribeOnline) == null ? void 0 : _this$unsubscribeOnli.call(this);\n    this.unsubscribeOnline = undefined;\n  }\n\n  /**\n   * @deprecated This method should be used with only one object argument.\n   */\n  isFetching(arg1, arg2) {\n    const [filters] = parseFilterArgs(arg1, arg2);\n    filters.fetchStatus = 'fetching';\n    return this.queryCache.findAll(filters).length;\n  }\n\n  isMutating(filters) {\n    return this.mutationCache.findAll({ ...filters,\n      fetching: true\n    }).length;\n  }\n\n  /**\n   * @deprecated This method will accept only queryKey in the next major version.\n   */\n  getQueryData(queryKey, filters) {\n    var _this$queryCache$find;\n\n    return (_this$queryCache$find = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find.state.data;\n  }\n\n  /**\n   * @deprecated This method should be used with only one object argument.\n   */\n  ensureQueryData(arg1, arg2, arg3) {\n    const parsedOptions = parseQueryArgs(arg1, arg2, arg3);\n    const cachedData = this.getQueryData(parsedOptions.queryKey);\n    return cachedData ? Promise.resolve(cachedData) : this.fetchQuery(parsedOptions);\n  }\n\n  /**\n   * @deprecated This method should be used with only one object argument.\n   */\n  getQueriesData(queryKeyOrFilters) {\n    return this.getQueryCache().findAll(queryKeyOrFilters).map(({\n      queryKey,\n      state\n    }) => {\n      const data = state.data;\n      return [queryKey, data];\n    });\n  }\n\n  setQueryData(queryKey, updater, options) {\n    const query = this.queryCache.find(queryKey);\n    const prevData = query == null ? void 0 : query.state.data;\n    const data = functionalUpdate(updater, prevData);\n\n    if (typeof data === 'undefined') {\n      return undefined;\n    }\n\n    const parsedOptions = parseQueryArgs(queryKey);\n    const defaultedOptions = this.defaultQueryOptions(parsedOptions);\n    return this.queryCache.build(this, defaultedOptions).setData(data, { ...options,\n      manual: true\n    });\n  }\n\n  /**\n   * @deprecated This method should be used with only one object argument.\n   */\n  setQueriesData(queryKeyOrFilters, updater, options) {\n    return notifyManager.batch(() => this.getQueryCache().findAll(queryKeyOrFilters).map(({\n      queryKey\n    }) => [queryKey, this.setQueryData(queryKey, updater, options)]));\n  }\n\n  getQueryState(queryKey,\n  /**\n   * @deprecated This filters will be removed in the next major version.\n   */\n  filters) {\n    var _this$queryCache$find2;\n\n    return (_this$queryCache$find2 = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find2.state;\n  }\n\n  /**\n   * @deprecated This method should be used with only one object argument.\n   */\n  removeQueries(arg1, arg2) {\n    const [filters] = parseFilterArgs(arg1, arg2);\n    const queryCache = this.queryCache;\n    notifyManager.batch(() => {\n      queryCache.findAll(filters).forEach(query => {\n        queryCache.remove(query);\n      });\n    });\n  }\n\n  /**\n   * @deprecated This method should be used with only one object argument.\n   */\n  resetQueries(arg1, arg2, arg3) {\n    const [filters, options] = parseFilterArgs(arg1, arg2, arg3);\n    const queryCache = this.queryCache;\n    const refetchFilters = {\n      type: 'active',\n      ...filters\n    };\n    return notifyManager.batch(() => {\n      queryCache.findAll(filters).forEach(query => {\n        query.reset();\n      });\n      return this.refetchQueries(refetchFilters, options);\n    });\n  }\n\n  /**\n   * @deprecated This method should be used with only one object argument.\n   */\n  cancelQueries(arg1, arg2, arg3) {\n    const [filters, cancelOptions = {}] = parseFilterArgs(arg1, arg2, arg3);\n\n    if (typeof cancelOptions.revert === 'undefined') {\n      cancelOptions.revert = true;\n    }\n\n    const promises = notifyManager.batch(() => this.queryCache.findAll(filters).map(query => query.cancel(cancelOptions)));\n    return Promise.all(promises).then(noop).catch(noop);\n  }\n\n  /**\n   * @deprecated This method should be used with only one object argument.\n   */\n  invalidateQueries(arg1, arg2, arg3) {\n    const [filters, options] = parseFilterArgs(arg1, arg2, arg3);\n    return notifyManager.batch(() => {\n      var _ref, _filters$refetchType;\n\n      this.queryCache.findAll(filters).forEach(query => {\n        query.invalidate();\n      });\n\n      if (filters.refetchType === 'none') {\n        return Promise.resolve();\n      }\n\n      const refetchFilters = { ...filters,\n        type: (_ref = (_filters$refetchType = filters.refetchType) != null ? _filters$refetchType : filters.type) != null ? _ref : 'active'\n      };\n      return this.refetchQueries(refetchFilters, options);\n    });\n  }\n\n  /**\n   * @deprecated This method should be used with only one object argument.\n   */\n  refetchQueries(arg1, arg2, arg3) {\n    const [filters, options] = parseFilterArgs(arg1, arg2, arg3);\n    const promises = notifyManager.batch(() => this.queryCache.findAll(filters).filter(query => !query.isDisabled()).map(query => {\n      var _options$cancelRefetc;\n\n      return query.fetch(undefined, { ...options,\n        cancelRefetch: (_options$cancelRefetc = options == null ? void 0 : options.cancelRefetch) != null ? _options$cancelRefetc : true,\n        meta: {\n          refetchPage: filters.refetchPage\n        }\n      });\n    }));\n    let promise = Promise.all(promises).then(noop);\n\n    if (!(options != null && options.throwOnError)) {\n      promise = promise.catch(noop);\n    }\n\n    return promise;\n  }\n\n  /**\n   * @deprecated This method should be used with only one object argument.\n   */\n  fetchQuery(arg1, arg2, arg3) {\n    const parsedOptions = parseQueryArgs(arg1, arg2, arg3);\n    const defaultedOptions = this.defaultQueryOptions(parsedOptions); // https://github.com/tannerlinsley/react-query/issues/652\n\n    if (typeof defaultedOptions.retry === 'undefined') {\n      defaultedOptions.retry = false;\n    }\n\n    const query = this.queryCache.build(this, defaultedOptions);\n    return query.isStaleByTime(defaultedOptions.staleTime) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);\n  }\n\n  /**\n   * @deprecated This method should be used with only one object argument.\n   */\n  prefetchQuery(arg1, arg2, arg3) {\n    return this.fetchQuery(arg1, arg2, arg3).then(noop).catch(noop);\n  }\n\n  /**\n   * @deprecated This method should be used with only one object argument.\n   */\n  fetchInfiniteQuery(arg1, arg2, arg3) {\n    const parsedOptions = parseQueryArgs(arg1, arg2, arg3);\n    parsedOptions.behavior = infiniteQueryBehavior();\n    return this.fetchQuery(parsedOptions);\n  }\n\n  /**\n   * @deprecated This method should be used with only one object argument.\n   */\n  prefetchInfiniteQuery(arg1, arg2, arg3) {\n    return this.fetchInfiniteQuery(arg1, arg2, arg3).then(noop).catch(noop);\n  }\n\n  resumePausedMutations() {\n    return this.mutationCache.resumePausedMutations();\n  }\n\n  getQueryCache() {\n    return this.queryCache;\n  }\n\n  getMutationCache() {\n    return this.mutationCache;\n  }\n\n  getLogger() {\n    return this.logger;\n  }\n\n  getDefaultOptions() {\n    return this.defaultOptions;\n  }\n\n  setDefaultOptions(options) {\n    this.defaultOptions = options;\n  }\n\n  setQueryDefaults(queryKey, options) {\n    const result = this.queryDefaults.find(x => hashQueryKey(queryKey) === hashQueryKey(x.queryKey));\n\n    if (result) {\n      result.defaultOptions = options;\n    } else {\n      this.queryDefaults.push({\n        queryKey,\n        defaultOptions: options\n      });\n    }\n  }\n\n  getQueryDefaults(queryKey) {\n    if (!queryKey) {\n      return undefined;\n    } // Get the first matching defaults\n\n\n    const firstMatchingDefaults = this.queryDefaults.find(x => partialMatchKey(queryKey, x.queryKey)); // Additional checks and error in dev mode\n\n    if (process.env.NODE_ENV !== 'production') {\n      // Retrieve all matching defaults for the given key\n      const matchingDefaults = this.queryDefaults.filter(x => partialMatchKey(queryKey, x.queryKey)); // It is ok not having defaults, but it is error prone to have more than 1 default for a given key\n\n      if (matchingDefaults.length > 1) {\n        this.logger.error(\"[QueryClient] Several query defaults match with key '\" + JSON.stringify(queryKey) + \"'. The first matching query defaults are used. Please check how query defaults are registered. Order does matter here. cf. https://react-query.tanstack.com/reference/QueryClient#queryclientsetquerydefaults.\");\n      }\n    }\n\n    return firstMatchingDefaults == null ? void 0 : firstMatchingDefaults.defaultOptions;\n  }\n\n  setMutationDefaults(mutationKey, options) {\n    const result = this.mutationDefaults.find(x => hashQueryKey(mutationKey) === hashQueryKey(x.mutationKey));\n\n    if (result) {\n      result.defaultOptions = options;\n    } else {\n      this.mutationDefaults.push({\n        mutationKey,\n        defaultOptions: options\n      });\n    }\n  }\n\n  getMutationDefaults(mutationKey) {\n    if (!mutationKey) {\n      return undefined;\n    } // Get the first matching defaults\n\n\n    const firstMatchingDefaults = this.mutationDefaults.find(x => partialMatchKey(mutationKey, x.mutationKey)); // Additional checks and error in dev mode\n\n    if (process.env.NODE_ENV !== 'production') {\n      // Retrieve all matching defaults for the given key\n      const matchingDefaults = this.mutationDefaults.filter(x => partialMatchKey(mutationKey, x.mutationKey)); // It is ok not having defaults, but it is error prone to have more than 1 default for a given key\n\n      if (matchingDefaults.length > 1) {\n        this.logger.error(\"[QueryClient] Several mutation defaults match with key '\" + JSON.stringify(mutationKey) + \"'. The first matching mutation defaults are used. Please check how mutation defaults are registered. Order does matter here. cf. https://react-query.tanstack.com/reference/QueryClient#queryclientsetmutationdefaults.\");\n      }\n    }\n\n    return firstMatchingDefaults == null ? void 0 : firstMatchingDefaults.defaultOptions;\n  }\n\n  defaultQueryOptions(options) {\n    if (options != null && options._defaulted) {\n      return options;\n    }\n\n    const defaultedOptions = { ...this.defaultOptions.queries,\n      ...this.getQueryDefaults(options == null ? void 0 : options.queryKey),\n      ...options,\n      _defaulted: true\n    };\n\n    if (!defaultedOptions.queryHash && defaultedOptions.queryKey) {\n      defaultedOptions.queryHash = hashQueryKeyByOptions(defaultedOptions.queryKey, defaultedOptions);\n    } // dependent default values\n\n\n    if (typeof defaultedOptions.refetchOnReconnect === 'undefined') {\n      defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== 'always';\n    }\n\n    if (typeof defaultedOptions.useErrorBoundary === 'undefined') {\n      defaultedOptions.useErrorBoundary = !!defaultedOptions.suspense;\n    }\n\n    return defaultedOptions;\n  }\n\n  defaultMutationOptions(options) {\n    if (options != null && options._defaulted) {\n      return options;\n    }\n\n    return { ...this.defaultOptions.mutations,\n      ...this.getMutationDefaults(options == null ? void 0 : options.mutationKey),\n      ...options,\n      _defaulted: true\n    };\n  }\n\n  clear() {\n    this.queryCache.clear();\n    this.mutationCache.clear();\n  }\n\n}\n\nexport { QueryClient };\n//# sourceMappingURL=queryClient.mjs.map\n","import { shallowEqualObjects, noop, isServer, isValidTimeout, timeUntilStale, replaceData } from './utils.mjs';\nimport { notifyManager } from './notifyManager.mjs';\nimport { focusManager } from './focusManager.mjs';\nimport { Subscribable } from './subscribable.mjs';\nimport { canFetch, isCancelledError } from './retryer.mjs';\n\nclass QueryObserver extends Subscribable {\n  constructor(client, options) {\n    super();\n    this.client = client;\n    this.options = options;\n    this.trackedProps = new Set();\n    this.selectError = null;\n    this.bindMethods();\n    this.setOptions(options);\n  }\n\n  bindMethods() {\n    this.remove = this.remove.bind(this);\n    this.refetch = this.refetch.bind(this);\n  }\n\n  onSubscribe() {\n    if (this.listeners.size === 1) {\n      this.currentQuery.addObserver(this);\n\n      if (shouldFetchOnMount(this.currentQuery, this.options)) {\n        this.executeFetch();\n      }\n\n      this.updateTimers();\n    }\n  }\n\n  onUnsubscribe() {\n    if (!this.hasListeners()) {\n      this.destroy();\n    }\n  }\n\n  shouldFetchOnReconnect() {\n    return shouldFetchOn(this.currentQuery, this.options, this.options.refetchOnReconnect);\n  }\n\n  shouldFetchOnWindowFocus() {\n    return shouldFetchOn(this.currentQuery, this.options, this.options.refetchOnWindowFocus);\n  }\n\n  destroy() {\n    this.listeners = new Set();\n    this.clearStaleTimeout();\n    this.clearRefetchInterval();\n    this.currentQuery.removeObserver(this);\n  }\n\n  setOptions(options, notifyOptions) {\n    const prevOptions = this.options;\n    const prevQuery = this.currentQuery;\n    this.options = this.client.defaultQueryOptions(options);\n\n    if (process.env.NODE_ENV !== 'production' && typeof (options == null ? void 0 : options.isDataEqual) !== 'undefined') {\n      this.client.getLogger().error(\"The isDataEqual option has been deprecated and will be removed in the next major version. You can achieve the same functionality by passing a function as the structuralSharing option\");\n    }\n\n    if (!shallowEqualObjects(prevOptions, this.options)) {\n      this.client.getQueryCache().notify({\n        type: 'observerOptionsUpdated',\n        query: this.currentQuery,\n        observer: this\n      });\n    }\n\n    if (typeof this.options.enabled !== 'undefined' && typeof this.options.enabled !== 'boolean') {\n      throw new Error('Expected enabled to be a boolean');\n    } // Keep previous query key if the user does not supply one\n\n\n    if (!this.options.queryKey) {\n      this.options.queryKey = prevOptions.queryKey;\n    }\n\n    this.updateQuery();\n    const mounted = this.hasListeners(); // Fetch if there are subscribers\n\n    if (mounted && shouldFetchOptionally(this.currentQuery, prevQuery, this.options, prevOptions)) {\n      this.executeFetch();\n    } // Update result\n\n\n    this.updateResult(notifyOptions); // Update stale interval if needed\n\n    if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || this.options.staleTime !== prevOptions.staleTime)) {\n      this.updateStaleTimeout();\n    }\n\n    const nextRefetchInterval = this.computeRefetchInterval(); // Update refetch interval if needed\n\n    if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || nextRefetchInterval !== this.currentRefetchInterval)) {\n      this.updateRefetchInterval(nextRefetchInterval);\n    }\n  }\n\n  getOptimisticResult(options) {\n    const query = this.client.getQueryCache().build(this.client, options);\n    const result = this.createResult(query, options);\n\n    if (shouldAssignObserverCurrentProperties(this, result, options)) {\n      // this assigns the optimistic result to the current Observer\n      // because if the query function changes, useQuery will be performing\n      // an effect where it would fetch again.\n      // When the fetch finishes, we perform a deep data cloning in order\n      // to reuse objects references. This deep data clone is performed against\n      // the `observer.currentResult.data` property\n      // When QueryKey changes, we refresh the query and get new `optimistic`\n      // result, while we leave the `observer.currentResult`, so when new data\n      // arrives, it finds the old `observer.currentResult` which is related\n      // to the old QueryKey. Which means that currentResult and selectData are\n      // out of sync already.\n      // To solve this, we move the cursor of the currentResult everytime\n      // an observer reads an optimistic value.\n      // When keeping the previous data, the result doesn't change until new\n      // data arrives.\n      this.currentResult = result;\n      this.currentResultOptions = this.options;\n      this.currentResultState = this.currentQuery.state;\n    }\n\n    return result;\n  }\n\n  getCurrentResult() {\n    return this.currentResult;\n  }\n\n  trackResult(result) {\n    const trackedResult = {};\n    Object.keys(result).forEach(key => {\n      Object.defineProperty(trackedResult, key, {\n        configurable: false,\n        enumerable: true,\n        get: () => {\n          this.trackedProps.add(key);\n          return result[key];\n        }\n      });\n    });\n    return trackedResult;\n  }\n\n  getCurrentQuery() {\n    return this.currentQuery;\n  }\n\n  remove() {\n    this.client.getQueryCache().remove(this.currentQuery);\n  }\n\n  refetch({\n    refetchPage,\n    ...options\n  } = {}) {\n    return this.fetch({ ...options,\n      meta: {\n        refetchPage\n      }\n    });\n  }\n\n  fetchOptimistic(options) {\n    const defaultedOptions = this.client.defaultQueryOptions(options);\n    const query = this.client.getQueryCache().build(this.client, defaultedOptions);\n    query.isFetchingOptimistic = true;\n    return query.fetch().then(() => this.createResult(query, defaultedOptions));\n  }\n\n  fetch(fetchOptions) {\n    var _fetchOptions$cancelR;\n\n    return this.executeFetch({ ...fetchOptions,\n      cancelRefetch: (_fetchOptions$cancelR = fetchOptions.cancelRefetch) != null ? _fetchOptions$cancelR : true\n    }).then(() => {\n      this.updateResult();\n      return this.currentResult;\n    });\n  }\n\n  executeFetch(fetchOptions) {\n    // Make sure we reference the latest query as the current one might have been removed\n    this.updateQuery(); // Fetch\n\n    let promise = this.currentQuery.fetch(this.options, fetchOptions);\n\n    if (!(fetchOptions != null && fetchOptions.throwOnError)) {\n      promise = promise.catch(noop);\n    }\n\n    return promise;\n  }\n\n  updateStaleTimeout() {\n    this.clearStaleTimeout();\n\n    if (isServer || this.currentResult.isStale || !isValidTimeout(this.options.staleTime)) {\n      return;\n    }\n\n    const time = timeUntilStale(this.currentResult.dataUpdatedAt, this.options.staleTime); // The timeout is sometimes triggered 1 ms before the stale time expiration.\n    // To mitigate this issue we always add 1 ms to the timeout.\n\n    const timeout = time + 1;\n    this.staleTimeoutId = setTimeout(() => {\n      if (!this.currentResult.isStale) {\n        this.updateResult();\n      }\n    }, timeout);\n  }\n\n  computeRefetchInterval() {\n    var _this$options$refetch;\n\n    return typeof this.options.refetchInterval === 'function' ? this.options.refetchInterval(this.currentResult.data, this.currentQuery) : (_this$options$refetch = this.options.refetchInterval) != null ? _this$options$refetch : false;\n  }\n\n  updateRefetchInterval(nextInterval) {\n    this.clearRefetchInterval();\n    this.currentRefetchInterval = nextInterval;\n\n    if (isServer || this.options.enabled === false || !isValidTimeout(this.currentRefetchInterval) || this.currentRefetchInterval === 0) {\n      return;\n    }\n\n    this.refetchIntervalId = setInterval(() => {\n      if (this.options.refetchIntervalInBackground || focusManager.isFocused()) {\n        this.executeFetch();\n      }\n    }, this.currentRefetchInterval);\n  }\n\n  updateTimers() {\n    this.updateStaleTimeout();\n    this.updateRefetchInterval(this.computeRefetchInterval());\n  }\n\n  clearStaleTimeout() {\n    if (this.staleTimeoutId) {\n      clearTimeout(this.staleTimeoutId);\n      this.staleTimeoutId = undefined;\n    }\n  }\n\n  clearRefetchInterval() {\n    if (this.refetchIntervalId) {\n      clearInterval(this.refetchIntervalId);\n      this.refetchIntervalId = undefined;\n    }\n  }\n\n  createResult(query, options) {\n    const prevQuery = this.currentQuery;\n    const prevOptions = this.options;\n    const prevResult = this.currentResult;\n    const prevResultState = this.currentResultState;\n    const prevResultOptions = this.currentResultOptions;\n    const queryChange = query !== prevQuery;\n    const queryInitialState = queryChange ? query.state : this.currentQueryInitialState;\n    const prevQueryResult = queryChange ? this.currentResult : this.previousQueryResult;\n    const {\n      state\n    } = query;\n    let {\n      dataUpdatedAt,\n      error,\n      errorUpdatedAt,\n      fetchStatus,\n      status\n    } = state;\n    let isPreviousData = false;\n    let isPlaceholderData = false;\n    let data; // Optimistically set result in fetching state if needed\n\n    if (options._optimisticResults) {\n      const mounted = this.hasListeners();\n      const fetchOnMount = !mounted && shouldFetchOnMount(query, options);\n      const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);\n\n      if (fetchOnMount || fetchOptionally) {\n        fetchStatus = canFetch(query.options.networkMode) ? 'fetching' : 'paused';\n\n        if (!dataUpdatedAt) {\n          status = 'loading';\n        }\n      }\n\n      if (options._optimisticResults === 'isRestoring') {\n        fetchStatus = 'idle';\n      }\n    } // Keep previous data if needed\n\n\n    if (options.keepPreviousData && !state.dataUpdatedAt && prevQueryResult != null && prevQueryResult.isSuccess && status !== 'error') {\n      data = prevQueryResult.data;\n      dataUpdatedAt = prevQueryResult.dataUpdatedAt;\n      status = prevQueryResult.status;\n      isPreviousData = true;\n    } // Select data if needed\n    else if (options.select && typeof state.data !== 'undefined') {\n      // Memoize select result\n      if (prevResult && state.data === (prevResultState == null ? void 0 : prevResultState.data) && options.select === this.selectFn) {\n        data = this.selectResult;\n      } else {\n        try {\n          this.selectFn = options.select;\n          data = options.select(state.data);\n          data = replaceData(prevResult == null ? void 0 : prevResult.data, data, options);\n          this.selectResult = data;\n          this.selectError = null;\n        } catch (selectError) {\n          if (process.env.NODE_ENV !== 'production') {\n            this.client.getLogger().error(selectError);\n          }\n\n          this.selectError = selectError;\n        }\n      }\n    } // Use query data\n    else {\n      data = state.data;\n    } // Show placeholder data if needed\n\n\n    if (typeof options.placeholderData !== 'undefined' && typeof data === 'undefined' && status === 'loading') {\n      let placeholderData; // Memoize placeholder data\n\n      if (prevResult != null && prevResult.isPlaceholderData && options.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) {\n        placeholderData = prevResult.data;\n      } else {\n        placeholderData = typeof options.placeholderData === 'function' ? options.placeholderData() : options.placeholderData;\n\n        if (options.select && typeof placeholderData !== 'undefined') {\n          try {\n            placeholderData = options.select(placeholderData);\n            this.selectError = null;\n          } catch (selectError) {\n            if (process.env.NODE_ENV !== 'production') {\n              this.client.getLogger().error(selectError);\n            }\n\n            this.selectError = selectError;\n          }\n        }\n      }\n\n      if (typeof placeholderData !== 'undefined') {\n        status = 'success';\n        data = replaceData(prevResult == null ? void 0 : prevResult.data, placeholderData, options);\n        isPlaceholderData = true;\n      }\n    }\n\n    if (this.selectError) {\n      error = this.selectError;\n      data = this.selectResult;\n      errorUpdatedAt = Date.now();\n      status = 'error';\n    }\n\n    const isFetching = fetchStatus === 'fetching';\n    const isLoading = status === 'loading';\n    const isError = status === 'error';\n    const result = {\n      status,\n      fetchStatus,\n      isLoading,\n      isSuccess: status === 'success',\n      isError,\n      isInitialLoading: isLoading && isFetching,\n      data,\n      dataUpdatedAt,\n      error,\n      errorUpdatedAt,\n      failureCount: state.fetchFailureCount,\n      failureReason: state.fetchFailureReason,\n      errorUpdateCount: state.errorUpdateCount,\n      isFetched: state.dataUpdateCount > 0 || state.errorUpdateCount > 0,\n      isFetchedAfterMount: state.dataUpdateCount > queryInitialState.dataUpdateCount || state.errorUpdateCount > queryInitialState.errorUpdateCount,\n      isFetching,\n      isRefetching: isFetching && !isLoading,\n      isLoadingError: isError && state.dataUpdatedAt === 0,\n      isPaused: fetchStatus === 'paused',\n      isPlaceholderData,\n      isPreviousData,\n      isRefetchError: isError && state.dataUpdatedAt !== 0,\n      isStale: isStale(query, options),\n      refetch: this.refetch,\n      remove: this.remove\n    };\n    return result;\n  }\n\n  updateResult(notifyOptions) {\n    const prevResult = this.currentResult;\n    const nextResult = this.createResult(this.currentQuery, this.options);\n    this.currentResultState = this.currentQuery.state;\n    this.currentResultOptions = this.options; // Only notify and update result if something has changed\n\n    if (shallowEqualObjects(nextResult, prevResult)) {\n      return;\n    }\n\n    this.currentResult = nextResult; // Determine which callbacks to trigger\n\n    const defaultNotifyOptions = {\n      cache: true\n    };\n\n    const shouldNotifyListeners = () => {\n      if (!prevResult) {\n        return true;\n      }\n\n      const {\n        notifyOnChangeProps\n      } = this.options;\n      const notifyOnChangePropsValue = typeof notifyOnChangeProps === 'function' ? notifyOnChangeProps() : notifyOnChangeProps;\n\n      if (notifyOnChangePropsValue === 'all' || !notifyOnChangePropsValue && !this.trackedProps.size) {\n        return true;\n      }\n\n      const includedProps = new Set(notifyOnChangePropsValue != null ? notifyOnChangePropsValue : this.trackedProps);\n\n      if (this.options.useErrorBoundary) {\n        includedProps.add('error');\n      }\n\n      return Object.keys(this.currentResult).some(key => {\n        const typedKey = key;\n        const changed = this.currentResult[typedKey] !== prevResult[typedKey];\n        return changed && includedProps.has(typedKey);\n      });\n    };\n\n    if ((notifyOptions == null ? void 0 : notifyOptions.listeners) !== false && shouldNotifyListeners()) {\n      defaultNotifyOptions.listeners = true;\n    }\n\n    this.notify({ ...defaultNotifyOptions,\n      ...notifyOptions\n    });\n  }\n\n  updateQuery() {\n    const query = this.client.getQueryCache().build(this.client, this.options);\n\n    if (query === this.currentQuery) {\n      return;\n    }\n\n    const prevQuery = this.currentQuery;\n    this.currentQuery = query;\n    this.currentQueryInitialState = query.state;\n    this.previousQueryResult = this.currentResult;\n\n    if (this.hasListeners()) {\n      prevQuery == null ? void 0 : prevQuery.removeObserver(this);\n      query.addObserver(this);\n    }\n  }\n\n  onQueryUpdate(action) {\n    const notifyOptions = {};\n\n    if (action.type === 'success') {\n      notifyOptions.onSuccess = !action.manual;\n    } else if (action.type === 'error' && !isCancelledError(action.error)) {\n      notifyOptions.onError = true;\n    }\n\n    this.updateResult(notifyOptions);\n\n    if (this.hasListeners()) {\n      this.updateTimers();\n    }\n  }\n\n  notify(notifyOptions) {\n    notifyManager.batch(() => {\n      // First trigger the configuration callbacks\n      if (notifyOptions.onSuccess) {\n        var _this$options$onSucce, _this$options, _this$options$onSettl, _this$options2;\n\n        (_this$options$onSucce = (_this$options = this.options).onSuccess) == null ? void 0 : _this$options$onSucce.call(_this$options, this.currentResult.data);\n        (_this$options$onSettl = (_this$options2 = this.options).onSettled) == null ? void 0 : _this$options$onSettl.call(_this$options2, this.currentResult.data, null);\n      } else if (notifyOptions.onError) {\n        var _this$options$onError, _this$options3, _this$options$onSettl2, _this$options4;\n\n        (_this$options$onError = (_this$options3 = this.options).onError) == null ? void 0 : _this$options$onError.call(_this$options3, this.currentResult.error);\n        (_this$options$onSettl2 = (_this$options4 = this.options).onSettled) == null ? void 0 : _this$options$onSettl2.call(_this$options4, undefined, this.currentResult.error);\n      } // Then trigger the listeners\n\n\n      if (notifyOptions.listeners) {\n        this.listeners.forEach(({\n          listener\n        }) => {\n          listener(this.currentResult);\n        });\n      } // Then the cache listeners\n\n\n      if (notifyOptions.cache) {\n        this.client.getQueryCache().notify({\n          query: this.currentQuery,\n          type: 'observerResultsUpdated'\n        });\n      }\n    });\n  }\n\n}\n\nfunction shouldLoadOnMount(query, options) {\n  return options.enabled !== false && !query.state.dataUpdatedAt && !(query.state.status === 'error' && options.retryOnMount === false);\n}\n\nfunction shouldFetchOnMount(query, options) {\n  return shouldLoadOnMount(query, options) || query.state.dataUpdatedAt > 0 && shouldFetchOn(query, options, options.refetchOnMount);\n}\n\nfunction shouldFetchOn(query, options, field) {\n  if (options.enabled !== false) {\n    const value = typeof field === 'function' ? field(query) : field;\n    return value === 'always' || value !== false && isStale(query, options);\n  }\n\n  return false;\n}\n\nfunction shouldFetchOptionally(query, prevQuery, options, prevOptions) {\n  return options.enabled !== false && (query !== prevQuery || prevOptions.enabled === false) && (!options.suspense || query.state.status !== 'error') && isStale(query, options);\n}\n\nfunction isStale(query, options) {\n  return query.isStaleByTime(options.staleTime);\n} // this function would decide if we will update the observer's 'current'\n// properties after an optimistic reading via getOptimisticResult\n\n\nfunction shouldAssignObserverCurrentProperties(observer, optimisticResult, options) {\n  // it is important to keep this condition like this for three reasons:\n  // 1. It will get removed in the v5\n  // 2. it reads: don't update the properties if we want to keep the previous\n  // data.\n  // 3. The opposite condition (!options.keepPreviousData) would fallthrough\n  // and will result in a bad decision\n  if (options.keepPreviousData) {\n    return false;\n  } // this means we want to put some placeholder data when pending and queryKey\n  // changed.\n\n\n  if (options.placeholderData !== undefined) {\n    // re-assign properties only if current data is placeholder data\n    // which means that data did not arrive yet, so, if there is some cached data\n    // we need to \"prepare\" to receive it\n    return optimisticResult.isPlaceholderData;\n  } // if the newly created result isn't what the observer is holding as current,\n  // then we'll need to update the properties as well\n\n\n  if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n    return true;\n  } // basically, just keep previous properties if nothing changed\n\n\n  return false;\n}\n\nexport { QueryObserver };\n//# sourceMappingURL=queryObserver.mjs.map\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.development.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\";\n\"production\" !== process.env.NODE_ENV &&\n  (function () {\n    function is(x, y) {\n      return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n    }\n    function useSyncExternalStore$2(subscribe, getSnapshot) {\n      didWarnOld18Alpha ||\n        void 0 === React.startTransition ||\n        ((didWarnOld18Alpha = !0),\n        console.error(\n          \"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.\"\n        ));\n      var value = getSnapshot();\n      if (!didWarnUncachedGetSnapshot) {\n        var cachedValue = getSnapshot();\n        objectIs(value, cachedValue) ||\n          (console.error(\n            \"The result of getSnapshot should be cached to avoid an infinite loop\"\n          ),\n          (didWarnUncachedGetSnapshot = !0));\n      }\n      cachedValue = useState({\n        inst: { value: value, getSnapshot: getSnapshot }\n      });\n      var inst = cachedValue[0].inst,\n        forceUpdate = cachedValue[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    }\n    function 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    }\n    function useSyncExternalStore$1(subscribe, getSnapshot) {\n      return getSnapshot();\n    }\n    \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n      \"function\" ===\n        typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n      __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n    var React = require(\"react\"),\n      objectIs = \"function\" === typeof Object.is ? Object.is : is,\n      useState = React.useState,\n      useEffect = React.useEffect,\n      useLayoutEffect = React.useLayoutEffect,\n      useDebugValue = React.useDebugValue,\n      didWarnOld18Alpha = !1,\n      didWarnUncachedGetSnapshot = !1,\n      shim =\n        \"undefined\" === typeof window ||\n        \"undefined\" === typeof window.document ||\n        \"undefined\" === typeof window.document.createElement\n          ? useSyncExternalStore$1\n          : useSyncExternalStore$2;\n    exports.useSyncExternalStore =\n      void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n    \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n      \"function\" ===\n        typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n      __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\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 client';\nimport { useSyncExternalStore as useSyncExternalStore$1 } from 'use-sync-external-store/shim/index.js';\n\nconst useSyncExternalStore = useSyncExternalStore$1;\n\nexport { useSyncExternalStore };\n//# sourceMappingURL=useSyncExternalStore.mjs.map\n","'use client';\nimport * as React from 'react';\n\nconst defaultContext = /*#__PURE__*/React.createContext(undefined);\nconst QueryClientSharingContext = /*#__PURE__*/React.createContext(false); // If we are given a context, we will use it.\n// Otherwise, if contextSharing is on, we share the first and at least one\n// instance of the context across the window\n// to ensure that if React Query is used across\n// different bundles or microfrontends they will\n// all use the same **instance** of context, regardless\n// of module scoping.\n\nfunction getQueryClientContext(context, contextSharing) {\n  if (context) {\n    return context;\n  }\n\n  if (contextSharing && typeof window !== 'undefined') {\n    if (!window.ReactQueryClientContext) {\n      window.ReactQueryClientContext = defaultContext;\n    }\n\n    return window.ReactQueryClientContext;\n  }\n\n  return defaultContext;\n}\n\nconst useQueryClient = ({\n  context\n} = {}) => {\n  const queryClient = React.useContext(getQueryClientContext(context, React.useContext(QueryClientSharingContext)));\n\n  if (!queryClient) {\n    throw new Error('No QueryClient set, use QueryClientProvider to set one');\n  }\n\n  return queryClient;\n};\nconst QueryClientProvider = ({\n  client,\n  children,\n  context,\n  contextSharing = false\n}) => {\n  React.useEffect(() => {\n    client.mount();\n    return () => {\n      client.unmount();\n    };\n  }, [client]);\n\n  if (process.env.NODE_ENV !== 'production' && contextSharing) {\n    client.getLogger().error(\"The contextSharing option has been deprecated and will be removed in the next major version\");\n  }\n\n  const Context = getQueryClientContext(context, contextSharing);\n  return /*#__PURE__*/React.createElement(QueryClientSharingContext.Provider, {\n    value: !context && contextSharing\n  }, /*#__PURE__*/React.createElement(Context.Provider, {\n    value: client\n  }, children));\n};\n\nexport { QueryClientProvider, defaultContext, useQueryClient };\n//# sourceMappingURL=QueryClientProvider.mjs.map\n","'use client';\nimport * as React from 'react';\n\nconst IsRestoringContext = /*#__PURE__*/React.createContext(false);\nconst useIsRestoring = () => React.useContext(IsRestoringContext);\nconst IsRestoringProvider = IsRestoringContext.Provider;\n\nexport { IsRestoringProvider, useIsRestoring };\n//# sourceMappingURL=isRestoring.mjs.map\n","'use client';\nimport * as React from 'react';\n\nfunction createValue() {\n  let isReset = false;\n  return {\n    clearReset: () => {\n      isReset = false;\n    },\n    reset: () => {\n      isReset = true;\n    },\n    isReset: () => {\n      return isReset;\n    }\n  };\n}\n\nconst QueryErrorResetBoundaryContext = /*#__PURE__*/React.createContext(createValue()); // HOOK\n\nconst useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext); // COMPONENT\n\nconst QueryErrorResetBoundary = ({\n  children\n}) => {\n  const [value] = React.useState(() => createValue());\n  return /*#__PURE__*/React.createElement(QueryErrorResetBoundaryContext.Provider, {\n    value: value\n  }, typeof children === 'function' ? children(value) : children);\n};\n\nexport { QueryErrorResetBoundary, useQueryErrorResetBoundary };\n//# sourceMappingURL=QueryErrorResetBoundary.mjs.map\n","function shouldThrowError(_useErrorBoundary, params) {\n  // Allow useErrorBoundary function to override throwing behavior on a per-error basis\n  if (typeof _useErrorBoundary === 'function') {\n    return _useErrorBoundary(...params);\n  }\n\n  return !!_useErrorBoundary;\n}\n\nexport { shouldThrowError };\n//# sourceMappingURL=utils.mjs.map\n","'use client';\nimport * as React from 'react';\nimport { shouldThrowError } from './utils.mjs';\n\nconst ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {\n  if (options.suspense || options.useErrorBoundary) {\n    // Prevent retrying failed query if the error boundary has not been reset yet\n    if (!errorResetBoundary.isReset()) {\n      options.retryOnMount = false;\n    }\n  }\n};\nconst useClearResetErrorBoundary = errorResetBoundary => {\n  React.useEffect(() => {\n    errorResetBoundary.clearReset();\n  }, [errorResetBoundary]);\n};\nconst getHasError = ({\n  result,\n  errorResetBoundary,\n  useErrorBoundary,\n  query\n}) => {\n  return result.isError && !errorResetBoundary.isReset() && !result.isFetching && shouldThrowError(useErrorBoundary, [result.error, query]);\n};\n\nexport { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary };\n//# sourceMappingURL=errorBoundaryUtils.mjs.map\n","const ensureStaleTime = defaultedOptions => {\n  if (defaultedOptions.suspense) {\n    // Always set stale time when using suspense to prevent\n    // fetching again when directly mounting after suspending\n    if (typeof defaultedOptions.staleTime !== 'number') {\n      defaultedOptions.staleTime = 1000;\n    }\n  }\n};\nconst willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;\nconst shouldSuspend = (defaultedOptions, result, isRestoring) => (defaultedOptions == null ? void 0 : defaultedOptions.suspense) && willFetch(result, isRestoring);\nconst fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).then(({\n  data\n}) => {\n  defaultedOptions.onSuccess == null ? void 0 : defaultedOptions.onSuccess(data);\n  defaultedOptions.onSettled == null ? void 0 : defaultedOptions.onSettled(data, null);\n}).catch(error => {\n  errorResetBoundary.clearReset();\n  defaultedOptions.onError == null ? void 0 : defaultedOptions.onError(error);\n  defaultedOptions.onSettled == null ? void 0 : defaultedOptions.onSettled(undefined, error);\n});\n\nexport { ensureStaleTime, fetchOptimistic, shouldSuspend, willFetch };\n//# sourceMappingURL=suspense.mjs.map\n","'use client';\nimport * as React from 'react';\nimport { notifyManager } from '@tanstack/query-core';\nimport { useSyncExternalStore } from './useSyncExternalStore.mjs';\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary.mjs';\nimport { useQueryClient } from './QueryClientProvider.mjs';\nimport { useIsRestoring } from './isRestoring.mjs';\nimport { ensurePreventErrorBoundaryRetry, useClearResetErrorBoundary, getHasError } from './errorBoundaryUtils.mjs';\nimport { ensureStaleTime, shouldSuspend, fetchOptimistic } from './suspense.mjs';\n\nfunction useBaseQuery(options, Observer) {\n  const queryClient = useQueryClient({\n    context: options.context\n  });\n  const isRestoring = useIsRestoring();\n  const errorResetBoundary = useQueryErrorResetBoundary();\n  const defaultedOptions = queryClient.defaultQueryOptions(options); // Make sure results are optimistically set in fetching state before subscribing or updating options\n\n  defaultedOptions._optimisticResults = isRestoring ? 'isRestoring' : 'optimistic'; // Include callbacks in batch renders\n\n  if (defaultedOptions.onError) {\n    defaultedOptions.onError = notifyManager.batchCalls(defaultedOptions.onError);\n  }\n\n  if (defaultedOptions.onSuccess) {\n    defaultedOptions.onSuccess = notifyManager.batchCalls(defaultedOptions.onSuccess);\n  }\n\n  if (defaultedOptions.onSettled) {\n    defaultedOptions.onSettled = notifyManager.batchCalls(defaultedOptions.onSettled);\n  }\n\n  ensureStaleTime(defaultedOptions);\n  ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary);\n  useClearResetErrorBoundary(errorResetBoundary);\n  const [observer] = React.useState(() => new Observer(queryClient, defaultedOptions));\n  const result = observer.getOptimisticResult(defaultedOptions);\n  useSyncExternalStore(React.useCallback(onStoreChange => {\n    const unsubscribe = isRestoring ? () => undefined : observer.subscribe(notifyManager.batchCalls(onStoreChange)); // Update result to make sure we did not miss any query updates\n    // between creating the observer and subscribing to it.\n\n    observer.updateResult();\n    return unsubscribe;\n  }, [observer, isRestoring]), () => observer.getCurrentResult(), () => observer.getCurrentResult());\n  React.useEffect(() => {\n    // Do not notify on updates because of changes in the options because\n    // these changes should already be reflected in the optimistic result.\n    observer.setOptions(defaultedOptions, {\n      listeners: false\n    });\n  }, [defaultedOptions, observer]); // Handle suspense\n\n  if (shouldSuspend(defaultedOptions, result, isRestoring)) {\n    throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);\n  } // Handle error boundary\n\n\n  if (getHasError({\n    result,\n    errorResetBoundary,\n    useErrorBoundary: defaultedOptions.useErrorBoundary,\n    query: observer.getCurrentQuery()\n  })) {\n    throw result.error;\n  } // Handle result property usage tracking\n\n\n  return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;\n}\n\nexport { useBaseQuery };\n//# sourceMappingURL=useBaseQuery.mjs.map\n","'use client';\nimport { parseQueryArgs, QueryObserver } from '@tanstack/query-core';\nimport { useBaseQuery } from './useBaseQuery.mjs';\n\nfunction useQuery(arg1, arg2, arg3) {\n  const parsedOptions = parseQueryArgs(arg1, arg2, arg3);\n  return useBaseQuery(parsedOptions, QueryObserver);\n}\n\nexport { useQuery };\n//# sourceMappingURL=useQuery.mjs.map\n","/**\n * @remix-run/router v1.23.0\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nfunction _extends() {\n  _extends = Object.assign ? Object.assign.bind() : function (target) {\n    for (var i = 1; i < arguments.length; i++) {\n      var source = arguments[i];\n      for (var key in source) {\n        if (Object.prototype.hasOwnProperty.call(source, key)) {\n          target[key] = source[key];\n        }\n      }\n    }\n    return target;\n  };\n  return _extends.apply(this, arguments);\n}\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Types and Constants\n////////////////////////////////////////////////////////////////////////////////\n/**\n * Actions represent the type of change to a location value.\n */\nvar Action;\n(function (Action) {\n  /**\n   * A POP indicates a change to an arbitrary index in the history stack, such\n   * as a back or forward navigation. It does not describe the direction of the\n   * navigation, only that the current index changed.\n   *\n   * Note: This is the default action for newly created history objects.\n   */\n  Action[\"Pop\"] = \"POP\";\n  /**\n   * A PUSH indicates a new entry being added to the history stack, such as when\n   * a link is clicked and a new page loads. When this happens, all subsequent\n   * entries in the stack are lost.\n   */\n  Action[\"Push\"] = \"PUSH\";\n  /**\n   * A REPLACE indicates the entry at the current index in the history stack\n   * being replaced by a new one.\n   */\n  Action[\"Replace\"] = \"REPLACE\";\n})(Action || (Action = {}));\nconst PopStateEventType = \"popstate\";\n/**\n * Memory history stores the current location in memory. It is designed for use\n * in stateful non-browser environments like tests and React Native.\n */\nfunction createMemoryHistory(options) {\n  if (options === void 0) {\n    options = {};\n  }\n  let {\n    initialEntries = [\"/\"],\n    initialIndex,\n    v5Compat = false\n  } = options;\n  let entries; // Declare so we can access from createMemoryLocation\n  entries = initialEntries.map((entry, index) => createMemoryLocation(entry, typeof entry === \"string\" ? null : entry.state, index === 0 ? \"default\" : undefined));\n  let index = clampIndex(initialIndex == null ? entries.length - 1 : initialIndex);\n  let action = Action.Pop;\n  let listener = null;\n  function clampIndex(n) {\n    return Math.min(Math.max(n, 0), entries.length - 1);\n  }\n  function getCurrentLocation() {\n    return entries[index];\n  }\n  function createMemoryLocation(to, state, key) {\n    if (state === void 0) {\n      state = null;\n    }\n    let location = createLocation(entries ? getCurrentLocation().pathname : \"/\", to, state, key);\n    warning(location.pathname.charAt(0) === \"/\", \"relative pathnames are not supported in memory history: \" + JSON.stringify(to));\n    return location;\n  }\n  function createHref(to) {\n    return typeof to === \"string\" ? to : createPath(to);\n  }\n  let history = {\n    get index() {\n      return index;\n    },\n    get action() {\n      return action;\n    },\n    get location() {\n      return getCurrentLocation();\n    },\n    createHref,\n    createURL(to) {\n      return new URL(createHref(to), \"http://localhost\");\n    },\n    encodeLocation(to) {\n      let path = typeof to === \"string\" ? parsePath(to) : to;\n      return {\n        pathname: path.pathname || \"\",\n        search: path.search || \"\",\n        hash: path.hash || \"\"\n      };\n    },\n    push(to, state) {\n      action = Action.Push;\n      let nextLocation = createMemoryLocation(to, state);\n      index += 1;\n      entries.splice(index, entries.length, nextLocation);\n      if (v5Compat && listener) {\n        listener({\n          action,\n          location: nextLocation,\n          delta: 1\n        });\n      }\n    },\n    replace(to, state) {\n      action = Action.Replace;\n      let nextLocation = createMemoryLocation(to, state);\n      entries[index] = nextLocation;\n      if (v5Compat && listener) {\n        listener({\n          action,\n          location: nextLocation,\n          delta: 0\n        });\n      }\n    },\n    go(delta) {\n      action = Action.Pop;\n      let nextIndex = clampIndex(index + delta);\n      let nextLocation = entries[nextIndex];\n      index = nextIndex;\n      if (listener) {\n        listener({\n          action,\n          location: nextLocation,\n          delta\n        });\n      }\n    },\n    listen(fn) {\n      listener = fn;\n      return () => {\n        listener = null;\n      };\n    }\n  };\n  return history;\n}\n/**\n * Browser history stores the location in regular URLs. This is the standard for\n * most web apps, but it requires some configuration on the server to ensure you\n * serve the same app at multiple URLs.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory\n */\nfunction createBrowserHistory(options) {\n  if (options === void 0) {\n    options = {};\n  }\n  function createBrowserLocation(window, globalHistory) {\n    let {\n      pathname,\n      search,\n      hash\n    } = window.location;\n    return createLocation(\"\", {\n      pathname,\n      search,\n      hash\n    },\n    // state defaults to `null` because `window.history.state` does\n    globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || \"default\");\n  }\n  function createBrowserHref(window, to) {\n    return typeof to === \"string\" ? to : createPath(to);\n  }\n  return getUrlBasedHistory(createBrowserLocation, createBrowserHref, null, options);\n}\n/**\n * Hash history stores the location in window.location.hash. This makes it ideal\n * for situations where you don't want to send the location to the server for\n * some reason, either because you do cannot configure it or the URL space is\n * reserved for something else.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory\n */\nfunction createHashHistory(options) {\n  if (options === void 0) {\n    options = {};\n  }\n  function createHashLocation(window, globalHistory) {\n    let {\n      pathname = \"/\",\n      search = \"\",\n      hash = \"\"\n    } = parsePath(window.location.hash.substr(1));\n    // Hash URL should always have a leading / just like window.location.pathname\n    // does, so if an app ends up at a route like /#something then we add a\n    // leading slash so all of our path-matching behaves the same as if it would\n    // in a browser router.  This is particularly important when there exists a\n    // root splat route (<Route path=\"*\">) since that matches internally against\n    // \"/*\" and we'd expect /#something to 404 in a hash router app.\n    if (!pathname.startsWith(\"/\") && !pathname.startsWith(\".\")) {\n      pathname = \"/\" + pathname;\n    }\n    return createLocation(\"\", {\n      pathname,\n      search,\n      hash\n    },\n    // state defaults to `null` because `window.history.state` does\n    globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || \"default\");\n  }\n  function createHashHref(window, to) {\n    let base = window.document.querySelector(\"base\");\n    let href = \"\";\n    if (base && base.getAttribute(\"href\")) {\n      let url = window.location.href;\n      let hashIndex = url.indexOf(\"#\");\n      href = hashIndex === -1 ? url : url.slice(0, hashIndex);\n    }\n    return href + \"#\" + (typeof to === \"string\" ? to : createPath(to));\n  }\n  function validateHashLocation(location, to) {\n    warning(location.pathname.charAt(0) === \"/\", \"relative pathnames are not supported in hash history.push(\" + JSON.stringify(to) + \")\");\n  }\n  return getUrlBasedHistory(createHashLocation, createHashHref, validateHashLocation, options);\n}\nfunction invariant(value, message) {\n  if (value === false || value === null || typeof value === \"undefined\") {\n    throw new Error(message);\n  }\n}\nfunction warning(cond, message) {\n  if (!cond) {\n    // eslint-disable-next-line no-console\n    if (typeof console !== \"undefined\") console.warn(message);\n    try {\n      // Welcome to debugging history!\n      //\n      // This error is thrown as a convenience, so you can more easily\n      // find the source for a warning that appears in the console by\n      // enabling \"pause on exceptions\" in your JavaScript debugger.\n      throw new Error(message);\n      // eslint-disable-next-line no-empty\n    } catch (e) {}\n  }\n}\nfunction createKey() {\n  return Math.random().toString(36).substr(2, 8);\n}\n/**\n * For browser-based histories, we combine the state and key into an object\n */\nfunction getHistoryState(location, index) {\n  return {\n    usr: location.state,\n    key: location.key,\n    idx: index\n  };\n}\n/**\n * Creates a Location object with a unique key from the given Path\n */\nfunction createLocation(current, to, state, key) {\n  if (state === void 0) {\n    state = null;\n  }\n  let location = _extends({\n    pathname: typeof current === \"string\" ? current : current.pathname,\n    search: \"\",\n    hash: \"\"\n  }, typeof to === \"string\" ? parsePath(to) : to, {\n    state,\n    // TODO: This could be cleaned up.  push/replace should probably just take\n    // full Locations now and avoid the need to run through this flow at all\n    // But that's a pretty big refactor to the current test suite so going to\n    // keep as is for the time being and just let any incoming keys take precedence\n    key: to && to.key || key || createKey()\n  });\n  return location;\n}\n/**\n * Creates a string URL path from the given pathname, search, and hash components.\n */\nfunction createPath(_ref) {\n  let {\n    pathname = \"/\",\n    search = \"\",\n    hash = \"\"\n  } = _ref;\n  if (search && search !== \"?\") pathname += search.charAt(0) === \"?\" ? search : \"?\" + search;\n  if (hash && hash !== \"#\") pathname += hash.charAt(0) === \"#\" ? hash : \"#\" + hash;\n  return pathname;\n}\n/**\n * Parses a string URL path into its separate pathname, search, and hash components.\n */\nfunction parsePath(path) {\n  let parsedPath = {};\n  if (path) {\n    let hashIndex = path.indexOf(\"#\");\n    if (hashIndex >= 0) {\n      parsedPath.hash = path.substr(hashIndex);\n      path = path.substr(0, hashIndex);\n    }\n    let searchIndex = path.indexOf(\"?\");\n    if (searchIndex >= 0) {\n      parsedPath.search = path.substr(searchIndex);\n      path = path.substr(0, searchIndex);\n    }\n    if (path) {\n      parsedPath.pathname = path;\n    }\n  }\n  return parsedPath;\n}\nfunction getUrlBasedHistory(getLocation, createHref, validateLocation, options) {\n  if (options === void 0) {\n    options = {};\n  }\n  let {\n    window = document.defaultView,\n    v5Compat = false\n  } = options;\n  let globalHistory = window.history;\n  let action = Action.Pop;\n  let listener = null;\n  let index = getIndex();\n  // Index should only be null when we initialize. If not, it's because the\n  // user called history.pushState or history.replaceState directly, in which\n  // case we should log a warning as it will result in bugs.\n  if (index == null) {\n    index = 0;\n    globalHistory.replaceState(_extends({}, globalHistory.state, {\n      idx: index\n    }), \"\");\n  }\n  function getIndex() {\n    let state = globalHistory.state || {\n      idx: null\n    };\n    return state.idx;\n  }\n  function handlePop() {\n    action = Action.Pop;\n    let nextIndex = getIndex();\n    let delta = nextIndex == null ? null : nextIndex - index;\n    index = nextIndex;\n    if (listener) {\n      listener({\n        action,\n        location: history.location,\n        delta\n      });\n    }\n  }\n  function push(to, state) {\n    action = Action.Push;\n    let location = createLocation(history.location, to, state);\n    if (validateLocation) validateLocation(location, to);\n    index = getIndex() + 1;\n    let historyState = getHistoryState(location, index);\n    let url = history.createHref(location);\n    // try...catch because iOS limits us to 100 pushState calls :/\n    try {\n      globalHistory.pushState(historyState, \"\", url);\n    } catch (error) {\n      // If the exception is because `state` can't be serialized, let that throw\n      // outwards just like a replace call would so the dev knows the cause\n      // https://html.spec.whatwg.org/multipage/nav-history-apis.html#shared-history-push/replace-state-steps\n      // https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal\n      if (error instanceof DOMException && error.name === \"DataCloneError\") {\n        throw error;\n      }\n      // They are going to lose state here, but there is no real\n      // way to warn them about it since the page will refresh...\n      window.location.assign(url);\n    }\n    if (v5Compat && listener) {\n      listener({\n        action,\n        location: history.location,\n        delta: 1\n      });\n    }\n  }\n  function replace(to, state) {\n    action = Action.Replace;\n    let location = createLocation(history.location, to, state);\n    if (validateLocation) validateLocation(location, to);\n    index = getIndex();\n    let historyState = getHistoryState(location, index);\n    let url = history.createHref(location);\n    globalHistory.replaceState(historyState, \"\", url);\n    if (v5Compat && listener) {\n      listener({\n        action,\n        location: history.location,\n        delta: 0\n      });\n    }\n  }\n  function createURL(to) {\n    // window.location.origin is \"null\" (the literal string value) in Firefox\n    // under certain conditions, notably when serving from a local HTML file\n    // See https://bugzilla.mozilla.org/show_bug.cgi?id=878297\n    let base = window.location.origin !== \"null\" ? window.location.origin : window.location.href;\n    let href = typeof to === \"string\" ? to : createPath(to);\n    // Treating this as a full URL will strip any trailing spaces so we need to\n    // pre-encode them since they might be part of a matching splat param from\n    // an ancestor route\n    href = href.replace(/ $/, \"%20\");\n    invariant(base, \"No window.location.(origin|href) available to create URL for href: \" + href);\n    return new URL(href, base);\n  }\n  let history = {\n    get action() {\n      return action;\n    },\n    get location() {\n      return getLocation(window, globalHistory);\n    },\n    listen(fn) {\n      if (listener) {\n        throw new Error(\"A history only accepts one active listener\");\n      }\n      window.addEventListener(PopStateEventType, handlePop);\n      listener = fn;\n      return () => {\n        window.removeEventListener(PopStateEventType, handlePop);\n        listener = null;\n      };\n    },\n    createHref(to) {\n      return createHref(window, to);\n    },\n    createURL,\n    encodeLocation(to) {\n      // Encode a Location the same way window.location would\n      let url = createURL(to);\n      return {\n        pathname: url.pathname,\n        search: url.search,\n        hash: url.hash\n      };\n    },\n    push,\n    replace,\n    go(n) {\n      return globalHistory.go(n);\n    }\n  };\n  return history;\n}\n//#endregion\n\nvar ResultType;\n(function (ResultType) {\n  ResultType[\"data\"] = \"data\";\n  ResultType[\"deferred\"] = \"deferred\";\n  ResultType[\"redirect\"] = \"redirect\";\n  ResultType[\"error\"] = \"error\";\n})(ResultType || (ResultType = {}));\nconst immutableRouteKeys = new Set([\"lazy\", \"caseSensitive\", \"path\", \"id\", \"index\", \"children\"]);\nfunction isIndexRoute(route) {\n  return route.index === true;\n}\n// Walk the route tree generating unique IDs where necessary, so we are working\n// solely with AgnosticDataRouteObject's within the Router\nfunction convertRoutesToDataRoutes(routes, mapRouteProperties, parentPath, manifest) {\n  if (parentPath === void 0) {\n    parentPath = [];\n  }\n  if (manifest === void 0) {\n    manifest = {};\n  }\n  return routes.map((route, index) => {\n    let treePath = [...parentPath, String(index)];\n    let id = typeof route.id === \"string\" ? route.id : treePath.join(\"-\");\n    invariant(route.index !== true || !route.children, \"Cannot specify children on an index route\");\n    invariant(!manifest[id], \"Found a route id collision on id \\\"\" + id + \"\\\".  Route \" + \"id's must be globally unique within Data Router usages\");\n    if (isIndexRoute(route)) {\n      let indexRoute = _extends({}, route, mapRouteProperties(route), {\n        id\n      });\n      manifest[id] = indexRoute;\n      return indexRoute;\n    } else {\n      let pathOrLayoutRoute = _extends({}, route, mapRouteProperties(route), {\n        id,\n        children: undefined\n      });\n      manifest[id] = pathOrLayoutRoute;\n      if (route.children) {\n        pathOrLayoutRoute.children = convertRoutesToDataRoutes(route.children, mapRouteProperties, treePath, manifest);\n      }\n      return pathOrLayoutRoute;\n    }\n  });\n}\n/**\n * Matches the given routes to a location and returns the match data.\n *\n * @see https://reactrouter.com/v6/utils/match-routes\n */\nfunction matchRoutes(routes, locationArg, basename) {\n  if (basename === void 0) {\n    basename = \"/\";\n  }\n  return matchRoutesImpl(routes, locationArg, basename, false);\n}\nfunction matchRoutesImpl(routes, locationArg, basename, allowPartial) {\n  let location = typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n  let pathname = stripBasename(location.pathname || \"/\", basename);\n  if (pathname == null) {\n    return null;\n  }\n  let branches = flattenRoutes(routes);\n  rankRouteBranches(branches);\n  let matches = null;\n  for (let i = 0; matches == null && i < branches.length; ++i) {\n    // Incoming pathnames are generally encoded from either window.location\n    // or from router.navigate, but we want to match against the unencoded\n    // paths in the route definitions.  Memory router locations won't be\n    // encoded here but there also shouldn't be anything to decode so this\n    // should be a safe operation.  This avoids needing matchRoutes to be\n    // history-aware.\n    let decoded = decodePath(pathname);\n    matches = matchRouteBranch(branches[i], decoded, allowPartial);\n  }\n  return matches;\n}\nfunction convertRouteMatchToUiMatch(match, loaderData) {\n  let {\n    route,\n    pathname,\n    params\n  } = match;\n  return {\n    id: route.id,\n    pathname,\n    params,\n    data: loaderData[route.id],\n    handle: route.handle\n  };\n}\nfunction flattenRoutes(routes, branches, parentsMeta, parentPath) {\n  if (branches === void 0) {\n    branches = [];\n  }\n  if (parentsMeta === void 0) {\n    parentsMeta = [];\n  }\n  if (parentPath === void 0) {\n    parentPath = \"\";\n  }\n  let flattenRoute = (route, index, relativePath) => {\n    let meta = {\n      relativePath: relativePath === undefined ? route.path || \"\" : relativePath,\n      caseSensitive: route.caseSensitive === true,\n      childrenIndex: index,\n      route\n    };\n    if (meta.relativePath.startsWith(\"/\")) {\n      invariant(meta.relativePath.startsWith(parentPath), \"Absolute route path \\\"\" + meta.relativePath + \"\\\" nested under path \" + (\"\\\"\" + parentPath + \"\\\" is not valid. An absolute child route path \") + \"must start with the combined path of all its parent routes.\");\n      meta.relativePath = meta.relativePath.slice(parentPath.length);\n    }\n    let path = joinPaths([parentPath, meta.relativePath]);\n    let routesMeta = parentsMeta.concat(meta);\n    // Add the children before adding this route to the array, so we traverse the\n    // route tree depth-first and child routes appear before their parents in\n    // the \"flattened\" version.\n    if (route.children && route.children.length > 0) {\n      invariant(\n      // Our types know better, but runtime JS may not!\n      // @ts-expect-error\n      route.index !== true, \"Index routes must not have child routes. Please remove \" + (\"all child routes from route path \\\"\" + path + \"\\\".\"));\n      flattenRoutes(route.children, branches, routesMeta, path);\n    }\n    // Routes without a path shouldn't ever match by themselves unless they are\n    // index routes, so don't add them to the list of possible branches.\n    if (route.path == null && !route.index) {\n      return;\n    }\n    branches.push({\n      path,\n      score: computeScore(path, route.index),\n      routesMeta\n    });\n  };\n  routes.forEach((route, index) => {\n    var _route$path;\n    // coarse-grain check for optional params\n    if (route.path === \"\" || !((_route$path = route.path) != null && _route$path.includes(\"?\"))) {\n      flattenRoute(route, index);\n    } else {\n      for (let exploded of explodeOptionalSegments(route.path)) {\n        flattenRoute(route, index, exploded);\n      }\n    }\n  });\n  return branches;\n}\n/**\n * Computes all combinations of optional path segments for a given path,\n * excluding combinations that are ambiguous and of lower priority.\n *\n * For example, `/one/:two?/three/:four?/:five?` explodes to:\n * - `/one/three`\n * - `/one/:two/three`\n * - `/one/three/:four`\n * - `/one/three/:five`\n * - `/one/:two/three/:four`\n * - `/one/:two/three/:five`\n * - `/one/three/:four/:five`\n * - `/one/:two/three/:four/:five`\n */\nfunction explodeOptionalSegments(path) {\n  let segments = path.split(\"/\");\n  if (segments.length === 0) return [];\n  let [first, ...rest] = segments;\n  // Optional path segments are denoted by a trailing `?`\n  let isOptional = first.endsWith(\"?\");\n  // Compute the corresponding required segment: `foo?` -> `foo`\n  let required = first.replace(/\\?$/, \"\");\n  if (rest.length === 0) {\n    // Intepret empty string as omitting an optional segment\n    // `[\"one\", \"\", \"three\"]` corresponds to omitting `:two` from `/one/:two?/three` -> `/one/three`\n    return isOptional ? [required, \"\"] : [required];\n  }\n  let restExploded = explodeOptionalSegments(rest.join(\"/\"));\n  let result = [];\n  // All child paths with the prefix.  Do this for all children before the\n  // optional version for all children, so we get consistent ordering where the\n  // parent optional aspect is preferred as required.  Otherwise, we can get\n  // child sections interspersed where deeper optional segments are higher than\n  // parent optional segments, where for example, /:two would explode _earlier_\n  // then /:one.  By always including the parent as required _for all children_\n  // first, we avoid this issue\n  result.push(...restExploded.map(subpath => subpath === \"\" ? required : [required, subpath].join(\"/\")));\n  // Then, if this is an optional value, add all child versions without\n  if (isOptional) {\n    result.push(...restExploded);\n  }\n  // for absolute paths, ensure `/` instead of empty segment\n  return result.map(exploded => path.startsWith(\"/\") && exploded === \"\" ? \"/\" : exploded);\n}\nfunction rankRouteBranches(branches) {\n  branches.sort((a, b) => a.score !== b.score ? b.score - a.score // Higher score first\n  : compareIndexes(a.routesMeta.map(meta => meta.childrenIndex), b.routesMeta.map(meta => meta.childrenIndex)));\n}\nconst paramRe = /^:[\\w-]+$/;\nconst dynamicSegmentValue = 3;\nconst indexRouteValue = 2;\nconst emptySegmentValue = 1;\nconst staticSegmentValue = 10;\nconst splatPenalty = -2;\nconst isSplat = s => s === \"*\";\nfunction computeScore(path, index) {\n  let segments = path.split(\"/\");\n  let initialScore = segments.length;\n  if (segments.some(isSplat)) {\n    initialScore += splatPenalty;\n  }\n  if (index) {\n    initialScore += indexRouteValue;\n  }\n  return segments.filter(s => !isSplat(s)).reduce((score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === \"\" ? emptySegmentValue : staticSegmentValue), initialScore);\n}\nfunction compareIndexes(a, b) {\n  let siblings = a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]);\n  return siblings ?\n  // If two routes are siblings, we should try to match the earlier sibling\n  // first. This allows people to have fine-grained control over the matching\n  // behavior by simply putting routes with identical paths in the order they\n  // want them tried.\n  a[a.length - 1] - b[b.length - 1] :\n  // Otherwise, it doesn't really make sense to rank non-siblings by index,\n  // so they sort equally.\n  0;\n}\nfunction matchRouteBranch(branch, pathname, allowPartial) {\n  if (allowPartial === void 0) {\n    allowPartial = false;\n  }\n  let {\n    routesMeta\n  } = branch;\n  let matchedParams = {};\n  let matchedPathname = \"/\";\n  let matches = [];\n  for (let i = 0; i < routesMeta.length; ++i) {\n    let meta = routesMeta[i];\n    let end = i === routesMeta.length - 1;\n    let remainingPathname = matchedPathname === \"/\" ? pathname : pathname.slice(matchedPathname.length) || \"/\";\n    let match = matchPath({\n      path: meta.relativePath,\n      caseSensitive: meta.caseSensitive,\n      end\n    }, remainingPathname);\n    let route = meta.route;\n    if (!match && end && allowPartial && !routesMeta[routesMeta.length - 1].route.index) {\n      match = matchPath({\n        path: meta.relativePath,\n        caseSensitive: meta.caseSensitive,\n        end: false\n      }, remainingPathname);\n    }\n    if (!match) {\n      return null;\n    }\n    Object.assign(matchedParams, match.params);\n    matches.push({\n      // TODO: Can this as be avoided?\n      params: matchedParams,\n      pathname: joinPaths([matchedPathname, match.pathname]),\n      pathnameBase: normalizePathname(joinPaths([matchedPathname, match.pathnameBase])),\n      route\n    });\n    if (match.pathnameBase !== \"/\") {\n      matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);\n    }\n  }\n  return matches;\n}\n/**\n * Returns a path with params interpolated.\n *\n * @see https://reactrouter.com/v6/utils/generate-path\n */\nfunction generatePath(originalPath, params) {\n  if (params === void 0) {\n    params = {};\n  }\n  let path = originalPath;\n  if (path.endsWith(\"*\") && path !== \"*\" && !path.endsWith(\"/*\")) {\n    warning(false, \"Route path \\\"\" + path + \"\\\" will be treated as if it were \" + (\"\\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\" because the `*` character must \") + \"always follow a `/` in the pattern. To get rid of this warning, \" + (\"please change the route path to \\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\".\"));\n    path = path.replace(/\\*$/, \"/*\");\n  }\n  // ensure `/` is added at the beginning if the path is absolute\n  const prefix = path.startsWith(\"/\") ? \"/\" : \"\";\n  const stringify = p => p == null ? \"\" : typeof p === \"string\" ? p : String(p);\n  const segments = path.split(/\\/+/).map((segment, index, array) => {\n    const isLastSegment = index === array.length - 1;\n    // only apply the splat if it's the last segment\n    if (isLastSegment && segment === \"*\") {\n      const star = \"*\";\n      // Apply the splat\n      return stringify(params[star]);\n    }\n    const keyMatch = segment.match(/^:([\\w-]+)(\\??)$/);\n    if (keyMatch) {\n      const [, key, optional] = keyMatch;\n      let param = params[key];\n      invariant(optional === \"?\" || param != null, \"Missing \\\":\" + key + \"\\\" param\");\n      return stringify(param);\n    }\n    // Remove any optional markers from optional static segments\n    return segment.replace(/\\?$/g, \"\");\n  })\n  // Remove empty segments\n  .filter(segment => !!segment);\n  return prefix + segments.join(\"/\");\n}\n/**\n * Performs pattern matching on a URL pathname and returns information about\n * the match.\n *\n * @see https://reactrouter.com/v6/utils/match-path\n */\nfunction matchPath(pattern, pathname) {\n  if (typeof pattern === \"string\") {\n    pattern = {\n      path: pattern,\n      caseSensitive: false,\n      end: true\n    };\n  }\n  let [matcher, compiledParams] = compilePath(pattern.path, pattern.caseSensitive, pattern.end);\n  let match = pathname.match(matcher);\n  if (!match) return null;\n  let matchedPathname = match[0];\n  let pathnameBase = matchedPathname.replace(/(.)\\/+$/, \"$1\");\n  let captureGroups = match.slice(1);\n  let params = compiledParams.reduce((memo, _ref, index) => {\n    let {\n      paramName,\n      isOptional\n    } = _ref;\n    // We need to compute the pathnameBase here using the raw splat value\n    // instead of using params[\"*\"] later because it will be decoded then\n    if (paramName === \"*\") {\n      let splatValue = captureGroups[index] || \"\";\n      pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\\/+$/, \"$1\");\n    }\n    const value = captureGroups[index];\n    if (isOptional && !value) {\n      memo[paramName] = undefined;\n    } else {\n      memo[paramName] = (value || \"\").replace(/%2F/g, \"/\");\n    }\n    return memo;\n  }, {});\n  return {\n    params,\n    pathname: matchedPathname,\n    pathnameBase,\n    pattern\n  };\n}\nfunction compilePath(path, caseSensitive, end) {\n  if (caseSensitive === void 0) {\n    caseSensitive = false;\n  }\n  if (end === void 0) {\n    end = true;\n  }\n  warning(path === \"*\" || !path.endsWith(\"*\") || path.endsWith(\"/*\"), \"Route path \\\"\" + path + \"\\\" will be treated as if it were \" + (\"\\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\" because the `*` character must \") + \"always follow a `/` in the pattern. To get rid of this warning, \" + (\"please change the route path to \\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\".\"));\n  let params = [];\n  let regexpSource = \"^\" + path.replace(/\\/*\\*?$/, \"\") // Ignore trailing / and /*, we'll handle it below\n  .replace(/^\\/*/, \"/\") // Make sure it has a leading /\n  .replace(/[\\\\.*+^${}|()[\\]]/g, \"\\\\$&\") // Escape special regex chars\n  .replace(/\\/:([\\w-]+)(\\?)?/g, (_, paramName, isOptional) => {\n    params.push({\n      paramName,\n      isOptional: isOptional != null\n    });\n    return isOptional ? \"/?([^\\\\/]+)?\" : \"/([^\\\\/]+)\";\n  });\n  if (path.endsWith(\"*\")) {\n    params.push({\n      paramName: \"*\"\n    });\n    regexpSource += path === \"*\" || path === \"/*\" ? \"(.*)$\" // Already matched the initial /, just match the rest\n    : \"(?:\\\\/(.+)|\\\\/*)$\"; // Don't include the / in params[\"*\"]\n  } else if (end) {\n    // When matching to the end, ignore trailing slashes\n    regexpSource += \"\\\\/*$\";\n  } else if (path !== \"\" && path !== \"/\") {\n    // If our path is non-empty and contains anything beyond an initial slash,\n    // then we have _some_ form of path in our regex, so we should expect to\n    // match only if we find the end of this path segment.  Look for an optional\n    // non-captured trailing slash (to match a portion of the URL) or the end\n    // of the path (if we've matched to the end).  We used to do this with a\n    // word boundary but that gives false positives on routes like\n    // /user-preferences since `-` counts as a word boundary.\n    regexpSource += \"(?:(?=\\\\/|$))\";\n  } else ;\n  let matcher = new RegExp(regexpSource, caseSensitive ? undefined : \"i\");\n  return [matcher, params];\n}\nfunction decodePath(value) {\n  try {\n    return value.split(\"/\").map(v => decodeURIComponent(v).replace(/\\//g, \"%2F\")).join(\"/\");\n  } catch (error) {\n    warning(false, \"The URL path \\\"\" + value + \"\\\" could not be decoded because it is is a \" + \"malformed URL segment. This is probably due to a bad percent \" + (\"encoding (\" + error + \").\"));\n    return value;\n  }\n}\n/**\n * @private\n */\nfunction stripBasename(pathname, basename) {\n  if (basename === \"/\") return pathname;\n  if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {\n    return null;\n  }\n  // We want to leave trailing slash behavior in the user's control, so if they\n  // specify a basename with a trailing slash, we should support it\n  let startIndex = basename.endsWith(\"/\") ? basename.length - 1 : basename.length;\n  let nextChar = pathname.charAt(startIndex);\n  if (nextChar && nextChar !== \"/\") {\n    // pathname does not start with basename/\n    return null;\n  }\n  return pathname.slice(startIndex) || \"/\";\n}\n/**\n * Returns a resolved path object relative to the given pathname.\n *\n * @see https://reactrouter.com/v6/utils/resolve-path\n */\nfunction resolvePath(to, fromPathname) {\n  if (fromPathname === void 0) {\n    fromPathname = \"/\";\n  }\n  let {\n    pathname: toPathname,\n    search = \"\",\n    hash = \"\"\n  } = typeof to === \"string\" ? parsePath(to) : to;\n  let pathname = toPathname ? toPathname.startsWith(\"/\") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;\n  return {\n    pathname,\n    search: normalizeSearch(search),\n    hash: normalizeHash(hash)\n  };\n}\nfunction resolvePathname(relativePath, fromPathname) {\n  let segments = fromPathname.replace(/\\/+$/, \"\").split(\"/\");\n  let relativeSegments = relativePath.split(\"/\");\n  relativeSegments.forEach(segment => {\n    if (segment === \"..\") {\n      // Keep the root \"\" segment so the pathname starts at /\n      if (segments.length > 1) segments.pop();\n    } else if (segment !== \".\") {\n      segments.push(segment);\n    }\n  });\n  return segments.length > 1 ? segments.join(\"/\") : \"/\";\n}\nfunction getInvalidPathError(char, field, dest, path) {\n  return \"Cannot include a '\" + char + \"' character in a manually specified \" + (\"`to.\" + field + \"` field [\" + JSON.stringify(path) + \"].  Please separate it out to the \") + (\"`to.\" + dest + \"` field. Alternatively you may provide the full path as \") + \"a string in <Link to=\\\"...\\\"> and the router will parse it for you.\";\n}\n/**\n * @private\n *\n * When processing relative navigation we want to ignore ancestor routes that\n * do not contribute to the path, such that index/pathless layout routes don't\n * interfere.\n *\n * For example, when moving a route element into an index route and/or a\n * pathless layout route, relative link behavior contained within should stay\n * the same.  Both of the following examples should link back to the root:\n *\n *   <Route path=\"/\">\n *     <Route path=\"accounts\" element={<Link to=\"..\"}>\n *   </Route>\n *\n *   <Route path=\"/\">\n *     <Route path=\"accounts\">\n *       <Route element={<AccountsLayout />}>       // <-- Does not contribute\n *         <Route index element={<Link to=\"..\"} />  // <-- Does not contribute\n *       </Route\n *     </Route>\n *   </Route>\n */\nfunction getPathContributingMatches(matches) {\n  return matches.filter((match, index) => index === 0 || match.route.path && match.route.path.length > 0);\n}\n// Return the array of pathnames for the current route matches - used to\n// generate the routePathnames input for resolveTo()\nfunction getResolveToMatches(matches, v7_relativeSplatPath) {\n  let pathMatches = getPathContributingMatches(matches);\n  // When v7_relativeSplatPath is enabled, use the full pathname for the leaf\n  // match so we include splat values for \".\" links.  See:\n  // https://github.com/remix-run/react-router/issues/11052#issuecomment-1836589329\n  if (v7_relativeSplatPath) {\n    return pathMatches.map((match, idx) => idx === pathMatches.length - 1 ? match.pathname : match.pathnameBase);\n  }\n  return pathMatches.map(match => match.pathnameBase);\n}\n/**\n * @private\n */\nfunction resolveTo(toArg, routePathnames, locationPathname, isPathRelative) {\n  if (isPathRelative === void 0) {\n    isPathRelative = false;\n  }\n  let to;\n  if (typeof toArg === \"string\") {\n    to = parsePath(toArg);\n  } else {\n    to = _extends({}, toArg);\n    invariant(!to.pathname || !to.pathname.includes(\"?\"), getInvalidPathError(\"?\", \"pathname\", \"search\", to));\n    invariant(!to.pathname || !to.pathname.includes(\"#\"), getInvalidPathError(\"#\", \"pathname\", \"hash\", to));\n    invariant(!to.search || !to.search.includes(\"#\"), getInvalidPathError(\"#\", \"search\", \"hash\", to));\n  }\n  let isEmptyPath = toArg === \"\" || to.pathname === \"\";\n  let toPathname = isEmptyPath ? \"/\" : to.pathname;\n  let from;\n  // Routing is relative to the current pathname if explicitly requested.\n  //\n  // If a pathname is explicitly provided in `to`, it should be relative to the\n  // route context. This is explained in `Note on `<Link to>` values` in our\n  // migration guide from v5 as a means of disambiguation between `to` values\n  // that begin with `/` and those that do not. However, this is problematic for\n  // `to` values that do not provide a pathname. `to` can simply be a search or\n  // hash string, in which case we should assume that the navigation is relative\n  // to the current location's pathname and *not* the route pathname.\n  if (toPathname == null) {\n    from = locationPathname;\n  } else {\n    let routePathnameIndex = routePathnames.length - 1;\n    // With relative=\"route\" (the default), each leading .. segment means\n    // \"go up one route\" instead of \"go up one URL segment\".  This is a key\n    // difference from how <a href> works and a major reason we call this a\n    // \"to\" value instead of a \"href\".\n    if (!isPathRelative && toPathname.startsWith(\"..\")) {\n      let toSegments = toPathname.split(\"/\");\n      while (toSegments[0] === \"..\") {\n        toSegments.shift();\n        routePathnameIndex -= 1;\n      }\n      to.pathname = toSegments.join(\"/\");\n    }\n    from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : \"/\";\n  }\n  let path = resolvePath(to, from);\n  // Ensure the pathname has a trailing slash if the original \"to\" had one\n  let hasExplicitTrailingSlash = toPathname && toPathname !== \"/\" && toPathname.endsWith(\"/\");\n  // Or if this was a link to the current path which has a trailing slash\n  let hasCurrentTrailingSlash = (isEmptyPath || toPathname === \".\") && locationPathname.endsWith(\"/\");\n  if (!path.pathname.endsWith(\"/\") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) {\n    path.pathname += \"/\";\n  }\n  return path;\n}\n/**\n * @private\n */\nfunction getToPathname(to) {\n  // Empty strings should be treated the same as / paths\n  return to === \"\" || to.pathname === \"\" ? \"/\" : typeof to === \"string\" ? parsePath(to).pathname : to.pathname;\n}\n/**\n * @private\n */\nconst joinPaths = paths => paths.join(\"/\").replace(/\\/\\/+/g, \"/\");\n/**\n * @private\n */\nconst normalizePathname = pathname => pathname.replace(/\\/+$/, \"\").replace(/^\\/*/, \"/\");\n/**\n * @private\n */\nconst normalizeSearch = search => !search || search === \"?\" ? \"\" : search.startsWith(\"?\") ? search : \"?\" + search;\n/**\n * @private\n */\nconst normalizeHash = hash => !hash || hash === \"#\" ? \"\" : hash.startsWith(\"#\") ? hash : \"#\" + hash;\n/**\n * This is a shortcut for creating `application/json` responses. Converts `data`\n * to JSON and sets the `Content-Type` header.\n *\n * @deprecated The `json` method is deprecated in favor of returning raw objects.\n * This method will be removed in v7.\n */\nconst json = function json(data, init) {\n  if (init === void 0) {\n    init = {};\n  }\n  let responseInit = typeof init === \"number\" ? {\n    status: init\n  } : init;\n  let headers = new Headers(responseInit.headers);\n  if (!headers.has(\"Content-Type\")) {\n    headers.set(\"Content-Type\", \"application/json; charset=utf-8\");\n  }\n  return new Response(JSON.stringify(data), _extends({}, responseInit, {\n    headers\n  }));\n};\nclass DataWithResponseInit {\n  constructor(data, init) {\n    this.type = \"DataWithResponseInit\";\n    this.data = data;\n    this.init = init || null;\n  }\n}\n/**\n * Create \"responses\" that contain `status`/`headers` without forcing\n * serialization into an actual `Response` - used by Remix single fetch\n */\nfunction data(data, init) {\n  return new DataWithResponseInit(data, typeof init === \"number\" ? {\n    status: init\n  } : init);\n}\nclass AbortedDeferredError extends Error {}\nclass DeferredData {\n  constructor(data, responseInit) {\n    this.pendingKeysSet = new Set();\n    this.subscribers = new Set();\n    this.deferredKeys = [];\n    invariant(data && typeof data === \"object\" && !Array.isArray(data), \"defer() only accepts plain objects\");\n    // Set up an AbortController + Promise we can race against to exit early\n    // cancellation\n    let reject;\n    this.abortPromise = new Promise((_, r) => reject = r);\n    this.controller = new AbortController();\n    let onAbort = () => reject(new AbortedDeferredError(\"Deferred data aborted\"));\n    this.unlistenAbortSignal = () => this.controller.signal.removeEventListener(\"abort\", onAbort);\n    this.controller.signal.addEventListener(\"abort\", onAbort);\n    this.data = Object.entries(data).reduce((acc, _ref2) => {\n      let [key, value] = _ref2;\n      return Object.assign(acc, {\n        [key]: this.trackPromise(key, value)\n      });\n    }, {});\n    if (this.done) {\n      // All incoming values were resolved\n      this.unlistenAbortSignal();\n    }\n    this.init = responseInit;\n  }\n  trackPromise(key, value) {\n    if (!(value instanceof Promise)) {\n      return value;\n    }\n    this.deferredKeys.push(key);\n    this.pendingKeysSet.add(key);\n    // We store a little wrapper promise that will be extended with\n    // _data/_error props upon resolve/reject\n    let promise = Promise.race([value, this.abortPromise]).then(data => this.onSettle(promise, key, undefined, data), error => this.onSettle(promise, key, error));\n    // Register rejection listeners to avoid uncaught promise rejections on\n    // errors or aborted deferred values\n    promise.catch(() => {});\n    Object.defineProperty(promise, \"_tracked\", {\n      get: () => true\n    });\n    return promise;\n  }\n  onSettle(promise, key, error, data) {\n    if (this.controller.signal.aborted && error instanceof AbortedDeferredError) {\n      this.unlistenAbortSignal();\n      Object.defineProperty(promise, \"_error\", {\n        get: () => error\n      });\n      return Promise.reject(error);\n    }\n    this.pendingKeysSet.delete(key);\n    if (this.done) {\n      // Nothing left to abort!\n      this.unlistenAbortSignal();\n    }\n    // If the promise was resolved/rejected with undefined, we'll throw an error as you\n    // should always resolve with a value or null\n    if (error === undefined && data === undefined) {\n      let undefinedError = new Error(\"Deferred data for key \\\"\" + key + \"\\\" resolved/rejected with `undefined`, \" + \"you must resolve/reject with a value or `null`.\");\n      Object.defineProperty(promise, \"_error\", {\n        get: () => undefinedError\n      });\n      this.emit(false, key);\n      return Promise.reject(undefinedError);\n    }\n    if (data === undefined) {\n      Object.defineProperty(promise, \"_error\", {\n        get: () => error\n      });\n      this.emit(false, key);\n      return Promise.reject(error);\n    }\n    Object.defineProperty(promise, \"_data\", {\n      get: () => data\n    });\n    this.emit(false, key);\n    return data;\n  }\n  emit(aborted, settledKey) {\n    this.subscribers.forEach(subscriber => subscriber(aborted, settledKey));\n  }\n  subscribe(fn) {\n    this.subscribers.add(fn);\n    return () => this.subscribers.delete(fn);\n  }\n  cancel() {\n    this.controller.abort();\n    this.pendingKeysSet.forEach((v, k) => this.pendingKeysSet.delete(k));\n    this.emit(true);\n  }\n  async resolveData(signal) {\n    let aborted = false;\n    if (!this.done) {\n      let onAbort = () => this.cancel();\n      signal.addEventListener(\"abort\", onAbort);\n      aborted = await new Promise(resolve => {\n        this.subscribe(aborted => {\n          signal.removeEventListener(\"abort\", onAbort);\n          if (aborted || this.done) {\n            resolve(aborted);\n          }\n        });\n      });\n    }\n    return aborted;\n  }\n  get done() {\n    return this.pendingKeysSet.size === 0;\n  }\n  get unwrappedData() {\n    invariant(this.data !== null && this.done, \"Can only unwrap data on initialized and settled deferreds\");\n    return Object.entries(this.data).reduce((acc, _ref3) => {\n      let [key, value] = _ref3;\n      return Object.assign(acc, {\n        [key]: unwrapTrackedPromise(value)\n      });\n    }, {});\n  }\n  get pendingKeys() {\n    return Array.from(this.pendingKeysSet);\n  }\n}\nfunction isTrackedPromise(value) {\n  return value instanceof Promise && value._tracked === true;\n}\nfunction unwrapTrackedPromise(value) {\n  if (!isTrackedPromise(value)) {\n    return value;\n  }\n  if (value._error) {\n    throw value._error;\n  }\n  return value._data;\n}\n/**\n * @deprecated The `defer` method is deprecated in favor of returning raw\n * objects. This method will be removed in v7.\n */\nconst defer = function defer(data, init) {\n  if (init === void 0) {\n    init = {};\n  }\n  let responseInit = typeof init === \"number\" ? {\n    status: init\n  } : init;\n  return new DeferredData(data, responseInit);\n};\n/**\n * A redirect response. Sets the status code and the `Location` header.\n * Defaults to \"302 Found\".\n */\nconst redirect = function redirect(url, init) {\n  if (init === void 0) {\n    init = 302;\n  }\n  let responseInit = init;\n  if (typeof responseInit === \"number\") {\n    responseInit = {\n      status: responseInit\n    };\n  } else if (typeof responseInit.status === \"undefined\") {\n    responseInit.status = 302;\n  }\n  let headers = new Headers(responseInit.headers);\n  headers.set(\"Location\", url);\n  return new Response(null, _extends({}, responseInit, {\n    headers\n  }));\n};\n/**\n * A redirect response that will force a document reload to the new location.\n * Sets the status code and the `Location` header.\n * Defaults to \"302 Found\".\n */\nconst redirectDocument = (url, init) => {\n  let response = redirect(url, init);\n  response.headers.set(\"X-Remix-Reload-Document\", \"true\");\n  return response;\n};\n/**\n * A redirect response that will perform a `history.replaceState` instead of a\n * `history.pushState` for client-side navigation redirects.\n * Sets the status code and the `Location` header.\n * Defaults to \"302 Found\".\n */\nconst replace = (url, init) => {\n  let response = redirect(url, init);\n  response.headers.set(\"X-Remix-Replace\", \"true\");\n  return response;\n};\n/**\n * @private\n * Utility class we use to hold auto-unwrapped 4xx/5xx Response bodies\n *\n * We don't export the class for public use since it's an implementation\n * detail, but we export the interface above so folks can build their own\n * abstractions around instances via isRouteErrorResponse()\n */\nclass ErrorResponseImpl {\n  constructor(status, statusText, data, internal) {\n    if (internal === void 0) {\n      internal = false;\n    }\n    this.status = status;\n    this.statusText = statusText || \"\";\n    this.internal = internal;\n    if (data instanceof Error) {\n      this.data = data.toString();\n      this.error = data;\n    } else {\n      this.data = data;\n    }\n  }\n}\n/**\n * Check if the given error is an ErrorResponse generated from a 4xx/5xx\n * Response thrown from an action/loader\n */\nfunction isRouteErrorResponse(error) {\n  return error != null && typeof error.status === \"number\" && typeof error.statusText === \"string\" && typeof error.internal === \"boolean\" && \"data\" in error;\n}\n\nconst validMutationMethodsArr = [\"post\", \"put\", \"patch\", \"delete\"];\nconst validMutationMethods = new Set(validMutationMethodsArr);\nconst validRequestMethodsArr = [\"get\", ...validMutationMethodsArr];\nconst validRequestMethods = new Set(validRequestMethodsArr);\nconst redirectStatusCodes = new Set([301, 302, 303, 307, 308]);\nconst redirectPreserveMethodStatusCodes = new Set([307, 308]);\nconst IDLE_NAVIGATION = {\n  state: \"idle\",\n  location: undefined,\n  formMethod: undefined,\n  formAction: undefined,\n  formEncType: undefined,\n  formData: undefined,\n  json: undefined,\n  text: undefined\n};\nconst IDLE_FETCHER = {\n  state: \"idle\",\n  data: undefined,\n  formMethod: undefined,\n  formAction: undefined,\n  formEncType: undefined,\n  formData: undefined,\n  json: undefined,\n  text: undefined\n};\nconst IDLE_BLOCKER = {\n  state: \"unblocked\",\n  proceed: undefined,\n  reset: undefined,\n  location: undefined\n};\nconst ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i;\nconst defaultMapRouteProperties = route => ({\n  hasErrorBoundary: Boolean(route.hasErrorBoundary)\n});\nconst TRANSITIONS_STORAGE_KEY = \"remix-router-transitions\";\n//#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region createRouter\n////////////////////////////////////////////////////////////////////////////////\n/**\n * Create a router and listen to history POP navigations\n */\nfunction createRouter(init) {\n  const routerWindow = init.window ? init.window : typeof window !== \"undefined\" ? window : undefined;\n  const isBrowser = typeof routerWindow !== \"undefined\" && typeof routerWindow.document !== \"undefined\" && typeof routerWindow.document.createElement !== \"undefined\";\n  const isServer = !isBrowser;\n  invariant(init.routes.length > 0, \"You must provide a non-empty routes array to createRouter\");\n  let mapRouteProperties;\n  if (init.mapRouteProperties) {\n    mapRouteProperties = init.mapRouteProperties;\n  } else if (init.detectErrorBoundary) {\n    // If they are still using the deprecated version, wrap it with the new API\n    let detectErrorBoundary = init.detectErrorBoundary;\n    mapRouteProperties = route => ({\n      hasErrorBoundary: detectErrorBoundary(route)\n    });\n  } else {\n    mapRouteProperties = defaultMapRouteProperties;\n  }\n  // Routes keyed by ID\n  let manifest = {};\n  // Routes in tree format for matching\n  let dataRoutes = convertRoutesToDataRoutes(init.routes, mapRouteProperties, undefined, manifest);\n  let inFlightDataRoutes;\n  let basename = init.basename || \"/\";\n  let dataStrategyImpl = init.dataStrategy || defaultDataStrategy;\n  let patchRoutesOnNavigationImpl = init.patchRoutesOnNavigation;\n  // Config driven behavior flags\n  let future = _extends({\n    v7_fetcherPersist: false,\n    v7_normalizeFormMethod: false,\n    v7_partialHydration: false,\n    v7_prependBasename: false,\n    v7_relativeSplatPath: false,\n    v7_skipActionErrorRevalidation: false\n  }, init.future);\n  // Cleanup function for history\n  let unlistenHistory = null;\n  // Externally-provided functions to call on all state changes\n  let subscribers = new Set();\n  // Externally-provided object to hold scroll restoration locations during routing\n  let savedScrollPositions = null;\n  // Externally-provided function to get scroll restoration keys\n  let getScrollRestorationKey = null;\n  // Externally-provided function to get current scroll position\n  let getScrollPosition = null;\n  // One-time flag to control the initial hydration scroll restoration.  Because\n  // we don't get the saved positions from <ScrollRestoration /> until _after_\n  // the initial render, we need to manually trigger a separate updateState to\n  // send along the restoreScrollPosition\n  // Set to true if we have `hydrationData` since we assume we were SSR'd and that\n  // SSR did the initial scroll restoration.\n  let initialScrollRestored = init.hydrationData != null;\n  let initialMatches = matchRoutes(dataRoutes, init.history.location, basename);\n  let initialMatchesIsFOW = false;\n  let initialErrors = null;\n  if (initialMatches == null && !patchRoutesOnNavigationImpl) {\n    // If we do not match a user-provided-route, fall back to the root\n    // to allow the error boundary to take over\n    let error = getInternalRouterError(404, {\n      pathname: init.history.location.pathname\n    });\n    let {\n      matches,\n      route\n    } = getShortCircuitMatches(dataRoutes);\n    initialMatches = matches;\n    initialErrors = {\n      [route.id]: error\n    };\n  }\n  // In SPA apps, if the user provided a patchRoutesOnNavigation implementation and\n  // our initial match is a splat route, clear them out so we run through lazy\n  // discovery on hydration in case there's a more accurate lazy route match.\n  // In SSR apps (with `hydrationData`), we expect that the server will send\n  // up the proper matched routes so we don't want to run lazy discovery on\n  // initial hydration and want to hydrate into the splat route.\n  if (initialMatches && !init.hydrationData) {\n    let fogOfWar = checkFogOfWar(initialMatches, dataRoutes, init.history.location.pathname);\n    if (fogOfWar.active) {\n      initialMatches = null;\n    }\n  }\n  let initialized;\n  if (!initialMatches) {\n    initialized = false;\n    initialMatches = [];\n    // If partial hydration and fog of war is enabled, we will be running\n    // `patchRoutesOnNavigation` during hydration so include any partial matches as\n    // the initial matches so we can properly render `HydrateFallback`'s\n    if (future.v7_partialHydration) {\n      let fogOfWar = checkFogOfWar(null, dataRoutes, init.history.location.pathname);\n      if (fogOfWar.active && fogOfWar.matches) {\n        initialMatchesIsFOW = true;\n        initialMatches = fogOfWar.matches;\n      }\n    }\n  } else if (initialMatches.some(m => m.route.lazy)) {\n    // All initialMatches need to be loaded before we're ready.  If we have lazy\n    // functions around still then we'll need to run them in initialize()\n    initialized = false;\n  } else if (!initialMatches.some(m => m.route.loader)) {\n    // If we've got no loaders to run, then we're good to go\n    initialized = true;\n  } else if (future.v7_partialHydration) {\n    // If partial hydration is enabled, we're initialized so long as we were\n    // provided with hydrationData for every route with a loader, and no loaders\n    // were marked for explicit hydration\n    let loaderData = init.hydrationData ? init.hydrationData.loaderData : null;\n    let errors = init.hydrationData ? init.hydrationData.errors : null;\n    // If errors exist, don't consider routes below the boundary\n    if (errors) {\n      let idx = initialMatches.findIndex(m => errors[m.route.id] !== undefined);\n      initialized = initialMatches.slice(0, idx + 1).every(m => !shouldLoadRouteOnHydration(m.route, loaderData, errors));\n    } else {\n      initialized = initialMatches.every(m => !shouldLoadRouteOnHydration(m.route, loaderData, errors));\n    }\n  } else {\n    // Without partial hydration - we're initialized if we were provided any\n    // hydrationData - which is expected to be complete\n    initialized = init.hydrationData != null;\n  }\n  let router;\n  let state = {\n    historyAction: init.history.action,\n    location: init.history.location,\n    matches: initialMatches,\n    initialized,\n    navigation: IDLE_NAVIGATION,\n    // Don't restore on initial updateState() if we were SSR'd\n    restoreScrollPosition: init.hydrationData != null ? false : null,\n    preventScrollReset: false,\n    revalidation: \"idle\",\n    loaderData: init.hydrationData && init.hydrationData.loaderData || {},\n    actionData: init.hydrationData && init.hydrationData.actionData || null,\n    errors: init.hydrationData && init.hydrationData.errors || initialErrors,\n    fetchers: new Map(),\n    blockers: new Map()\n  };\n  // -- Stateful internal variables to manage navigations --\n  // Current navigation in progress (to be committed in completeNavigation)\n  let pendingAction = Action.Pop;\n  // Should the current navigation prevent the scroll reset if scroll cannot\n  // be restored?\n  let pendingPreventScrollReset = false;\n  // AbortController for the active navigation\n  let pendingNavigationController;\n  // Should the current navigation enable document.startViewTransition?\n  let pendingViewTransitionEnabled = false;\n  // Store applied view transitions so we can apply them on POP\n  let appliedViewTransitions = new Map();\n  // Cleanup function for persisting applied transitions to sessionStorage\n  let removePageHideEventListener = null;\n  // We use this to avoid touching history in completeNavigation if a\n  // revalidation is entirely uninterrupted\n  let isUninterruptedRevalidation = false;\n  // Use this internal flag to force revalidation of all loaders:\n  //  - submissions (completed or interrupted)\n  //  - useRevalidator()\n  //  - X-Remix-Revalidate (from redirect)\n  let isRevalidationRequired = false;\n  // Use this internal array to capture routes that require revalidation due\n  // to a cancelled deferred on action submission\n  let cancelledDeferredRoutes = [];\n  // Use this internal array to capture fetcher loads that were cancelled by an\n  // action navigation and require revalidation\n  let cancelledFetcherLoads = new Set();\n  // AbortControllers for any in-flight fetchers\n  let fetchControllers = new Map();\n  // Track loads based on the order in which they started\n  let incrementingLoadId = 0;\n  // Track the outstanding pending navigation data load to be compared against\n  // the globally incrementing load when a fetcher load lands after a completed\n  // navigation\n  let pendingNavigationLoadId = -1;\n  // Fetchers that triggered data reloads as a result of their actions\n  let fetchReloadIds = new Map();\n  // Fetchers that triggered redirect navigations\n  let fetchRedirectIds = new Set();\n  // Most recent href/match for fetcher.load calls for fetchers\n  let fetchLoadMatches = new Map();\n  // Ref-count mounted fetchers so we know when it's ok to clean them up\n  let activeFetchers = new Map();\n  // Fetchers that have requested a delete when using v7_fetcherPersist,\n  // they'll be officially removed after they return to idle\n  let deletedFetchers = new Set();\n  // Store DeferredData instances for active route matches.  When a\n  // route loader returns defer() we stick one in here.  Then, when a nested\n  // promise resolves we update loaderData.  If a new navigation starts we\n  // cancel active deferreds for eliminated routes.\n  let activeDeferreds = new Map();\n  // Store blocker functions in a separate Map outside of router state since\n  // we don't need to update UI state if they change\n  let blockerFunctions = new Map();\n  // Flag to ignore the next history update, so we can revert the URL change on\n  // a POP navigation that was blocked by the user without touching router state\n  let unblockBlockerHistoryUpdate = undefined;\n  // Initialize the router, all side effects should be kicked off from here.\n  // Implemented as a Fluent API for ease of:\n  //   let router = createRouter(init).initialize();\n  function initialize() {\n    // If history informs us of a POP navigation, start the navigation but do not update\n    // state.  We'll update our own state once the navigation completes\n    unlistenHistory = init.history.listen(_ref => {\n      let {\n        action: historyAction,\n        location,\n        delta\n      } = _ref;\n      // Ignore this event if it was just us resetting the URL from a\n      // blocked POP navigation\n      if (unblockBlockerHistoryUpdate) {\n        unblockBlockerHistoryUpdate();\n        unblockBlockerHistoryUpdate = undefined;\n        return;\n      }\n      warning(blockerFunctions.size === 0 || delta != null, \"You are trying to use a blocker on a POP navigation to a location \" + \"that was not created by @remix-run/router. This will fail silently in \" + \"production. This can happen if you are navigating outside the router \" + \"via `window.history.pushState`/`window.location.hash` instead of using \" + \"router navigation APIs.  This can also happen if you are using \" + \"createHashRouter and the user manually changes the URL.\");\n      let blockerKey = shouldBlockNavigation({\n        currentLocation: state.location,\n        nextLocation: location,\n        historyAction\n      });\n      if (blockerKey && delta != null) {\n        // Restore the URL to match the current UI, but don't update router state\n        let nextHistoryUpdatePromise = new Promise(resolve => {\n          unblockBlockerHistoryUpdate = resolve;\n        });\n        init.history.go(delta * -1);\n        // Put the blocker into a blocked state\n        updateBlocker(blockerKey, {\n          state: \"blocked\",\n          location,\n          proceed() {\n            updateBlocker(blockerKey, {\n              state: \"proceeding\",\n              proceed: undefined,\n              reset: undefined,\n              location\n            });\n            // Re-do the same POP navigation we just blocked, after the url\n            // restoration is also complete.  See:\n            // https://github.com/remix-run/react-router/issues/11613\n            nextHistoryUpdatePromise.then(() => init.history.go(delta));\n          },\n          reset() {\n            let blockers = new Map(state.blockers);\n            blockers.set(blockerKey, IDLE_BLOCKER);\n            updateState({\n              blockers\n            });\n          }\n        });\n        return;\n      }\n      return startNavigation(historyAction, location);\n    });\n    if (isBrowser) {\n      // FIXME: This feels gross.  How can we cleanup the lines between\n      // scrollRestoration/appliedTransitions persistance?\n      restoreAppliedTransitions(routerWindow, appliedViewTransitions);\n      let _saveAppliedTransitions = () => persistAppliedTransitions(routerWindow, appliedViewTransitions);\n      routerWindow.addEventListener(\"pagehide\", _saveAppliedTransitions);\n      removePageHideEventListener = () => routerWindow.removeEventListener(\"pagehide\", _saveAppliedTransitions);\n    }\n    // Kick off initial data load if needed.  Use Pop to avoid modifying history\n    // Note we don't do any handling of lazy here.  For SPA's it'll get handled\n    // in the normal navigation flow.  For SSR it's expected that lazy modules are\n    // resolved prior to router creation since we can't go into a fallbackElement\n    // UI for SSR'd apps\n    if (!state.initialized) {\n      startNavigation(Action.Pop, state.location, {\n        initialHydration: true\n      });\n    }\n    return router;\n  }\n  // Clean up a router and it's side effects\n  function dispose() {\n    if (unlistenHistory) {\n      unlistenHistory();\n    }\n    if (removePageHideEventListener) {\n      removePageHideEventListener();\n    }\n    subscribers.clear();\n    pendingNavigationController && pendingNavigationController.abort();\n    state.fetchers.forEach((_, key) => deleteFetcher(key));\n    state.blockers.forEach((_, key) => deleteBlocker(key));\n  }\n  // Subscribe to state updates for the router\n  function subscribe(fn) {\n    subscribers.add(fn);\n    return () => subscribers.delete(fn);\n  }\n  // Update our state and notify the calling context of the change\n  function updateState(newState, opts) {\n    if (opts === void 0) {\n      opts = {};\n    }\n    state = _extends({}, state, newState);\n    // Prep fetcher cleanup so we can tell the UI which fetcher data entries\n    // can be removed\n    let completedFetchers = [];\n    let deletedFetchersKeys = [];\n    if (future.v7_fetcherPersist) {\n      state.fetchers.forEach((fetcher, key) => {\n        if (fetcher.state === \"idle\") {\n          if (deletedFetchers.has(key)) {\n            // Unmounted from the UI and can be totally removed\n            deletedFetchersKeys.push(key);\n          } else {\n            // Returned to idle but still mounted in the UI, so semi-remains for\n            // revalidations and such\n            completedFetchers.push(key);\n          }\n        }\n      });\n    }\n    // Remove any lingering deleted fetchers that have already been removed\n    // from state.fetchers\n    deletedFetchers.forEach(key => {\n      if (!state.fetchers.has(key) && !fetchControllers.has(key)) {\n        deletedFetchersKeys.push(key);\n      }\n    });\n    // Iterate over a local copy so that if flushSync is used and we end up\n    // removing and adding a new subscriber due to the useCallback dependencies,\n    // we don't get ourselves into a loop calling the new subscriber immediately\n    [...subscribers].forEach(subscriber => subscriber(state, {\n      deletedFetchers: deletedFetchersKeys,\n      viewTransitionOpts: opts.viewTransitionOpts,\n      flushSync: opts.flushSync === true\n    }));\n    // Remove idle fetchers from state since we only care about in-flight fetchers.\n    if (future.v7_fetcherPersist) {\n      completedFetchers.forEach(key => state.fetchers.delete(key));\n      deletedFetchersKeys.forEach(key => deleteFetcher(key));\n    } else {\n      // We already called deleteFetcher() on these, can remove them from this\n      // Set now that we've handed the keys off to the data layer\n      deletedFetchersKeys.forEach(key => deletedFetchers.delete(key));\n    }\n  }\n  // Complete a navigation returning the state.navigation back to the IDLE_NAVIGATION\n  // and setting state.[historyAction/location/matches] to the new route.\n  // - Location is a required param\n  // - Navigation will always be set to IDLE_NAVIGATION\n  // - Can pass any other state in newState\n  function completeNavigation(location, newState, _temp) {\n    var _location$state, _location$state2;\n    let {\n      flushSync\n    } = _temp === void 0 ? {} : _temp;\n    // Deduce if we're in a loading/actionReload state:\n    // - We have committed actionData in the store\n    // - The current navigation was a mutation submission\n    // - We're past the submitting state and into the loading state\n    // - The location being loaded is not the result of a redirect\n    let isActionReload = state.actionData != null && state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && state.navigation.state === \"loading\" && ((_location$state = location.state) == null ? void 0 : _location$state._isRedirect) !== true;\n    let actionData;\n    if (newState.actionData) {\n      if (Object.keys(newState.actionData).length > 0) {\n        actionData = newState.actionData;\n      } else {\n        // Empty actionData -> clear prior actionData due to an action error\n        actionData = null;\n      }\n    } else if (isActionReload) {\n      // Keep the current data if we're wrapping up the action reload\n      actionData = state.actionData;\n    } else {\n      // Clear actionData on any other completed navigations\n      actionData = null;\n    }\n    // Always preserve any existing loaderData from re-used routes\n    let loaderData = newState.loaderData ? mergeLoaderData(state.loaderData, newState.loaderData, newState.matches || [], newState.errors) : state.loaderData;\n    // On a successful navigation we can assume we got through all blockers\n    // so we can start fresh\n    let blockers = state.blockers;\n    if (blockers.size > 0) {\n      blockers = new Map(blockers);\n      blockers.forEach((_, k) => blockers.set(k, IDLE_BLOCKER));\n    }\n    // Always respect the user flag.  Otherwise don't reset on mutation\n    // submission navigations unless they redirect\n    let preventScrollReset = pendingPreventScrollReset === true || state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && ((_location$state2 = location.state) == null ? void 0 : _location$state2._isRedirect) !== true;\n    // Commit any in-flight routes at the end of the HMR revalidation \"navigation\"\n    if (inFlightDataRoutes) {\n      dataRoutes = inFlightDataRoutes;\n      inFlightDataRoutes = undefined;\n    }\n    if (isUninterruptedRevalidation) ; else if (pendingAction === Action.Pop) ; else if (pendingAction === Action.Push) {\n      init.history.push(location, location.state);\n    } else if (pendingAction === Action.Replace) {\n      init.history.replace(location, location.state);\n    }\n    let viewTransitionOpts;\n    // On POP, enable transitions if they were enabled on the original navigation\n    if (pendingAction === Action.Pop) {\n      // Forward takes precedence so they behave like the original navigation\n      let priorPaths = appliedViewTransitions.get(state.location.pathname);\n      if (priorPaths && priorPaths.has(location.pathname)) {\n        viewTransitionOpts = {\n          currentLocation: state.location,\n          nextLocation: location\n        };\n      } else if (appliedViewTransitions.has(location.pathname)) {\n        // If we don't have a previous forward nav, assume we're popping back to\n        // the new location and enable if that location previously enabled\n        viewTransitionOpts = {\n          currentLocation: location,\n          nextLocation: state.location\n        };\n      }\n    } else if (pendingViewTransitionEnabled) {\n      // Store the applied transition on PUSH/REPLACE\n      let toPaths = appliedViewTransitions.get(state.location.pathname);\n      if (toPaths) {\n        toPaths.add(location.pathname);\n      } else {\n        toPaths = new Set([location.pathname]);\n        appliedViewTransitions.set(state.location.pathname, toPaths);\n      }\n      viewTransitionOpts = {\n        currentLocation: state.location,\n        nextLocation: location\n      };\n    }\n    updateState(_extends({}, newState, {\n      actionData,\n      loaderData,\n      historyAction: pendingAction,\n      location,\n      initialized: true,\n      navigation: IDLE_NAVIGATION,\n      revalidation: \"idle\",\n      restoreScrollPosition: getSavedScrollPosition(location, newState.matches || state.matches),\n      preventScrollReset,\n      blockers\n    }), {\n      viewTransitionOpts,\n      flushSync: flushSync === true\n    });\n    // Reset stateful navigation vars\n    pendingAction = Action.Pop;\n    pendingPreventScrollReset = false;\n    pendingViewTransitionEnabled = false;\n    isUninterruptedRevalidation = false;\n    isRevalidationRequired = false;\n    cancelledDeferredRoutes = [];\n  }\n  // Trigger a navigation event, which can either be a numerical POP or a PUSH\n  // replace with an optional submission\n  async function navigate(to, opts) {\n    if (typeof to === \"number\") {\n      init.history.go(to);\n      return;\n    }\n    let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, to, future.v7_relativeSplatPath, opts == null ? void 0 : opts.fromRouteId, opts == null ? void 0 : opts.relative);\n    let {\n      path,\n      submission,\n      error\n    } = normalizeNavigateOptions(future.v7_normalizeFormMethod, false, normalizedPath, opts);\n    let currentLocation = state.location;\n    let nextLocation = createLocation(state.location, path, opts && opts.state);\n    // When using navigate as a PUSH/REPLACE we aren't reading an already-encoded\n    // URL from window.location, so we need to encode it here so the behavior\n    // remains the same as POP and non-data-router usages.  new URL() does all\n    // the same encoding we'd get from a history.pushState/window.location read\n    // without having to touch history\n    nextLocation = _extends({}, nextLocation, init.history.encodeLocation(nextLocation));\n    let userReplace = opts && opts.replace != null ? opts.replace : undefined;\n    let historyAction = Action.Push;\n    if (userReplace === true) {\n      historyAction = Action.Replace;\n    } else if (userReplace === false) ; else if (submission != null && isMutationMethod(submission.formMethod) && submission.formAction === state.location.pathname + state.location.search) {\n      // By default on submissions to the current location we REPLACE so that\n      // users don't have to double-click the back button to get to the prior\n      // location.  If the user redirects to a different location from the\n      // action/loader this will be ignored and the redirect will be a PUSH\n      historyAction = Action.Replace;\n    }\n    let preventScrollReset = opts && \"preventScrollReset\" in opts ? opts.preventScrollReset === true : undefined;\n    let flushSync = (opts && opts.flushSync) === true;\n    let blockerKey = shouldBlockNavigation({\n      currentLocation,\n      nextLocation,\n      historyAction\n    });\n    if (blockerKey) {\n      // Put the blocker into a blocked state\n      updateBlocker(blockerKey, {\n        state: \"blocked\",\n        location: nextLocation,\n        proceed() {\n          updateBlocker(blockerKey, {\n            state: \"proceeding\",\n            proceed: undefined,\n            reset: undefined,\n            location: nextLocation\n          });\n          // Send the same navigation through\n          navigate(to, opts);\n        },\n        reset() {\n          let blockers = new Map(state.blockers);\n          blockers.set(blockerKey, IDLE_BLOCKER);\n          updateState({\n            blockers\n          });\n        }\n      });\n      return;\n    }\n    return await startNavigation(historyAction, nextLocation, {\n      submission,\n      // Send through the formData serialization error if we have one so we can\n      // render at the right error boundary after we match routes\n      pendingError: error,\n      preventScrollReset,\n      replace: opts && opts.replace,\n      enableViewTransition: opts && opts.viewTransition,\n      flushSync\n    });\n  }\n  // Revalidate all current loaders.  If a navigation is in progress or if this\n  // is interrupted by a navigation, allow this to \"succeed\" by calling all\n  // loaders during the next loader round\n  function revalidate() {\n    interruptActiveLoads();\n    updateState({\n      revalidation: \"loading\"\n    });\n    // If we're currently submitting an action, we don't need to start a new\n    // navigation, we'll just let the follow up loader execution call all loaders\n    if (state.navigation.state === \"submitting\") {\n      return;\n    }\n    // If we're currently in an idle state, start a new navigation for the current\n    // action/location and mark it as uninterrupted, which will skip the history\n    // update in completeNavigation\n    if (state.navigation.state === \"idle\") {\n      startNavigation(state.historyAction, state.location, {\n        startUninterruptedRevalidation: true\n      });\n      return;\n    }\n    // Otherwise, if we're currently in a loading state, just start a new\n    // navigation to the navigation.location but do not trigger an uninterrupted\n    // revalidation so that history correctly updates once the navigation completes\n    startNavigation(pendingAction || state.historyAction, state.navigation.location, {\n      overrideNavigation: state.navigation,\n      // Proxy through any rending view transition\n      enableViewTransition: pendingViewTransitionEnabled === true\n    });\n  }\n  // Start a navigation to the given action/location.  Can optionally provide a\n  // overrideNavigation which will override the normalLoad in the case of a redirect\n  // navigation\n  async function startNavigation(historyAction, location, opts) {\n    // Abort any in-progress navigations and start a new one. Unset any ongoing\n    // uninterrupted revalidations unless told otherwise, since we want this\n    // new navigation to update history normally\n    pendingNavigationController && pendingNavigationController.abort();\n    pendingNavigationController = null;\n    pendingAction = historyAction;\n    isUninterruptedRevalidation = (opts && opts.startUninterruptedRevalidation) === true;\n    // Save the current scroll position every time we start a new navigation,\n    // and track whether we should reset scroll on completion\n    saveScrollPosition(state.location, state.matches);\n    pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;\n    pendingViewTransitionEnabled = (opts && opts.enableViewTransition) === true;\n    let routesToUse = inFlightDataRoutes || dataRoutes;\n    let loadingNavigation = opts && opts.overrideNavigation;\n    let matches = opts != null && opts.initialHydration && state.matches && state.matches.length > 0 && !initialMatchesIsFOW ?\n    // `matchRoutes()` has already been called if we're in here via `router.initialize()`\n    state.matches : matchRoutes(routesToUse, location, basename);\n    let flushSync = (opts && opts.flushSync) === true;\n    // Short circuit if it's only a hash change and not a revalidation or\n    // mutation submission.\n    //\n    // Ignore on initial page loads because since the initial hydration will always\n    // be \"same hash\".  For example, on /page#hash and submit a <Form method=\"post\">\n    // which will default to a navigation to /page\n    if (matches && state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {\n      completeNavigation(location, {\n        matches\n      }, {\n        flushSync\n      });\n      return;\n    }\n    let fogOfWar = checkFogOfWar(matches, routesToUse, location.pathname);\n    if (fogOfWar.active && fogOfWar.matches) {\n      matches = fogOfWar.matches;\n    }\n    // Short circuit with a 404 on the root error boundary if we match nothing\n    if (!matches) {\n      let {\n        error,\n        notFoundMatches,\n        route\n      } = handleNavigational404(location.pathname);\n      completeNavigation(location, {\n        matches: notFoundMatches,\n        loaderData: {},\n        errors: {\n          [route.id]: error\n        }\n      }, {\n        flushSync\n      });\n      return;\n    }\n    // Create a controller/Request for this navigation\n    pendingNavigationController = new AbortController();\n    let request = createClientSideRequest(init.history, location, pendingNavigationController.signal, opts && opts.submission);\n    let pendingActionResult;\n    if (opts && opts.pendingError) {\n      // If we have a pendingError, it means the user attempted a GET submission\n      // with binary FormData so assign here and skip to handleLoaders.  That\n      // way we handle calling loaders above the boundary etc.  It's not really\n      // different from an actionError in that sense.\n      pendingActionResult = [findNearestBoundary(matches).route.id, {\n        type: ResultType.error,\n        error: opts.pendingError\n      }];\n    } else if (opts && opts.submission && isMutationMethod(opts.submission.formMethod)) {\n      // Call action if we received an action submission\n      let actionResult = await handleAction(request, location, opts.submission, matches, fogOfWar.active, {\n        replace: opts.replace,\n        flushSync\n      });\n      if (actionResult.shortCircuited) {\n        return;\n      }\n      // If we received a 404 from handleAction, it's because we couldn't lazily\n      // discover the destination route so we don't want to call loaders\n      if (actionResult.pendingActionResult) {\n        let [routeId, result] = actionResult.pendingActionResult;\n        if (isErrorResult(result) && isRouteErrorResponse(result.error) && result.error.status === 404) {\n          pendingNavigationController = null;\n          completeNavigation(location, {\n            matches: actionResult.matches,\n            loaderData: {},\n            errors: {\n              [routeId]: result.error\n            }\n          });\n          return;\n        }\n      }\n      matches = actionResult.matches || matches;\n      pendingActionResult = actionResult.pendingActionResult;\n      loadingNavigation = getLoadingNavigation(location, opts.submission);\n      flushSync = false;\n      // No need to do fog of war matching again on loader execution\n      fogOfWar.active = false;\n      // Create a GET request for the loaders\n      request = createClientSideRequest(init.history, request.url, request.signal);\n    }\n    // Call loaders\n    let {\n      shortCircuited,\n      matches: updatedMatches,\n      loaderData,\n      errors\n    } = await handleLoaders(request, location, matches, fogOfWar.active, loadingNavigation, opts && opts.submission, opts && opts.fetcherSubmission, opts && opts.replace, opts && opts.initialHydration === true, flushSync, pendingActionResult);\n    if (shortCircuited) {\n      return;\n    }\n    // Clean up now that the action/loaders have completed.  Don't clean up if\n    // we short circuited because pendingNavigationController will have already\n    // been assigned to a new controller for the next navigation\n    pendingNavigationController = null;\n    completeNavigation(location, _extends({\n      matches: updatedMatches || matches\n    }, getActionDataForCommit(pendingActionResult), {\n      loaderData,\n      errors\n    }));\n  }\n  // Call the action matched by the leaf route for this navigation and handle\n  // redirects/errors\n  async function handleAction(request, location, submission, matches, isFogOfWar, opts) {\n    if (opts === void 0) {\n      opts = {};\n    }\n    interruptActiveLoads();\n    // Put us in a submitting state\n    let navigation = getSubmittingNavigation(location, submission);\n    updateState({\n      navigation\n    }, {\n      flushSync: opts.flushSync === true\n    });\n    if (isFogOfWar) {\n      let discoverResult = await discoverRoutes(matches, location.pathname, request.signal);\n      if (discoverResult.type === \"aborted\") {\n        return {\n          shortCircuited: true\n        };\n      } else if (discoverResult.type === \"error\") {\n        let boundaryId = findNearestBoundary(discoverResult.partialMatches).route.id;\n        return {\n          matches: discoverResult.partialMatches,\n          pendingActionResult: [boundaryId, {\n            type: ResultType.error,\n            error: discoverResult.error\n          }]\n        };\n      } else if (!discoverResult.matches) {\n        let {\n          notFoundMatches,\n          error,\n          route\n        } = handleNavigational404(location.pathname);\n        return {\n          matches: notFoundMatches,\n          pendingActionResult: [route.id, {\n            type: ResultType.error,\n            error\n          }]\n        };\n      } else {\n        matches = discoverResult.matches;\n      }\n    }\n    // Call our action and get the result\n    let result;\n    let actionMatch = getTargetMatch(matches, location);\n    if (!actionMatch.route.action && !actionMatch.route.lazy) {\n      result = {\n        type: ResultType.error,\n        error: getInternalRouterError(405, {\n          method: request.method,\n          pathname: location.pathname,\n          routeId: actionMatch.route.id\n        })\n      };\n    } else {\n      let results = await callDataStrategy(\"action\", state, request, [actionMatch], matches, null);\n      result = results[actionMatch.route.id];\n      if (request.signal.aborted) {\n        return {\n          shortCircuited: true\n        };\n      }\n    }\n    if (isRedirectResult(result)) {\n      let replace;\n      if (opts && opts.replace != null) {\n        replace = opts.replace;\n      } else {\n        // If the user didn't explicity indicate replace behavior, replace if\n        // we redirected to the exact same location we're currently at to avoid\n        // double back-buttons\n        let location = normalizeRedirectLocation(result.response.headers.get(\"Location\"), new URL(request.url), basename);\n        replace = location === state.location.pathname + state.location.search;\n      }\n      await startRedirectNavigation(request, result, true, {\n        submission,\n        replace\n      });\n      return {\n        shortCircuited: true\n      };\n    }\n    if (isDeferredResult(result)) {\n      throw getInternalRouterError(400, {\n        type: \"defer-action\"\n      });\n    }\n    if (isErrorResult(result)) {\n      // Store off the pending error - we use it to determine which loaders\n      // to call and will commit it when we complete the navigation\n      let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);\n      // By default, all submissions to the current location are REPLACE\n      // navigations, but if the action threw an error that'll be rendered in\n      // an errorElement, we fall back to PUSH so that the user can use the\n      // back button to get back to the pre-submission form location to try\n      // again\n      if ((opts && opts.replace) !== true) {\n        pendingAction = Action.Push;\n      }\n      return {\n        matches,\n        pendingActionResult: [boundaryMatch.route.id, result]\n      };\n    }\n    return {\n      matches,\n      pendingActionResult: [actionMatch.route.id, result]\n    };\n  }\n  // Call all applicable loaders for the given matches, handling redirects,\n  // errors, etc.\n  async function handleLoaders(request, location, matches, isFogOfWar, overrideNavigation, submission, fetcherSubmission, replace, initialHydration, flushSync, pendingActionResult) {\n    // Figure out the right navigation we want to use for data loading\n    let loadingNavigation = overrideNavigation || getLoadingNavigation(location, submission);\n    // If this was a redirect from an action we don't have a \"submission\" but\n    // we have it on the loading navigation so use that if available\n    let activeSubmission = submission || fetcherSubmission || getSubmissionFromNavigation(loadingNavigation);\n    // If this is an uninterrupted revalidation, we remain in our current idle\n    // state.  If not, we need to switch to our loading state and load data,\n    // preserving any new action data or existing action data (in the case of\n    // a revalidation interrupting an actionReload)\n    // If we have partialHydration enabled, then don't update the state for the\n    // initial data load since it's not a \"navigation\"\n    let shouldUpdateNavigationState = !isUninterruptedRevalidation && (!future.v7_partialHydration || !initialHydration);\n    // When fog of war is enabled, we enter our `loading` state earlier so we\n    // can discover new routes during the `loading` state.  We skip this if\n    // we've already run actions since we would have done our matching already.\n    // If the children() function threw then, we want to proceed with the\n    // partial matches it discovered.\n    if (isFogOfWar) {\n      if (shouldUpdateNavigationState) {\n        let actionData = getUpdatedActionData(pendingActionResult);\n        updateState(_extends({\n          navigation: loadingNavigation\n        }, actionData !== undefined ? {\n          actionData\n        } : {}), {\n          flushSync\n        });\n      }\n      let discoverResult = await discoverRoutes(matches, location.pathname, request.signal);\n      if (discoverResult.type === \"aborted\") {\n        return {\n          shortCircuited: true\n        };\n      } else if (discoverResult.type === \"error\") {\n        let boundaryId = findNearestBoundary(discoverResult.partialMatches).route.id;\n        return {\n          matches: discoverResult.partialMatches,\n          loaderData: {},\n          errors: {\n            [boundaryId]: discoverResult.error\n          }\n        };\n      } else if (!discoverResult.matches) {\n        let {\n          error,\n          notFoundMatches,\n          route\n        } = handleNavigational404(location.pathname);\n        return {\n          matches: notFoundMatches,\n          loaderData: {},\n          errors: {\n            [route.id]: error\n          }\n        };\n      } else {\n        matches = discoverResult.matches;\n      }\n    }\n    let routesToUse = inFlightDataRoutes || dataRoutes;\n    let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, activeSubmission, location, future.v7_partialHydration && initialHydration === true, future.v7_skipActionErrorRevalidation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionResult);\n    // Cancel pending deferreds for no-longer-matched routes or routes we're\n    // about to reload.  Note that if this is an action reload we would have\n    // already cancelled all pending deferreds so this would be a no-op\n    cancelActiveDeferreds(routeId => !(matches && matches.some(m => m.route.id === routeId)) || matchesToLoad && matchesToLoad.some(m => m.route.id === routeId));\n    pendingNavigationLoadId = ++incrementingLoadId;\n    // Short circuit if we have no loaders to run\n    if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) {\n      let updatedFetchers = markFetchRedirectsDone();\n      completeNavigation(location, _extends({\n        matches,\n        loaderData: {},\n        // Commit pending error if we're short circuiting\n        errors: pendingActionResult && isErrorResult(pendingActionResult[1]) ? {\n          [pendingActionResult[0]]: pendingActionResult[1].error\n        } : null\n      }, getActionDataForCommit(pendingActionResult), updatedFetchers ? {\n        fetchers: new Map(state.fetchers)\n      } : {}), {\n        flushSync\n      });\n      return {\n        shortCircuited: true\n      };\n    }\n    if (shouldUpdateNavigationState) {\n      let updates = {};\n      if (!isFogOfWar) {\n        // Only update navigation/actionNData if we didn't already do it above\n        updates.navigation = loadingNavigation;\n        let actionData = getUpdatedActionData(pendingActionResult);\n        if (actionData !== undefined) {\n          updates.actionData = actionData;\n        }\n      }\n      if (revalidatingFetchers.length > 0) {\n        updates.fetchers = getUpdatedRevalidatingFetchers(revalidatingFetchers);\n      }\n      updateState(updates, {\n        flushSync\n      });\n    }\n    revalidatingFetchers.forEach(rf => {\n      abortFetcher(rf.key);\n      if (rf.controller) {\n        // Fetchers use an independent AbortController so that aborting a fetcher\n        // (via deleteFetcher) does not abort the triggering navigation that\n        // triggered the revalidation\n        fetchControllers.set(rf.key, rf.controller);\n      }\n    });\n    // Proxy navigation abort through to revalidation fetchers\n    let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach(f => abortFetcher(f.key));\n    if (pendingNavigationController) {\n      pendingNavigationController.signal.addEventListener(\"abort\", abortPendingFetchRevalidations);\n    }\n    let {\n      loaderResults,\n      fetcherResults\n    } = await callLoadersAndMaybeResolveData(state, matches, matchesToLoad, revalidatingFetchers, request);\n    if (request.signal.aborted) {\n      return {\n        shortCircuited: true\n      };\n    }\n    // Clean up _after_ loaders have completed.  Don't clean up if we short\n    // circuited because fetchControllers would have been aborted and\n    // reassigned to new controllers for the next navigation\n    if (pendingNavigationController) {\n      pendingNavigationController.signal.removeEventListener(\"abort\", abortPendingFetchRevalidations);\n    }\n    revalidatingFetchers.forEach(rf => fetchControllers.delete(rf.key));\n    // If any loaders returned a redirect Response, start a new REPLACE navigation\n    let redirect = findRedirect(loaderResults);\n    if (redirect) {\n      await startRedirectNavigation(request, redirect.result, true, {\n        replace\n      });\n      return {\n        shortCircuited: true\n      };\n    }\n    redirect = findRedirect(fetcherResults);\n    if (redirect) {\n      // If this redirect came from a fetcher make sure we mark it in\n      // fetchRedirectIds so it doesn't get revalidated on the next set of\n      // loader executions\n      fetchRedirectIds.add(redirect.key);\n      await startRedirectNavigation(request, redirect.result, true, {\n        replace\n      });\n      return {\n        shortCircuited: true\n      };\n    }\n    // Process and commit output from loaders\n    let {\n      loaderData,\n      errors\n    } = processLoaderData(state, matches, loaderResults, pendingActionResult, revalidatingFetchers, fetcherResults, activeDeferreds);\n    // Wire up subscribers to update loaderData as promises settle\n    activeDeferreds.forEach((deferredData, routeId) => {\n      deferredData.subscribe(aborted => {\n        // Note: No need to updateState here since the TrackedPromise on\n        // loaderData is stable across resolve/reject\n        // Remove this instance if we were aborted or if promises have settled\n        if (aborted || deferredData.done) {\n          activeDeferreds.delete(routeId);\n        }\n      });\n    });\n    // Preserve SSR errors during partial hydration\n    if (future.v7_partialHydration && initialHydration && state.errors) {\n      errors = _extends({}, state.errors, errors);\n    }\n    let updatedFetchers = markFetchRedirectsDone();\n    let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId);\n    let shouldUpdateFetchers = updatedFetchers || didAbortFetchLoads || revalidatingFetchers.length > 0;\n    return _extends({\n      matches,\n      loaderData,\n      errors\n    }, shouldUpdateFetchers ? {\n      fetchers: new Map(state.fetchers)\n    } : {});\n  }\n  function getUpdatedActionData(pendingActionResult) {\n    if (pendingActionResult && !isErrorResult(pendingActionResult[1])) {\n      // This is cast to `any` currently because `RouteData`uses any and it\n      // would be a breaking change to use any.\n      // TODO: v7 - change `RouteData` to use `unknown` instead of `any`\n      return {\n        [pendingActionResult[0]]: pendingActionResult[1].data\n      };\n    } else if (state.actionData) {\n      if (Object.keys(state.actionData).length === 0) {\n        return null;\n      } else {\n        return state.actionData;\n      }\n    }\n  }\n  function getUpdatedRevalidatingFetchers(revalidatingFetchers) {\n    revalidatingFetchers.forEach(rf => {\n      let fetcher = state.fetchers.get(rf.key);\n      let revalidatingFetcher = getLoadingFetcher(undefined, fetcher ? fetcher.data : undefined);\n      state.fetchers.set(rf.key, revalidatingFetcher);\n    });\n    return new Map(state.fetchers);\n  }\n  // Trigger a fetcher load/submit for the given fetcher key\n  function fetch(key, routeId, href, opts) {\n    if (isServer) {\n      throw new Error(\"router.fetch() was called during the server render, but it shouldn't be. \" + \"You are likely calling a useFetcher() method in the body of your component. \" + \"Try moving it to a useEffect or a callback.\");\n    }\n    abortFetcher(key);\n    let flushSync = (opts && opts.flushSync) === true;\n    let routesToUse = inFlightDataRoutes || dataRoutes;\n    let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, href, future.v7_relativeSplatPath, routeId, opts == null ? void 0 : opts.relative);\n    let matches = matchRoutes(routesToUse, normalizedPath, basename);\n    let fogOfWar = checkFogOfWar(matches, routesToUse, normalizedPath);\n    if (fogOfWar.active && fogOfWar.matches) {\n      matches = fogOfWar.matches;\n    }\n    if (!matches) {\n      setFetcherError(key, routeId, getInternalRouterError(404, {\n        pathname: normalizedPath\n      }), {\n        flushSync\n      });\n      return;\n    }\n    let {\n      path,\n      submission,\n      error\n    } = normalizeNavigateOptions(future.v7_normalizeFormMethod, true, normalizedPath, opts);\n    if (error) {\n      setFetcherError(key, routeId, error, {\n        flushSync\n      });\n      return;\n    }\n    let match = getTargetMatch(matches, path);\n    let preventScrollReset = (opts && opts.preventScrollReset) === true;\n    if (submission && isMutationMethod(submission.formMethod)) {\n      handleFetcherAction(key, routeId, path, match, matches, fogOfWar.active, flushSync, preventScrollReset, submission);\n      return;\n    }\n    // Store off the match so we can call it's shouldRevalidate on subsequent\n    // revalidations\n    fetchLoadMatches.set(key, {\n      routeId,\n      path\n    });\n    handleFetcherLoader(key, routeId, path, match, matches, fogOfWar.active, flushSync, preventScrollReset, submission);\n  }\n  // Call the action for the matched fetcher.submit(), and then handle redirects,\n  // errors, and revalidation\n  async function handleFetcherAction(key, routeId, path, match, requestMatches, isFogOfWar, flushSync, preventScrollReset, submission) {\n    interruptActiveLoads();\n    fetchLoadMatches.delete(key);\n    function detectAndHandle405Error(m) {\n      if (!m.route.action && !m.route.lazy) {\n        let error = getInternalRouterError(405, {\n          method: submission.formMethod,\n          pathname: path,\n          routeId: routeId\n        });\n        setFetcherError(key, routeId, error, {\n          flushSync\n        });\n        return true;\n      }\n      return false;\n    }\n    if (!isFogOfWar && detectAndHandle405Error(match)) {\n      return;\n    }\n    // Put this fetcher into it's submitting state\n    let existingFetcher = state.fetchers.get(key);\n    updateFetcherState(key, getSubmittingFetcher(submission, existingFetcher), {\n      flushSync\n    });\n    let abortController = new AbortController();\n    let fetchRequest = createClientSideRequest(init.history, path, abortController.signal, submission);\n    if (isFogOfWar) {\n      let discoverResult = await discoverRoutes(requestMatches, new URL(fetchRequest.url).pathname, fetchRequest.signal, key);\n      if (discoverResult.type === \"aborted\") {\n        return;\n      } else if (discoverResult.type === \"error\") {\n        setFetcherError(key, routeId, discoverResult.error, {\n          flushSync\n        });\n        return;\n      } else if (!discoverResult.matches) {\n        setFetcherError(key, routeId, getInternalRouterError(404, {\n          pathname: path\n        }), {\n          flushSync\n        });\n        return;\n      } else {\n        requestMatches = discoverResult.matches;\n        match = getTargetMatch(requestMatches, path);\n        if (detectAndHandle405Error(match)) {\n          return;\n        }\n      }\n    }\n    // Call the action for the fetcher\n    fetchControllers.set(key, abortController);\n    let originatingLoadId = incrementingLoadId;\n    let actionResults = await callDataStrategy(\"action\", state, fetchRequest, [match], requestMatches, key);\n    let actionResult = actionResults[match.route.id];\n    if (fetchRequest.signal.aborted) {\n      // We can delete this so long as we weren't aborted by our own fetcher\n      // re-submit which would have put _new_ controller is in fetchControllers\n      if (fetchControllers.get(key) === abortController) {\n        fetchControllers.delete(key);\n      }\n      return;\n    }\n    // When using v7_fetcherPersist, we don't want errors bubbling up to the UI\n    // or redirects processed for unmounted fetchers so we just revert them to\n    // idle\n    if (future.v7_fetcherPersist && deletedFetchers.has(key)) {\n      if (isRedirectResult(actionResult) || isErrorResult(actionResult)) {\n        updateFetcherState(key, getDoneFetcher(undefined));\n        return;\n      }\n      // Let SuccessResult's fall through for revalidation\n    } else {\n      if (isRedirectResult(actionResult)) {\n        fetchControllers.delete(key);\n        if (pendingNavigationLoadId > originatingLoadId) {\n          // A new navigation was kicked off after our action started, so that\n          // should take precedence over this redirect navigation.  We already\n          // set isRevalidationRequired so all loaders for the new route should\n          // fire unless opted out via shouldRevalidate\n          updateFetcherState(key, getDoneFetcher(undefined));\n          return;\n        } else {\n          fetchRedirectIds.add(key);\n          updateFetcherState(key, getLoadingFetcher(submission));\n          return startRedirectNavigation(fetchRequest, actionResult, false, {\n            fetcherSubmission: submission,\n            preventScrollReset\n          });\n        }\n      }\n      // Process any non-redirect errors thrown\n      if (isErrorResult(actionResult)) {\n        setFetcherError(key, routeId, actionResult.error);\n        return;\n      }\n    }\n    if (isDeferredResult(actionResult)) {\n      throw getInternalRouterError(400, {\n        type: \"defer-action\"\n      });\n    }\n    // Start the data load for current matches, or the next location if we're\n    // in the middle of a navigation\n    let nextLocation = state.navigation.location || state.location;\n    let revalidationRequest = createClientSideRequest(init.history, nextLocation, abortController.signal);\n    let routesToUse = inFlightDataRoutes || dataRoutes;\n    let matches = state.navigation.state !== \"idle\" ? matchRoutes(routesToUse, state.navigation.location, basename) : state.matches;\n    invariant(matches, \"Didn't find any matches after fetcher action\");\n    let loadId = ++incrementingLoadId;\n    fetchReloadIds.set(key, loadId);\n    let loadFetcher = getLoadingFetcher(submission, actionResult.data);\n    state.fetchers.set(key, loadFetcher);\n    let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, submission, nextLocation, false, future.v7_skipActionErrorRevalidation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, [match.route.id, actionResult]);\n    // Put all revalidating fetchers into the loading state, except for the\n    // current fetcher which we want to keep in it's current loading state which\n    // contains it's action submission info + action data\n    revalidatingFetchers.filter(rf => rf.key !== key).forEach(rf => {\n      let staleKey = rf.key;\n      let existingFetcher = state.fetchers.get(staleKey);\n      let revalidatingFetcher = getLoadingFetcher(undefined, existingFetcher ? existingFetcher.data : undefined);\n      state.fetchers.set(staleKey, revalidatingFetcher);\n      abortFetcher(staleKey);\n      if (rf.controller) {\n        fetchControllers.set(staleKey, rf.controller);\n      }\n    });\n    updateState({\n      fetchers: new Map(state.fetchers)\n    });\n    let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach(rf => abortFetcher(rf.key));\n    abortController.signal.addEventListener(\"abort\", abortPendingFetchRevalidations);\n    let {\n      loaderResults,\n      fetcherResults\n    } = await callLoadersAndMaybeResolveData(state, matches, matchesToLoad, revalidatingFetchers, revalidationRequest);\n    if (abortController.signal.aborted) {\n      return;\n    }\n    abortController.signal.removeEventListener(\"abort\", abortPendingFetchRevalidations);\n    fetchReloadIds.delete(key);\n    fetchControllers.delete(key);\n    revalidatingFetchers.forEach(r => fetchControllers.delete(r.key));\n    let redirect = findRedirect(loaderResults);\n    if (redirect) {\n      return startRedirectNavigation(revalidationRequest, redirect.result, false, {\n        preventScrollReset\n      });\n    }\n    redirect = findRedirect(fetcherResults);\n    if (redirect) {\n      // If this redirect came from a fetcher make sure we mark it in\n      // fetchRedirectIds so it doesn't get revalidated on the next set of\n      // loader executions\n      fetchRedirectIds.add(redirect.key);\n      return startRedirectNavigation(revalidationRequest, redirect.result, false, {\n        preventScrollReset\n      });\n    }\n    // Process and commit output from loaders\n    let {\n      loaderData,\n      errors\n    } = processLoaderData(state, matches, loaderResults, undefined, revalidatingFetchers, fetcherResults, activeDeferreds);\n    // Since we let revalidations complete even if the submitting fetcher was\n    // deleted, only put it back to idle if it hasn't been deleted\n    if (state.fetchers.has(key)) {\n      let doneFetcher = getDoneFetcher(actionResult.data);\n      state.fetchers.set(key, doneFetcher);\n    }\n    abortStaleFetchLoads(loadId);\n    // If we are currently in a navigation loading state and this fetcher is\n    // more recent than the navigation, we want the newer data so abort the\n    // navigation and complete it with the fetcher data\n    if (state.navigation.state === \"loading\" && loadId > pendingNavigationLoadId) {\n      invariant(pendingAction, \"Expected pending action\");\n      pendingNavigationController && pendingNavigationController.abort();\n      completeNavigation(state.navigation.location, {\n        matches,\n        loaderData,\n        errors,\n        fetchers: new Map(state.fetchers)\n      });\n    } else {\n      // otherwise just update with the fetcher data, preserving any existing\n      // loaderData for loaders that did not need to reload.  We have to\n      // manually merge here since we aren't going through completeNavigation\n      updateState({\n        errors,\n        loaderData: mergeLoaderData(state.loaderData, loaderData, matches, errors),\n        fetchers: new Map(state.fetchers)\n      });\n      isRevalidationRequired = false;\n    }\n  }\n  // Call the matched loader for fetcher.load(), handling redirects, errors, etc.\n  async function handleFetcherLoader(key, routeId, path, match, matches, isFogOfWar, flushSync, preventScrollReset, submission) {\n    let existingFetcher = state.fetchers.get(key);\n    updateFetcherState(key, getLoadingFetcher(submission, existingFetcher ? existingFetcher.data : undefined), {\n      flushSync\n    });\n    let abortController = new AbortController();\n    let fetchRequest = createClientSideRequest(init.history, path, abortController.signal);\n    if (isFogOfWar) {\n      let discoverResult = await discoverRoutes(matches, new URL(fetchRequest.url).pathname, fetchRequest.signal, key);\n      if (discoverResult.type === \"aborted\") {\n        return;\n      } else if (discoverResult.type === \"error\") {\n        setFetcherError(key, routeId, discoverResult.error, {\n          flushSync\n        });\n        return;\n      } else if (!discoverResult.matches) {\n        setFetcherError(key, routeId, getInternalRouterError(404, {\n          pathname: path\n        }), {\n          flushSync\n        });\n        return;\n      } else {\n        matches = discoverResult.matches;\n        match = getTargetMatch(matches, path);\n      }\n    }\n    // Call the loader for this fetcher route match\n    fetchControllers.set(key, abortController);\n    let originatingLoadId = incrementingLoadId;\n    let results = await callDataStrategy(\"loader\", state, fetchRequest, [match], matches, key);\n    let result = results[match.route.id];\n    // Deferred isn't supported for fetcher loads, await everything and treat it\n    // as a normal load.  resolveDeferredData will return undefined if this\n    // fetcher gets aborted, so we just leave result untouched and short circuit\n    // below if that happens\n    if (isDeferredResult(result)) {\n      result = (await resolveDeferredData(result, fetchRequest.signal, true)) || result;\n    }\n    // We can delete this so long as we weren't aborted by our our own fetcher\n    // re-load which would have put _new_ controller is in fetchControllers\n    if (fetchControllers.get(key) === abortController) {\n      fetchControllers.delete(key);\n    }\n    if (fetchRequest.signal.aborted) {\n      return;\n    }\n    // We don't want errors bubbling up or redirects followed for unmounted\n    // fetchers, so short circuit here if it was removed from the UI\n    if (deletedFetchers.has(key)) {\n      updateFetcherState(key, getDoneFetcher(undefined));\n      return;\n    }\n    // If the loader threw a redirect Response, start a new REPLACE navigation\n    if (isRedirectResult(result)) {\n      if (pendingNavigationLoadId > originatingLoadId) {\n        // A new navigation was kicked off after our loader started, so that\n        // should take precedence over this redirect navigation\n        updateFetcherState(key, getDoneFetcher(undefined));\n        return;\n      } else {\n        fetchRedirectIds.add(key);\n        await startRedirectNavigation(fetchRequest, result, false, {\n          preventScrollReset\n        });\n        return;\n      }\n    }\n    // Process any non-redirect errors thrown\n    if (isErrorResult(result)) {\n      setFetcherError(key, routeId, result.error);\n      return;\n    }\n    invariant(!isDeferredResult(result), \"Unhandled fetcher deferred data\");\n    // Put the fetcher back into an idle state\n    updateFetcherState(key, getDoneFetcher(result.data));\n  }\n  /**\n   * Utility function to handle redirects returned from an action or loader.\n   * Normally, a redirect \"replaces\" the navigation that triggered it.  So, for\n   * example:\n   *\n   *  - user is on /a\n   *  - user clicks a link to /b\n   *  - loader for /b redirects to /c\n   *\n   * In a non-JS app the browser would track the in-flight navigation to /b and\n   * then replace it with /c when it encountered the redirect response.  In\n   * the end it would only ever update the URL bar with /c.\n   *\n   * In client-side routing using pushState/replaceState, we aim to emulate\n   * this behavior and we also do not update history until the end of the\n   * navigation (including processed redirects).  This means that we never\n   * actually touch history until we've processed redirects, so we just use\n   * the history action from the original navigation (PUSH or REPLACE).\n   */\n  async function startRedirectNavigation(request, redirect, isNavigation, _temp2) {\n    let {\n      submission,\n      fetcherSubmission,\n      preventScrollReset,\n      replace\n    } = _temp2 === void 0 ? {} : _temp2;\n    if (redirect.response.headers.has(\"X-Remix-Revalidate\")) {\n      isRevalidationRequired = true;\n    }\n    let location = redirect.response.headers.get(\"Location\");\n    invariant(location, \"Expected a Location header on the redirect Response\");\n    location = normalizeRedirectLocation(location, new URL(request.url), basename);\n    let redirectLocation = createLocation(state.location, location, {\n      _isRedirect: true\n    });\n    if (isBrowser) {\n      let isDocumentReload = false;\n      if (redirect.response.headers.has(\"X-Remix-Reload-Document\")) {\n        // Hard reload if the response contained X-Remix-Reload-Document\n        isDocumentReload = true;\n      } else if (ABSOLUTE_URL_REGEX.test(location)) {\n        const url = init.history.createURL(location);\n        isDocumentReload =\n        // Hard reload if it's an absolute URL to a new origin\n        url.origin !== routerWindow.location.origin ||\n        // Hard reload if it's an absolute URL that does not match our basename\n        stripBasename(url.pathname, basename) == null;\n      }\n      if (isDocumentReload) {\n        if (replace) {\n          routerWindow.location.replace(location);\n        } else {\n          routerWindow.location.assign(location);\n        }\n        return;\n      }\n    }\n    // There's no need to abort on redirects, since we don't detect the\n    // redirect until the action/loaders have settled\n    pendingNavigationController = null;\n    let redirectHistoryAction = replace === true || redirect.response.headers.has(\"X-Remix-Replace\") ? Action.Replace : Action.Push;\n    // Use the incoming submission if provided, fallback on the active one in\n    // state.navigation\n    let {\n      formMethod,\n      formAction,\n      formEncType\n    } = state.navigation;\n    if (!submission && !fetcherSubmission && formMethod && formAction && formEncType) {\n      submission = getSubmissionFromNavigation(state.navigation);\n    }\n    // If this was a 307/308 submission we want to preserve the HTTP method and\n    // re-submit the GET/POST/PUT/PATCH/DELETE as a submission navigation to the\n    // redirected location\n    let activeSubmission = submission || fetcherSubmission;\n    if (redirectPreserveMethodStatusCodes.has(redirect.response.status) && activeSubmission && isMutationMethod(activeSubmission.formMethod)) {\n      await startNavigation(redirectHistoryAction, redirectLocation, {\n        submission: _extends({}, activeSubmission, {\n          formAction: location\n        }),\n        // Preserve these flags across redirects\n        preventScrollReset: preventScrollReset || pendingPreventScrollReset,\n        enableViewTransition: isNavigation ? pendingViewTransitionEnabled : undefined\n      });\n    } else {\n      // If we have a navigation submission, we will preserve it through the\n      // redirect navigation\n      let overrideNavigation = getLoadingNavigation(redirectLocation, submission);\n      await startNavigation(redirectHistoryAction, redirectLocation, {\n        overrideNavigation,\n        // Send fetcher submissions through for shouldRevalidate\n        fetcherSubmission,\n        // Preserve these flags across redirects\n        preventScrollReset: preventScrollReset || pendingPreventScrollReset,\n        enableViewTransition: isNavigation ? pendingViewTransitionEnabled : undefined\n      });\n    }\n  }\n  // Utility wrapper for calling dataStrategy client-side without having to\n  // pass around the manifest, mapRouteProperties, etc.\n  async function callDataStrategy(type, state, request, matchesToLoad, matches, fetcherKey) {\n    let results;\n    let dataResults = {};\n    try {\n      results = await callDataStrategyImpl(dataStrategyImpl, type, state, request, matchesToLoad, matches, fetcherKey, manifest, mapRouteProperties);\n    } catch (e) {\n      // If the outer dataStrategy method throws, just return the error for all\n      // matches - and it'll naturally bubble to the root\n      matchesToLoad.forEach(m => {\n        dataResults[m.route.id] = {\n          type: ResultType.error,\n          error: e\n        };\n      });\n      return dataResults;\n    }\n    for (let [routeId, result] of Object.entries(results)) {\n      if (isRedirectDataStrategyResultResult(result)) {\n        let response = result.result;\n        dataResults[routeId] = {\n          type: ResultType.redirect,\n          response: normalizeRelativeRoutingRedirectResponse(response, request, routeId, matches, basename, future.v7_relativeSplatPath)\n        };\n      } else {\n        dataResults[routeId] = await convertDataStrategyResultToDataResult(result);\n      }\n    }\n    return dataResults;\n  }\n  async function callLoadersAndMaybeResolveData(state, matches, matchesToLoad, fetchersToLoad, request) {\n    let currentMatches = state.matches;\n    // Kick off loaders and fetchers in parallel\n    let loaderResultsPromise = callDataStrategy(\"loader\", state, request, matchesToLoad, matches, null);\n    let fetcherResultsPromise = Promise.all(fetchersToLoad.map(async f => {\n      if (f.matches && f.match && f.controller) {\n        let results = await callDataStrategy(\"loader\", state, createClientSideRequest(init.history, f.path, f.controller.signal), [f.match], f.matches, f.key);\n        let result = results[f.match.route.id];\n        // Fetcher results are keyed by fetcher key from here on out, not routeId\n        return {\n          [f.key]: result\n        };\n      } else {\n        return Promise.resolve({\n          [f.key]: {\n            type: ResultType.error,\n            error: getInternalRouterError(404, {\n              pathname: f.path\n            })\n          }\n        });\n      }\n    }));\n    let loaderResults = await loaderResultsPromise;\n    let fetcherResults = (await fetcherResultsPromise).reduce((acc, r) => Object.assign(acc, r), {});\n    await Promise.all([resolveNavigationDeferredResults(matches, loaderResults, request.signal, currentMatches, state.loaderData), resolveFetcherDeferredResults(matches, fetcherResults, fetchersToLoad)]);\n    return {\n      loaderResults,\n      fetcherResults\n    };\n  }\n  function interruptActiveLoads() {\n    // Every interruption triggers a revalidation\n    isRevalidationRequired = true;\n    // Cancel pending route-level deferreds and mark cancelled routes for\n    // revalidation\n    cancelledDeferredRoutes.push(...cancelActiveDeferreds());\n    // Abort in-flight fetcher loads\n    fetchLoadMatches.forEach((_, key) => {\n      if (fetchControllers.has(key)) {\n        cancelledFetcherLoads.add(key);\n      }\n      abortFetcher(key);\n    });\n  }\n  function updateFetcherState(key, fetcher, opts) {\n    if (opts === void 0) {\n      opts = {};\n    }\n    state.fetchers.set(key, fetcher);\n    updateState({\n      fetchers: new Map(state.fetchers)\n    }, {\n      flushSync: (opts && opts.flushSync) === true\n    });\n  }\n  function setFetcherError(key, routeId, error, opts) {\n    if (opts === void 0) {\n      opts = {};\n    }\n    let boundaryMatch = findNearestBoundary(state.matches, routeId);\n    deleteFetcher(key);\n    updateState({\n      errors: {\n        [boundaryMatch.route.id]: error\n      },\n      fetchers: new Map(state.fetchers)\n    }, {\n      flushSync: (opts && opts.flushSync) === true\n    });\n  }\n  function getFetcher(key) {\n    activeFetchers.set(key, (activeFetchers.get(key) || 0) + 1);\n    // If this fetcher was previously marked for deletion, unmark it since we\n    // have a new instance\n    if (deletedFetchers.has(key)) {\n      deletedFetchers.delete(key);\n    }\n    return state.fetchers.get(key) || IDLE_FETCHER;\n  }\n  function deleteFetcher(key) {\n    let fetcher = state.fetchers.get(key);\n    // Don't abort the controller if this is a deletion of a fetcher.submit()\n    // in it's loading phase since - we don't want to abort the corresponding\n    // revalidation and want them to complete and land\n    if (fetchControllers.has(key) && !(fetcher && fetcher.state === \"loading\" && fetchReloadIds.has(key))) {\n      abortFetcher(key);\n    }\n    fetchLoadMatches.delete(key);\n    fetchReloadIds.delete(key);\n    fetchRedirectIds.delete(key);\n    // If we opted into the flag we can clear this now since we're calling\n    // deleteFetcher() at the end of updateState() and we've already handed the\n    // deleted fetcher keys off to the data layer.\n    // If not, we're eagerly calling deleteFetcher() and we need to keep this\n    // Set populated until the next updateState call, and we'll clear\n    // `deletedFetchers` then\n    if (future.v7_fetcherPersist) {\n      deletedFetchers.delete(key);\n    }\n    cancelledFetcherLoads.delete(key);\n    state.fetchers.delete(key);\n  }\n  function deleteFetcherAndUpdateState(key) {\n    let count = (activeFetchers.get(key) || 0) - 1;\n    if (count <= 0) {\n      activeFetchers.delete(key);\n      deletedFetchers.add(key);\n      if (!future.v7_fetcherPersist) {\n        deleteFetcher(key);\n      }\n    } else {\n      activeFetchers.set(key, count);\n    }\n    updateState({\n      fetchers: new Map(state.fetchers)\n    });\n  }\n  function abortFetcher(key) {\n    let controller = fetchControllers.get(key);\n    if (controller) {\n      controller.abort();\n      fetchControllers.delete(key);\n    }\n  }\n  function markFetchersDone(keys) {\n    for (let key of keys) {\n      let fetcher = getFetcher(key);\n      let doneFetcher = getDoneFetcher(fetcher.data);\n      state.fetchers.set(key, doneFetcher);\n    }\n  }\n  function markFetchRedirectsDone() {\n    let doneKeys = [];\n    let updatedFetchers = false;\n    for (let key of fetchRedirectIds) {\n      let fetcher = state.fetchers.get(key);\n      invariant(fetcher, \"Expected fetcher: \" + key);\n      if (fetcher.state === \"loading\") {\n        fetchRedirectIds.delete(key);\n        doneKeys.push(key);\n        updatedFetchers = true;\n      }\n    }\n    markFetchersDone(doneKeys);\n    return updatedFetchers;\n  }\n  function abortStaleFetchLoads(landedId) {\n    let yeetedKeys = [];\n    for (let [key, id] of fetchReloadIds) {\n      if (id < landedId) {\n        let fetcher = state.fetchers.get(key);\n        invariant(fetcher, \"Expected fetcher: \" + key);\n        if (fetcher.state === \"loading\") {\n          abortFetcher(key);\n          fetchReloadIds.delete(key);\n          yeetedKeys.push(key);\n        }\n      }\n    }\n    markFetchersDone(yeetedKeys);\n    return yeetedKeys.length > 0;\n  }\n  function getBlocker(key, fn) {\n    let blocker = state.blockers.get(key) || IDLE_BLOCKER;\n    if (blockerFunctions.get(key) !== fn) {\n      blockerFunctions.set(key, fn);\n    }\n    return blocker;\n  }\n  function deleteBlocker(key) {\n    state.blockers.delete(key);\n    blockerFunctions.delete(key);\n  }\n  // Utility function to update blockers, ensuring valid state transitions\n  function updateBlocker(key, newBlocker) {\n    let blocker = state.blockers.get(key) || IDLE_BLOCKER;\n    // Poor mans state machine :)\n    // https://mermaid.live/edit#pako:eNqVkc9OwzAMxl8l8nnjAYrEtDIOHEBIgwvKJTReGy3_lDpIqO27k6awMG0XcrLlnz87nwdonESogKXXBuE79rq75XZO3-yHds0RJVuv70YrPlUrCEe2HfrORS3rubqZfuhtpg5C9wk5tZ4VKcRUq88q9Z8RS0-48cE1iHJkL0ugbHuFLus9L6spZy8nX9MP2CNdomVaposqu3fGayT8T8-jJQwhepo_UtpgBQaDEUom04dZhAN1aJBDlUKJBxE1ceB2Smj0Mln-IBW5AFU2dwUiktt_2Qaq2dBfaKdEup85UV7Yd-dKjlnkabl2Pvr0DTkTreM\n    invariant(blocker.state === \"unblocked\" && newBlocker.state === \"blocked\" || blocker.state === \"blocked\" && newBlocker.state === \"blocked\" || blocker.state === \"blocked\" && newBlocker.state === \"proceeding\" || blocker.state === \"blocked\" && newBlocker.state === \"unblocked\" || blocker.state === \"proceeding\" && newBlocker.state === \"unblocked\", \"Invalid blocker state transition: \" + blocker.state + \" -> \" + newBlocker.state);\n    let blockers = new Map(state.blockers);\n    blockers.set(key, newBlocker);\n    updateState({\n      blockers\n    });\n  }\n  function shouldBlockNavigation(_ref2) {\n    let {\n      currentLocation,\n      nextLocation,\n      historyAction\n    } = _ref2;\n    if (blockerFunctions.size === 0) {\n      return;\n    }\n    // We ony support a single active blocker at the moment since we don't have\n    // any compelling use cases for multi-blocker yet\n    if (blockerFunctions.size > 1) {\n      warning(false, \"A router only supports one blocker at a time\");\n    }\n    let entries = Array.from(blockerFunctions.entries());\n    let [blockerKey, blockerFunction] = entries[entries.length - 1];\n    let blocker = state.blockers.get(blockerKey);\n    if (blocker && blocker.state === \"proceeding\") {\n      // If the blocker is currently proceeding, we don't need to re-check\n      // it and can let this navigation continue\n      return;\n    }\n    // At this point, we know we're unblocked/blocked so we need to check the\n    // user-provided blocker function\n    if (blockerFunction({\n      currentLocation,\n      nextLocation,\n      historyAction\n    })) {\n      return blockerKey;\n    }\n  }\n  function handleNavigational404(pathname) {\n    let error = getInternalRouterError(404, {\n      pathname\n    });\n    let routesToUse = inFlightDataRoutes || dataRoutes;\n    let {\n      matches,\n      route\n    } = getShortCircuitMatches(routesToUse);\n    // Cancel all pending deferred on 404s since we don't keep any routes\n    cancelActiveDeferreds();\n    return {\n      notFoundMatches: matches,\n      route,\n      error\n    };\n  }\n  function cancelActiveDeferreds(predicate) {\n    let cancelledRouteIds = [];\n    activeDeferreds.forEach((dfd, routeId) => {\n      if (!predicate || predicate(routeId)) {\n        // Cancel the deferred - but do not remove from activeDeferreds here -\n        // we rely on the subscribers to do that so our tests can assert proper\n        // cleanup via _internalActiveDeferreds\n        dfd.cancel();\n        cancelledRouteIds.push(routeId);\n        activeDeferreds.delete(routeId);\n      }\n    });\n    return cancelledRouteIds;\n  }\n  // Opt in to capturing and reporting scroll positions during navigations,\n  // used by the <ScrollRestoration> component\n  function enableScrollRestoration(positions, getPosition, getKey) {\n    savedScrollPositions = positions;\n    getScrollPosition = getPosition;\n    getScrollRestorationKey = getKey || null;\n    // Perform initial hydration scroll restoration, since we miss the boat on\n    // the initial updateState() because we've not yet rendered <ScrollRestoration/>\n    // and therefore have no savedScrollPositions available\n    if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) {\n      initialScrollRestored = true;\n      let y = getSavedScrollPosition(state.location, state.matches);\n      if (y != null) {\n        updateState({\n          restoreScrollPosition: y\n        });\n      }\n    }\n    return () => {\n      savedScrollPositions = null;\n      getScrollPosition = null;\n      getScrollRestorationKey = null;\n    };\n  }\n  function getScrollKey(location, matches) {\n    if (getScrollRestorationKey) {\n      let key = getScrollRestorationKey(location, matches.map(m => convertRouteMatchToUiMatch(m, state.loaderData)));\n      return key || location.key;\n    }\n    return location.key;\n  }\n  function saveScrollPosition(location, matches) {\n    if (savedScrollPositions && getScrollPosition) {\n      let key = getScrollKey(location, matches);\n      savedScrollPositions[key] = getScrollPosition();\n    }\n  }\n  function getSavedScrollPosition(location, matches) {\n    if (savedScrollPositions) {\n      let key = getScrollKey(location, matches);\n      let y = savedScrollPositions[key];\n      if (typeof y === \"number\") {\n        return y;\n      }\n    }\n    return null;\n  }\n  function checkFogOfWar(matches, routesToUse, pathname) {\n    if (patchRoutesOnNavigationImpl) {\n      if (!matches) {\n        let fogMatches = matchRoutesImpl(routesToUse, pathname, basename, true);\n        return {\n          active: true,\n          matches: fogMatches || []\n        };\n      } else {\n        if (Object.keys(matches[0].params).length > 0) {\n          // If we matched a dynamic param or a splat, it might only be because\n          // we haven't yet discovered other routes that would match with a\n          // higher score.  Call patchRoutesOnNavigation just to be sure\n          let partialMatches = matchRoutesImpl(routesToUse, pathname, basename, true);\n          return {\n            active: true,\n            matches: partialMatches\n          };\n        }\n      }\n    }\n    return {\n      active: false,\n      matches: null\n    };\n  }\n  async function discoverRoutes(matches, pathname, signal, fetcherKey) {\n    if (!patchRoutesOnNavigationImpl) {\n      return {\n        type: \"success\",\n        matches\n      };\n    }\n    let partialMatches = matches;\n    while (true) {\n      let isNonHMR = inFlightDataRoutes == null;\n      let routesToUse = inFlightDataRoutes || dataRoutes;\n      let localManifest = manifest;\n      try {\n        await patchRoutesOnNavigationImpl({\n          signal,\n          path: pathname,\n          matches: partialMatches,\n          fetcherKey,\n          patch: (routeId, children) => {\n            if (signal.aborted) return;\n            patchRoutesImpl(routeId, children, routesToUse, localManifest, mapRouteProperties);\n          }\n        });\n      } catch (e) {\n        return {\n          type: \"error\",\n          error: e,\n          partialMatches\n        };\n      } finally {\n        // If we are not in the middle of an HMR revalidation and we changed the\n        // routes, provide a new identity so when we `updateState` at the end of\n        // this navigation/fetch `router.routes` will be a new identity and\n        // trigger a re-run of memoized `router.routes` dependencies.\n        // HMR will already update the identity and reflow when it lands\n        // `inFlightDataRoutes` in `completeNavigation`\n        if (isNonHMR && !signal.aborted) {\n          dataRoutes = [...dataRoutes];\n        }\n      }\n      if (signal.aborted) {\n        return {\n          type: \"aborted\"\n        };\n      }\n      let newMatches = matchRoutes(routesToUse, pathname, basename);\n      if (newMatches) {\n        return {\n          type: \"success\",\n          matches: newMatches\n        };\n      }\n      let newPartialMatches = matchRoutesImpl(routesToUse, pathname, basename, true);\n      // Avoid loops if the second pass results in the same partial matches\n      if (!newPartialMatches || partialMatches.length === newPartialMatches.length && partialMatches.every((m, i) => m.route.id === newPartialMatches[i].route.id)) {\n        return {\n          type: \"success\",\n          matches: null\n        };\n      }\n      partialMatches = newPartialMatches;\n    }\n  }\n  function _internalSetRoutes(newRoutes) {\n    manifest = {};\n    inFlightDataRoutes = convertRoutesToDataRoutes(newRoutes, mapRouteProperties, undefined, manifest);\n  }\n  function patchRoutes(routeId, children) {\n    let isNonHMR = inFlightDataRoutes == null;\n    let routesToUse = inFlightDataRoutes || dataRoutes;\n    patchRoutesImpl(routeId, children, routesToUse, manifest, mapRouteProperties);\n    // If we are not in the middle of an HMR revalidation and we changed the\n    // routes, provide a new identity and trigger a reflow via `updateState`\n    // to re-run memoized `router.routes` dependencies.\n    // HMR will already update the identity and reflow when it lands\n    // `inFlightDataRoutes` in `completeNavigation`\n    if (isNonHMR) {\n      dataRoutes = [...dataRoutes];\n      updateState({});\n    }\n  }\n  router = {\n    get basename() {\n      return basename;\n    },\n    get future() {\n      return future;\n    },\n    get state() {\n      return state;\n    },\n    get routes() {\n      return dataRoutes;\n    },\n    get window() {\n      return routerWindow;\n    },\n    initialize,\n    subscribe,\n    enableScrollRestoration,\n    navigate,\n    fetch,\n    revalidate,\n    // Passthrough to history-aware createHref used by useHref so we get proper\n    // hash-aware URLs in DOM paths\n    createHref: to => init.history.createHref(to),\n    encodeLocation: to => init.history.encodeLocation(to),\n    getFetcher,\n    deleteFetcher: deleteFetcherAndUpdateState,\n    dispose,\n    getBlocker,\n    deleteBlocker,\n    patchRoutes,\n    _internalFetchControllers: fetchControllers,\n    _internalActiveDeferreds: activeDeferreds,\n    // TODO: Remove setRoutes, it's temporary to avoid dealing with\n    // updating the tree while validating the update algorithm.\n    _internalSetRoutes\n  };\n  return router;\n}\n//#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region createStaticHandler\n////////////////////////////////////////////////////////////////////////////////\nconst UNSAFE_DEFERRED_SYMBOL = Symbol(\"deferred\");\nfunction createStaticHandler(routes, opts) {\n  invariant(routes.length > 0, \"You must provide a non-empty routes array to createStaticHandler\");\n  let manifest = {};\n  let basename = (opts ? opts.basename : null) || \"/\";\n  let mapRouteProperties;\n  if (opts != null && opts.mapRouteProperties) {\n    mapRouteProperties = opts.mapRouteProperties;\n  } else if (opts != null && opts.detectErrorBoundary) {\n    // If they are still using the deprecated version, wrap it with the new API\n    let detectErrorBoundary = opts.detectErrorBoundary;\n    mapRouteProperties = route => ({\n      hasErrorBoundary: detectErrorBoundary(route)\n    });\n  } else {\n    mapRouteProperties = defaultMapRouteProperties;\n  }\n  // Config driven behavior flags\n  let future = _extends({\n    v7_relativeSplatPath: false,\n    v7_throwAbortReason: false\n  }, opts ? opts.future : null);\n  let dataRoutes = convertRoutesToDataRoutes(routes, mapRouteProperties, undefined, manifest);\n  /**\n   * The query() method is intended for document requests, in which we want to\n   * call an optional action and potentially multiple loaders for all nested\n   * routes.  It returns a StaticHandlerContext object, which is very similar\n   * to the router state (location, loaderData, actionData, errors, etc.) and\n   * also adds SSR-specific information such as the statusCode and headers\n   * from action/loaders Responses.\n   *\n   * It _should_ never throw and should report all errors through the\n   * returned context.errors object, properly associating errors to their error\n   * boundary.  Additionally, it tracks _deepestRenderedBoundaryId which can be\n   * used to emulate React error boundaries during SSr by performing a second\n   * pass only down to the boundaryId.\n   *\n   * The one exception where we do not return a StaticHandlerContext is when a\n   * redirect response is returned or thrown from any action/loader.  We\n   * propagate that out and return the raw Response so the HTTP server can\n   * return it directly.\n   *\n   * - `opts.requestContext` is an optional server context that will be passed\n   *   to actions/loaders in the `context` parameter\n   * - `opts.skipLoaderErrorBubbling` is an optional parameter that will prevent\n   *   the bubbling of errors which allows single-fetch-type implementations\n   *   where the client will handle the bubbling and we may need to return data\n   *   for the handling route\n   */\n  async function query(request, _temp3) {\n    let {\n      requestContext,\n      skipLoaderErrorBubbling,\n      dataStrategy\n    } = _temp3 === void 0 ? {} : _temp3;\n    let url = new URL(request.url);\n    let method = request.method;\n    let location = createLocation(\"\", createPath(url), null, \"default\");\n    let matches = matchRoutes(dataRoutes, location, basename);\n    // SSR supports HEAD requests while SPA doesn't\n    if (!isValidMethod(method) && method !== \"HEAD\") {\n      let error = getInternalRouterError(405, {\n        method\n      });\n      let {\n        matches: methodNotAllowedMatches,\n        route\n      } = getShortCircuitMatches(dataRoutes);\n      return {\n        basename,\n        location,\n        matches: methodNotAllowedMatches,\n        loaderData: {},\n        actionData: null,\n        errors: {\n          [route.id]: error\n        },\n        statusCode: error.status,\n        loaderHeaders: {},\n        actionHeaders: {},\n        activeDeferreds: null\n      };\n    } else if (!matches) {\n      let error = getInternalRouterError(404, {\n        pathname: location.pathname\n      });\n      let {\n        matches: notFoundMatches,\n        route\n      } = getShortCircuitMatches(dataRoutes);\n      return {\n        basename,\n        location,\n        matches: notFoundMatches,\n        loaderData: {},\n        actionData: null,\n        errors: {\n          [route.id]: error\n        },\n        statusCode: error.status,\n        loaderHeaders: {},\n        actionHeaders: {},\n        activeDeferreds: null\n      };\n    }\n    let result = await queryImpl(request, location, matches, requestContext, dataStrategy || null, skipLoaderErrorBubbling === true, null);\n    if (isResponse(result)) {\n      return result;\n    }\n    // When returning StaticHandlerContext, we patch back in the location here\n    // since we need it for React Context.  But this helps keep our submit and\n    // loadRouteData operating on a Request instead of a Location\n    return _extends({\n      location,\n      basename\n    }, result);\n  }\n  /**\n   * The queryRoute() method is intended for targeted route requests, either\n   * for fetch ?_data requests or resource route requests.  In this case, we\n   * are only ever calling a single action or loader, and we are returning the\n   * returned value directly.  In most cases, this will be a Response returned\n   * from the action/loader, but it may be a primitive or other value as well -\n   * and in such cases the calling context should handle that accordingly.\n   *\n   * We do respect the throw/return differentiation, so if an action/loader\n   * throws, then this method will throw the value.  This is important so we\n   * can do proper boundary identification in Remix where a thrown Response\n   * must go to the Catch Boundary but a returned Response is happy-path.\n   *\n   * One thing to note is that any Router-initiated Errors that make sense\n   * to associate with a status code will be thrown as an ErrorResponse\n   * instance which include the raw Error, such that the calling context can\n   * serialize the error as they see fit while including the proper response\n   * code.  Examples here are 404 and 405 errors that occur prior to reaching\n   * any user-defined loaders.\n   *\n   * - `opts.routeId` allows you to specify the specific route handler to call.\n   *   If not provided the handler will determine the proper route by matching\n   *   against `request.url`\n   * - `opts.requestContext` is an optional server context that will be passed\n   *    to actions/loaders in the `context` parameter\n   */\n  async function queryRoute(request, _temp4) {\n    let {\n      routeId,\n      requestContext,\n      dataStrategy\n    } = _temp4 === void 0 ? {} : _temp4;\n    let url = new URL(request.url);\n    let method = request.method;\n    let location = createLocation(\"\", createPath(url), null, \"default\");\n    let matches = matchRoutes(dataRoutes, location, basename);\n    // SSR supports HEAD requests while SPA doesn't\n    if (!isValidMethod(method) && method !== \"HEAD\" && method !== \"OPTIONS\") {\n      throw getInternalRouterError(405, {\n        method\n      });\n    } else if (!matches) {\n      throw getInternalRouterError(404, {\n        pathname: location.pathname\n      });\n    }\n    let match = routeId ? matches.find(m => m.route.id === routeId) : getTargetMatch(matches, location);\n    if (routeId && !match) {\n      throw getInternalRouterError(403, {\n        pathname: location.pathname,\n        routeId\n      });\n    } else if (!match) {\n      // This should never hit I don't think?\n      throw getInternalRouterError(404, {\n        pathname: location.pathname\n      });\n    }\n    let result = await queryImpl(request, location, matches, requestContext, dataStrategy || null, false, match);\n    if (isResponse(result)) {\n      return result;\n    }\n    let error = result.errors ? Object.values(result.errors)[0] : undefined;\n    if (error !== undefined) {\n      // If we got back result.errors, that means the loader/action threw\n      // _something_ that wasn't a Response, but it's not guaranteed/required\n      // to be an `instanceof Error` either, so we have to use throw here to\n      // preserve the \"error\" state outside of queryImpl.\n      throw error;\n    }\n    // Pick off the right state value to return\n    if (result.actionData) {\n      return Object.values(result.actionData)[0];\n    }\n    if (result.loaderData) {\n      var _result$activeDeferre;\n      let data = Object.values(result.loaderData)[0];\n      if ((_result$activeDeferre = result.activeDeferreds) != null && _result$activeDeferre[match.route.id]) {\n        data[UNSAFE_DEFERRED_SYMBOL] = result.activeDeferreds[match.route.id];\n      }\n      return data;\n    }\n    return undefined;\n  }\n  async function queryImpl(request, location, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch) {\n    invariant(request.signal, \"query()/queryRoute() requests must contain an AbortController signal\");\n    try {\n      if (isMutationMethod(request.method.toLowerCase())) {\n        let result = await submit(request, matches, routeMatch || getTargetMatch(matches, location), requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch != null);\n        return result;\n      }\n      let result = await loadRouteData(request, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch);\n      return isResponse(result) ? result : _extends({}, result, {\n        actionData: null,\n        actionHeaders: {}\n      });\n    } catch (e) {\n      // If the user threw/returned a Response in callLoaderOrAction for a\n      // `queryRoute` call, we throw the `DataStrategyResult` to bail out early\n      // and then return or throw the raw Response here accordingly\n      if (isDataStrategyResult(e) && isResponse(e.result)) {\n        if (e.type === ResultType.error) {\n          throw e.result;\n        }\n        return e.result;\n      }\n      // Redirects are always returned since they don't propagate to catch\n      // boundaries\n      if (isRedirectResponse(e)) {\n        return e;\n      }\n      throw e;\n    }\n  }\n  async function submit(request, matches, actionMatch, requestContext, dataStrategy, skipLoaderErrorBubbling, isRouteRequest) {\n    let result;\n    if (!actionMatch.route.action && !actionMatch.route.lazy) {\n      let error = getInternalRouterError(405, {\n        method: request.method,\n        pathname: new URL(request.url).pathname,\n        routeId: actionMatch.route.id\n      });\n      if (isRouteRequest) {\n        throw error;\n      }\n      result = {\n        type: ResultType.error,\n        error\n      };\n    } else {\n      let results = await callDataStrategy(\"action\", request, [actionMatch], matches, isRouteRequest, requestContext, dataStrategy);\n      result = results[actionMatch.route.id];\n      if (request.signal.aborted) {\n        throwStaticHandlerAbortedError(request, isRouteRequest, future);\n      }\n    }\n    if (isRedirectResult(result)) {\n      // Uhhhh - this should never happen, we should always throw these from\n      // callLoaderOrAction, but the type narrowing here keeps TS happy and we\n      // can get back on the \"throw all redirect responses\" train here should\n      // this ever happen :/\n      throw new Response(null, {\n        status: result.response.status,\n        headers: {\n          Location: result.response.headers.get(\"Location\")\n        }\n      });\n    }\n    if (isDeferredResult(result)) {\n      let error = getInternalRouterError(400, {\n        type: \"defer-action\"\n      });\n      if (isRouteRequest) {\n        throw error;\n      }\n      result = {\n        type: ResultType.error,\n        error\n      };\n    }\n    if (isRouteRequest) {\n      // Note: This should only be non-Response values if we get here, since\n      // isRouteRequest should throw any Response received in callLoaderOrAction\n      if (isErrorResult(result)) {\n        throw result.error;\n      }\n      return {\n        matches: [actionMatch],\n        loaderData: {},\n        actionData: {\n          [actionMatch.route.id]: result.data\n        },\n        errors: null,\n        // Note: statusCode + headers are unused here since queryRoute will\n        // return the raw Response or value\n        statusCode: 200,\n        loaderHeaders: {},\n        actionHeaders: {},\n        activeDeferreds: null\n      };\n    }\n    // Create a GET request for the loaders\n    let loaderRequest = new Request(request.url, {\n      headers: request.headers,\n      redirect: request.redirect,\n      signal: request.signal\n    });\n    if (isErrorResult(result)) {\n      // Store off the pending error - we use it to determine which loaders\n      // to call and will commit it when we complete the navigation\n      let boundaryMatch = skipLoaderErrorBubbling ? actionMatch : findNearestBoundary(matches, actionMatch.route.id);\n      let context = await loadRouteData(loaderRequest, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, null, [boundaryMatch.route.id, result]);\n      // action status codes take precedence over loader status codes\n      return _extends({}, context, {\n        statusCode: isRouteErrorResponse(result.error) ? result.error.status : result.statusCode != null ? result.statusCode : 500,\n        actionData: null,\n        actionHeaders: _extends({}, result.headers ? {\n          [actionMatch.route.id]: result.headers\n        } : {})\n      });\n    }\n    let context = await loadRouteData(loaderRequest, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, null);\n    return _extends({}, context, {\n      actionData: {\n        [actionMatch.route.id]: result.data\n      }\n    }, result.statusCode ? {\n      statusCode: result.statusCode\n    } : {}, {\n      actionHeaders: result.headers ? {\n        [actionMatch.route.id]: result.headers\n      } : {}\n    });\n  }\n  async function loadRouteData(request, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch, pendingActionResult) {\n    let isRouteRequest = routeMatch != null;\n    // Short circuit if we have no loaders to run (queryRoute())\n    if (isRouteRequest && !(routeMatch != null && routeMatch.route.loader) && !(routeMatch != null && routeMatch.route.lazy)) {\n      throw getInternalRouterError(400, {\n        method: request.method,\n        pathname: new URL(request.url).pathname,\n        routeId: routeMatch == null ? void 0 : routeMatch.route.id\n      });\n    }\n    let requestMatches = routeMatch ? [routeMatch] : pendingActionResult && isErrorResult(pendingActionResult[1]) ? getLoaderMatchesUntilBoundary(matches, pendingActionResult[0]) : matches;\n    let matchesToLoad = requestMatches.filter(m => m.route.loader || m.route.lazy);\n    // Short circuit if we have no loaders to run (query())\n    if (matchesToLoad.length === 0) {\n      return {\n        matches,\n        // Add a null for all matched routes for proper revalidation on the client\n        loaderData: matches.reduce((acc, m) => Object.assign(acc, {\n          [m.route.id]: null\n        }), {}),\n        errors: pendingActionResult && isErrorResult(pendingActionResult[1]) ? {\n          [pendingActionResult[0]]: pendingActionResult[1].error\n        } : null,\n        statusCode: 200,\n        loaderHeaders: {},\n        activeDeferreds: null\n      };\n    }\n    let results = await callDataStrategy(\"loader\", request, matchesToLoad, matches, isRouteRequest, requestContext, dataStrategy);\n    if (request.signal.aborted) {\n      throwStaticHandlerAbortedError(request, isRouteRequest, future);\n    }\n    // Process and commit output from loaders\n    let activeDeferreds = new Map();\n    let context = processRouteLoaderData(matches, results, pendingActionResult, activeDeferreds, skipLoaderErrorBubbling);\n    // Add a null for any non-loader matches for proper revalidation on the client\n    let executedLoaders = new Set(matchesToLoad.map(match => match.route.id));\n    matches.forEach(match => {\n      if (!executedLoaders.has(match.route.id)) {\n        context.loaderData[match.route.id] = null;\n      }\n    });\n    return _extends({}, context, {\n      matches,\n      activeDeferreds: activeDeferreds.size > 0 ? Object.fromEntries(activeDeferreds.entries()) : null\n    });\n  }\n  // Utility wrapper for calling dataStrategy server-side without having to\n  // pass around the manifest, mapRouteProperties, etc.\n  async function callDataStrategy(type, request, matchesToLoad, matches, isRouteRequest, requestContext, dataStrategy) {\n    let results = await callDataStrategyImpl(dataStrategy || defaultDataStrategy, type, null, request, matchesToLoad, matches, null, manifest, mapRouteProperties, requestContext);\n    let dataResults = {};\n    await Promise.all(matches.map(async match => {\n      if (!(match.route.id in results)) {\n        return;\n      }\n      let result = results[match.route.id];\n      if (isRedirectDataStrategyResultResult(result)) {\n        let response = result.result;\n        // Throw redirects and let the server handle them with an HTTP redirect\n        throw normalizeRelativeRoutingRedirectResponse(response, request, match.route.id, matches, basename, future.v7_relativeSplatPath);\n      }\n      if (isResponse(result.result) && isRouteRequest) {\n        // For SSR single-route requests, we want to hand Responses back\n        // directly without unwrapping\n        throw result;\n      }\n      dataResults[match.route.id] = await convertDataStrategyResultToDataResult(result);\n    }));\n    return dataResults;\n  }\n  return {\n    dataRoutes,\n    query,\n    queryRoute\n  };\n}\n//#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region Helpers\n////////////////////////////////////////////////////////////////////////////////\n/**\n * Given an existing StaticHandlerContext and an error thrown at render time,\n * provide an updated StaticHandlerContext suitable for a second SSR render\n */\nfunction getStaticContextFromError(routes, context, error) {\n  let newContext = _extends({}, context, {\n    statusCode: isRouteErrorResponse(error) ? error.status : 500,\n    errors: {\n      [context._deepestRenderedBoundaryId || routes[0].id]: error\n    }\n  });\n  return newContext;\n}\nfunction throwStaticHandlerAbortedError(request, isRouteRequest, future) {\n  if (future.v7_throwAbortReason && request.signal.reason !== undefined) {\n    throw request.signal.reason;\n  }\n  let method = isRouteRequest ? \"queryRoute\" : \"query\";\n  throw new Error(method + \"() call aborted: \" + request.method + \" \" + request.url);\n}\nfunction isSubmissionNavigation(opts) {\n  return opts != null && (\"formData\" in opts && opts.formData != null || \"body\" in opts && opts.body !== undefined);\n}\nfunction normalizeTo(location, matches, basename, prependBasename, to, v7_relativeSplatPath, fromRouteId, relative) {\n  let contextualMatches;\n  let activeRouteMatch;\n  if (fromRouteId) {\n    // Grab matches up to the calling route so our route-relative logic is\n    // relative to the correct source route\n    contextualMatches = [];\n    for (let match of matches) {\n      contextualMatches.push(match);\n      if (match.route.id === fromRouteId) {\n        activeRouteMatch = match;\n        break;\n      }\n    }\n  } else {\n    contextualMatches = matches;\n    activeRouteMatch = matches[matches.length - 1];\n  }\n  // Resolve the relative path\n  let path = resolveTo(to ? to : \".\", getResolveToMatches(contextualMatches, v7_relativeSplatPath), stripBasename(location.pathname, basename) || location.pathname, relative === \"path\");\n  // When `to` is not specified we inherit search/hash from the current\n  // location, unlike when to=\".\" and we just inherit the path.\n  // See https://github.com/remix-run/remix/issues/927\n  if (to == null) {\n    path.search = location.search;\n    path.hash = location.hash;\n  }\n  // Account for `?index` params when routing to the current location\n  if ((to == null || to === \"\" || to === \".\") && activeRouteMatch) {\n    let nakedIndex = hasNakedIndexQuery(path.search);\n    if (activeRouteMatch.route.index && !nakedIndex) {\n      // Add one when we're targeting an index route\n      path.search = path.search ? path.search.replace(/^\\?/, \"?index&\") : \"?index\";\n    } else if (!activeRouteMatch.route.index && nakedIndex) {\n      // Remove existing ones when we're not\n      let params = new URLSearchParams(path.search);\n      let indexValues = params.getAll(\"index\");\n      params.delete(\"index\");\n      indexValues.filter(v => v).forEach(v => params.append(\"index\", v));\n      let qs = params.toString();\n      path.search = qs ? \"?\" + qs : \"\";\n    }\n  }\n  // If we're operating within a basename, prepend it to the pathname.  If\n  // this is a root navigation, then just use the raw basename which allows\n  // the basename to have full control over the presence of a trailing slash\n  // on root actions\n  if (prependBasename && basename !== \"/\") {\n    path.pathname = path.pathname === \"/\" ? basename : joinPaths([basename, path.pathname]);\n  }\n  return createPath(path);\n}\n// Normalize navigation options by converting formMethod=GET formData objects to\n// URLSearchParams so they behave identically to links with query params\nfunction normalizeNavigateOptions(normalizeFormMethod, isFetcher, path, opts) {\n  // Return location verbatim on non-submission navigations\n  if (!opts || !isSubmissionNavigation(opts)) {\n    return {\n      path\n    };\n  }\n  if (opts.formMethod && !isValidMethod(opts.formMethod)) {\n    return {\n      path,\n      error: getInternalRouterError(405, {\n        method: opts.formMethod\n      })\n    };\n  }\n  let getInvalidBodyError = () => ({\n    path,\n    error: getInternalRouterError(400, {\n      type: \"invalid-body\"\n    })\n  });\n  // Create a Submission on non-GET navigations\n  let rawFormMethod = opts.formMethod || \"get\";\n  let formMethod = normalizeFormMethod ? rawFormMethod.toUpperCase() : rawFormMethod.toLowerCase();\n  let formAction = stripHashFromPath(path);\n  if (opts.body !== undefined) {\n    if (opts.formEncType === \"text/plain\") {\n      // text only support POST/PUT/PATCH/DELETE submissions\n      if (!isMutationMethod(formMethod)) {\n        return getInvalidBodyError();\n      }\n      let text = typeof opts.body === \"string\" ? opts.body : opts.body instanceof FormData || opts.body instanceof URLSearchParams ?\n      // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#plain-text-form-data\n      Array.from(opts.body.entries()).reduce((acc, _ref3) => {\n        let [name, value] = _ref3;\n        return \"\" + acc + name + \"=\" + value + \"\\n\";\n      }, \"\") : String(opts.body);\n      return {\n        path,\n        submission: {\n          formMethod,\n          formAction,\n          formEncType: opts.formEncType,\n          formData: undefined,\n          json: undefined,\n          text\n        }\n      };\n    } else if (opts.formEncType === \"application/json\") {\n      // json only supports POST/PUT/PATCH/DELETE submissions\n      if (!isMutationMethod(formMethod)) {\n        return getInvalidBodyError();\n      }\n      try {\n        let json = typeof opts.body === \"string\" ? JSON.parse(opts.body) : opts.body;\n        return {\n          path,\n          submission: {\n            formMethod,\n            formAction,\n            formEncType: opts.formEncType,\n            formData: undefined,\n            json,\n            text: undefined\n          }\n        };\n      } catch (e) {\n        return getInvalidBodyError();\n      }\n    }\n  }\n  invariant(typeof FormData === \"function\", \"FormData is not available in this environment\");\n  let searchParams;\n  let formData;\n  if (opts.formData) {\n    searchParams = convertFormDataToSearchParams(opts.formData);\n    formData = opts.formData;\n  } else if (opts.body instanceof FormData) {\n    searchParams = convertFormDataToSearchParams(opts.body);\n    formData = opts.body;\n  } else if (opts.body instanceof URLSearchParams) {\n    searchParams = opts.body;\n    formData = convertSearchParamsToFormData(searchParams);\n  } else if (opts.body == null) {\n    searchParams = new URLSearchParams();\n    formData = new FormData();\n  } else {\n    try {\n      searchParams = new URLSearchParams(opts.body);\n      formData = convertSearchParamsToFormData(searchParams);\n    } catch (e) {\n      return getInvalidBodyError();\n    }\n  }\n  let submission = {\n    formMethod,\n    formAction,\n    formEncType: opts && opts.formEncType || \"application/x-www-form-urlencoded\",\n    formData,\n    json: undefined,\n    text: undefined\n  };\n  if (isMutationMethod(submission.formMethod)) {\n    return {\n      path,\n      submission\n    };\n  }\n  // Flatten submission onto URLSearchParams for GET submissions\n  let parsedPath = parsePath(path);\n  // On GET navigation submissions we can drop the ?index param from the\n  // resulting location since all loaders will run.  But fetcher GET submissions\n  // only run a single loader so we need to preserve any incoming ?index params\n  if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) {\n    searchParams.append(\"index\", \"\");\n  }\n  parsedPath.search = \"?\" + searchParams;\n  return {\n    path: createPath(parsedPath),\n    submission\n  };\n}\n// Filter out all routes at/below any caught error as they aren't going to\n// render so we don't need to load them\nfunction getLoaderMatchesUntilBoundary(matches, boundaryId, includeBoundary) {\n  if (includeBoundary === void 0) {\n    includeBoundary = false;\n  }\n  let index = matches.findIndex(m => m.route.id === boundaryId);\n  if (index >= 0) {\n    return matches.slice(0, includeBoundary ? index + 1 : index);\n  }\n  return matches;\n}\nfunction getMatchesToLoad(history, state, matches, submission, location, initialHydration, skipActionErrorRevalidation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionResult) {\n  let actionResult = pendingActionResult ? isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : pendingActionResult[1].data : undefined;\n  let currentUrl = history.createURL(state.location);\n  let nextUrl = history.createURL(location);\n  // Pick navigation matches that are net-new or qualify for revalidation\n  let boundaryMatches = matches;\n  if (initialHydration && state.errors) {\n    // On initial hydration, only consider matches up to _and including_ the boundary.\n    // This is inclusive to handle cases where a server loader ran successfully,\n    // a child server loader bubbled up to this route, but this route has\n    // `clientLoader.hydrate` so we want to still run the `clientLoader` so that\n    // we have a complete version of `loaderData`\n    boundaryMatches = getLoaderMatchesUntilBoundary(matches, Object.keys(state.errors)[0], true);\n  } else if (pendingActionResult && isErrorResult(pendingActionResult[1])) {\n    // If an action threw an error, we call loaders up to, but not including the\n    // boundary\n    boundaryMatches = getLoaderMatchesUntilBoundary(matches, pendingActionResult[0]);\n  }\n  // Don't revalidate loaders by default after action 4xx/5xx responses\n  // when the flag is enabled.  They can still opt-into revalidation via\n  // `shouldRevalidate` via `actionResult`\n  let actionStatus = pendingActionResult ? pendingActionResult[1].statusCode : undefined;\n  let shouldSkipRevalidation = skipActionErrorRevalidation && actionStatus && actionStatus >= 400;\n  let navigationMatches = boundaryMatches.filter((match, index) => {\n    let {\n      route\n    } = match;\n    if (route.lazy) {\n      // We haven't loaded this route yet so we don't know if it's got a loader!\n      return true;\n    }\n    if (route.loader == null) {\n      return false;\n    }\n    if (initialHydration) {\n      return shouldLoadRouteOnHydration(route, state.loaderData, state.errors);\n    }\n    // Always call the loader on new route instances and pending defer cancellations\n    if (isNewLoader(state.loaderData, state.matches[index], match) || cancelledDeferredRoutes.some(id => id === match.route.id)) {\n      return true;\n    }\n    // This is the default implementation for when we revalidate.  If the route\n    // provides it's own implementation, then we give them full control but\n    // provide this value so they can leverage it if needed after they check\n    // their own specific use cases\n    let currentRouteMatch = state.matches[index];\n    let nextRouteMatch = match;\n    return shouldRevalidateLoader(match, _extends({\n      currentUrl,\n      currentParams: currentRouteMatch.params,\n      nextUrl,\n      nextParams: nextRouteMatch.params\n    }, submission, {\n      actionResult,\n      actionStatus,\n      defaultShouldRevalidate: shouldSkipRevalidation ? false :\n      // Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate\n      isRevalidationRequired || currentUrl.pathname + currentUrl.search === nextUrl.pathname + nextUrl.search ||\n      // Search params affect all loaders\n      currentUrl.search !== nextUrl.search || isNewRouteInstance(currentRouteMatch, nextRouteMatch)\n    }));\n  });\n  // Pick fetcher.loads that need to be revalidated\n  let revalidatingFetchers = [];\n  fetchLoadMatches.forEach((f, key) => {\n    // Don't revalidate:\n    //  - on initial hydration (shouldn't be any fetchers then anyway)\n    //  - if fetcher won't be present in the subsequent render\n    //    - no longer matches the URL (v7_fetcherPersist=false)\n    //    - was unmounted but persisted due to v7_fetcherPersist=true\n    if (initialHydration || !matches.some(m => m.route.id === f.routeId) || deletedFetchers.has(key)) {\n      return;\n    }\n    let fetcherMatches = matchRoutes(routesToUse, f.path, basename);\n    // If the fetcher path no longer matches, push it in with null matches so\n    // we can trigger a 404 in callLoadersAndMaybeResolveData.  Note this is\n    // currently only a use-case for Remix HMR where the route tree can change\n    // at runtime and remove a route previously loaded via a fetcher\n    if (!fetcherMatches) {\n      revalidatingFetchers.push({\n        key,\n        routeId: f.routeId,\n        path: f.path,\n        matches: null,\n        match: null,\n        controller: null\n      });\n      return;\n    }\n    // Revalidating fetchers are decoupled from the route matches since they\n    // load from a static href.  They revalidate based on explicit revalidation\n    // (submission, useRevalidator, or X-Remix-Revalidate)\n    let fetcher = state.fetchers.get(key);\n    let fetcherMatch = getTargetMatch(fetcherMatches, f.path);\n    let shouldRevalidate = false;\n    if (fetchRedirectIds.has(key)) {\n      // Never trigger a revalidation of an actively redirecting fetcher\n      shouldRevalidate = false;\n    } else if (cancelledFetcherLoads.has(key)) {\n      // Always mark for revalidation if the fetcher was cancelled\n      cancelledFetcherLoads.delete(key);\n      shouldRevalidate = true;\n    } else if (fetcher && fetcher.state !== \"idle\" && fetcher.data === undefined) {\n      // If the fetcher hasn't ever completed loading yet, then this isn't a\n      // revalidation, it would just be a brand new load if an explicit\n      // revalidation is required\n      shouldRevalidate = isRevalidationRequired;\n    } else {\n      // Otherwise fall back on any user-defined shouldRevalidate, defaulting\n      // to explicit revalidations only\n      shouldRevalidate = shouldRevalidateLoader(fetcherMatch, _extends({\n        currentUrl,\n        currentParams: state.matches[state.matches.length - 1].params,\n        nextUrl,\n        nextParams: matches[matches.length - 1].params\n      }, submission, {\n        actionResult,\n        actionStatus,\n        defaultShouldRevalidate: shouldSkipRevalidation ? false : isRevalidationRequired\n      }));\n    }\n    if (shouldRevalidate) {\n      revalidatingFetchers.push({\n        key,\n        routeId: f.routeId,\n        path: f.path,\n        matches: fetcherMatches,\n        match: fetcherMatch,\n        controller: new AbortController()\n      });\n    }\n  });\n  return [navigationMatches, revalidatingFetchers];\n}\nfunction shouldLoadRouteOnHydration(route, loaderData, errors) {\n  // We dunno if we have a loader - gotta find out!\n  if (route.lazy) {\n    return true;\n  }\n  // No loader, nothing to initialize\n  if (!route.loader) {\n    return false;\n  }\n  let hasData = loaderData != null && loaderData[route.id] !== undefined;\n  let hasError = errors != null && errors[route.id] !== undefined;\n  // Don't run if we error'd during SSR\n  if (!hasData && hasError) {\n    return false;\n  }\n  // Explicitly opting-in to running on hydration\n  if (typeof route.loader === \"function\" && route.loader.hydrate === true) {\n    return true;\n  }\n  // Otherwise, run if we're not yet initialized with anything\n  return !hasData && !hasError;\n}\nfunction isNewLoader(currentLoaderData, currentMatch, match) {\n  let isNew =\n  // [a] -> [a, b]\n  !currentMatch ||\n  // [a, b] -> [a, c]\n  match.route.id !== currentMatch.route.id;\n  // Handle the case that we don't have data for a re-used route, potentially\n  // from a prior error or from a cancelled pending deferred\n  let isMissingData = currentLoaderData[match.route.id] === undefined;\n  // Always load if this is a net-new route or we don't yet have data\n  return isNew || isMissingData;\n}\nfunction isNewRouteInstance(currentMatch, match) {\n  let currentPath = currentMatch.route.path;\n  return (\n    // param change for this match, /users/123 -> /users/456\n    currentMatch.pathname !== match.pathname ||\n    // splat param changed, which is not present in match.path\n    // e.g. /files/images/avatar.jpg -> files/finances.xls\n    currentPath != null && currentPath.endsWith(\"*\") && currentMatch.params[\"*\"] !== match.params[\"*\"]\n  );\n}\nfunction shouldRevalidateLoader(loaderMatch, arg) {\n  if (loaderMatch.route.shouldRevalidate) {\n    let routeChoice = loaderMatch.route.shouldRevalidate(arg);\n    if (typeof routeChoice === \"boolean\") {\n      return routeChoice;\n    }\n  }\n  return arg.defaultShouldRevalidate;\n}\nfunction patchRoutesImpl(routeId, children, routesToUse, manifest, mapRouteProperties) {\n  var _childrenToPatch;\n  let childrenToPatch;\n  if (routeId) {\n    let route = manifest[routeId];\n    invariant(route, \"No route found to patch children into: routeId = \" + routeId);\n    if (!route.children) {\n      route.children = [];\n    }\n    childrenToPatch = route.children;\n  } else {\n    childrenToPatch = routesToUse;\n  }\n  // Don't patch in routes we already know about so that `patch` is idempotent\n  // to simplify user-land code. This is useful because we re-call the\n  // `patchRoutesOnNavigation` function for matched routes with params.\n  let uniqueChildren = children.filter(newRoute => !childrenToPatch.some(existingRoute => isSameRoute(newRoute, existingRoute)));\n  let newRoutes = convertRoutesToDataRoutes(uniqueChildren, mapRouteProperties, [routeId || \"_\", \"patch\", String(((_childrenToPatch = childrenToPatch) == null ? void 0 : _childrenToPatch.length) || \"0\")], manifest);\n  childrenToPatch.push(...newRoutes);\n}\nfunction isSameRoute(newRoute, existingRoute) {\n  // Most optimal check is by id\n  if (\"id\" in newRoute && \"id\" in existingRoute && newRoute.id === existingRoute.id) {\n    return true;\n  }\n  // Second is by pathing differences\n  if (!(newRoute.index === existingRoute.index && newRoute.path === existingRoute.path && newRoute.caseSensitive === existingRoute.caseSensitive)) {\n    return false;\n  }\n  // Pathless layout routes are trickier since we need to check children.\n  // If they have no children then they're the same as far as we can tell\n  if ((!newRoute.children || newRoute.children.length === 0) && (!existingRoute.children || existingRoute.children.length === 0)) {\n    return true;\n  }\n  // Otherwise, we look to see if every child in the new route is already\n  // represented in the existing route's children\n  return newRoute.children.every((aChild, i) => {\n    var _existingRoute$childr;\n    return (_existingRoute$childr = existingRoute.children) == null ? void 0 : _existingRoute$childr.some(bChild => isSameRoute(aChild, bChild));\n  });\n}\n/**\n * Execute route.lazy() methods to lazily load route modules (loader, action,\n * shouldRevalidate) and update the routeManifest in place which shares objects\n * with dataRoutes so those get updated as well.\n */\nasync function loadLazyRouteModule(route, mapRouteProperties, manifest) {\n  if (!route.lazy) {\n    return;\n  }\n  let lazyRoute = await route.lazy();\n  // If the lazy route function was executed and removed by another parallel\n  // call then we can return - first lazy() to finish wins because the return\n  // value of lazy is expected to be static\n  if (!route.lazy) {\n    return;\n  }\n  let routeToUpdate = manifest[route.id];\n  invariant(routeToUpdate, \"No route found in manifest\");\n  // Update the route in place.  This should be safe because there's no way\n  // we could yet be sitting on this route as we can't get there without\n  // resolving lazy() first.\n  //\n  // This is different than the HMR \"update\" use-case where we may actively be\n  // on the route being updated.  The main concern boils down to \"does this\n  // mutation affect any ongoing navigations or any current state.matches\n  // values?\".  If not, it should be safe to update in place.\n  let routeUpdates = {};\n  for (let lazyRouteProperty in lazyRoute) {\n    let staticRouteValue = routeToUpdate[lazyRouteProperty];\n    let isPropertyStaticallyDefined = staticRouteValue !== undefined &&\n    // This property isn't static since it should always be updated based\n    // on the route updates\n    lazyRouteProperty !== \"hasErrorBoundary\";\n    warning(!isPropertyStaticallyDefined, \"Route \\\"\" + routeToUpdate.id + \"\\\" has a static property \\\"\" + lazyRouteProperty + \"\\\" \" + \"defined but its lazy function is also returning a value for this property. \" + (\"The lazy route property \\\"\" + lazyRouteProperty + \"\\\" will be ignored.\"));\n    if (!isPropertyStaticallyDefined && !immutableRouteKeys.has(lazyRouteProperty)) {\n      routeUpdates[lazyRouteProperty] = lazyRoute[lazyRouteProperty];\n    }\n  }\n  // Mutate the route with the provided updates.  Do this first so we pass\n  // the updated version to mapRouteProperties\n  Object.assign(routeToUpdate, routeUpdates);\n  // Mutate the `hasErrorBoundary` property on the route based on the route\n  // updates and remove the `lazy` function so we don't resolve the lazy\n  // route again.\n  Object.assign(routeToUpdate, _extends({}, mapRouteProperties(routeToUpdate), {\n    lazy: undefined\n  }));\n}\n// Default implementation of `dataStrategy` which fetches all loaders in parallel\nasync function defaultDataStrategy(_ref4) {\n  let {\n    matches\n  } = _ref4;\n  let matchesToLoad = matches.filter(m => m.shouldLoad);\n  let results = await Promise.all(matchesToLoad.map(m => m.resolve()));\n  return results.reduce((acc, result, i) => Object.assign(acc, {\n    [matchesToLoad[i].route.id]: result\n  }), {});\n}\nasync function callDataStrategyImpl(dataStrategyImpl, type, state, request, matchesToLoad, matches, fetcherKey, manifest, mapRouteProperties, requestContext) {\n  let loadRouteDefinitionsPromises = matches.map(m => m.route.lazy ? loadLazyRouteModule(m.route, mapRouteProperties, manifest) : undefined);\n  let dsMatches = matches.map((match, i) => {\n    let loadRoutePromise = loadRouteDefinitionsPromises[i];\n    let shouldLoad = matchesToLoad.some(m => m.route.id === match.route.id);\n    // `resolve` encapsulates route.lazy(), executing the loader/action,\n    // and mapping return values/thrown errors to a `DataStrategyResult`.  Users\n    // can pass a callback to take fine-grained control over the execution\n    // of the loader/action\n    let resolve = async handlerOverride => {\n      if (handlerOverride && request.method === \"GET\" && (match.route.lazy || match.route.loader)) {\n        shouldLoad = true;\n      }\n      return shouldLoad ? callLoaderOrAction(type, request, match, loadRoutePromise, handlerOverride, requestContext) : Promise.resolve({\n        type: ResultType.data,\n        result: undefined\n      });\n    };\n    return _extends({}, match, {\n      shouldLoad,\n      resolve\n    });\n  });\n  // Send all matches here to allow for a middleware-type implementation.\n  // handler will be a no-op for unneeded routes and we filter those results\n  // back out below.\n  let results = await dataStrategyImpl({\n    matches: dsMatches,\n    request,\n    params: matches[0].params,\n    fetcherKey,\n    context: requestContext\n  });\n  // Wait for all routes to load here but 'swallow the error since we want\n  // it to bubble up from the `await loadRoutePromise` in `callLoaderOrAction` -\n  // called from `match.resolve()`\n  try {\n    await Promise.all(loadRouteDefinitionsPromises);\n  } catch (e) {\n    // No-op\n  }\n  return results;\n}\n// Default logic for calling a loader/action is the user has no specified a dataStrategy\nasync function callLoaderOrAction(type, request, match, loadRoutePromise, handlerOverride, staticContext) {\n  let result;\n  let onReject;\n  let runHandler = handler => {\n    // Setup a promise we can race against so that abort signals short circuit\n    let reject;\n    // This will never resolve so safe to type it as Promise<DataStrategyResult> to\n    // satisfy the function return value\n    let abortPromise = new Promise((_, r) => reject = r);\n    onReject = () => reject();\n    request.signal.addEventListener(\"abort\", onReject);\n    let actualHandler = ctx => {\n      if (typeof handler !== \"function\") {\n        return Promise.reject(new Error(\"You cannot call the handler for a route which defines a boolean \" + (\"\\\"\" + type + \"\\\" [routeId: \" + match.route.id + \"]\")));\n      }\n      return handler({\n        request,\n        params: match.params,\n        context: staticContext\n      }, ...(ctx !== undefined ? [ctx] : []));\n    };\n    let handlerPromise = (async () => {\n      try {\n        let val = await (handlerOverride ? handlerOverride(ctx => actualHandler(ctx)) : actualHandler());\n        return {\n          type: \"data\",\n          result: val\n        };\n      } catch (e) {\n        return {\n          type: \"error\",\n          result: e\n        };\n      }\n    })();\n    return Promise.race([handlerPromise, abortPromise]);\n  };\n  try {\n    let handler = match.route[type];\n    // If we have a route.lazy promise, await that first\n    if (loadRoutePromise) {\n      if (handler) {\n        // Run statically defined handler in parallel with lazy()\n        let handlerError;\n        let [value] = await Promise.all([\n        // If the handler throws, don't let it immediately bubble out,\n        // since we need to let the lazy() execution finish so we know if this\n        // route has a boundary that can handle the error\n        runHandler(handler).catch(e => {\n          handlerError = e;\n        }), loadRoutePromise]);\n        if (handlerError !== undefined) {\n          throw handlerError;\n        }\n        result = value;\n      } else {\n        // Load lazy route module, then run any returned handler\n        await loadRoutePromise;\n        handler = match.route[type];\n        if (handler) {\n          // Handler still runs even if we got interrupted to maintain consistency\n          // with un-abortable behavior of handler execution on non-lazy or\n          // previously-lazy-loaded routes\n          result = await runHandler(handler);\n        } else if (type === \"action\") {\n          let url = new URL(request.url);\n          let pathname = url.pathname + url.search;\n          throw getInternalRouterError(405, {\n            method: request.method,\n            pathname,\n            routeId: match.route.id\n          });\n        } else {\n          // lazy() route has no loader to run.  Short circuit here so we don't\n          // hit the invariant below that errors on returning undefined.\n          return {\n            type: ResultType.data,\n            result: undefined\n          };\n        }\n      }\n    } else if (!handler) {\n      let url = new URL(request.url);\n      let pathname = url.pathname + url.search;\n      throw getInternalRouterError(404, {\n        pathname\n      });\n    } else {\n      result = await runHandler(handler);\n    }\n    invariant(result.result !== undefined, \"You defined \" + (type === \"action\" ? \"an action\" : \"a loader\") + \" for route \" + (\"\\\"\" + match.route.id + \"\\\" but didn't return anything from your `\" + type + \"` \") + \"function. Please return a value or `null`.\");\n  } catch (e) {\n    // We should already be catching and converting normal handler executions to\n    // DataStrategyResults and returning them, so anything that throws here is an\n    // unexpected error we still need to wrap\n    return {\n      type: ResultType.error,\n      result: e\n    };\n  } finally {\n    if (onReject) {\n      request.signal.removeEventListener(\"abort\", onReject);\n    }\n  }\n  return result;\n}\nasync function convertDataStrategyResultToDataResult(dataStrategyResult) {\n  let {\n    result,\n    type\n  } = dataStrategyResult;\n  if (isResponse(result)) {\n    let data;\n    try {\n      let contentType = result.headers.get(\"Content-Type\");\n      // Check between word boundaries instead of startsWith() due to the last\n      // paragraph of https://httpwg.org/specs/rfc9110.html#field.content-type\n      if (contentType && /\\bapplication\\/json\\b/.test(contentType)) {\n        if (result.body == null) {\n          data = null;\n        } else {\n          data = await result.json();\n        }\n      } else {\n        data = await result.text();\n      }\n    } catch (e) {\n      return {\n        type: ResultType.error,\n        error: e\n      };\n    }\n    if (type === ResultType.error) {\n      return {\n        type: ResultType.error,\n        error: new ErrorResponseImpl(result.status, result.statusText, data),\n        statusCode: result.status,\n        headers: result.headers\n      };\n    }\n    return {\n      type: ResultType.data,\n      data,\n      statusCode: result.status,\n      headers: result.headers\n    };\n  }\n  if (type === ResultType.error) {\n    if (isDataWithResponseInit(result)) {\n      var _result$init3, _result$init4;\n      if (result.data instanceof Error) {\n        var _result$init, _result$init2;\n        return {\n          type: ResultType.error,\n          error: result.data,\n          statusCode: (_result$init = result.init) == null ? void 0 : _result$init.status,\n          headers: (_result$init2 = result.init) != null && _result$init2.headers ? new Headers(result.init.headers) : undefined\n        };\n      }\n      // Convert thrown data() to ErrorResponse instances\n      return {\n        type: ResultType.error,\n        error: new ErrorResponseImpl(((_result$init3 = result.init) == null ? void 0 : _result$init3.status) || 500, undefined, result.data),\n        statusCode: isRouteErrorResponse(result) ? result.status : undefined,\n        headers: (_result$init4 = result.init) != null && _result$init4.headers ? new Headers(result.init.headers) : undefined\n      };\n    }\n    return {\n      type: ResultType.error,\n      error: result,\n      statusCode: isRouteErrorResponse(result) ? result.status : undefined\n    };\n  }\n  if (isDeferredData(result)) {\n    var _result$init5, _result$init6;\n    return {\n      type: ResultType.deferred,\n      deferredData: result,\n      statusCode: (_result$init5 = result.init) == null ? void 0 : _result$init5.status,\n      headers: ((_result$init6 = result.init) == null ? void 0 : _result$init6.headers) && new Headers(result.init.headers)\n    };\n  }\n  if (isDataWithResponseInit(result)) {\n    var _result$init7, _result$init8;\n    return {\n      type: ResultType.data,\n      data: result.data,\n      statusCode: (_result$init7 = result.init) == null ? void 0 : _result$init7.status,\n      headers: (_result$init8 = result.init) != null && _result$init8.headers ? new Headers(result.init.headers) : undefined\n    };\n  }\n  return {\n    type: ResultType.data,\n    data: result\n  };\n}\n// Support relative routing in internal redirects\nfunction normalizeRelativeRoutingRedirectResponse(response, request, routeId, matches, basename, v7_relativeSplatPath) {\n  let location = response.headers.get(\"Location\");\n  invariant(location, \"Redirects returned/thrown from loaders/actions must have a Location header\");\n  if (!ABSOLUTE_URL_REGEX.test(location)) {\n    let trimmedMatches = matches.slice(0, matches.findIndex(m => m.route.id === routeId) + 1);\n    location = normalizeTo(new URL(request.url), trimmedMatches, basename, true, location, v7_relativeSplatPath);\n    response.headers.set(\"Location\", location);\n  }\n  return response;\n}\nfunction normalizeRedirectLocation(location, currentUrl, basename) {\n  if (ABSOLUTE_URL_REGEX.test(location)) {\n    // Strip off the protocol+origin for same-origin + same-basename absolute redirects\n    let normalizedLocation = location;\n    let url = normalizedLocation.startsWith(\"//\") ? new URL(currentUrl.protocol + normalizedLocation) : new URL(normalizedLocation);\n    let isSameBasename = stripBasename(url.pathname, basename) != null;\n    if (url.origin === currentUrl.origin && isSameBasename) {\n      return url.pathname + url.search + url.hash;\n    }\n  }\n  return location;\n}\n// Utility method for creating the Request instances for loaders/actions during\n// client-side navigations and fetches.  During SSR we will always have a\n// Request instance from the static handler (query/queryRoute)\nfunction createClientSideRequest(history, location, signal, submission) {\n  let url = history.createURL(stripHashFromPath(location)).toString();\n  let init = {\n    signal\n  };\n  if (submission && isMutationMethod(submission.formMethod)) {\n    let {\n      formMethod,\n      formEncType\n    } = submission;\n    // Didn't think we needed this but it turns out unlike other methods, patch\n    // won't be properly normalized to uppercase and results in a 405 error.\n    // See: https://fetch.spec.whatwg.org/#concept-method\n    init.method = formMethod.toUpperCase();\n    if (formEncType === \"application/json\") {\n      init.headers = new Headers({\n        \"Content-Type\": formEncType\n      });\n      init.body = JSON.stringify(submission.json);\n    } else if (formEncType === \"text/plain\") {\n      // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)\n      init.body = submission.text;\n    } else if (formEncType === \"application/x-www-form-urlencoded\" && submission.formData) {\n      // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)\n      init.body = convertFormDataToSearchParams(submission.formData);\n    } else {\n      // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)\n      init.body = submission.formData;\n    }\n  }\n  return new Request(url, init);\n}\nfunction convertFormDataToSearchParams(formData) {\n  let searchParams = new URLSearchParams();\n  for (let [key, value] of formData.entries()) {\n    // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#converting-an-entry-list-to-a-list-of-name-value-pairs\n    searchParams.append(key, typeof value === \"string\" ? value : value.name);\n  }\n  return searchParams;\n}\nfunction convertSearchParamsToFormData(searchParams) {\n  let formData = new FormData();\n  for (let [key, value] of searchParams.entries()) {\n    formData.append(key, value);\n  }\n  return formData;\n}\nfunction processRouteLoaderData(matches, results, pendingActionResult, activeDeferreds, skipLoaderErrorBubbling) {\n  // Fill in loaderData/errors from our loaders\n  let loaderData = {};\n  let errors = null;\n  let statusCode;\n  let foundError = false;\n  let loaderHeaders = {};\n  let pendingError = pendingActionResult && isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : undefined;\n  // Process loader results into state.loaderData/state.errors\n  matches.forEach(match => {\n    if (!(match.route.id in results)) {\n      return;\n    }\n    let id = match.route.id;\n    let result = results[id];\n    invariant(!isRedirectResult(result), \"Cannot handle redirect results in processLoaderData\");\n    if (isErrorResult(result)) {\n      let error = result.error;\n      // If we have a pending action error, we report it at the highest-route\n      // that throws a loader error, and then clear it out to indicate that\n      // it was consumed\n      if (pendingError !== undefined) {\n        error = pendingError;\n        pendingError = undefined;\n      }\n      errors = errors || {};\n      if (skipLoaderErrorBubbling) {\n        errors[id] = error;\n      } else {\n        // Look upwards from the matched route for the closest ancestor error\n        // boundary, defaulting to the root match.  Prefer higher error values\n        // if lower errors bubble to the same boundary\n        let boundaryMatch = findNearestBoundary(matches, id);\n        if (errors[boundaryMatch.route.id] == null) {\n          errors[boundaryMatch.route.id] = error;\n        }\n      }\n      // Clear our any prior loaderData for the throwing route\n      loaderData[id] = undefined;\n      // Once we find our first (highest) error, we set the status code and\n      // prevent deeper status codes from overriding\n      if (!foundError) {\n        foundError = true;\n        statusCode = isRouteErrorResponse(result.error) ? result.error.status : 500;\n      }\n      if (result.headers) {\n        loaderHeaders[id] = result.headers;\n      }\n    } else {\n      if (isDeferredResult(result)) {\n        activeDeferreds.set(id, result.deferredData);\n        loaderData[id] = result.deferredData.data;\n        // Error status codes always override success status codes, but if all\n        // loaders are successful we take the deepest status code.\n        if (result.statusCode != null && result.statusCode !== 200 && !foundError) {\n          statusCode = result.statusCode;\n        }\n        if (result.headers) {\n          loaderHeaders[id] = result.headers;\n        }\n      } else {\n        loaderData[id] = result.data;\n        // Error status codes always override success status codes, but if all\n        // loaders are successful we take the deepest status code.\n        if (result.statusCode && result.statusCode !== 200 && !foundError) {\n          statusCode = result.statusCode;\n        }\n        if (result.headers) {\n          loaderHeaders[id] = result.headers;\n        }\n      }\n    }\n  });\n  // If we didn't consume the pending action error (i.e., all loaders\n  // resolved), then consume it here.  Also clear out any loaderData for the\n  // throwing route\n  if (pendingError !== undefined && pendingActionResult) {\n    errors = {\n      [pendingActionResult[0]]: pendingError\n    };\n    loaderData[pendingActionResult[0]] = undefined;\n  }\n  return {\n    loaderData,\n    errors,\n    statusCode: statusCode || 200,\n    loaderHeaders\n  };\n}\nfunction processLoaderData(state, matches, results, pendingActionResult, revalidatingFetchers, fetcherResults, activeDeferreds) {\n  let {\n    loaderData,\n    errors\n  } = processRouteLoaderData(matches, results, pendingActionResult, activeDeferreds, false // This method is only called client side so we always want to bubble\n  );\n  // Process results from our revalidating fetchers\n  revalidatingFetchers.forEach(rf => {\n    let {\n      key,\n      match,\n      controller\n    } = rf;\n    let result = fetcherResults[key];\n    invariant(result, \"Did not find corresponding fetcher result\");\n    // Process fetcher non-redirect errors\n    if (controller && controller.signal.aborted) {\n      // Nothing to do for aborted fetchers\n      return;\n    } else if (isErrorResult(result)) {\n      let boundaryMatch = findNearestBoundary(state.matches, match == null ? void 0 : match.route.id);\n      if (!(errors && errors[boundaryMatch.route.id])) {\n        errors = _extends({}, errors, {\n          [boundaryMatch.route.id]: result.error\n        });\n      }\n      state.fetchers.delete(key);\n    } else if (isRedirectResult(result)) {\n      // Should never get here, redirects should get processed above, but we\n      // keep this to type narrow to a success result in the else\n      invariant(false, \"Unhandled fetcher revalidation redirect\");\n    } else if (isDeferredResult(result)) {\n      // Should never get here, deferred data should be awaited for fetchers\n      // in resolveDeferredResults\n      invariant(false, \"Unhandled fetcher deferred data\");\n    } else {\n      let doneFetcher = getDoneFetcher(result.data);\n      state.fetchers.set(key, doneFetcher);\n    }\n  });\n  return {\n    loaderData,\n    errors\n  };\n}\nfunction mergeLoaderData(loaderData, newLoaderData, matches, errors) {\n  let mergedLoaderData = _extends({}, newLoaderData);\n  for (let match of matches) {\n    let id = match.route.id;\n    if (newLoaderData.hasOwnProperty(id)) {\n      if (newLoaderData[id] !== undefined) {\n        mergedLoaderData[id] = newLoaderData[id];\n      }\n    } else if (loaderData[id] !== undefined && match.route.loader) {\n      // Preserve existing keys not included in newLoaderData and where a loader\n      // wasn't removed by HMR\n      mergedLoaderData[id] = loaderData[id];\n    }\n    if (errors && errors.hasOwnProperty(id)) {\n      // Don't keep any loader data below the boundary\n      break;\n    }\n  }\n  return mergedLoaderData;\n}\nfunction getActionDataForCommit(pendingActionResult) {\n  if (!pendingActionResult) {\n    return {};\n  }\n  return isErrorResult(pendingActionResult[1]) ? {\n    // Clear out prior actionData on errors\n    actionData: {}\n  } : {\n    actionData: {\n      [pendingActionResult[0]]: pendingActionResult[1].data\n    }\n  };\n}\n// Find the nearest error boundary, looking upwards from the leaf route (or the\n// route specified by routeId) for the closest ancestor error boundary,\n// defaulting to the root match\nfunction findNearestBoundary(matches, routeId) {\n  let eligibleMatches = routeId ? matches.slice(0, matches.findIndex(m => m.route.id === routeId) + 1) : [...matches];\n  return eligibleMatches.reverse().find(m => m.route.hasErrorBoundary === true) || matches[0];\n}\nfunction getShortCircuitMatches(routes) {\n  // Prefer a root layout route if present, otherwise shim in a route object\n  let route = routes.length === 1 ? routes[0] : routes.find(r => r.index || !r.path || r.path === \"/\") || {\n    id: \"__shim-error-route__\"\n  };\n  return {\n    matches: [{\n      params: {},\n      pathname: \"\",\n      pathnameBase: \"\",\n      route\n    }],\n    route\n  };\n}\nfunction getInternalRouterError(status, _temp5) {\n  let {\n    pathname,\n    routeId,\n    method,\n    type,\n    message\n  } = _temp5 === void 0 ? {} : _temp5;\n  let statusText = \"Unknown Server Error\";\n  let errorMessage = \"Unknown @remix-run/router error\";\n  if (status === 400) {\n    statusText = \"Bad Request\";\n    if (method && pathname && routeId) {\n      errorMessage = \"You made a \" + method + \" request to \\\"\" + pathname + \"\\\" but \" + (\"did not provide a `loader` for route \\\"\" + routeId + \"\\\", \") + \"so there is no way to handle the request.\";\n    } else if (type === \"defer-action\") {\n      errorMessage = \"defer() is not supported in actions\";\n    } else if (type === \"invalid-body\") {\n      errorMessage = \"Unable to encode submission body\";\n    }\n  } else if (status === 403) {\n    statusText = \"Forbidden\";\n    errorMessage = \"Route \\\"\" + routeId + \"\\\" does not match URL \\\"\" + pathname + \"\\\"\";\n  } else if (status === 404) {\n    statusText = \"Not Found\";\n    errorMessage = \"No route matches URL \\\"\" + pathname + \"\\\"\";\n  } else if (status === 405) {\n    statusText = \"Method Not Allowed\";\n    if (method && pathname && routeId) {\n      errorMessage = \"You made a \" + method.toUpperCase() + \" request to \\\"\" + pathname + \"\\\" but \" + (\"did not provide an `action` for route \\\"\" + routeId + \"\\\", \") + \"so there is no way to handle the request.\";\n    } else if (method) {\n      errorMessage = \"Invalid request method \\\"\" + method.toUpperCase() + \"\\\"\";\n    }\n  }\n  return new ErrorResponseImpl(status || 500, statusText, new Error(errorMessage), true);\n}\n// Find any returned redirect errors, starting from the lowest match\nfunction findRedirect(results) {\n  let entries = Object.entries(results);\n  for (let i = entries.length - 1; i >= 0; i--) {\n    let [key, result] = entries[i];\n    if (isRedirectResult(result)) {\n      return {\n        key,\n        result\n      };\n    }\n  }\n}\nfunction stripHashFromPath(path) {\n  let parsedPath = typeof path === \"string\" ? parsePath(path) : path;\n  return createPath(_extends({}, parsedPath, {\n    hash: \"\"\n  }));\n}\nfunction isHashChangeOnly(a, b) {\n  if (a.pathname !== b.pathname || a.search !== b.search) {\n    return false;\n  }\n  if (a.hash === \"\") {\n    // /page -> /page#hash\n    return b.hash !== \"\";\n  } else if (a.hash === b.hash) {\n    // /page#hash -> /page#hash\n    return true;\n  } else if (b.hash !== \"\") {\n    // /page#hash -> /page#other\n    return true;\n  }\n  // If the hash is removed the browser will re-perform a request to the server\n  // /page#hash -> /page\n  return false;\n}\nfunction isDataStrategyResult(result) {\n  return result != null && typeof result === \"object\" && \"type\" in result && \"result\" in result && (result.type === ResultType.data || result.type === ResultType.error);\n}\nfunction isRedirectDataStrategyResultResult(result) {\n  return isResponse(result.result) && redirectStatusCodes.has(result.result.status);\n}\nfunction isDeferredResult(result) {\n  return result.type === ResultType.deferred;\n}\nfunction isErrorResult(result) {\n  return result.type === ResultType.error;\n}\nfunction isRedirectResult(result) {\n  return (result && result.type) === ResultType.redirect;\n}\nfunction isDataWithResponseInit(value) {\n  return typeof value === \"object\" && value != null && \"type\" in value && \"data\" in value && \"init\" in value && value.type === \"DataWithResponseInit\";\n}\nfunction isDeferredData(value) {\n  let deferred = value;\n  return deferred && typeof deferred === \"object\" && typeof deferred.data === \"object\" && typeof deferred.subscribe === \"function\" && typeof deferred.cancel === \"function\" && typeof deferred.resolveData === \"function\";\n}\nfunction isResponse(value) {\n  return value != null && typeof value.status === \"number\" && typeof value.statusText === \"string\" && typeof value.headers === \"object\" && typeof value.body !== \"undefined\";\n}\nfunction isRedirectResponse(result) {\n  if (!isResponse(result)) {\n    return false;\n  }\n  let status = result.status;\n  let location = result.headers.get(\"Location\");\n  return status >= 300 && status <= 399 && location != null;\n}\nfunction isValidMethod(method) {\n  return validRequestMethods.has(method.toLowerCase());\n}\nfunction isMutationMethod(method) {\n  return validMutationMethods.has(method.toLowerCase());\n}\nasync function resolveNavigationDeferredResults(matches, results, signal, currentMatches, currentLoaderData) {\n  let entries = Object.entries(results);\n  for (let index = 0; index < entries.length; index++) {\n    let [routeId, result] = entries[index];\n    let match = matches.find(m => (m == null ? void 0 : m.route.id) === routeId);\n    // If we don't have a match, then we can have a deferred result to do\n    // anything with.  This is for revalidating fetchers where the route was\n    // removed during HMR\n    if (!match) {\n      continue;\n    }\n    let currentMatch = currentMatches.find(m => m.route.id === match.route.id);\n    let isRevalidatingLoader = currentMatch != null && !isNewRouteInstance(currentMatch, match) && (currentLoaderData && currentLoaderData[match.route.id]) !== undefined;\n    if (isDeferredResult(result) && isRevalidatingLoader) {\n      // Note: we do not have to touch activeDeferreds here since we race them\n      // against the signal in resolveDeferredData and they'll get aborted\n      // there if needed\n      await resolveDeferredData(result, signal, false).then(result => {\n        if (result) {\n          results[routeId] = result;\n        }\n      });\n    }\n  }\n}\nasync function resolveFetcherDeferredResults(matches, results, revalidatingFetchers) {\n  for (let index = 0; index < revalidatingFetchers.length; index++) {\n    let {\n      key,\n      routeId,\n      controller\n    } = revalidatingFetchers[index];\n    let result = results[key];\n    let match = matches.find(m => (m == null ? void 0 : m.route.id) === routeId);\n    // If we don't have a match, then we can have a deferred result to do\n    // anything with.  This is for revalidating fetchers where the route was\n    // removed during HMR\n    if (!match) {\n      continue;\n    }\n    if (isDeferredResult(result)) {\n      // Note: we do not have to touch activeDeferreds here since we race them\n      // against the signal in resolveDeferredData and they'll get aborted\n      // there if needed\n      invariant(controller, \"Expected an AbortController for revalidating fetcher deferred result\");\n      await resolveDeferredData(result, controller.signal, true).then(result => {\n        if (result) {\n          results[key] = result;\n        }\n      });\n    }\n  }\n}\nasync function resolveDeferredData(result, signal, unwrap) {\n  if (unwrap === void 0) {\n    unwrap = false;\n  }\n  let aborted = await result.deferredData.resolveData(signal);\n  if (aborted) {\n    return;\n  }\n  if (unwrap) {\n    try {\n      return {\n        type: ResultType.data,\n        data: result.deferredData.unwrappedData\n      };\n    } catch (e) {\n      // Handle any TrackedPromise._error values encountered while unwrapping\n      return {\n        type: ResultType.error,\n        error: e\n      };\n    }\n  }\n  return {\n    type: ResultType.data,\n    data: result.deferredData.data\n  };\n}\nfunction hasNakedIndexQuery(search) {\n  return new URLSearchParams(search).getAll(\"index\").some(v => v === \"\");\n}\nfunction getTargetMatch(matches, location) {\n  let search = typeof location === \"string\" ? parsePath(location).search : location.search;\n  if (matches[matches.length - 1].route.index && hasNakedIndexQuery(search || \"\")) {\n    // Return the leaf index route when index is present\n    return matches[matches.length - 1];\n  }\n  // Otherwise grab the deepest \"path contributing\" match (ignoring index and\n  // pathless layout routes)\n  let pathMatches = getPathContributingMatches(matches);\n  return pathMatches[pathMatches.length - 1];\n}\nfunction getSubmissionFromNavigation(navigation) {\n  let {\n    formMethod,\n    formAction,\n    formEncType,\n    text,\n    formData,\n    json\n  } = navigation;\n  if (!formMethod || !formAction || !formEncType) {\n    return;\n  }\n  if (text != null) {\n    return {\n      formMethod,\n      formAction,\n      formEncType,\n      formData: undefined,\n      json: undefined,\n      text\n    };\n  } else if (formData != null) {\n    return {\n      formMethod,\n      formAction,\n      formEncType,\n      formData,\n      json: undefined,\n      text: undefined\n    };\n  } else if (json !== undefined) {\n    return {\n      formMethod,\n      formAction,\n      formEncType,\n      formData: undefined,\n      json,\n      text: undefined\n    };\n  }\n}\nfunction getLoadingNavigation(location, submission) {\n  if (submission) {\n    let navigation = {\n      state: \"loading\",\n      location,\n      formMethod: submission.formMethod,\n      formAction: submission.formAction,\n      formEncType: submission.formEncType,\n      formData: submission.formData,\n      json: submission.json,\n      text: submission.text\n    };\n    return navigation;\n  } else {\n    let navigation = {\n      state: \"loading\",\n      location,\n      formMethod: undefined,\n      formAction: undefined,\n      formEncType: undefined,\n      formData: undefined,\n      json: undefined,\n      text: undefined\n    };\n    return navigation;\n  }\n}\nfunction getSubmittingNavigation(location, submission) {\n  let navigation = {\n    state: \"submitting\",\n    location,\n    formMethod: submission.formMethod,\n    formAction: submission.formAction,\n    formEncType: submission.formEncType,\n    formData: submission.formData,\n    json: submission.json,\n    text: submission.text\n  };\n  return navigation;\n}\nfunction getLoadingFetcher(submission, data) {\n  if (submission) {\n    let fetcher = {\n      state: \"loading\",\n      formMethod: submission.formMethod,\n      formAction: submission.formAction,\n      formEncType: submission.formEncType,\n      formData: submission.formData,\n      json: submission.json,\n      text: submission.text,\n      data\n    };\n    return fetcher;\n  } else {\n    let fetcher = {\n      state: \"loading\",\n      formMethod: undefined,\n      formAction: undefined,\n      formEncType: undefined,\n      formData: undefined,\n      json: undefined,\n      text: undefined,\n      data\n    };\n    return fetcher;\n  }\n}\nfunction getSubmittingFetcher(submission, existingFetcher) {\n  let fetcher = {\n    state: \"submitting\",\n    formMethod: submission.formMethod,\n    formAction: submission.formAction,\n    formEncType: submission.formEncType,\n    formData: submission.formData,\n    json: submission.json,\n    text: submission.text,\n    data: existingFetcher ? existingFetcher.data : undefined\n  };\n  return fetcher;\n}\nfunction getDoneFetcher(data) {\n  let fetcher = {\n    state: \"idle\",\n    formMethod: undefined,\n    formAction: undefined,\n    formEncType: undefined,\n    formData: undefined,\n    json: undefined,\n    text: undefined,\n    data\n  };\n  return fetcher;\n}\nfunction restoreAppliedTransitions(_window, transitions) {\n  try {\n    let sessionPositions = _window.sessionStorage.getItem(TRANSITIONS_STORAGE_KEY);\n    if (sessionPositions) {\n      let json = JSON.parse(sessionPositions);\n      for (let [k, v] of Object.entries(json || {})) {\n        if (v && Array.isArray(v)) {\n          transitions.set(k, new Set(v || []));\n        }\n      }\n    }\n  } catch (e) {\n    // no-op, use default empty object\n  }\n}\nfunction persistAppliedTransitions(_window, transitions) {\n  if (transitions.size > 0) {\n    let json = {};\n    for (let [k, v] of transitions) {\n      json[k] = [...v];\n    }\n    try {\n      _window.sessionStorage.setItem(TRANSITIONS_STORAGE_KEY, JSON.stringify(json));\n    } catch (error) {\n      warning(false, \"Failed to save applied view transitions in sessionStorage (\" + error + \").\");\n    }\n  }\n}\n//#endregion\n\nexport { AbortedDeferredError, Action, IDLE_BLOCKER, IDLE_FETCHER, IDLE_NAVIGATION, UNSAFE_DEFERRED_SYMBOL, DeferredData as UNSAFE_DeferredData, ErrorResponseImpl as UNSAFE_ErrorResponseImpl, convertRouteMatchToUiMatch as UNSAFE_convertRouteMatchToUiMatch, convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes, decodePath as UNSAFE_decodePath, getResolveToMatches as UNSAFE_getResolveToMatches, invariant as UNSAFE_invariant, warning as UNSAFE_warning, createBrowserHistory, createHashHistory, createMemoryHistory, createPath, createRouter, createStaticHandler, data, defer, generatePath, getStaticContextFromError, getToPathname, isDataWithResponseInit, isDeferredData, isRouteErrorResponse, joinPaths, json, matchPath, matchRoutes, normalizePathname, parsePath, redirect, redirectDocument, replace, resolvePath, resolveTo, stripBasename };\n//# sourceMappingURL=router.js.map\n","/**\n * React Router v6.30.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport * as React from 'react';\nimport { UNSAFE_invariant, joinPaths, matchPath, UNSAFE_decodePath, UNSAFE_getResolveToMatches, UNSAFE_warning, resolveTo, parsePath, matchRoutes, Action, UNSAFE_convertRouteMatchToUiMatch, stripBasename, IDLE_BLOCKER, isRouteErrorResponse, createMemoryHistory, AbortedDeferredError, createRouter } from '@remix-run/router';\nexport { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, replace, resolvePath } from '@remix-run/router';\n\nfunction _extends() {\n  _extends = Object.assign ? Object.assign.bind() : function (target) {\n    for (var i = 1; i < arguments.length; i++) {\n      var source = arguments[i];\n      for (var key in source) {\n        if (Object.prototype.hasOwnProperty.call(source, key)) {\n          target[key] = source[key];\n        }\n      }\n    }\n    return target;\n  };\n  return _extends.apply(this, arguments);\n}\n\n// Create react-specific types from the agnostic types in @remix-run/router to\n// export from react-router\nconst DataRouterContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") {\n  DataRouterContext.displayName = \"DataRouter\";\n}\nconst DataRouterStateContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") {\n  DataRouterStateContext.displayName = \"DataRouterState\";\n}\nconst AwaitContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") {\n  AwaitContext.displayName = \"Await\";\n}\n\n/**\n * A Navigator is a \"location changer\"; it's how you get to different locations.\n *\n * Every history instance conforms to the Navigator interface, but the\n * distinction is useful primarily when it comes to the low-level `<Router>` API\n * where both the location and a navigator must be provided separately in order\n * to avoid \"tearing\" that may occur in a suspense-enabled app if the action\n * and/or location were to be read directly from the history instance.\n */\n\nconst NavigationContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") {\n  NavigationContext.displayName = \"Navigation\";\n}\nconst LocationContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") {\n  LocationContext.displayName = \"Location\";\n}\nconst RouteContext = /*#__PURE__*/React.createContext({\n  outlet: null,\n  matches: [],\n  isDataRoute: false\n});\nif (process.env.NODE_ENV !== \"production\") {\n  RouteContext.displayName = \"Route\";\n}\nconst RouteErrorContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") {\n  RouteErrorContext.displayName = \"RouteError\";\n}\n\n/**\n * Returns the full href for the given \"to\" value. This is useful for building\n * custom links that are also accessible and preserve right-click behavior.\n *\n * @see https://reactrouter.com/v6/hooks/use-href\n */\nfunction useHref(to, _temp) {\n  let {\n    relative\n  } = _temp === void 0 ? {} : _temp;\n  !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n  // router loaded. We can help them understand how to avoid that.\n  \"useHref() may be used only in the context of a <Router> component.\") : UNSAFE_invariant(false) : void 0;\n  let {\n    basename,\n    navigator\n  } = React.useContext(NavigationContext);\n  let {\n    hash,\n    pathname,\n    search\n  } = useResolvedPath(to, {\n    relative\n  });\n  let joinedPathname = pathname;\n\n  // If we're operating within a basename, prepend it to the pathname prior\n  // to creating the href.  If this is a root navigation, then just use the raw\n  // basename which allows the basename to have full control over the presence\n  // of a trailing slash on root links\n  if (basename !== \"/\") {\n    joinedPathname = pathname === \"/\" ? basename : joinPaths([basename, pathname]);\n  }\n  return navigator.createHref({\n    pathname: joinedPathname,\n    search,\n    hash\n  });\n}\n\n/**\n * Returns true if this component is a descendant of a `<Router>`.\n *\n * @see https://reactrouter.com/v6/hooks/use-in-router-context\n */\nfunction useInRouterContext() {\n  return React.useContext(LocationContext) != null;\n}\n\n/**\n * Returns the current location object, which represents the current URL in web\n * browsers.\n *\n * Note: If you're using this it may mean you're doing some of your own\n * \"routing\" in your app, and we'd like to know what your use case is. We may\n * be able to provide something higher-level to better suit your needs.\n *\n * @see https://reactrouter.com/v6/hooks/use-location\n */\nfunction useLocation() {\n  !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n  // router loaded. We can help them understand how to avoid that.\n  \"useLocation() may be used only in the context of a <Router> component.\") : UNSAFE_invariant(false) : void 0;\n  return React.useContext(LocationContext).location;\n}\n\n/**\n * Returns the current navigation action which describes how the router came to\n * the current location, either by a pop, push, or replace on the history stack.\n *\n * @see https://reactrouter.com/v6/hooks/use-navigation-type\n */\nfunction useNavigationType() {\n  return React.useContext(LocationContext).navigationType;\n}\n\n/**\n * Returns a PathMatch object if the given pattern matches the current URL.\n * This is useful for components that need to know \"active\" state, e.g.\n * `<NavLink>`.\n *\n * @see https://reactrouter.com/v6/hooks/use-match\n */\nfunction useMatch(pattern) {\n  !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n  // router loaded. We can help them understand how to avoid that.\n  \"useMatch() may be used only in the context of a <Router> component.\") : UNSAFE_invariant(false) : void 0;\n  let {\n    pathname\n  } = useLocation();\n  return React.useMemo(() => matchPath(pattern, UNSAFE_decodePath(pathname)), [pathname, pattern]);\n}\n\n/**\n * The interface for the navigate() function returned from useNavigate().\n */\n\nconst navigateEffectWarning = \"You should call navigate() in a React.useEffect(), not when \" + \"your component is first rendered.\";\n\n// Mute warnings for calls to useNavigate in SSR environments\nfunction useIsomorphicLayoutEffect(cb) {\n  let isStatic = React.useContext(NavigationContext).static;\n  if (!isStatic) {\n    // We should be able to get rid of this once react 18.3 is released\n    // See: https://github.com/facebook/react/pull/26395\n    // eslint-disable-next-line react-hooks/rules-of-hooks\n    React.useLayoutEffect(cb);\n  }\n}\n\n/**\n * Returns an imperative method for changing the location. Used by `<Link>`s, but\n * may also be used by other elements to change the location.\n *\n * @see https://reactrouter.com/v6/hooks/use-navigate\n */\nfunction useNavigate() {\n  let {\n    isDataRoute\n  } = React.useContext(RouteContext);\n  // Conditional usage is OK here because the usage of a data router is static\n  // eslint-disable-next-line react-hooks/rules-of-hooks\n  return isDataRoute ? useNavigateStable() : useNavigateUnstable();\n}\nfunction useNavigateUnstable() {\n  !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n  // router loaded. We can help them understand how to avoid that.\n  \"useNavigate() may be used only in the context of a <Router> component.\") : UNSAFE_invariant(false) : void 0;\n  let dataRouterContext = React.useContext(DataRouterContext);\n  let {\n    basename,\n    future,\n    navigator\n  } = React.useContext(NavigationContext);\n  let {\n    matches\n  } = React.useContext(RouteContext);\n  let {\n    pathname: locationPathname\n  } = useLocation();\n  let routePathnamesJson = JSON.stringify(UNSAFE_getResolveToMatches(matches, future.v7_relativeSplatPath));\n  let activeRef = React.useRef(false);\n  useIsomorphicLayoutEffect(() => {\n    activeRef.current = true;\n  });\n  let navigate = React.useCallback(function (to, options) {\n    if (options === void 0) {\n      options = {};\n    }\n    process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(activeRef.current, navigateEffectWarning) : void 0;\n\n    // Short circuit here since if this happens on first render the navigate\n    // is useless because we haven't wired up our history listener yet\n    if (!activeRef.current) return;\n    if (typeof to === \"number\") {\n      navigator.go(to);\n      return;\n    }\n    let path = resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === \"path\");\n\n    // If we're operating within a basename, prepend it to the pathname prior\n    // to handing off to history (but only if we're not in a data router,\n    // otherwise it'll prepend the basename inside of the router).\n    // If this is a root navigation, then we navigate to the raw basename\n    // which allows the basename to have full control over the presence of a\n    // trailing slash on root links\n    if (dataRouterContext == null && basename !== \"/\") {\n      path.pathname = path.pathname === \"/\" ? basename : joinPaths([basename, path.pathname]);\n    }\n    (!!options.replace ? navigator.replace : navigator.push)(path, options.state, options);\n  }, [basename, navigator, routePathnamesJson, locationPathname, dataRouterContext]);\n  return navigate;\n}\nconst OutletContext = /*#__PURE__*/React.createContext(null);\n\n/**\n * Returns the context (if provided) for the child route at this level of the route\n * hierarchy.\n * @see https://reactrouter.com/v6/hooks/use-outlet-context\n */\nfunction useOutletContext() {\n  return React.useContext(OutletContext);\n}\n\n/**\n * Returns the element for the child route at this level of the route\n * hierarchy. Used internally by `<Outlet>` to render child routes.\n *\n * @see https://reactrouter.com/v6/hooks/use-outlet\n */\nfunction useOutlet(context) {\n  let outlet = React.useContext(RouteContext).outlet;\n  if (outlet) {\n    return /*#__PURE__*/React.createElement(OutletContext.Provider, {\n      value: context\n    }, outlet);\n  }\n  return outlet;\n}\n\n/**\n * Returns an object of key/value pairs of the dynamic params from the current\n * URL that were matched by the route path.\n *\n * @see https://reactrouter.com/v6/hooks/use-params\n */\nfunction useParams() {\n  let {\n    matches\n  } = React.useContext(RouteContext);\n  let routeMatch = matches[matches.length - 1];\n  return routeMatch ? routeMatch.params : {};\n}\n\n/**\n * Resolves the pathname of the given `to` value against the current location.\n *\n * @see https://reactrouter.com/v6/hooks/use-resolved-path\n */\nfunction useResolvedPath(to, _temp2) {\n  let {\n    relative\n  } = _temp2 === void 0 ? {} : _temp2;\n  let {\n    future\n  } = React.useContext(NavigationContext);\n  let {\n    matches\n  } = React.useContext(RouteContext);\n  let {\n    pathname: locationPathname\n  } = useLocation();\n  let routePathnamesJson = JSON.stringify(UNSAFE_getResolveToMatches(matches, future.v7_relativeSplatPath));\n  return React.useMemo(() => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, relative === \"path\"), [to, routePathnamesJson, locationPathname, relative]);\n}\n\n/**\n * Returns the element of the route that matched the current location, prepared\n * with the correct context to render the remainder of the route tree. Route\n * elements in the tree must render an `<Outlet>` to render their child route's\n * element.\n *\n * @see https://reactrouter.com/v6/hooks/use-routes\n */\nfunction useRoutes(routes, locationArg) {\n  return useRoutesImpl(routes, locationArg);\n}\n\n// Internal implementation with accept optional param for RouterProvider usage\nfunction useRoutesImpl(routes, locationArg, dataRouterState, future) {\n  !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n  // router loaded. We can help them understand how to avoid that.\n  \"useRoutes() may be used only in the context of a <Router> component.\") : UNSAFE_invariant(false) : void 0;\n  let {\n    navigator\n  } = React.useContext(NavigationContext);\n  let {\n    matches: parentMatches\n  } = React.useContext(RouteContext);\n  let routeMatch = parentMatches[parentMatches.length - 1];\n  let parentParams = routeMatch ? routeMatch.params : {};\n  let parentPathname = routeMatch ? routeMatch.pathname : \"/\";\n  let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : \"/\";\n  let parentRoute = routeMatch && routeMatch.route;\n  if (process.env.NODE_ENV !== \"production\") {\n    // You won't get a warning about 2 different <Routes> under a <Route>\n    // without a trailing *, but this is a best-effort warning anyway since we\n    // cannot even give the warning unless they land at the parent route.\n    //\n    // Example:\n    //\n    // <Routes>\n    //   {/* This route path MUST end with /* because otherwise\n    //       it will never match /blog/post/123 */}\n    //   <Route path=\"blog\" element={<Blog />} />\n    //   <Route path=\"blog/feed\" element={<BlogFeed />} />\n    // </Routes>\n    //\n    // function Blog() {\n    //   return (\n    //     <Routes>\n    //       <Route path=\"post/:id\" element={<Post />} />\n    //     </Routes>\n    //   );\n    // }\n    let parentPath = parentRoute && parentRoute.path || \"\";\n    warningOnce(parentPathname, !parentRoute || parentPath.endsWith(\"*\"), \"You rendered descendant <Routes> (or called `useRoutes()`) at \" + (\"\\\"\" + parentPathname + \"\\\" (under <Route path=\\\"\" + parentPath + \"\\\">) but the \") + \"parent route path has no trailing \\\"*\\\". This means if you navigate \" + \"deeper, the parent won't match anymore and therefore the child \" + \"routes will never render.\\n\\n\" + (\"Please change the parent <Route path=\\\"\" + parentPath + \"\\\"> to <Route \") + (\"path=\\\"\" + (parentPath === \"/\" ? \"*\" : parentPath + \"/*\") + \"\\\">.\"));\n  }\n  let locationFromContext = useLocation();\n  let location;\n  if (locationArg) {\n    var _parsedLocationArg$pa;\n    let parsedLocationArg = typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n    !(parentPathnameBase === \"/\" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, \" + \"the location pathname must begin with the portion of the URL pathname that was \" + (\"matched by all parent routes. The current pathname base is \\\"\" + parentPathnameBase + \"\\\" \") + (\"but pathname \\\"\" + parsedLocationArg.pathname + \"\\\" was given in the `location` prop.\")) : UNSAFE_invariant(false) : void 0;\n    location = parsedLocationArg;\n  } else {\n    location = locationFromContext;\n  }\n  let pathname = location.pathname || \"/\";\n  let remainingPathname = pathname;\n  if (parentPathnameBase !== \"/\") {\n    // Determine the remaining pathname by removing the # of URL segments the\n    // parentPathnameBase has, instead of removing based on character count.\n    // This is because we can't guarantee that incoming/outgoing encodings/\n    // decodings will match exactly.\n    // We decode paths before matching on a per-segment basis with\n    // decodeURIComponent(), but we re-encode pathnames via `new URL()` so they\n    // match what `window.location.pathname` would reflect.  Those don't 100%\n    // align when it comes to encoded URI characters such as % and &.\n    //\n    // So we may end up with:\n    //   pathname:           \"/descendant/a%25b/match\"\n    //   parentPathnameBase: \"/descendant/a%b\"\n    //\n    // And the direct substring removal approach won't work :/\n    let parentSegments = parentPathnameBase.replace(/^\\//, \"\").split(\"/\");\n    let segments = pathname.replace(/^\\//, \"\").split(\"/\");\n    remainingPathname = \"/\" + segments.slice(parentSegments.length).join(\"/\");\n  }\n  let matches = matchRoutes(routes, {\n    pathname: remainingPathname\n  });\n  if (process.env.NODE_ENV !== \"production\") {\n    process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(parentRoute || matches != null, \"No routes matched location \\\"\" + location.pathname + location.search + location.hash + \"\\\" \") : void 0;\n    process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(matches == null || matches[matches.length - 1].route.element !== undefined || matches[matches.length - 1].route.Component !== undefined || matches[matches.length - 1].route.lazy !== undefined, \"Matched leaf route at location \\\"\" + location.pathname + location.search + location.hash + \"\\\" \" + \"does not have an element or Component. This means it will render an <Outlet /> with a \" + \"null value by default resulting in an \\\"empty\\\" page.\") : void 0;\n  }\n  let renderedMatches = _renderMatches(matches && matches.map(match => Object.assign({}, match, {\n    params: Object.assign({}, parentParams, match.params),\n    pathname: joinPaths([parentPathnameBase,\n    // Re-encode pathnames that were decoded inside matchRoutes\n    navigator.encodeLocation ? navigator.encodeLocation(match.pathname).pathname : match.pathname]),\n    pathnameBase: match.pathnameBase === \"/\" ? parentPathnameBase : joinPaths([parentPathnameBase,\n    // Re-encode pathnames that were decoded inside matchRoutes\n    navigator.encodeLocation ? navigator.encodeLocation(match.pathnameBase).pathname : match.pathnameBase])\n  })), parentMatches, dataRouterState, future);\n\n  // When a user passes in a `locationArg`, the associated routes need to\n  // be wrapped in a new `LocationContext.Provider` in order for `useLocation`\n  // to use the scoped location instead of the global location.\n  if (locationArg && renderedMatches) {\n    return /*#__PURE__*/React.createElement(LocationContext.Provider, {\n      value: {\n        location: _extends({\n          pathname: \"/\",\n          search: \"\",\n          hash: \"\",\n          state: null,\n          key: \"default\"\n        }, location),\n        navigationType: Action.Pop\n      }\n    }, renderedMatches);\n  }\n  return renderedMatches;\n}\nfunction DefaultErrorComponent() {\n  let error = useRouteError();\n  let message = isRouteErrorResponse(error) ? error.status + \" \" + error.statusText : error instanceof Error ? error.message : JSON.stringify(error);\n  let stack = error instanceof Error ? error.stack : null;\n  let lightgrey = \"rgba(200,200,200, 0.5)\";\n  let preStyles = {\n    padding: \"0.5rem\",\n    backgroundColor: lightgrey\n  };\n  let codeStyles = {\n    padding: \"2px 4px\",\n    backgroundColor: lightgrey\n  };\n  let devInfo = null;\n  if (process.env.NODE_ENV !== \"production\") {\n    console.error(\"Error handled by React Router default ErrorBoundary:\", error);\n    devInfo = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"p\", null, \"\\uD83D\\uDCBF Hey developer \\uD83D\\uDC4B\"), /*#__PURE__*/React.createElement(\"p\", null, \"You can provide a way better UX than this when your app throws errors by providing your own \", /*#__PURE__*/React.createElement(\"code\", {\n      style: codeStyles\n    }, \"ErrorBoundary\"), \" or\", \" \", /*#__PURE__*/React.createElement(\"code\", {\n      style: codeStyles\n    }, \"errorElement\"), \" prop on your route.\"));\n  }\n  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"h2\", null, \"Unexpected Application Error!\"), /*#__PURE__*/React.createElement(\"h3\", {\n    style: {\n      fontStyle: \"italic\"\n    }\n  }, message), stack ? /*#__PURE__*/React.createElement(\"pre\", {\n    style: preStyles\n  }, stack) : null, devInfo);\n}\nconst defaultErrorElement = /*#__PURE__*/React.createElement(DefaultErrorComponent, null);\nclass RenderErrorBoundary extends React.Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      location: props.location,\n      revalidation: props.revalidation,\n      error: props.error\n    };\n  }\n  static getDerivedStateFromError(error) {\n    return {\n      error: error\n    };\n  }\n  static getDerivedStateFromProps(props, state) {\n    // When we get into an error state, the user will likely click \"back\" to the\n    // previous page that didn't have an error. Because this wraps the entire\n    // application, that will have no effect--the error page continues to display.\n    // This gives us a mechanism to recover from the error when the location changes.\n    //\n    // Whether we're in an error state or not, we update the location in state\n    // so that when we are in an error state, it gets reset when a new location\n    // comes in and the user recovers from the error.\n    if (state.location !== props.location || state.revalidation !== \"idle\" && props.revalidation === \"idle\") {\n      return {\n        error: props.error,\n        location: props.location,\n        revalidation: props.revalidation\n      };\n    }\n\n    // If we're not changing locations, preserve the location but still surface\n    // any new errors that may come through. We retain the existing error, we do\n    // this because the error provided from the app state may be cleared without\n    // the location changing.\n    return {\n      error: props.error !== undefined ? props.error : state.error,\n      location: state.location,\n      revalidation: props.revalidation || state.revalidation\n    };\n  }\n  componentDidCatch(error, errorInfo) {\n    console.error(\"React Router caught the following error during render\", error, errorInfo);\n  }\n  render() {\n    return this.state.error !== undefined ? /*#__PURE__*/React.createElement(RouteContext.Provider, {\n      value: this.props.routeContext\n    }, /*#__PURE__*/React.createElement(RouteErrorContext.Provider, {\n      value: this.state.error,\n      children: this.props.component\n    })) : this.props.children;\n  }\n}\nfunction RenderedRoute(_ref) {\n  let {\n    routeContext,\n    match,\n    children\n  } = _ref;\n  let dataRouterContext = React.useContext(DataRouterContext);\n\n  // Track how deep we got in our render pass to emulate SSR componentDidCatch\n  // in a DataStaticRouter\n  if (dataRouterContext && dataRouterContext.static && dataRouterContext.staticContext && (match.route.errorElement || match.route.ErrorBoundary)) {\n    dataRouterContext.staticContext._deepestRenderedBoundaryId = match.route.id;\n  }\n  return /*#__PURE__*/React.createElement(RouteContext.Provider, {\n    value: routeContext\n  }, children);\n}\nfunction _renderMatches(matches, parentMatches, dataRouterState, future) {\n  var _dataRouterState;\n  if (parentMatches === void 0) {\n    parentMatches = [];\n  }\n  if (dataRouterState === void 0) {\n    dataRouterState = null;\n  }\n  if (future === void 0) {\n    future = null;\n  }\n  if (matches == null) {\n    var _future;\n    if (!dataRouterState) {\n      return null;\n    }\n    if (dataRouterState.errors) {\n      // Don't bail if we have data router errors so we can render them in the\n      // boundary.  Use the pre-matched (or shimmed) matches\n      matches = dataRouterState.matches;\n    } else if ((_future = future) != null && _future.v7_partialHydration && parentMatches.length === 0 && !dataRouterState.initialized && dataRouterState.matches.length > 0) {\n      // Don't bail if we're initializing with partial hydration and we have\n      // router matches.  That means we're actively running `patchRoutesOnNavigation`\n      // so we should render down the partial matches to the appropriate\n      // `HydrateFallback`.  We only do this if `parentMatches` is empty so it\n      // only impacts the root matches for `RouterProvider` and no descendant\n      // `<Routes>`\n      matches = dataRouterState.matches;\n    } else {\n      return null;\n    }\n  }\n  let renderedMatches = matches;\n\n  // If we have data errors, trim matches to the highest error boundary\n  let errors = (_dataRouterState = dataRouterState) == null ? void 0 : _dataRouterState.errors;\n  if (errors != null) {\n    let errorIndex = renderedMatches.findIndex(m => m.route.id && (errors == null ? void 0 : errors[m.route.id]) !== undefined);\n    !(errorIndex >= 0) ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"Could not find a matching route for errors on route IDs: \" + Object.keys(errors).join(\",\")) : UNSAFE_invariant(false) : void 0;\n    renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1));\n  }\n\n  // If we're in a partial hydration mode, detect if we need to render down to\n  // a given HydrateFallback while we load the rest of the hydration data\n  let renderFallback = false;\n  let fallbackIndex = -1;\n  if (dataRouterState && future && future.v7_partialHydration) {\n    for (let i = 0; i < renderedMatches.length; i++) {\n      let match = renderedMatches[i];\n      // Track the deepest fallback up until the first route without data\n      if (match.route.HydrateFallback || match.route.hydrateFallbackElement) {\n        fallbackIndex = i;\n      }\n      if (match.route.id) {\n        let {\n          loaderData,\n          errors\n        } = dataRouterState;\n        let needsToRunLoader = match.route.loader && loaderData[match.route.id] === undefined && (!errors || errors[match.route.id] === undefined);\n        if (match.route.lazy || needsToRunLoader) {\n          // We found the first route that's not ready to render (waiting on\n          // lazy, or has a loader that hasn't run yet).  Flag that we need to\n          // render a fallback and render up until the appropriate fallback\n          renderFallback = true;\n          if (fallbackIndex >= 0) {\n            renderedMatches = renderedMatches.slice(0, fallbackIndex + 1);\n          } else {\n            renderedMatches = [renderedMatches[0]];\n          }\n          break;\n        }\n      }\n    }\n  }\n  return renderedMatches.reduceRight((outlet, match, index) => {\n    // Only data routers handle errors/fallbacks\n    let error;\n    let shouldRenderHydrateFallback = false;\n    let errorElement = null;\n    let hydrateFallbackElement = null;\n    if (dataRouterState) {\n      error = errors && match.route.id ? errors[match.route.id] : undefined;\n      errorElement = match.route.errorElement || defaultErrorElement;\n      if (renderFallback) {\n        if (fallbackIndex < 0 && index === 0) {\n          warningOnce(\"route-fallback\", false, \"No `HydrateFallback` element provided to render during initial hydration\");\n          shouldRenderHydrateFallback = true;\n          hydrateFallbackElement = null;\n        } else if (fallbackIndex === index) {\n          shouldRenderHydrateFallback = true;\n          hydrateFallbackElement = match.route.hydrateFallbackElement || null;\n        }\n      }\n    }\n    let matches = parentMatches.concat(renderedMatches.slice(0, index + 1));\n    let getChildren = () => {\n      let children;\n      if (error) {\n        children = errorElement;\n      } else if (shouldRenderHydrateFallback) {\n        children = hydrateFallbackElement;\n      } else if (match.route.Component) {\n        // Note: This is a de-optimized path since React won't re-use the\n        // ReactElement since it's identity changes with each new\n        // React.createElement call.  We keep this so folks can use\n        // `<Route Component={...}>` in `<Routes>` but generally `Component`\n        // usage is only advised in `RouterProvider` when we can convert it to\n        // `element` ahead of time.\n        children = /*#__PURE__*/React.createElement(match.route.Component, null);\n      } else if (match.route.element) {\n        children = match.route.element;\n      } else {\n        children = outlet;\n      }\n      return /*#__PURE__*/React.createElement(RenderedRoute, {\n        match: match,\n        routeContext: {\n          outlet,\n          matches,\n          isDataRoute: dataRouterState != null\n        },\n        children: children\n      });\n    };\n    // Only wrap in an error boundary within data router usages when we have an\n    // ErrorBoundary/errorElement on this route.  Otherwise let it bubble up to\n    // an ancestor ErrorBoundary/errorElement\n    return dataRouterState && (match.route.ErrorBoundary || match.route.errorElement || index === 0) ? /*#__PURE__*/React.createElement(RenderErrorBoundary, {\n      location: dataRouterState.location,\n      revalidation: dataRouterState.revalidation,\n      component: errorElement,\n      error: error,\n      children: getChildren(),\n      routeContext: {\n        outlet: null,\n        matches,\n        isDataRoute: true\n      }\n    }) : getChildren();\n  }, null);\n}\nvar DataRouterHook = /*#__PURE__*/function (DataRouterHook) {\n  DataRouterHook[\"UseBlocker\"] = \"useBlocker\";\n  DataRouterHook[\"UseRevalidator\"] = \"useRevalidator\";\n  DataRouterHook[\"UseNavigateStable\"] = \"useNavigate\";\n  return DataRouterHook;\n}(DataRouterHook || {});\nvar DataRouterStateHook = /*#__PURE__*/function (DataRouterStateHook) {\n  DataRouterStateHook[\"UseBlocker\"] = \"useBlocker\";\n  DataRouterStateHook[\"UseLoaderData\"] = \"useLoaderData\";\n  DataRouterStateHook[\"UseActionData\"] = \"useActionData\";\n  DataRouterStateHook[\"UseRouteError\"] = \"useRouteError\";\n  DataRouterStateHook[\"UseNavigation\"] = \"useNavigation\";\n  DataRouterStateHook[\"UseRouteLoaderData\"] = \"useRouteLoaderData\";\n  DataRouterStateHook[\"UseMatches\"] = \"useMatches\";\n  DataRouterStateHook[\"UseRevalidator\"] = \"useRevalidator\";\n  DataRouterStateHook[\"UseNavigateStable\"] = \"useNavigate\";\n  DataRouterStateHook[\"UseRouteId\"] = \"useRouteId\";\n  return DataRouterStateHook;\n}(DataRouterStateHook || {});\nfunction getDataRouterConsoleError(hookName) {\n  return hookName + \" must be used within a data router.  See https://reactrouter.com/v6/routers/picking-a-router.\";\n}\nfunction useDataRouterContext(hookName) {\n  let ctx = React.useContext(DataRouterContext);\n  !ctx ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, getDataRouterConsoleError(hookName)) : UNSAFE_invariant(false) : void 0;\n  return ctx;\n}\nfunction useDataRouterState(hookName) {\n  let state = React.useContext(DataRouterStateContext);\n  !state ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, getDataRouterConsoleError(hookName)) : UNSAFE_invariant(false) : void 0;\n  return state;\n}\nfunction useRouteContext(hookName) {\n  let route = React.useContext(RouteContext);\n  !route ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, getDataRouterConsoleError(hookName)) : UNSAFE_invariant(false) : void 0;\n  return route;\n}\n\n// Internal version with hookName-aware debugging\nfunction useCurrentRouteId(hookName) {\n  let route = useRouteContext(hookName);\n  let thisRoute = route.matches[route.matches.length - 1];\n  !thisRoute.route.id ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, hookName + \" can only be used on routes that contain a unique \\\"id\\\"\") : UNSAFE_invariant(false) : void 0;\n  return thisRoute.route.id;\n}\n\n/**\n * Returns the ID for the nearest contextual route\n */\nfunction useRouteId() {\n  return useCurrentRouteId(DataRouterStateHook.UseRouteId);\n}\n\n/**\n * Returns the current navigation, defaulting to an \"idle\" navigation when\n * no navigation is in progress\n */\nfunction useNavigation() {\n  let state = useDataRouterState(DataRouterStateHook.UseNavigation);\n  return state.navigation;\n}\n\n/**\n * Returns a revalidate function for manually triggering revalidation, as well\n * as the current state of any manual revalidations\n */\nfunction useRevalidator() {\n  let dataRouterContext = useDataRouterContext(DataRouterHook.UseRevalidator);\n  let state = useDataRouterState(DataRouterStateHook.UseRevalidator);\n  return React.useMemo(() => ({\n    revalidate: dataRouterContext.router.revalidate,\n    state: state.revalidation\n  }), [dataRouterContext.router.revalidate, state.revalidation]);\n}\n\n/**\n * Returns the active route matches, useful for accessing loaderData for\n * parent/child routes or the route \"handle\" property\n */\nfunction useMatches() {\n  let {\n    matches,\n    loaderData\n  } = useDataRouterState(DataRouterStateHook.UseMatches);\n  return React.useMemo(() => matches.map(m => UNSAFE_convertRouteMatchToUiMatch(m, loaderData)), [matches, loaderData]);\n}\n\n/**\n * Returns the loader data for the nearest ancestor Route loader\n */\nfunction useLoaderData() {\n  let state = useDataRouterState(DataRouterStateHook.UseLoaderData);\n  let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData);\n  if (state.errors && state.errors[routeId] != null) {\n    console.error(\"You cannot `useLoaderData` in an errorElement (routeId: \" + routeId + \")\");\n    return undefined;\n  }\n  return state.loaderData[routeId];\n}\n\n/**\n * Returns the loaderData for the given routeId\n */\nfunction useRouteLoaderData(routeId) {\n  let state = useDataRouterState(DataRouterStateHook.UseRouteLoaderData);\n  return state.loaderData[routeId];\n}\n\n/**\n * Returns the action data for the nearest ancestor Route action\n */\nfunction useActionData() {\n  let state = useDataRouterState(DataRouterStateHook.UseActionData);\n  let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData);\n  return state.actionData ? state.actionData[routeId] : undefined;\n}\n\n/**\n * Returns the nearest ancestor Route error, which could be a loader/action\n * error or a render error.  This is intended to be called from your\n * ErrorBoundary/errorElement to display a proper error message.\n */\nfunction useRouteError() {\n  var _state$errors;\n  let error = React.useContext(RouteErrorContext);\n  let state = useDataRouterState(DataRouterStateHook.UseRouteError);\n  let routeId = useCurrentRouteId(DataRouterStateHook.UseRouteError);\n\n  // If this was a render error, we put it in a RouteError context inside\n  // of RenderErrorBoundary\n  if (error !== undefined) {\n    return error;\n  }\n\n  // Otherwise look for errors from our data router state\n  return (_state$errors = state.errors) == null ? void 0 : _state$errors[routeId];\n}\n\n/**\n * Returns the happy-path data from the nearest ancestor `<Await />` value\n */\nfunction useAsyncValue() {\n  let value = React.useContext(AwaitContext);\n  return value == null ? void 0 : value._data;\n}\n\n/**\n * Returns the error from the nearest ancestor `<Await />` value\n */\nfunction useAsyncError() {\n  let value = React.useContext(AwaitContext);\n  return value == null ? void 0 : value._error;\n}\nlet blockerId = 0;\n\n/**\n * Allow the application to block navigations within the SPA and present the\n * user a confirmation dialog to confirm the navigation.  Mostly used to avoid\n * using half-filled form data.  This does not handle hard-reloads or\n * cross-origin navigations.\n */\nfunction useBlocker(shouldBlock) {\n  let {\n    router,\n    basename\n  } = useDataRouterContext(DataRouterHook.UseBlocker);\n  let state = useDataRouterState(DataRouterStateHook.UseBlocker);\n  let [blockerKey, setBlockerKey] = React.useState(\"\");\n  let blockerFunction = React.useCallback(arg => {\n    if (typeof shouldBlock !== \"function\") {\n      return !!shouldBlock;\n    }\n    if (basename === \"/\") {\n      return shouldBlock(arg);\n    }\n\n    // If they provided us a function and we've got an active basename, strip\n    // it from the locations we expose to the user to match the behavior of\n    // useLocation\n    let {\n      currentLocation,\n      nextLocation,\n      historyAction\n    } = arg;\n    return shouldBlock({\n      currentLocation: _extends({}, currentLocation, {\n        pathname: stripBasename(currentLocation.pathname, basename) || currentLocation.pathname\n      }),\n      nextLocation: _extends({}, nextLocation, {\n        pathname: stripBasename(nextLocation.pathname, basename) || nextLocation.pathname\n      }),\n      historyAction\n    });\n  }, [basename, shouldBlock]);\n\n  // This effect is in charge of blocker key assignment and deletion (which is\n  // tightly coupled to the key)\n  React.useEffect(() => {\n    let key = String(++blockerId);\n    setBlockerKey(key);\n    return () => router.deleteBlocker(key);\n  }, [router]);\n\n  // This effect handles assigning the blockerFunction.  This is to handle\n  // unstable blocker function identities, and happens only after the prior\n  // effect so we don't get an orphaned blockerFunction in the router with a\n  // key of \"\".  Until then we just have the IDLE_BLOCKER.\n  React.useEffect(() => {\n    if (blockerKey !== \"\") {\n      router.getBlocker(blockerKey, blockerFunction);\n    }\n  }, [router, blockerKey, blockerFunction]);\n\n  // Prefer the blocker from `state` not `router.state` since DataRouterContext\n  // is memoized so this ensures we update on blocker state updates\n  return blockerKey && state.blockers.has(blockerKey) ? state.blockers.get(blockerKey) : IDLE_BLOCKER;\n}\n\n/**\n * Stable version of useNavigate that is used when we are in the context of\n * a RouterProvider.\n */\nfunction useNavigateStable() {\n  let {\n    router\n  } = useDataRouterContext(DataRouterHook.UseNavigateStable);\n  let id = useCurrentRouteId(DataRouterStateHook.UseNavigateStable);\n  let activeRef = React.useRef(false);\n  useIsomorphicLayoutEffect(() => {\n    activeRef.current = true;\n  });\n  let navigate = React.useCallback(function (to, options) {\n    if (options === void 0) {\n      options = {};\n    }\n    process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(activeRef.current, navigateEffectWarning) : void 0;\n\n    // Short circuit here since if this happens on first render the navigate\n    // is useless because we haven't wired up our router subscriber yet\n    if (!activeRef.current) return;\n    if (typeof to === \"number\") {\n      router.navigate(to);\n    } else {\n      router.navigate(to, _extends({\n        fromRouteId: id\n      }, options));\n    }\n  }, [router, id]);\n  return navigate;\n}\nconst alreadyWarned$1 = {};\nfunction warningOnce(key, cond, message) {\n  if (!cond && !alreadyWarned$1[key]) {\n    alreadyWarned$1[key] = true;\n    process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(false, message) : void 0;\n  }\n}\n\nconst alreadyWarned = {};\nfunction warnOnce(key, message) {\n  if (process.env.NODE_ENV !== \"production\" && !alreadyWarned[message]) {\n    alreadyWarned[message] = true;\n    console.warn(message);\n  }\n}\nconst logDeprecation = (flag, msg, link) => warnOnce(flag, \"\\u26A0\\uFE0F React Router Future Flag Warning: \" + msg + \". \" + (\"You can use the `\" + flag + \"` future flag to opt-in early. \") + (\"For more information, see \" + link + \".\"));\nfunction logV6DeprecationWarnings(renderFuture, routerFuture) {\n  if ((renderFuture == null ? void 0 : renderFuture.v7_startTransition) === undefined) {\n    logDeprecation(\"v7_startTransition\", \"React Router will begin wrapping state updates in `React.startTransition` in v7\", \"https://reactrouter.com/v6/upgrading/future#v7_starttransition\");\n  }\n  if ((renderFuture == null ? void 0 : renderFuture.v7_relativeSplatPath) === undefined && (!routerFuture || routerFuture.v7_relativeSplatPath === undefined)) {\n    logDeprecation(\"v7_relativeSplatPath\", \"Relative route resolution within Splat routes is changing in v7\", \"https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath\");\n  }\n  if (routerFuture) {\n    if (routerFuture.v7_fetcherPersist === undefined) {\n      logDeprecation(\"v7_fetcherPersist\", \"The persistence behavior of fetchers is changing in v7\", \"https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist\");\n    }\n    if (routerFuture.v7_normalizeFormMethod === undefined) {\n      logDeprecation(\"v7_normalizeFormMethod\", \"Casing of `formMethod` fields is being normalized to uppercase in v7\", \"https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod\");\n    }\n    if (routerFuture.v7_partialHydration === undefined) {\n      logDeprecation(\"v7_partialHydration\", \"`RouterProvider` hydration behavior is changing in v7\", \"https://reactrouter.com/v6/upgrading/future#v7_partialhydration\");\n    }\n    if (routerFuture.v7_skipActionErrorRevalidation === undefined) {\n      logDeprecation(\"v7_skipActionErrorRevalidation\", \"The revalidation behavior after 4xx/5xx `action` responses is changing in v7\", \"https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation\");\n    }\n  }\n}\n\n/**\n  Webpack + React 17 fails to compile on any of the following because webpack\n  complains that `startTransition` doesn't exist in `React`:\n  * import { startTransition } from \"react\"\n  * import * as React from from \"react\";\n    \"startTransition\" in React ? React.startTransition(() => setState()) : setState()\n  * import * as React from from \"react\";\n    \"startTransition\" in React ? React[\"startTransition\"](() => setState()) : setState()\n\n  Moving it to a constant such as the following solves the Webpack/React 17 issue:\n  * import * as React from from \"react\";\n    const START_TRANSITION = \"startTransition\";\n    START_TRANSITION in React ? React[START_TRANSITION](() => setState()) : setState()\n\n  However, that introduces webpack/terser minification issues in production builds\n  in React 18 where minification/obfuscation ends up removing the call of\n  React.startTransition entirely from the first half of the ternary.  Grabbing\n  this exported reference once up front resolves that issue.\n\n  See https://github.com/remix-run/react-router/issues/10579\n*/\nconst START_TRANSITION = \"startTransition\";\nconst startTransitionImpl = React[START_TRANSITION];\n\n/**\n * Given a Remix Router instance, render the appropriate UI\n */\nfunction RouterProvider(_ref) {\n  let {\n    fallbackElement,\n    router,\n    future\n  } = _ref;\n  let [state, setStateImpl] = React.useState(router.state);\n  let {\n    v7_startTransition\n  } = future || {};\n  let setState = React.useCallback(newState => {\n    if (v7_startTransition && startTransitionImpl) {\n      startTransitionImpl(() => setStateImpl(newState));\n    } else {\n      setStateImpl(newState);\n    }\n  }, [setStateImpl, v7_startTransition]);\n\n  // Need to use a layout effect here so we are subscribed early enough to\n  // pick up on any render-driven redirects/navigations (useEffect/<Navigate>)\n  React.useLayoutEffect(() => router.subscribe(setState), [router, setState]);\n  React.useEffect(() => {\n    process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(fallbackElement == null || !router.future.v7_partialHydration, \"`<RouterProvider fallbackElement>` is deprecated when using \" + \"`v7_partialHydration`, use a `HydrateFallback` component instead\") : void 0;\n    // Only log this once on initial mount\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, []);\n  let navigator = React.useMemo(() => {\n    return {\n      createHref: router.createHref,\n      encodeLocation: router.encodeLocation,\n      go: n => router.navigate(n),\n      push: (to, state, opts) => router.navigate(to, {\n        state,\n        preventScrollReset: opts == null ? void 0 : opts.preventScrollReset\n      }),\n      replace: (to, state, opts) => router.navigate(to, {\n        replace: true,\n        state,\n        preventScrollReset: opts == null ? void 0 : opts.preventScrollReset\n      })\n    };\n  }, [router]);\n  let basename = router.basename || \"/\";\n  let dataRouterContext = React.useMemo(() => ({\n    router,\n    navigator,\n    static: false,\n    basename\n  }), [router, navigator, basename]);\n  React.useEffect(() => logV6DeprecationWarnings(future, router.future), [router, future]);\n\n  // The fragment and {null} here are important!  We need them to keep React 18's\n  // useId happy when we are server-rendering since we may have a <script> here\n  // containing the hydrated server-side staticContext (from StaticRouterProvider).\n  // useId relies on the component tree structure to generate deterministic id's\n  // so we need to ensure it remains the same on the client even though\n  // we don't need the <script> tag\n  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DataRouterContext.Provider, {\n    value: dataRouterContext\n  }, /*#__PURE__*/React.createElement(DataRouterStateContext.Provider, {\n    value: state\n  }, /*#__PURE__*/React.createElement(Router, {\n    basename: basename,\n    location: state.location,\n    navigationType: state.historyAction,\n    navigator: navigator,\n    future: {\n      v7_relativeSplatPath: router.future.v7_relativeSplatPath\n    }\n  }, state.initialized || router.future.v7_partialHydration ? /*#__PURE__*/React.createElement(DataRoutes, {\n    routes: router.routes,\n    future: router.future,\n    state: state\n  }) : fallbackElement))), null);\n}\nfunction DataRoutes(_ref2) {\n  let {\n    routes,\n    future,\n    state\n  } = _ref2;\n  return useRoutesImpl(routes, undefined, state, future);\n}\n/**\n * A `<Router>` that stores all entries in memory.\n *\n * @see https://reactrouter.com/v6/router-components/memory-router\n */\nfunction MemoryRouter(_ref3) {\n  let {\n    basename,\n    children,\n    initialEntries,\n    initialIndex,\n    future\n  } = _ref3;\n  let historyRef = React.useRef();\n  if (historyRef.current == null) {\n    historyRef.current = createMemoryHistory({\n      initialEntries,\n      initialIndex,\n      v5Compat: true\n    });\n  }\n  let history = historyRef.current;\n  let [state, setStateImpl] = React.useState({\n    action: history.action,\n    location: history.location\n  });\n  let {\n    v7_startTransition\n  } = future || {};\n  let setState = React.useCallback(newState => {\n    v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState);\n  }, [setStateImpl, v7_startTransition]);\n  React.useLayoutEffect(() => history.listen(setState), [history, setState]);\n  React.useEffect(() => logV6DeprecationWarnings(future), [future]);\n  return /*#__PURE__*/React.createElement(Router, {\n    basename: basename,\n    children: children,\n    location: state.location,\n    navigationType: state.action,\n    navigator: history,\n    future: future\n  });\n}\n/**\n * Changes the current location.\n *\n * Note: This API is mostly useful in React.Component subclasses that are not\n * able to use hooks. In functional components, we recommend you use the\n * `useNavigate` hook instead.\n *\n * @see https://reactrouter.com/v6/components/navigate\n */\nfunction Navigate(_ref4) {\n  let {\n    to,\n    replace,\n    state,\n    relative\n  } = _ref4;\n  !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, // TODO: This error is probably because they somehow have 2 versions of\n  // the router loaded. We can help them understand how to avoid that.\n  \"<Navigate> may be used only in the context of a <Router> component.\") : UNSAFE_invariant(false) : void 0;\n  let {\n    future,\n    static: isStatic\n  } = React.useContext(NavigationContext);\n  process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(!isStatic, \"<Navigate> must not be used on the initial render in a <StaticRouter>. \" + \"This is a no-op, but you should modify your code so the <Navigate> is \" + \"only ever rendered in response to some user interaction or state change.\") : void 0;\n  let {\n    matches\n  } = React.useContext(RouteContext);\n  let {\n    pathname: locationPathname\n  } = useLocation();\n  let navigate = useNavigate();\n\n  // Resolve the path outside of the effect so that when effects run twice in\n  // StrictMode they navigate to the same place\n  let path = resolveTo(to, UNSAFE_getResolveToMatches(matches, future.v7_relativeSplatPath), locationPathname, relative === \"path\");\n  let jsonPath = JSON.stringify(path);\n  React.useEffect(() => navigate(JSON.parse(jsonPath), {\n    replace,\n    state,\n    relative\n  }), [navigate, jsonPath, relative, replace, state]);\n  return null;\n}\n/**\n * Renders the child route's element, if there is one.\n *\n * @see https://reactrouter.com/v6/components/outlet\n */\nfunction Outlet(props) {\n  return useOutlet(props.context);\n}\n/**\n * Declares an element that should be rendered at a certain URL path.\n *\n * @see https://reactrouter.com/v6/components/route\n */\nfunction Route(_props) {\n  process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"A <Route> is only ever to be used as the child of <Routes> element, \" + \"never rendered directly. Please wrap your <Route> in a <Routes>.\") : UNSAFE_invariant(false) ;\n}\n/**\n * Provides location context for the rest of the app.\n *\n * Note: You usually won't render a `<Router>` directly. Instead, you'll render a\n * router that is more specific to your environment such as a `<BrowserRouter>`\n * in web browsers or a `<StaticRouter>` for server rendering.\n *\n * @see https://reactrouter.com/v6/router-components/router\n */\nfunction Router(_ref5) {\n  let {\n    basename: basenameProp = \"/\",\n    children = null,\n    location: locationProp,\n    navigationType = Action.Pop,\n    navigator,\n    static: staticProp = false,\n    future\n  } = _ref5;\n  !!useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"You cannot render a <Router> inside another <Router>.\" + \" You should never have more than one in your app.\") : UNSAFE_invariant(false) : void 0;\n\n  // Preserve trailing slashes on basename, so we can let the user control\n  // the enforcement of trailing slashes throughout the app\n  let basename = basenameProp.replace(/^\\/*/, \"/\");\n  let navigationContext = React.useMemo(() => ({\n    basename,\n    navigator,\n    static: staticProp,\n    future: _extends({\n      v7_relativeSplatPath: false\n    }, future)\n  }), [basename, future, navigator, staticProp]);\n  if (typeof locationProp === \"string\") {\n    locationProp = parsePath(locationProp);\n  }\n  let {\n    pathname = \"/\",\n    search = \"\",\n    hash = \"\",\n    state = null,\n    key = \"default\"\n  } = locationProp;\n  let locationContext = React.useMemo(() => {\n    let trailingPathname = stripBasename(pathname, basename);\n    if (trailingPathname == null) {\n      return null;\n    }\n    return {\n      location: {\n        pathname: trailingPathname,\n        search,\n        hash,\n        state,\n        key\n      },\n      navigationType\n    };\n  }, [basename, pathname, search, hash, state, key, navigationType]);\n  process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(locationContext != null, \"<Router basename=\\\"\" + basename + \"\\\"> is not able to match the URL \" + (\"\\\"\" + pathname + search + hash + \"\\\" because it does not start with the \") + \"basename, so the <Router> won't render anything.\") : void 0;\n  if (locationContext == null) {\n    return null;\n  }\n  return /*#__PURE__*/React.createElement(NavigationContext.Provider, {\n    value: navigationContext\n  }, /*#__PURE__*/React.createElement(LocationContext.Provider, {\n    children: children,\n    value: locationContext\n  }));\n}\n/**\n * A container for a nested tree of `<Route>` elements that renders the branch\n * that best matches the current location.\n *\n * @see https://reactrouter.com/v6/components/routes\n */\nfunction Routes(_ref6) {\n  let {\n    children,\n    location\n  } = _ref6;\n  return useRoutes(createRoutesFromChildren(children), location);\n}\n/**\n * Component to use for rendering lazily loaded data from returning defer()\n * in a loader function\n */\nfunction Await(_ref7) {\n  let {\n    children,\n    errorElement,\n    resolve\n  } = _ref7;\n  return /*#__PURE__*/React.createElement(AwaitErrorBoundary, {\n    resolve: resolve,\n    errorElement: errorElement\n  }, /*#__PURE__*/React.createElement(ResolveAwait, null, children));\n}\nvar AwaitRenderStatus = /*#__PURE__*/function (AwaitRenderStatus) {\n  AwaitRenderStatus[AwaitRenderStatus[\"pending\"] = 0] = \"pending\";\n  AwaitRenderStatus[AwaitRenderStatus[\"success\"] = 1] = \"success\";\n  AwaitRenderStatus[AwaitRenderStatus[\"error\"] = 2] = \"error\";\n  return AwaitRenderStatus;\n}(AwaitRenderStatus || {});\nconst neverSettledPromise = new Promise(() => {});\nclass AwaitErrorBoundary extends React.Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      error: null\n    };\n  }\n  static getDerivedStateFromError(error) {\n    return {\n      error\n    };\n  }\n  componentDidCatch(error, errorInfo) {\n    console.error(\"<Await> caught the following error during render\", error, errorInfo);\n  }\n  render() {\n    let {\n      children,\n      errorElement,\n      resolve\n    } = this.props;\n    let promise = null;\n    let status = AwaitRenderStatus.pending;\n    if (!(resolve instanceof Promise)) {\n      // Didn't get a promise - provide as a resolved promise\n      status = AwaitRenderStatus.success;\n      promise = Promise.resolve();\n      Object.defineProperty(promise, \"_tracked\", {\n        get: () => true\n      });\n      Object.defineProperty(promise, \"_data\", {\n        get: () => resolve\n      });\n    } else if (this.state.error) {\n      // Caught a render error, provide it as a rejected promise\n      status = AwaitRenderStatus.error;\n      let renderError = this.state.error;\n      promise = Promise.reject().catch(() => {}); // Avoid unhandled rejection warnings\n      Object.defineProperty(promise, \"_tracked\", {\n        get: () => true\n      });\n      Object.defineProperty(promise, \"_error\", {\n        get: () => renderError\n      });\n    } else if (resolve._tracked) {\n      // Already tracked promise - check contents\n      promise = resolve;\n      status = \"_error\" in promise ? AwaitRenderStatus.error : \"_data\" in promise ? AwaitRenderStatus.success : AwaitRenderStatus.pending;\n    } else {\n      // Raw (untracked) promise - track it\n      status = AwaitRenderStatus.pending;\n      Object.defineProperty(resolve, \"_tracked\", {\n        get: () => true\n      });\n      promise = resolve.then(data => Object.defineProperty(resolve, \"_data\", {\n        get: () => data\n      }), error => Object.defineProperty(resolve, \"_error\", {\n        get: () => error\n      }));\n    }\n    if (status === AwaitRenderStatus.error && promise._error instanceof AbortedDeferredError) {\n      // Freeze the UI by throwing a never resolved promise\n      throw neverSettledPromise;\n    }\n    if (status === AwaitRenderStatus.error && !errorElement) {\n      // No errorElement, throw to the nearest route-level error boundary\n      throw promise._error;\n    }\n    if (status === AwaitRenderStatus.error) {\n      // Render via our errorElement\n      return /*#__PURE__*/React.createElement(AwaitContext.Provider, {\n        value: promise,\n        children: errorElement\n      });\n    }\n    if (status === AwaitRenderStatus.success) {\n      // Render children with resolved value\n      return /*#__PURE__*/React.createElement(AwaitContext.Provider, {\n        value: promise,\n        children: children\n      });\n    }\n\n    // Throw to the suspense boundary\n    throw promise;\n  }\n}\n\n/**\n * @private\n * Indirection to leverage useAsyncValue for a render-prop API on `<Await>`\n */\nfunction ResolveAwait(_ref8) {\n  let {\n    children\n  } = _ref8;\n  let data = useAsyncValue();\n  let toRender = typeof children === \"function\" ? children(data) : children;\n  return /*#__PURE__*/React.createElement(React.Fragment, null, toRender);\n}\n\n///////////////////////////////////////////////////////////////////////////////\n// UTILS\n///////////////////////////////////////////////////////////////////////////////\n\n/**\n * Creates a route config from a React \"children\" object, which is usually\n * either a `<Route>` element or an array of them. Used internally by\n * `<Routes>` to create a route config from its children.\n *\n * @see https://reactrouter.com/v6/utils/create-routes-from-children\n */\nfunction createRoutesFromChildren(children, parentPath) {\n  if (parentPath === void 0) {\n    parentPath = [];\n  }\n  let routes = [];\n  React.Children.forEach(children, (element, index) => {\n    if (! /*#__PURE__*/React.isValidElement(element)) {\n      // Ignore non-elements. This allows people to more easily inline\n      // conditionals in their route config.\n      return;\n    }\n    let treePath = [...parentPath, index];\n    if (element.type === React.Fragment) {\n      // Transparently support React.Fragment and its children.\n      routes.push.apply(routes, createRoutesFromChildren(element.props.children, treePath));\n      return;\n    }\n    !(element.type === Route) ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"[\" + (typeof element.type === \"string\" ? element.type : element.type.name) + \"] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>\") : UNSAFE_invariant(false) : void 0;\n    !(!element.props.index || !element.props.children) ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"An index route cannot have child routes.\") : UNSAFE_invariant(false) : void 0;\n    let route = {\n      id: element.props.id || treePath.join(\"-\"),\n      caseSensitive: element.props.caseSensitive,\n      element: element.props.element,\n      Component: element.props.Component,\n      index: element.props.index,\n      path: element.props.path,\n      loader: element.props.loader,\n      action: element.props.action,\n      errorElement: element.props.errorElement,\n      ErrorBoundary: element.props.ErrorBoundary,\n      hasErrorBoundary: element.props.ErrorBoundary != null || element.props.errorElement != null,\n      shouldRevalidate: element.props.shouldRevalidate,\n      handle: element.props.handle,\n      lazy: element.props.lazy\n    };\n    if (element.props.children) {\n      route.children = createRoutesFromChildren(element.props.children, treePath);\n    }\n    routes.push(route);\n  });\n  return routes;\n}\n\n/**\n * Renders the result of `matchRoutes()` into a React element.\n */\nfunction renderMatches(matches) {\n  return _renderMatches(matches);\n}\n\nfunction mapRouteProperties(route) {\n  let updates = {\n    // Note: this check also occurs in createRoutesFromChildren so update\n    // there if you change this -- please and thank you!\n    hasErrorBoundary: route.ErrorBoundary != null || route.errorElement != null\n  };\n  if (route.Component) {\n    if (process.env.NODE_ENV !== \"production\") {\n      if (route.element) {\n        process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(false, \"You should not include both `Component` and `element` on your route - \" + \"`Component` will be used.\") : void 0;\n      }\n    }\n    Object.assign(updates, {\n      element: /*#__PURE__*/React.createElement(route.Component),\n      Component: undefined\n    });\n  }\n  if (route.HydrateFallback) {\n    if (process.env.NODE_ENV !== \"production\") {\n      if (route.hydrateFallbackElement) {\n        process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(false, \"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - \" + \"`HydrateFallback` will be used.\") : void 0;\n      }\n    }\n    Object.assign(updates, {\n      hydrateFallbackElement: /*#__PURE__*/React.createElement(route.HydrateFallback),\n      HydrateFallback: undefined\n    });\n  }\n  if (route.ErrorBoundary) {\n    if (process.env.NODE_ENV !== \"production\") {\n      if (route.errorElement) {\n        process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(false, \"You should not include both `ErrorBoundary` and `errorElement` on your route - \" + \"`ErrorBoundary` will be used.\") : void 0;\n      }\n    }\n    Object.assign(updates, {\n      errorElement: /*#__PURE__*/React.createElement(route.ErrorBoundary),\n      ErrorBoundary: undefined\n    });\n  }\n  return updates;\n}\nfunction createMemoryRouter(routes, opts) {\n  return createRouter({\n    basename: opts == null ? void 0 : opts.basename,\n    future: _extends({}, opts == null ? void 0 : opts.future, {\n      v7_prependBasename: true\n    }),\n    history: createMemoryHistory({\n      initialEntries: opts == null ? void 0 : opts.initialEntries,\n      initialIndex: opts == null ? void 0 : opts.initialIndex\n    }),\n    hydrationData: opts == null ? void 0 : opts.hydrationData,\n    routes,\n    mapRouteProperties,\n    dataStrategy: opts == null ? void 0 : opts.dataStrategy,\n    patchRoutesOnNavigation: opts == null ? void 0 : opts.patchRoutesOnNavigation\n  }).initialize();\n}\n\nexport { Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, logV6DeprecationWarnings as UNSAFE_logV6DeprecationWarnings, mapRouteProperties as UNSAFE_mapRouteProperties, useRouteId as UNSAFE_useRouteId, useRoutesImpl as UNSAFE_useRoutesImpl, createMemoryRouter, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, renderMatches, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };\n//# sourceMappingURL=index.js.map\n","/**\n * React Router DOM v6.30.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { UNSAFE_mapRouteProperties, UNSAFE_logV6DeprecationWarnings, UNSAFE_DataRouterContext, UNSAFE_DataRouterStateContext, Router, UNSAFE_useRoutesImpl, UNSAFE_NavigationContext, useHref, useResolvedPath, useLocation, useNavigate, createPath, UNSAFE_useRouteId, UNSAFE_RouteContext, useMatches, useNavigation, useBlocker } from 'react-router';\nexport { AbortedDeferredError, Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, Routes, UNSAFE_DataRouterContext, UNSAFE_DataRouterStateContext, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, UNSAFE_useRouteId, createMemoryRouter, createPath, createRoutesFromChildren, createRoutesFromElements, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, renderMatches, replace, resolvePath, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes } from 'react-router';\nimport { stripBasename, UNSAFE_warning, createRouter, createBrowserHistory, createHashHistory, UNSAFE_ErrorResponseImpl, UNSAFE_invariant, joinPaths, IDLE_FETCHER, matchPath } from '@remix-run/router';\nexport { UNSAFE_ErrorResponseImpl } from '@remix-run/router';\n\nfunction _extends() {\n  _extends = Object.assign ? Object.assign.bind() : function (target) {\n    for (var i = 1; i < arguments.length; i++) {\n      var source = arguments[i];\n      for (var key in source) {\n        if (Object.prototype.hasOwnProperty.call(source, key)) {\n          target[key] = source[key];\n        }\n      }\n    }\n    return target;\n  };\n  return _extends.apply(this, arguments);\n}\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n  if (source == null) return {};\n  var target = {};\n  var sourceKeys = Object.keys(source);\n  var key, i;\n  for (i = 0; i < sourceKeys.length; i++) {\n    key = sourceKeys[i];\n    if (excluded.indexOf(key) >= 0) continue;\n    target[key] = source[key];\n  }\n  return target;\n}\n\nconst defaultMethod = \"get\";\nconst defaultEncType = \"application/x-www-form-urlencoded\";\nfunction isHtmlElement(object) {\n  return object != null && typeof object.tagName === \"string\";\n}\nfunction isButtonElement(object) {\n  return isHtmlElement(object) && object.tagName.toLowerCase() === \"button\";\n}\nfunction isFormElement(object) {\n  return isHtmlElement(object) && object.tagName.toLowerCase() === \"form\";\n}\nfunction isInputElement(object) {\n  return isHtmlElement(object) && object.tagName.toLowerCase() === \"input\";\n}\nfunction isModifiedEvent(event) {\n  return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\nfunction shouldProcessLinkClick(event, target) {\n  return event.button === 0 && (\n  // Ignore everything but left clicks\n  !target || target === \"_self\") &&\n  // Let browser handle \"target=_blank\" etc.\n  !isModifiedEvent(event) // Ignore clicks with modifier keys\n  ;\n}\n/**\n * Creates a URLSearchParams object using the given initializer.\n *\n * This is identical to `new URLSearchParams(init)` except it also\n * supports arrays as values in the object form of the initializer\n * instead of just strings. This is convenient when you need multiple\n * values for a given key, but don't want to use an array initializer.\n *\n * For example, instead of:\n *\n *   let searchParams = new URLSearchParams([\n *     ['sort', 'name'],\n *     ['sort', 'price']\n *   ]);\n *\n * you can do:\n *\n *   let searchParams = createSearchParams({\n *     sort: ['name', 'price']\n *   });\n */\nfunction createSearchParams(init) {\n  if (init === void 0) {\n    init = \"\";\n  }\n  return new URLSearchParams(typeof init === \"string\" || Array.isArray(init) || init instanceof URLSearchParams ? init : Object.keys(init).reduce((memo, key) => {\n    let value = init[key];\n    return memo.concat(Array.isArray(value) ? value.map(v => [key, v]) : [[key, value]]);\n  }, []));\n}\nfunction getSearchParamsForLocation(locationSearch, defaultSearchParams) {\n  let searchParams = createSearchParams(locationSearch);\n  if (defaultSearchParams) {\n    // Use `defaultSearchParams.forEach(...)` here instead of iterating of\n    // `defaultSearchParams.keys()` to work-around a bug in Firefox related to\n    // web extensions. Relevant Bugzilla tickets:\n    // https://bugzilla.mozilla.org/show_bug.cgi?id=1414602\n    // https://bugzilla.mozilla.org/show_bug.cgi?id=1023984\n    defaultSearchParams.forEach((_, key) => {\n      if (!searchParams.has(key)) {\n        defaultSearchParams.getAll(key).forEach(value => {\n          searchParams.append(key, value);\n        });\n      }\n    });\n  }\n  return searchParams;\n}\n// One-time check for submitter support\nlet _formDataSupportsSubmitter = null;\nfunction isFormDataSubmitterSupported() {\n  if (_formDataSupportsSubmitter === null) {\n    try {\n      new FormData(document.createElement(\"form\"),\n      // @ts-expect-error if FormData supports the submitter parameter, this will throw\n      0);\n      _formDataSupportsSubmitter = false;\n    } catch (e) {\n      _formDataSupportsSubmitter = true;\n    }\n  }\n  return _formDataSupportsSubmitter;\n}\nconst supportedFormEncTypes = new Set([\"application/x-www-form-urlencoded\", \"multipart/form-data\", \"text/plain\"]);\nfunction getFormEncType(encType) {\n  if (encType != null && !supportedFormEncTypes.has(encType)) {\n    process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(false, \"\\\"\" + encType + \"\\\" is not a valid `encType` for `<Form>`/`<fetcher.Form>` \" + (\"and will default to \\\"\" + defaultEncType + \"\\\"\")) : void 0;\n    return null;\n  }\n  return encType;\n}\nfunction getFormSubmissionInfo(target, basename) {\n  let method;\n  let action;\n  let encType;\n  let formData;\n  let body;\n  if (isFormElement(target)) {\n    // When grabbing the action from the element, it will have had the basename\n    // prefixed to ensure non-JS scenarios work, so strip it since we'll\n    // re-prefix in the router\n    let attr = target.getAttribute(\"action\");\n    action = attr ? stripBasename(attr, basename) : null;\n    method = target.getAttribute(\"method\") || defaultMethod;\n    encType = getFormEncType(target.getAttribute(\"enctype\")) || defaultEncType;\n    formData = new FormData(target);\n  } else if (isButtonElement(target) || isInputElement(target) && (target.type === \"submit\" || target.type === \"image\")) {\n    let form = target.form;\n    if (form == null) {\n      throw new Error(\"Cannot submit a <button> or <input type=\\\"submit\\\"> without a <form>\");\n    }\n    // <button>/<input type=\"submit\"> may override attributes of <form>\n    // When grabbing the action from the element, it will have had the basename\n    // prefixed to ensure non-JS scenarios work, so strip it since we'll\n    // re-prefix in the router\n    let attr = target.getAttribute(\"formaction\") || form.getAttribute(\"action\");\n    action = attr ? stripBasename(attr, basename) : null;\n    method = target.getAttribute(\"formmethod\") || form.getAttribute(\"method\") || defaultMethod;\n    encType = getFormEncType(target.getAttribute(\"formenctype\")) || getFormEncType(form.getAttribute(\"enctype\")) || defaultEncType;\n    // Build a FormData object populated from a form and submitter\n    formData = new FormData(form, target);\n    // If this browser doesn't support the `FormData(el, submitter)` format,\n    // then tack on the submitter value at the end.  This is a lightweight\n    // solution that is not 100% spec compliant.  For complete support in older\n    // browsers, consider using the `formdata-submitter-polyfill` package\n    if (!isFormDataSubmitterSupported()) {\n      let {\n        name,\n        type,\n        value\n      } = target;\n      if (type === \"image\") {\n        let prefix = name ? name + \".\" : \"\";\n        formData.append(prefix + \"x\", \"0\");\n        formData.append(prefix + \"y\", \"0\");\n      } else if (name) {\n        formData.append(name, value);\n      }\n    }\n  } else if (isHtmlElement(target)) {\n    throw new Error(\"Cannot submit element that is not <form>, <button>, or \" + \"<input type=\\\"submit|image\\\">\");\n  } else {\n    method = defaultMethod;\n    action = null;\n    encType = defaultEncType;\n    body = target;\n  }\n  // Send body for <Form encType=\"text/plain\" so we encode it into text\n  if (formData && encType === \"text/plain\") {\n    body = formData;\n    formData = undefined;\n  }\n  return {\n    action,\n    method: method.toLowerCase(),\n    encType,\n    formData,\n    body\n  };\n}\n\nconst _excluded = [\"onClick\", \"relative\", \"reloadDocument\", \"replace\", \"state\", \"target\", \"to\", \"preventScrollReset\", \"viewTransition\"],\n  _excluded2 = [\"aria-current\", \"caseSensitive\", \"className\", \"end\", \"style\", \"to\", \"viewTransition\", \"children\"],\n  _excluded3 = [\"fetcherKey\", \"navigate\", \"reloadDocument\", \"replace\", \"state\", \"method\", \"action\", \"onSubmit\", \"relative\", \"preventScrollReset\", \"viewTransition\"];\n// HEY YOU! DON'T TOUCH THIS VARIABLE!\n//\n// It is replaced with the proper version at build time via a babel plugin in\n// the rollup config.\n//\n// Export a global property onto the window for React Router detection by the\n// Core Web Vitals Technology Report.  This way they can configure the `wappalyzer`\n// to detect and properly classify live websites as being built with React Router:\n// https://github.com/HTTPArchive/wappalyzer/blob/main/src/technologies/r.json\nconst REACT_ROUTER_VERSION = \"6\";\ntry {\n  window.__reactRouterVersion = REACT_ROUTER_VERSION;\n} catch (e) {\n  // no-op\n}\nfunction createBrowserRouter(routes, opts) {\n  return createRouter({\n    basename: opts == null ? void 0 : opts.basename,\n    future: _extends({}, opts == null ? void 0 : opts.future, {\n      v7_prependBasename: true\n    }),\n    history: createBrowserHistory({\n      window: opts == null ? void 0 : opts.window\n    }),\n    hydrationData: (opts == null ? void 0 : opts.hydrationData) || parseHydrationData(),\n    routes,\n    mapRouteProperties: UNSAFE_mapRouteProperties,\n    dataStrategy: opts == null ? void 0 : opts.dataStrategy,\n    patchRoutesOnNavigation: opts == null ? void 0 : opts.patchRoutesOnNavigation,\n    window: opts == null ? void 0 : opts.window\n  }).initialize();\n}\nfunction createHashRouter(routes, opts) {\n  return createRouter({\n    basename: opts == null ? void 0 : opts.basename,\n    future: _extends({}, opts == null ? void 0 : opts.future, {\n      v7_prependBasename: true\n    }),\n    history: createHashHistory({\n      window: opts == null ? void 0 : opts.window\n    }),\n    hydrationData: (opts == null ? void 0 : opts.hydrationData) || parseHydrationData(),\n    routes,\n    mapRouteProperties: UNSAFE_mapRouteProperties,\n    dataStrategy: opts == null ? void 0 : opts.dataStrategy,\n    patchRoutesOnNavigation: opts == null ? void 0 : opts.patchRoutesOnNavigation,\n    window: opts == null ? void 0 : opts.window\n  }).initialize();\n}\nfunction parseHydrationData() {\n  var _window;\n  let state = (_window = window) == null ? void 0 : _window.__staticRouterHydrationData;\n  if (state && state.errors) {\n    state = _extends({}, state, {\n      errors: deserializeErrors(state.errors)\n    });\n  }\n  return state;\n}\nfunction deserializeErrors(errors) {\n  if (!errors) return null;\n  let entries = Object.entries(errors);\n  let serialized = {};\n  for (let [key, val] of entries) {\n    // Hey you!  If you change this, please change the corresponding logic in\n    // serializeErrors in react-router-dom/server.tsx :)\n    if (val && val.__type === \"RouteErrorResponse\") {\n      serialized[key] = new UNSAFE_ErrorResponseImpl(val.status, val.statusText, val.data, val.internal === true);\n    } else if (val && val.__type === \"Error\") {\n      // Attempt to reconstruct the right type of Error (i.e., ReferenceError)\n      if (val.__subType) {\n        let ErrorConstructor = window[val.__subType];\n        if (typeof ErrorConstructor === \"function\") {\n          try {\n            // @ts-expect-error\n            let error = new ErrorConstructor(val.message);\n            // Wipe away the client-side stack trace.  Nothing to fill it in with\n            // because we don't serialize SSR stack traces for security reasons\n            error.stack = \"\";\n            serialized[key] = error;\n          } catch (e) {\n            // no-op - fall through and create a normal Error\n          }\n        }\n      }\n      if (serialized[key] == null) {\n        let error = new Error(val.message);\n        // Wipe away the client-side stack trace.  Nothing to fill it in with\n        // because we don't serialize SSR stack traces for security reasons\n        error.stack = \"\";\n        serialized[key] = error;\n      }\n    } else {\n      serialized[key] = val;\n    }\n  }\n  return serialized;\n}\nconst ViewTransitionContext = /*#__PURE__*/React.createContext({\n  isTransitioning: false\n});\nif (process.env.NODE_ENV !== \"production\") {\n  ViewTransitionContext.displayName = \"ViewTransition\";\n}\nconst FetchersContext = /*#__PURE__*/React.createContext(new Map());\nif (process.env.NODE_ENV !== \"production\") {\n  FetchersContext.displayName = \"Fetchers\";\n}\n//#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region Components\n////////////////////////////////////////////////////////////////////////////////\n/**\n  Webpack + React 17 fails to compile on any of the following because webpack\n  complains that `startTransition` doesn't exist in `React`:\n  * import { startTransition } from \"react\"\n  * import * as React from from \"react\";\n    \"startTransition\" in React ? React.startTransition(() => setState()) : setState()\n  * import * as React from from \"react\";\n    \"startTransition\" in React ? React[\"startTransition\"](() => setState()) : setState()\n\n  Moving it to a constant such as the following solves the Webpack/React 17 issue:\n  * import * as React from from \"react\";\n    const START_TRANSITION = \"startTransition\";\n    START_TRANSITION in React ? React[START_TRANSITION](() => setState()) : setState()\n\n  However, that introduces webpack/terser minification issues in production builds\n  in React 18 where minification/obfuscation ends up removing the call of\n  React.startTransition entirely from the first half of the ternary.  Grabbing\n  this exported reference once up front resolves that issue.\n\n  See https://github.com/remix-run/react-router/issues/10579\n*/\nconst START_TRANSITION = \"startTransition\";\nconst startTransitionImpl = React[START_TRANSITION];\nconst FLUSH_SYNC = \"flushSync\";\nconst flushSyncImpl = ReactDOM[FLUSH_SYNC];\nconst USE_ID = \"useId\";\nconst useIdImpl = React[USE_ID];\nfunction startTransitionSafe(cb) {\n  if (startTransitionImpl) {\n    startTransitionImpl(cb);\n  } else {\n    cb();\n  }\n}\nfunction flushSyncSafe(cb) {\n  if (flushSyncImpl) {\n    flushSyncImpl(cb);\n  } else {\n    cb();\n  }\n}\nclass Deferred {\n  constructor() {\n    this.status = \"pending\";\n    this.promise = new Promise((resolve, reject) => {\n      this.resolve = value => {\n        if (this.status === \"pending\") {\n          this.status = \"resolved\";\n          resolve(value);\n        }\n      };\n      this.reject = reason => {\n        if (this.status === \"pending\") {\n          this.status = \"rejected\";\n          reject(reason);\n        }\n      };\n    });\n  }\n}\n/**\n * Given a Remix Router instance, render the appropriate UI\n */\nfunction RouterProvider(_ref) {\n  let {\n    fallbackElement,\n    router,\n    future\n  } = _ref;\n  let [state, setStateImpl] = React.useState(router.state);\n  let [pendingState, setPendingState] = React.useState();\n  let [vtContext, setVtContext] = React.useState({\n    isTransitioning: false\n  });\n  let [renderDfd, setRenderDfd] = React.useState();\n  let [transition, setTransition] = React.useState();\n  let [interruption, setInterruption] = React.useState();\n  let fetcherData = React.useRef(new Map());\n  let {\n    v7_startTransition\n  } = future || {};\n  let optInStartTransition = React.useCallback(cb => {\n    if (v7_startTransition) {\n      startTransitionSafe(cb);\n    } else {\n      cb();\n    }\n  }, [v7_startTransition]);\n  let setState = React.useCallback((newState, _ref2) => {\n    let {\n      deletedFetchers,\n      flushSync: flushSync,\n      viewTransitionOpts: viewTransitionOpts\n    } = _ref2;\n    newState.fetchers.forEach((fetcher, key) => {\n      if (fetcher.data !== undefined) {\n        fetcherData.current.set(key, fetcher.data);\n      }\n    });\n    deletedFetchers.forEach(key => fetcherData.current.delete(key));\n    let isViewTransitionUnavailable = router.window == null || router.window.document == null || typeof router.window.document.startViewTransition !== \"function\";\n    // If this isn't a view transition or it's not available in this browser,\n    // just update and be done with it\n    if (!viewTransitionOpts || isViewTransitionUnavailable) {\n      if (flushSync) {\n        flushSyncSafe(() => setStateImpl(newState));\n      } else {\n        optInStartTransition(() => setStateImpl(newState));\n      }\n      return;\n    }\n    // flushSync + startViewTransition\n    if (flushSync) {\n      // Flush through the context to mark DOM elements as transition=ing\n      flushSyncSafe(() => {\n        // Cancel any pending transitions\n        if (transition) {\n          renderDfd && renderDfd.resolve();\n          transition.skipTransition();\n        }\n        setVtContext({\n          isTransitioning: true,\n          flushSync: true,\n          currentLocation: viewTransitionOpts.currentLocation,\n          nextLocation: viewTransitionOpts.nextLocation\n        });\n      });\n      // Update the DOM\n      let t = router.window.document.startViewTransition(() => {\n        flushSyncSafe(() => setStateImpl(newState));\n      });\n      // Clean up after the animation completes\n      t.finished.finally(() => {\n        flushSyncSafe(() => {\n          setRenderDfd(undefined);\n          setTransition(undefined);\n          setPendingState(undefined);\n          setVtContext({\n            isTransitioning: false\n          });\n        });\n      });\n      flushSyncSafe(() => setTransition(t));\n      return;\n    }\n    // startTransition + startViewTransition\n    if (transition) {\n      // Interrupting an in-progress transition, cancel and let everything flush\n      // out, and then kick off a new transition from the interruption state\n      renderDfd && renderDfd.resolve();\n      transition.skipTransition();\n      setInterruption({\n        state: newState,\n        currentLocation: viewTransitionOpts.currentLocation,\n        nextLocation: viewTransitionOpts.nextLocation\n      });\n    } else {\n      // Completed navigation update with opted-in view transitions, let 'er rip\n      setPendingState(newState);\n      setVtContext({\n        isTransitioning: true,\n        flushSync: false,\n        currentLocation: viewTransitionOpts.currentLocation,\n        nextLocation: viewTransitionOpts.nextLocation\n      });\n    }\n  }, [router.window, transition, renderDfd, fetcherData, optInStartTransition]);\n  // Need to use a layout effect here so we are subscribed early enough to\n  // pick up on any render-driven redirects/navigations (useEffect/<Navigate>)\n  React.useLayoutEffect(() => router.subscribe(setState), [router, setState]);\n  // When we start a view transition, create a Deferred we can use for the\n  // eventual \"completed\" render\n  React.useEffect(() => {\n    if (vtContext.isTransitioning && !vtContext.flushSync) {\n      setRenderDfd(new Deferred());\n    }\n  }, [vtContext]);\n  // Once the deferred is created, kick off startViewTransition() to update the\n  // DOM and then wait on the Deferred to resolve (indicating the DOM update has\n  // happened)\n  React.useEffect(() => {\n    if (renderDfd && pendingState && router.window) {\n      let newState = pendingState;\n      let renderPromise = renderDfd.promise;\n      let transition = router.window.document.startViewTransition(async () => {\n        optInStartTransition(() => setStateImpl(newState));\n        await renderPromise;\n      });\n      transition.finished.finally(() => {\n        setRenderDfd(undefined);\n        setTransition(undefined);\n        setPendingState(undefined);\n        setVtContext({\n          isTransitioning: false\n        });\n      });\n      setTransition(transition);\n    }\n  }, [optInStartTransition, pendingState, renderDfd, router.window]);\n  // When the new location finally renders and is committed to the DOM, this\n  // effect will run to resolve the transition\n  React.useEffect(() => {\n    if (renderDfd && pendingState && state.location.key === pendingState.location.key) {\n      renderDfd.resolve();\n    }\n  }, [renderDfd, transition, state.location, pendingState]);\n  // If we get interrupted with a new navigation during a transition, we skip\n  // the active transition, let it cleanup, then kick it off again here\n  React.useEffect(() => {\n    if (!vtContext.isTransitioning && interruption) {\n      setPendingState(interruption.state);\n      setVtContext({\n        isTransitioning: true,\n        flushSync: false,\n        currentLocation: interruption.currentLocation,\n        nextLocation: interruption.nextLocation\n      });\n      setInterruption(undefined);\n    }\n  }, [vtContext.isTransitioning, interruption]);\n  React.useEffect(() => {\n    process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(fallbackElement == null || !router.future.v7_partialHydration, \"`<RouterProvider fallbackElement>` is deprecated when using \" + \"`v7_partialHydration`, use a `HydrateFallback` component instead\") : void 0;\n    // Only log this once on initial mount\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, []);\n  let navigator = React.useMemo(() => {\n    return {\n      createHref: router.createHref,\n      encodeLocation: router.encodeLocation,\n      go: n => router.navigate(n),\n      push: (to, state, opts) => router.navigate(to, {\n        state,\n        preventScrollReset: opts == null ? void 0 : opts.preventScrollReset\n      }),\n      replace: (to, state, opts) => router.navigate(to, {\n        replace: true,\n        state,\n        preventScrollReset: opts == null ? void 0 : opts.preventScrollReset\n      })\n    };\n  }, [router]);\n  let basename = router.basename || \"/\";\n  let dataRouterContext = React.useMemo(() => ({\n    router,\n    navigator,\n    static: false,\n    basename\n  }), [router, navigator, basename]);\n  let routerFuture = React.useMemo(() => ({\n    v7_relativeSplatPath: router.future.v7_relativeSplatPath\n  }), [router.future.v7_relativeSplatPath]);\n  React.useEffect(() => UNSAFE_logV6DeprecationWarnings(future, router.future), [future, router.future]);\n  // The fragment and {null} here are important!  We need them to keep React 18's\n  // useId happy when we are server-rendering since we may have a <script> here\n  // containing the hydrated server-side staticContext (from StaticRouterProvider).\n  // useId relies on the component tree structure to generate deterministic id's\n  // so we need to ensure it remains the same on the client even though\n  // we don't need the <script> tag\n  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(UNSAFE_DataRouterContext.Provider, {\n    value: dataRouterContext\n  }, /*#__PURE__*/React.createElement(UNSAFE_DataRouterStateContext.Provider, {\n    value: state\n  }, /*#__PURE__*/React.createElement(FetchersContext.Provider, {\n    value: fetcherData.current\n  }, /*#__PURE__*/React.createElement(ViewTransitionContext.Provider, {\n    value: vtContext\n  }, /*#__PURE__*/React.createElement(Router, {\n    basename: basename,\n    location: state.location,\n    navigationType: state.historyAction,\n    navigator: navigator,\n    future: routerFuture\n  }, state.initialized || router.future.v7_partialHydration ? /*#__PURE__*/React.createElement(MemoizedDataRoutes, {\n    routes: router.routes,\n    future: router.future,\n    state: state\n  }) : fallbackElement))))), null);\n}\n// Memoize to avoid re-renders when updating `ViewTransitionContext`\nconst MemoizedDataRoutes = /*#__PURE__*/React.memo(DataRoutes);\nfunction DataRoutes(_ref3) {\n  let {\n    routes,\n    future,\n    state\n  } = _ref3;\n  return UNSAFE_useRoutesImpl(routes, undefined, state, future);\n}\n/**\n * A `<Router>` for use in web browsers. Provides the cleanest URLs.\n */\nfunction BrowserRouter(_ref4) {\n  let {\n    basename,\n    children,\n    future,\n    window\n  } = _ref4;\n  let historyRef = React.useRef();\n  if (historyRef.current == null) {\n    historyRef.current = createBrowserHistory({\n      window,\n      v5Compat: true\n    });\n  }\n  let history = historyRef.current;\n  let [state, setStateImpl] = React.useState({\n    action: history.action,\n    location: history.location\n  });\n  let {\n    v7_startTransition\n  } = future || {};\n  let setState = React.useCallback(newState => {\n    v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState);\n  }, [setStateImpl, v7_startTransition]);\n  React.useLayoutEffect(() => history.listen(setState), [history, setState]);\n  React.useEffect(() => UNSAFE_logV6DeprecationWarnings(future), [future]);\n  return /*#__PURE__*/React.createElement(Router, {\n    basename: basename,\n    children: children,\n    location: state.location,\n    navigationType: state.action,\n    navigator: history,\n    future: future\n  });\n}\n/**\n * A `<Router>` for use in web browsers. Stores the location in the hash\n * portion of the URL so it is not sent to the server.\n */\nfunction HashRouter(_ref5) {\n  let {\n    basename,\n    children,\n    future,\n    window\n  } = _ref5;\n  let historyRef = React.useRef();\n  if (historyRef.current == null) {\n    historyRef.current = createHashHistory({\n      window,\n      v5Compat: true\n    });\n  }\n  let history = historyRef.current;\n  let [state, setStateImpl] = React.useState({\n    action: history.action,\n    location: history.location\n  });\n  let {\n    v7_startTransition\n  } = future || {};\n  let setState = React.useCallback(newState => {\n    v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState);\n  }, [setStateImpl, v7_startTransition]);\n  React.useLayoutEffect(() => history.listen(setState), [history, setState]);\n  React.useEffect(() => UNSAFE_logV6DeprecationWarnings(future), [future]);\n  return /*#__PURE__*/React.createElement(Router, {\n    basename: basename,\n    children: children,\n    location: state.location,\n    navigationType: state.action,\n    navigator: history,\n    future: future\n  });\n}\n/**\n * A `<Router>` that accepts a pre-instantiated history object. It's important\n * to note that using your own history object is highly discouraged and may add\n * two versions of the history library to your bundles unless you use the same\n * version of the history library that React Router uses internally.\n */\nfunction HistoryRouter(_ref6) {\n  let {\n    basename,\n    children,\n    future,\n    history\n  } = _ref6;\n  let [state, setStateImpl] = React.useState({\n    action: history.action,\n    location: history.location\n  });\n  let {\n    v7_startTransition\n  } = future || {};\n  let setState = React.useCallback(newState => {\n    v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState);\n  }, [setStateImpl, v7_startTransition]);\n  React.useLayoutEffect(() => history.listen(setState), [history, setState]);\n  React.useEffect(() => UNSAFE_logV6DeprecationWarnings(future), [future]);\n  return /*#__PURE__*/React.createElement(Router, {\n    basename: basename,\n    children: children,\n    location: state.location,\n    navigationType: state.action,\n    navigator: history,\n    future: future\n  });\n}\nif (process.env.NODE_ENV !== \"production\") {\n  HistoryRouter.displayName = \"unstable_HistoryRouter\";\n}\nconst isBrowser = typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.document.createElement !== \"undefined\";\nconst ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i;\n/**\n * The public API for rendering a history-aware `<a>`.\n */\nconst Link = /*#__PURE__*/React.forwardRef(function LinkWithRef(_ref7, ref) {\n  let {\n      onClick,\n      relative,\n      reloadDocument,\n      replace,\n      state,\n      target,\n      to,\n      preventScrollReset,\n      viewTransition\n    } = _ref7,\n    rest = _objectWithoutPropertiesLoose(_ref7, _excluded);\n  let {\n    basename\n  } = React.useContext(UNSAFE_NavigationContext);\n  // Rendered into <a href> for absolute URLs\n  let absoluteHref;\n  let isExternal = false;\n  if (typeof to === \"string\" && ABSOLUTE_URL_REGEX.test(to)) {\n    // Render the absolute href server- and client-side\n    absoluteHref = to;\n    // Only check for external origins client-side\n    if (isBrowser) {\n      try {\n        let currentUrl = new URL(window.location.href);\n        let targetUrl = to.startsWith(\"//\") ? new URL(currentUrl.protocol + to) : new URL(to);\n        let path = stripBasename(targetUrl.pathname, basename);\n        if (targetUrl.origin === currentUrl.origin && path != null) {\n          // Strip the protocol/origin/basename for same-origin absolute URLs\n          to = path + targetUrl.search + targetUrl.hash;\n        } else {\n          isExternal = true;\n        }\n      } catch (e) {\n        // We can't do external URL detection without a valid URL\n        process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(false, \"<Link to=\\\"\" + to + \"\\\"> contains an invalid URL which will probably break \" + \"when clicked - please update to a valid URL path.\") : void 0;\n      }\n    }\n  }\n  // Rendered into <a href> for relative URLs\n  let href = useHref(to, {\n    relative\n  });\n  let internalOnClick = useLinkClickHandler(to, {\n    replace,\n    state,\n    target,\n    preventScrollReset,\n    relative,\n    viewTransition\n  });\n  function handleClick(event) {\n    if (onClick) onClick(event);\n    if (!event.defaultPrevented) {\n      internalOnClick(event);\n    }\n  }\n  return (\n    /*#__PURE__*/\n    // eslint-disable-next-line jsx-a11y/anchor-has-content\n    React.createElement(\"a\", _extends({}, rest, {\n      href: absoluteHref || href,\n      onClick: isExternal || reloadDocument ? onClick : handleClick,\n      ref: ref,\n      target: target\n    }))\n  );\n});\nif (process.env.NODE_ENV !== \"production\") {\n  Link.displayName = \"Link\";\n}\n/**\n * A `<Link>` wrapper that knows if it's \"active\" or not.\n */\nconst NavLink = /*#__PURE__*/React.forwardRef(function NavLinkWithRef(_ref8, ref) {\n  let {\n      \"aria-current\": ariaCurrentProp = \"page\",\n      caseSensitive = false,\n      className: classNameProp = \"\",\n      end = false,\n      style: styleProp,\n      to,\n      viewTransition,\n      children\n    } = _ref8,\n    rest = _objectWithoutPropertiesLoose(_ref8, _excluded2);\n  let path = useResolvedPath(to, {\n    relative: rest.relative\n  });\n  let location = useLocation();\n  let routerState = React.useContext(UNSAFE_DataRouterStateContext);\n  let {\n    navigator,\n    basename\n  } = React.useContext(UNSAFE_NavigationContext);\n  let isTransitioning = routerState != null &&\n  // Conditional usage is OK here because the usage of a data router is static\n  // eslint-disable-next-line react-hooks/rules-of-hooks\n  useViewTransitionState(path) && viewTransition === true;\n  let toPathname = navigator.encodeLocation ? navigator.encodeLocation(path).pathname : path.pathname;\n  let locationPathname = location.pathname;\n  let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;\n  if (!caseSensitive) {\n    locationPathname = locationPathname.toLowerCase();\n    nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;\n    toPathname = toPathname.toLowerCase();\n  }\n  if (nextLocationPathname && basename) {\n    nextLocationPathname = stripBasename(nextLocationPathname, basename) || nextLocationPathname;\n  }\n  // If the `to` has a trailing slash, look at that exact spot.  Otherwise,\n  // we're looking for a slash _after_ what's in `to`.  For example:\n  //\n  // <NavLink to=\"/users\"> and <NavLink to=\"/users/\">\n  // both want to look for a / at index 6 to match URL `/users/matt`\n  const endSlashPosition = toPathname !== \"/\" && toPathname.endsWith(\"/\") ? toPathname.length - 1 : toPathname.length;\n  let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === \"/\";\n  let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === \"/\");\n  let renderProps = {\n    isActive,\n    isPending,\n    isTransitioning\n  };\n  let ariaCurrent = isActive ? ariaCurrentProp : undefined;\n  let className;\n  if (typeof classNameProp === \"function\") {\n    className = classNameProp(renderProps);\n  } else {\n    // If the className prop is not a function, we use a default `active`\n    // class for <NavLink />s that are active. In v5 `active` was the default\n    // value for `activeClassName`, but we are removing that API and can still\n    // use the old default behavior for a cleaner upgrade path and keep the\n    // simple styling rules working as they currently do.\n    className = [classNameProp, isActive ? \"active\" : null, isPending ? \"pending\" : null, isTransitioning ? \"transitioning\" : null].filter(Boolean).join(\" \");\n  }\n  let style = typeof styleProp === \"function\" ? styleProp(renderProps) : styleProp;\n  return /*#__PURE__*/React.createElement(Link, _extends({}, rest, {\n    \"aria-current\": ariaCurrent,\n    className: className,\n    ref: ref,\n    style: style,\n    to: to,\n    viewTransition: viewTransition\n  }), typeof children === \"function\" ? children(renderProps) : children);\n});\nif (process.env.NODE_ENV !== \"production\") {\n  NavLink.displayName = \"NavLink\";\n}\n/**\n * A `@remix-run/router`-aware `<form>`. It behaves like a normal form except\n * that the interaction with the server is with `fetch` instead of new document\n * requests, allowing components to add nicer UX to the page as the form is\n * submitted and returns with data.\n */\nconst Form = /*#__PURE__*/React.forwardRef((_ref9, forwardedRef) => {\n  let {\n      fetcherKey,\n      navigate,\n      reloadDocument,\n      replace,\n      state,\n      method = defaultMethod,\n      action,\n      onSubmit,\n      relative,\n      preventScrollReset,\n      viewTransition\n    } = _ref9,\n    props = _objectWithoutPropertiesLoose(_ref9, _excluded3);\n  let submit = useSubmit();\n  let formAction = useFormAction(action, {\n    relative\n  });\n  let formMethod = method.toLowerCase() === \"get\" ? \"get\" : \"post\";\n  let submitHandler = event => {\n    onSubmit && onSubmit(event);\n    if (event.defaultPrevented) return;\n    event.preventDefault();\n    let submitter = event.nativeEvent.submitter;\n    let submitMethod = (submitter == null ? void 0 : submitter.getAttribute(\"formmethod\")) || method;\n    submit(submitter || event.currentTarget, {\n      fetcherKey,\n      method: submitMethod,\n      navigate,\n      replace,\n      state,\n      relative,\n      preventScrollReset,\n      viewTransition\n    });\n  };\n  return /*#__PURE__*/React.createElement(\"form\", _extends({\n    ref: forwardedRef,\n    method: formMethod,\n    action: formAction,\n    onSubmit: reloadDocument ? onSubmit : submitHandler\n  }, props));\n});\nif (process.env.NODE_ENV !== \"production\") {\n  Form.displayName = \"Form\";\n}\n/**\n * This component will emulate the browser's scroll restoration on location\n * changes.\n */\nfunction ScrollRestoration(_ref10) {\n  let {\n    getKey,\n    storageKey\n  } = _ref10;\n  useScrollRestoration({\n    getKey,\n    storageKey\n  });\n  return null;\n}\nif (process.env.NODE_ENV !== \"production\") {\n  ScrollRestoration.displayName = \"ScrollRestoration\";\n}\n//#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region Hooks\n////////////////////////////////////////////////////////////////////////////////\nvar DataRouterHook;\n(function (DataRouterHook) {\n  DataRouterHook[\"UseScrollRestoration\"] = \"useScrollRestoration\";\n  DataRouterHook[\"UseSubmit\"] = \"useSubmit\";\n  DataRouterHook[\"UseSubmitFetcher\"] = \"useSubmitFetcher\";\n  DataRouterHook[\"UseFetcher\"] = \"useFetcher\";\n  DataRouterHook[\"useViewTransitionState\"] = \"useViewTransitionState\";\n})(DataRouterHook || (DataRouterHook = {}));\nvar DataRouterStateHook;\n(function (DataRouterStateHook) {\n  DataRouterStateHook[\"UseFetcher\"] = \"useFetcher\";\n  DataRouterStateHook[\"UseFetchers\"] = \"useFetchers\";\n  DataRouterStateHook[\"UseScrollRestoration\"] = \"useScrollRestoration\";\n})(DataRouterStateHook || (DataRouterStateHook = {}));\n// Internal hooks\nfunction getDataRouterConsoleError(hookName) {\n  return hookName + \" must be used within a data router.  See https://reactrouter.com/v6/routers/picking-a-router.\";\n}\nfunction useDataRouterContext(hookName) {\n  let ctx = React.useContext(UNSAFE_DataRouterContext);\n  !ctx ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, getDataRouterConsoleError(hookName)) : UNSAFE_invariant(false) : void 0;\n  return ctx;\n}\nfunction useDataRouterState(hookName) {\n  let state = React.useContext(UNSAFE_DataRouterStateContext);\n  !state ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, getDataRouterConsoleError(hookName)) : UNSAFE_invariant(false) : void 0;\n  return state;\n}\n// External hooks\n/**\n * Handles the click behavior for router `<Link>` components. This is useful if\n * you need to create custom `<Link>` components with the same click behavior we\n * use in our exported `<Link>`.\n */\nfunction useLinkClickHandler(to, _temp) {\n  let {\n    target,\n    replace: replaceProp,\n    state,\n    preventScrollReset,\n    relative,\n    viewTransition\n  } = _temp === void 0 ? {} : _temp;\n  let navigate = useNavigate();\n  let location = useLocation();\n  let path = useResolvedPath(to, {\n    relative\n  });\n  return React.useCallback(event => {\n    if (shouldProcessLinkClick(event, target)) {\n      event.preventDefault();\n      // If the URL hasn't changed, a regular <a> will do a replace instead of\n      // a push, so do the same here unless the replace prop is explicitly set\n      let replace = replaceProp !== undefined ? replaceProp : createPath(location) === createPath(path);\n      navigate(to, {\n        replace,\n        state,\n        preventScrollReset,\n        relative,\n        viewTransition\n      });\n    }\n  }, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative, viewTransition]);\n}\n/**\n * A convenient wrapper for reading and writing search parameters via the\n * URLSearchParams interface.\n */\nfunction useSearchParams(defaultInit) {\n  process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(typeof URLSearchParams !== \"undefined\", \"You cannot use the `useSearchParams` hook in a browser that does not \" + \"support the URLSearchParams API. If you need to support Internet \" + \"Explorer 11, we recommend you load a polyfill such as \" + \"https://github.com/ungap/url-search-params.\") : void 0;\n  let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));\n  let hasSetSearchParamsRef = React.useRef(false);\n  let location = useLocation();\n  let searchParams = React.useMemo(() =>\n  // Only merge in the defaults if we haven't yet called setSearchParams.\n  // Once we call that we want those to take precedence, otherwise you can't\n  // remove a param with setSearchParams({}) if it has an initial value\n  getSearchParamsForLocation(location.search, hasSetSearchParamsRef.current ? null : defaultSearchParamsRef.current), [location.search]);\n  let navigate = useNavigate();\n  let setSearchParams = React.useCallback((nextInit, navigateOptions) => {\n    const newSearchParams = createSearchParams(typeof nextInit === \"function\" ? nextInit(searchParams) : nextInit);\n    hasSetSearchParamsRef.current = true;\n    navigate(\"?\" + newSearchParams, navigateOptions);\n  }, [navigate, searchParams]);\n  return [searchParams, setSearchParams];\n}\nfunction validateClientSideSubmission() {\n  if (typeof document === \"undefined\") {\n    throw new Error(\"You are calling submit during the server render. \" + \"Try calling submit within a `useEffect` or callback instead.\");\n  }\n}\nlet fetcherId = 0;\nlet getUniqueFetcherId = () => \"__\" + String(++fetcherId) + \"__\";\n/**\n * Returns a function that may be used to programmatically submit a form (or\n * some arbitrary data) to the server.\n */\nfunction useSubmit() {\n  let {\n    router\n  } = useDataRouterContext(DataRouterHook.UseSubmit);\n  let {\n    basename\n  } = React.useContext(UNSAFE_NavigationContext);\n  let currentRouteId = UNSAFE_useRouteId();\n  return React.useCallback(function (target, options) {\n    if (options === void 0) {\n      options = {};\n    }\n    validateClientSideSubmission();\n    let {\n      action,\n      method,\n      encType,\n      formData,\n      body\n    } = getFormSubmissionInfo(target, basename);\n    if (options.navigate === false) {\n      let key = options.fetcherKey || getUniqueFetcherId();\n      router.fetch(key, currentRouteId, options.action || action, {\n        preventScrollReset: options.preventScrollReset,\n        formData,\n        body,\n        formMethod: options.method || method,\n        formEncType: options.encType || encType,\n        flushSync: options.flushSync\n      });\n    } else {\n      router.navigate(options.action || action, {\n        preventScrollReset: options.preventScrollReset,\n        formData,\n        body,\n        formMethod: options.method || method,\n        formEncType: options.encType || encType,\n        replace: options.replace,\n        state: options.state,\n        fromRouteId: currentRouteId,\n        flushSync: options.flushSync,\n        viewTransition: options.viewTransition\n      });\n    }\n  }, [router, basename, currentRouteId]);\n}\n// v7: Eventually we should deprecate this entirely in favor of using the\n// router method directly?\nfunction useFormAction(action, _temp2) {\n  let {\n    relative\n  } = _temp2 === void 0 ? {} : _temp2;\n  let {\n    basename\n  } = React.useContext(UNSAFE_NavigationContext);\n  let routeContext = React.useContext(UNSAFE_RouteContext);\n  !routeContext ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"useFormAction must be used inside a RouteContext\") : UNSAFE_invariant(false) : void 0;\n  let [match] = routeContext.matches.slice(-1);\n  // Shallow clone path so we can modify it below, otherwise we modify the\n  // object referenced by useMemo inside useResolvedPath\n  let path = _extends({}, useResolvedPath(action ? action : \".\", {\n    relative\n  }));\n  // If no action was specified, browsers will persist current search params\n  // when determining the path, so match that behavior\n  // https://github.com/remix-run/remix/issues/927\n  let location = useLocation();\n  if (action == null) {\n    // Safe to write to this directly here since if action was undefined, we\n    // would have called useResolvedPath(\".\") which will never include a search\n    path.search = location.search;\n    // When grabbing search params from the URL, remove any included ?index param\n    // since it might not apply to our contextual route.  We add it back based\n    // on match.route.index below\n    let params = new URLSearchParams(path.search);\n    let indexValues = params.getAll(\"index\");\n    let hasNakedIndexParam = indexValues.some(v => v === \"\");\n    if (hasNakedIndexParam) {\n      params.delete(\"index\");\n      indexValues.filter(v => v).forEach(v => params.append(\"index\", v));\n      let qs = params.toString();\n      path.search = qs ? \"?\" + qs : \"\";\n    }\n  }\n  if ((!action || action === \".\") && match.route.index) {\n    path.search = path.search ? path.search.replace(/^\\?/, \"?index&\") : \"?index\";\n  }\n  // If we're operating within a basename, prepend it to the pathname prior\n  // to creating the form action.  If this is a root navigation, then just use\n  // the raw basename which allows the basename to have full control over the\n  // presence of a trailing slash on root actions\n  if (basename !== \"/\") {\n    path.pathname = path.pathname === \"/\" ? basename : joinPaths([basename, path.pathname]);\n  }\n  return createPath(path);\n}\n// TODO: (v7) Change the useFetcher generic default from `any` to `unknown`\n/**\n * Interacts with route loaders and actions without causing a navigation. Great\n * for any interaction that stays on the same page.\n */\nfunction useFetcher(_temp3) {\n  var _route$matches;\n  let {\n    key\n  } = _temp3 === void 0 ? {} : _temp3;\n  let {\n    router\n  } = useDataRouterContext(DataRouterHook.UseFetcher);\n  let state = useDataRouterState(DataRouterStateHook.UseFetcher);\n  let fetcherData = React.useContext(FetchersContext);\n  let route = React.useContext(UNSAFE_RouteContext);\n  let routeId = (_route$matches = route.matches[route.matches.length - 1]) == null ? void 0 : _route$matches.route.id;\n  !fetcherData ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"useFetcher must be used inside a FetchersContext\") : UNSAFE_invariant(false) : void 0;\n  !route ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"useFetcher must be used inside a RouteContext\") : UNSAFE_invariant(false) : void 0;\n  !(routeId != null) ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"useFetcher can only be used on routes that contain a unique \\\"id\\\"\") : UNSAFE_invariant(false) : void 0;\n  // Fetcher key handling\n  // OK to call conditionally to feature detect `useId`\n  // eslint-disable-next-line react-hooks/rules-of-hooks\n  let defaultKey = useIdImpl ? useIdImpl() : \"\";\n  let [fetcherKey, setFetcherKey] = React.useState(key || defaultKey);\n  if (key && key !== fetcherKey) {\n    setFetcherKey(key);\n  } else if (!fetcherKey) {\n    // We will only fall through here when `useId` is not available\n    setFetcherKey(getUniqueFetcherId());\n  }\n  // Registration/cleanup\n  React.useEffect(() => {\n    router.getFetcher(fetcherKey);\n    return () => {\n      // Tell the router we've unmounted - if v7_fetcherPersist is enabled this\n      // will not delete immediately but instead queue up a delete after the\n      // fetcher returns to an `idle` state\n      router.deleteFetcher(fetcherKey);\n    };\n  }, [router, fetcherKey]);\n  // Fetcher additions\n  let load = React.useCallback((href, opts) => {\n    !routeId ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"No routeId available for fetcher.load()\") : UNSAFE_invariant(false) : void 0;\n    router.fetch(fetcherKey, routeId, href, opts);\n  }, [fetcherKey, routeId, router]);\n  let submitImpl = useSubmit();\n  let submit = React.useCallback((target, opts) => {\n    submitImpl(target, _extends({}, opts, {\n      navigate: false,\n      fetcherKey\n    }));\n  }, [fetcherKey, submitImpl]);\n  let FetcherForm = React.useMemo(() => {\n    let FetcherForm = /*#__PURE__*/React.forwardRef((props, ref) => {\n      return /*#__PURE__*/React.createElement(Form, _extends({}, props, {\n        navigate: false,\n        fetcherKey: fetcherKey,\n        ref: ref\n      }));\n    });\n    if (process.env.NODE_ENV !== \"production\") {\n      FetcherForm.displayName = \"fetcher.Form\";\n    }\n    return FetcherForm;\n  }, [fetcherKey]);\n  // Exposed FetcherWithComponents\n  let fetcher = state.fetchers.get(fetcherKey) || IDLE_FETCHER;\n  let data = fetcherData.get(fetcherKey);\n  let fetcherWithComponents = React.useMemo(() => _extends({\n    Form: FetcherForm,\n    submit,\n    load\n  }, fetcher, {\n    data\n  }), [FetcherForm, submit, load, fetcher, data]);\n  return fetcherWithComponents;\n}\n/**\n * Provides all fetchers currently on the page. Useful for layouts and parent\n * routes that need to provide pending/optimistic UI regarding the fetch.\n */\nfunction useFetchers() {\n  let state = useDataRouterState(DataRouterStateHook.UseFetchers);\n  return Array.from(state.fetchers.entries()).map(_ref11 => {\n    let [key, fetcher] = _ref11;\n    return _extends({}, fetcher, {\n      key\n    });\n  });\n}\nconst SCROLL_RESTORATION_STORAGE_KEY = \"react-router-scroll-positions\";\nlet savedScrollPositions = {};\n/**\n * When rendered inside a RouterProvider, will restore scroll positions on navigations\n */\nfunction useScrollRestoration(_temp4) {\n  let {\n    getKey,\n    storageKey\n  } = _temp4 === void 0 ? {} : _temp4;\n  let {\n    router\n  } = useDataRouterContext(DataRouterHook.UseScrollRestoration);\n  let {\n    restoreScrollPosition,\n    preventScrollReset\n  } = useDataRouterState(DataRouterStateHook.UseScrollRestoration);\n  let {\n    basename\n  } = React.useContext(UNSAFE_NavigationContext);\n  let location = useLocation();\n  let matches = useMatches();\n  let navigation = useNavigation();\n  // Trigger manual scroll restoration while we're active\n  React.useEffect(() => {\n    window.history.scrollRestoration = \"manual\";\n    return () => {\n      window.history.scrollRestoration = \"auto\";\n    };\n  }, []);\n  // Save positions on pagehide\n  usePageHide(React.useCallback(() => {\n    if (navigation.state === \"idle\") {\n      let key = (getKey ? getKey(location, matches) : null) || location.key;\n      savedScrollPositions[key] = window.scrollY;\n    }\n    try {\n      sessionStorage.setItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY, JSON.stringify(savedScrollPositions));\n    } catch (error) {\n      process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(false, \"Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (\" + error + \").\") : void 0;\n    }\n    window.history.scrollRestoration = \"auto\";\n  }, [storageKey, getKey, navigation.state, location, matches]));\n  // Read in any saved scroll locations\n  if (typeof document !== \"undefined\") {\n    // eslint-disable-next-line react-hooks/rules-of-hooks\n    React.useLayoutEffect(() => {\n      try {\n        let sessionPositions = sessionStorage.getItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY);\n        if (sessionPositions) {\n          savedScrollPositions = JSON.parse(sessionPositions);\n        }\n      } catch (e) {\n        // no-op, use default empty object\n      }\n    }, [storageKey]);\n    // Enable scroll restoration in the router\n    // eslint-disable-next-line react-hooks/rules-of-hooks\n    React.useLayoutEffect(() => {\n      let getKeyWithoutBasename = getKey && basename !== \"/\" ? (location, matches) => getKey( // Strip the basename to match useLocation()\n      _extends({}, location, {\n        pathname: stripBasename(location.pathname, basename) || location.pathname\n      }), matches) : getKey;\n      let disableScrollRestoration = router == null ? void 0 : router.enableScrollRestoration(savedScrollPositions, () => window.scrollY, getKeyWithoutBasename);\n      return () => disableScrollRestoration && disableScrollRestoration();\n    }, [router, basename, getKey]);\n    // Restore scrolling when state.restoreScrollPosition changes\n    // eslint-disable-next-line react-hooks/rules-of-hooks\n    React.useLayoutEffect(() => {\n      // Explicit false means don't do anything (used for submissions)\n      if (restoreScrollPosition === false) {\n        return;\n      }\n      // been here before, scroll to it\n      if (typeof restoreScrollPosition === \"number\") {\n        window.scrollTo(0, restoreScrollPosition);\n        return;\n      }\n      // try to scroll to the hash\n      if (location.hash) {\n        let el = document.getElementById(decodeURIComponent(location.hash.slice(1)));\n        if (el) {\n          el.scrollIntoView();\n          return;\n        }\n      }\n      // Don't reset if this navigation opted out\n      if (preventScrollReset === true) {\n        return;\n      }\n      // otherwise go to the top on new locations\n      window.scrollTo(0, 0);\n    }, [location, restoreScrollPosition, preventScrollReset]);\n  }\n}\n/**\n * Setup a callback to be fired on the window's `beforeunload` event. This is\n * useful for saving some data to `window.localStorage` just before the page\n * refreshes.\n *\n * Note: The `callback` argument should be a function created with\n * `React.useCallback()`.\n */\nfunction useBeforeUnload(callback, options) {\n  let {\n    capture\n  } = options || {};\n  React.useEffect(() => {\n    let opts = capture != null ? {\n      capture\n    } : undefined;\n    window.addEventListener(\"beforeunload\", callback, opts);\n    return () => {\n      window.removeEventListener(\"beforeunload\", callback, opts);\n    };\n  }, [callback, capture]);\n}\n/**\n * Setup a callback to be fired on the window's `pagehide` event. This is\n * useful for saving some data to `window.localStorage` just before the page\n * refreshes.  This event is better supported than beforeunload across browsers.\n *\n * Note: The `callback` argument should be a function created with\n * `React.useCallback()`.\n */\nfunction usePageHide(callback, options) {\n  let {\n    capture\n  } = options || {};\n  React.useEffect(() => {\n    let opts = capture != null ? {\n      capture\n    } : undefined;\n    window.addEventListener(\"pagehide\", callback, opts);\n    return () => {\n      window.removeEventListener(\"pagehide\", callback, opts);\n    };\n  }, [callback, capture]);\n}\n/**\n * Wrapper around useBlocker to show a window.confirm prompt to users instead\n * of building a custom UI with useBlocker.\n *\n * Warning: This has *a lot of rough edges* and behaves very differently (and\n * very incorrectly in some cases) across browsers if user click addition\n * back/forward navigations while the confirm is open.  Use at your own risk.\n */\nfunction usePrompt(_ref12) {\n  let {\n    when,\n    message\n  } = _ref12;\n  let blocker = useBlocker(when);\n  React.useEffect(() => {\n    if (blocker.state === \"blocked\") {\n      let proceed = window.confirm(message);\n      if (proceed) {\n        // This timeout is needed to avoid a weird \"race\" on POP navigations\n        // between the `window.history` revert navigation and the result of\n        // `window.confirm`\n        setTimeout(blocker.proceed, 0);\n      } else {\n        blocker.reset();\n      }\n    }\n  }, [blocker, message]);\n  React.useEffect(() => {\n    if (blocker.state === \"blocked\" && !when) {\n      blocker.reset();\n    }\n  }, [blocker, when]);\n}\n/**\n * Return a boolean indicating if there is an active view transition to the\n * given href.  You can use this value to render CSS classes or viewTransitionName\n * styles onto your elements\n *\n * @param href The destination href\n * @param [opts.relative] Relative routing type (\"route\" | \"path\")\n */\nfunction useViewTransitionState(to, opts) {\n  if (opts === void 0) {\n    opts = {};\n  }\n  let vtContext = React.useContext(ViewTransitionContext);\n  !(vtContext != null) ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  \" + \"Did you accidentally import `RouterProvider` from `react-router`?\") : UNSAFE_invariant(false) : void 0;\n  let {\n    basename\n  } = useDataRouterContext(DataRouterHook.useViewTransitionState);\n  let path = useResolvedPath(to, {\n    relative: opts.relative\n  });\n  if (!vtContext.isTransitioning) {\n    return false;\n  }\n  let currentPath = stripBasename(vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;\n  let nextPath = stripBasename(vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;\n  // Transition is active if we're going to or coming from the indicated\n  // destination.  This ensures that other PUSH navigations that reverse\n  // an indicated transition apply.  I.e., on the list view you have:\n  //\n  //   <NavLink to=\"/details/1\" viewTransition>\n  //\n  // If you click the breadcrumb back to the list view:\n  //\n  //   <NavLink to=\"/list\" viewTransition>\n  //\n  // We should apply the transition because it's indicated as active going\n  // from /list -> /details/1 and therefore should be active on the reverse\n  // (even though this isn't strictly a POP reverse)\n  return matchPath(path.pathname, nextPath) != null || matchPath(path.pathname, currentPath) != null;\n}\n//#endregion\n\nexport { BrowserRouter, Form, HashRouter, Link, NavLink, RouterProvider, ScrollRestoration, FetchersContext as UNSAFE_FetchersContext, ViewTransitionContext as UNSAFE_ViewTransitionContext, useScrollRestoration as UNSAFE_useScrollRestoration, createBrowserRouter, createHashRouter, createSearchParams, HistoryRouter as unstable_HistoryRouter, usePrompt as unstable_usePrompt, useBeforeUnload, useFetcher, useFetchers, useFormAction, useLinkClickHandler, useSearchParams, useSubmit, useViewTransitionState };\n//# sourceMappingURL=index.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nvar defaultAttributes = {\n  xmlns: \"http://www.w3.org/2000/svg\",\n  width: 24,\n  height: 24,\n  viewBox: \"0 0 24 24\",\n  fill: \"none\",\n  stroke: \"currentColor\",\n  strokeWidth: 2,\n  strokeLinecap: \"round\",\n  strokeLinejoin: \"round\"\n};\n\nexport { defaultAttributes as default };\n//# sourceMappingURL=defaultAttributes.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport { forwardRef, createElement } from 'react';\nimport defaultAttributes from './defaultAttributes.js';\n\nconst toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").toLowerCase();\nconst createLucideIcon = (iconName, iconNode) => {\n  const Component = forwardRef(\n    ({ color = \"currentColor\", size = 24, strokeWidth = 2, absoluteStrokeWidth, children, ...rest }, ref) => createElement(\n      \"svg\",\n      {\n        ref,\n        ...defaultAttributes,\n        width: size,\n        height: size,\n        stroke: color,\n        strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,\n        className: `lucide lucide-${toKebabCase(iconName)}`,\n        ...rest\n      },\n      [\n        ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n        ...(Array.isArray(children) ? children : [children]) || []\n      ]\n    )\n  );\n  Component.displayName = `${iconName}`;\n  return Component;\n};\n\nexport { createLucideIcon as default, toKebabCase };\n//# sourceMappingURL=createLucideIcon.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Activity = createLucideIcon(\"Activity\", [\n  [\"path\", { d: \"M22 12h-4l-3 9L9 3l-3 9H2\", key: \"d5dnw9\" }]\n]);\n\nexport { Activity as default };\n//# sourceMappingURL=activity.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst AlertCircle = createLucideIcon(\"AlertCircle\", [\n  [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n  [\"line\", { x1: \"12\", x2: \"12\", y1: \"8\", y2: \"12\", key: \"1pkeuh\" }],\n  [\"line\", { x1: \"12\", x2: \"12.01\", y1: \"16\", y2: \"16\", key: \"4dfq90\" }]\n]);\n\nexport { AlertCircle as default };\n//# sourceMappingURL=alert-circle.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst AlertTriangle = createLucideIcon(\"AlertTriangle\", [\n  [\n    \"path\",\n    {\n      d: \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z\",\n      key: \"c3ski4\"\n    }\n  ],\n  [\"path\", { d: \"M12 9v4\", key: \"juzpu7\" }],\n  [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n]);\n\nexport { AlertTriangle as default };\n//# sourceMappingURL=alert-triangle.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst ArrowRight = createLucideIcon(\"ArrowRight\", [\n  [\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }],\n  [\"path\", { d: \"m12 5 7 7-7 7\", key: \"xquz4c\" }]\n]);\n\nexport { ArrowRight as default };\n//# sourceMappingURL=arrow-right.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst BarChart3 = createLucideIcon(\"BarChart3\", [\n  [\"path\", { d: \"M3 3v18h18\", key: \"1s2lah\" }],\n  [\"path\", { d: \"M18 17V9\", key: \"2bz60n\" }],\n  [\"path\", { d: \"M13 17V5\", key: \"1frdt8\" }],\n  [\"path\", { d: \"M8 17v-3\", key: \"17ska0\" }]\n]);\n\nexport { BarChart3 as default };\n//# sourceMappingURL=bar-chart-3.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Bug = createLucideIcon(\"Bug\", [\n  [\"path\", { d: \"m8 2 1.88 1.88\", key: \"fmnt4t\" }],\n  [\"path\", { d: \"M14.12 3.88 16 2\", key: \"qol33r\" }],\n  [\"path\", { d: \"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1\", key: \"d7y7pr\" }],\n  [\n    \"path\",\n    {\n      d: \"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6\",\n      key: \"xs1cw7\"\n    }\n  ],\n  [\"path\", { d: \"M12 20v-9\", key: \"1qisl0\" }],\n  [\"path\", { d: \"M6.53 9C4.6 8.8 3 7.1 3 5\", key: \"32zzws\" }],\n  [\"path\", { d: \"M6 13H2\", key: \"82j7cp\" }],\n  [\"path\", { d: \"M3 21c0-2.1 1.7-3.9 3.8-4\", key: \"4p0ekp\" }],\n  [\"path\", { d: \"M20.97 5c0 2.1-1.6 3.8-3.5 4\", key: \"18gb23\" }],\n  [\"path\", { d: \"M22 13h-4\", key: \"1jl80f\" }],\n  [\"path\", { d: \"M17.2 17c2.1.1 3.8 1.9 3.8 4\", key: \"k3fwyw\" }]\n]);\n\nexport { Bug as default };\n//# sourceMappingURL=bug.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Calendar = createLucideIcon(\"Calendar\", [\n  [\n    \"rect\",\n    {\n      width: \"18\",\n      height: \"18\",\n      x: \"3\",\n      y: \"4\",\n      rx: \"2\",\n      ry: \"2\",\n      key: \"eu3xkr\"\n    }\n  ],\n  [\"line\", { x1: \"16\", x2: \"16\", y1: \"2\", y2: \"6\", key: \"m3sa8f\" }],\n  [\"line\", { x1: \"8\", x2: \"8\", y1: \"2\", y2: \"6\", key: \"18kwsl\" }],\n  [\"line\", { x1: \"3\", x2: \"21\", y1: \"10\", y2: \"10\", key: \"xt86sb\" }]\n]);\n\nexport { Calendar as default };\n//# sourceMappingURL=calendar.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst CheckCircle = createLucideIcon(\"CheckCircle\", [\n  [\"path\", { d: \"M22 11.08V12a10 10 0 1 1-5.93-9.14\", key: \"g774vq\" }],\n  [\"polyline\", { points: \"22 4 12 14.01 9 11.01\", key: \"6xbx8j\" }]\n]);\n\nexport { CheckCircle as default };\n//# sourceMappingURL=check-circle.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst CheckSquare = createLucideIcon(\"CheckSquare\", [\n  [\"polyline\", { points: \"9 11 12 14 22 4\", key: \"19ybtz\" }],\n  [\n    \"path\",\n    {\n      d: \"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11\",\n      key: \"1jnkn4\"\n    }\n  ]\n]);\n\nexport { CheckSquare as default };\n//# sourceMappingURL=check-square.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Circle = createLucideIcon(\"Circle\", [\n  [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }]\n]);\n\nexport { Circle as default };\n//# sourceMappingURL=circle.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Clock = createLucideIcon(\"Clock\", [\n  [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n  [\"polyline\", { points: \"12 6 12 12 16 14\", key: \"68esgv\" }]\n]);\n\nexport { Clock as default };\n//# sourceMappingURL=clock.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Cpu = createLucideIcon(\"Cpu\", [\n  [\n    \"rect\",\n    { x: \"4\", y: \"4\", width: \"16\", height: \"16\", rx: \"2\", key: \"1vbyd7\" }\n  ],\n  [\"rect\", { x: \"9\", y: \"9\", width: \"6\", height: \"6\", key: \"o3kz5p\" }],\n  [\"path\", { d: \"M15 2v2\", key: \"13l42r\" }],\n  [\"path\", { d: \"M15 20v2\", key: \"15mkzm\" }],\n  [\"path\", { d: \"M2 15h2\", key: \"1gxd5l\" }],\n  [\"path\", { d: \"M2 9h2\", key: \"1bbxkp\" }],\n  [\"path\", { d: \"M20 15h2\", key: \"19e6y8\" }],\n  [\"path\", { d: \"M20 9h2\", key: \"19tzq7\" }],\n  [\"path\", { d: \"M9 2v2\", key: \"165o2o\" }],\n  [\"path\", { d: \"M9 20v2\", key: \"i2bqo8\" }]\n]);\n\nexport { Cpu as default };\n//# sourceMappingURL=cpu.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst DollarSign = createLucideIcon(\"DollarSign\", [\n  [\"line\", { x1: \"12\", x2: \"12\", y1: \"2\", y2: \"22\", key: \"7eqyqh\" }],\n  [\n    \"path\",\n    { d: \"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6\", key: \"1b0p4s\" }\n  ]\n]);\n\nexport { DollarSign as default };\n//# sourceMappingURL=dollar-sign.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst ExternalLink = createLucideIcon(\"ExternalLink\", [\n  [\n    \"path\",\n    {\n      d: \"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\",\n      key: \"a6xqqp\"\n    }\n  ],\n  [\"polyline\", { points: \"15 3 21 3 21 9\", key: \"mznyad\" }],\n  [\"line\", { x1: \"10\", x2: \"21\", y1: \"14\", y2: \"3\", key: \"18c3s4\" }]\n]);\n\nexport { ExternalLink as default };\n//# sourceMappingURL=external-link.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Filter = createLucideIcon(\"Filter\", [\n  [\n    \"polygon\",\n    { points: \"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3\", key: \"1yg77f\" }\n  ]\n]);\n\nexport { Filter as default };\n//# sourceMappingURL=filter.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst FolderOpen = createLucideIcon(\"FolderOpen\", [\n  [\n    \"path\",\n    {\n      d: \"m6 14 1.45-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.55 6a2 2 0 0 1-1.94 1.5H4a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.93a2 2 0 0 1 1.66.9l.82 1.2a2 2 0 0 0 1.66.9H18a2 2 0 0 1 2 2v2\",\n      key: \"1nmvlm\"\n    }\n  ]\n]);\n\nexport { FolderOpen as default };\n//# sourceMappingURL=folder-open.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst GitBranch = createLucideIcon(\"GitBranch\", [\n  [\"line\", { x1: \"6\", x2: \"6\", y1: \"3\", y2: \"15\", key: \"17qcm7\" }],\n  [\"circle\", { cx: \"18\", cy: \"6\", r: \"3\", key: \"1h7g24\" }],\n  [\"circle\", { cx: \"6\", cy: \"18\", r: \"3\", key: \"fqmcym\" }],\n  [\"path\", { d: \"M18 9a9 9 0 0 1-9 9\", key: \"n2h4wq\" }]\n]);\n\nexport { GitBranch as default };\n//# sourceMappingURL=git-branch.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst HardDrive = createLucideIcon(\"HardDrive\", [\n  [\"line\", { x1: \"22\", x2: \"2\", y1: \"12\", y2: \"12\", key: \"1y58io\" }],\n  [\n    \"path\",\n    {\n      d: \"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\",\n      key: \"oot6mr\"\n    }\n  ],\n  [\"line\", { x1: \"6\", x2: \"6.01\", y1: \"16\", y2: \"16\", key: \"sgf278\" }],\n  [\"line\", { x1: \"10\", x2: \"10.01\", y1: \"16\", y2: \"16\", key: \"1l4acy\" }]\n]);\n\nexport { HardDrive as default };\n//# sourceMappingURL=hard-drive.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Home = createLucideIcon(\"Home\", [\n  [\n    \"path\",\n    { d: \"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\", key: \"y5dka4\" }\n  ],\n  [\"polyline\", { points: \"9 22 9 12 15 12 15 22\", key: \"e2us08\" }]\n]);\n\nexport { Home as default };\n//# sourceMappingURL=home.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Key = createLucideIcon(\"Key\", [\n  [\"circle\", { cx: \"7.5\", cy: \"15.5\", r: \"5.5\", key: \"yqb3hr\" }],\n  [\"path\", { d: \"m21 2-9.6 9.6\", key: \"1j0ho8\" }],\n  [\"path\", { d: \"m15.5 7.5 3 3L22 7l-3-3\", key: \"1rn1fs\" }]\n]);\n\nexport { Key as default };\n//# sourceMappingURL=key.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Maximize2 = createLucideIcon(\"Maximize2\", [\n  [\"polyline\", { points: \"15 3 21 3 21 9\", key: \"mznyad\" }],\n  [\"polyline\", { points: \"9 21 3 21 3 15\", key: \"1avn1i\" }],\n  [\"line\", { x1: \"21\", x2: \"14\", y1: \"3\", y2: \"10\", key: \"ota7mn\" }],\n  [\"line\", { x1: \"3\", x2: \"10\", y1: \"21\", y2: \"14\", key: \"1atl0r\" }]\n]);\n\nexport { Maximize2 as default };\n//# sourceMappingURL=maximize-2.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst MonitorSpeaker = createLucideIcon(\"MonitorSpeaker\", [\n  [\"path\", { d: \"M5.5 20H8\", key: \"1k40s5\" }],\n  [\"path\", { d: \"M17 9h.01\", key: \"1j24nn\" }],\n  [\n    \"rect\",\n    { width: \"10\", height: \"16\", x: \"12\", y: \"4\", rx: \"2\", key: \"ixliua\" }\n  ],\n  [\"path\", { d: \"M8 6H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h4\", key: \"1mp6e1\" }],\n  [\"circle\", { cx: \"17\", cy: \"15\", r: \"1\", key: \"tqvash\" }]\n]);\n\nexport { MonitorSpeaker as default };\n//# sourceMappingURL=monitor-speaker.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Pause = createLucideIcon(\"Pause\", [\n  [\"rect\", { width: \"4\", height: \"16\", x: \"6\", y: \"4\", key: \"iffhe4\" }],\n  [\"rect\", { width: \"4\", height: \"16\", x: \"14\", y: \"4\", key: \"sjin7j\" }]\n]);\n\nexport { Pause as default };\n//# sourceMappingURL=pause.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Play = createLucideIcon(\"Play\", [\n  [\"polygon\", { points: \"5 3 19 12 5 21 5 3\", key: \"191637\" }]\n]);\n\nexport { Play as default };\n//# sourceMappingURL=play.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst RefreshCw = createLucideIcon(\"RefreshCw\", [\n  [\n    \"path\",\n    { d: \"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\", key: \"v9h5vc\" }\n  ],\n  [\"path\", { d: \"M21 3v5h-5\", key: \"1q7to0\" }],\n  [\n    \"path\",\n    { d: \"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\", key: \"3uifl3\" }\n  ],\n  [\"path\", { d: \"M8 16H3v5\", key: \"1cv678\" }]\n]);\n\nexport { RefreshCw as default };\n//# sourceMappingURL=refresh-cw.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Rocket = createLucideIcon(\"Rocket\", [\n  [\n    \"path\",\n    {\n      d: \"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z\",\n      key: \"m3kijz\"\n    }\n  ],\n  [\n    \"path\",\n    {\n      d: \"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z\",\n      key: \"1fmvmk\"\n    }\n  ],\n  [\"path\", { d: \"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0\", key: \"1f8sc4\" }],\n  [\"path\", { d: \"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5\", key: \"qeys4\" }]\n]);\n\nexport { Rocket as default };\n//# sourceMappingURL=rocket.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst RotateCcw = createLucideIcon(\"RotateCcw\", [\n  [\n    \"path\",\n    { d: \"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\", key: \"1357e3\" }\n  ],\n  [\"path\", { d: \"M3 3v5h5\", key: \"1xhq8a\" }]\n]);\n\nexport { RotateCcw as default };\n//# sourceMappingURL=rotate-ccw.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Search = createLucideIcon(\"Search\", [\n  [\"circle\", { cx: \"11\", cy: \"11\", r: \"8\", key: \"4ej97u\" }],\n  [\"path\", { d: \"m21 21-4.3-4.3\", key: \"1qie3q\" }]\n]);\n\nexport { Search as default };\n//# sourceMappingURL=search.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Server = createLucideIcon(\"Server\", [\n  [\n    \"rect\",\n    {\n      width: \"20\",\n      height: \"8\",\n      x: \"2\",\n      y: \"2\",\n      rx: \"2\",\n      ry: \"2\",\n      key: \"ngkwjq\"\n    }\n  ],\n  [\n    \"rect\",\n    {\n      width: \"20\",\n      height: \"8\",\n      x: \"2\",\n      y: \"14\",\n      rx: \"2\",\n      ry: \"2\",\n      key: \"iecqi9\"\n    }\n  ],\n  [\"line\", { x1: \"6\", x2: \"6.01\", y1: \"6\", y2: \"6\", key: \"16zg32\" }],\n  [\"line\", { x1: \"6\", x2: \"6.01\", y1: \"18\", y2: \"18\", key: \"nzw8ys\" }]\n]);\n\nexport { Server as default };\n//# sourceMappingURL=server.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Square = createLucideIcon(\"Square\", [\n  [\n    \"rect\",\n    { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\", key: \"afitv7\" }\n  ]\n]);\n\nexport { Square as default };\n//# sourceMappingURL=square.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Target = createLucideIcon(\"Target\", [\n  [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n  [\"circle\", { cx: \"12\", cy: \"12\", r: \"6\", key: \"1vlfrh\" }],\n  [\"circle\", { cx: \"12\", cy: \"12\", r: \"2\", key: \"1c9p78\" }]\n]);\n\nexport { Target as default };\n//# sourceMappingURL=target.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst TrendingUp = createLucideIcon(\"TrendingUp\", [\n  [\"polyline\", { points: \"22 7 13.5 15.5 8.5 10.5 2 17\", key: \"126l90\" }],\n  [\"polyline\", { points: \"16 7 22 7 22 13\", key: \"kwv8wd\" }]\n]);\n\nexport { TrendingUp as default };\n//# sourceMappingURL=trending-up.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst User = createLucideIcon(\"User\", [\n  [\"path\", { d: \"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\", key: \"975kel\" }],\n  [\"circle\", { cx: \"12\", cy: \"7\", r: \"4\", key: \"17ys0d\" }]\n]);\n\nexport { User as default };\n//# sourceMappingURL=user.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Users = createLucideIcon(\"Users\", [\n  [\"path\", { d: \"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\", key: \"1yyitq\" }],\n  [\"circle\", { cx: \"9\", cy: \"7\", r: \"4\", key: \"nufk8\" }],\n  [\"path\", { d: \"M22 21v-2a4 4 0 0 0-3-3.87\", key: \"kshegd\" }],\n  [\"path\", { d: \"M16 3.13a4 4 0 0 1 0 7.75\", key: \"1da9ce\" }]\n]);\n\nexport { Users as default };\n//# sourceMappingURL=users.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst WifiOff = createLucideIcon(\"WifiOff\", [\n  [\"line\", { x1: \"2\", x2: \"22\", y1: \"2\", y2: \"22\", key: \"a6p6uj\" }],\n  [\"path\", { d: \"M8.5 16.5a5 5 0 0 1 7 0\", key: \"sej527\" }],\n  [\"path\", { d: \"M2 8.82a15 15 0 0 1 4.17-2.65\", key: \"11utq1\" }],\n  [\"path\", { d: \"M10.66 5c4.01-.36 8.14.9 11.34 3.76\", key: \"hxefdu\" }],\n  [\"path\", { d: \"M16.85 11.25a10 10 0 0 1 2.22 1.68\", key: \"q734kn\" }],\n  [\"path\", { d: \"M5 13a10 10 0 0 1 5.24-2.76\", key: \"piq4yl\" }],\n  [\"line\", { x1: \"12\", x2: \"12.01\", y1: \"20\", y2: \"20\", key: \"of4bc4\" }]\n]);\n\nexport { WifiOff as default };\n//# sourceMappingURL=wifi-off.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Wifi = createLucideIcon(\"Wifi\", [\n  [\"path\", { d: \"M5 13a10 10 0 0 1 14 0\", key: \"6v8j51\" }],\n  [\"path\", { d: \"M8.5 16.5a5 5 0 0 1 7 0\", key: \"sej527\" }],\n  [\"path\", { d: \"M2 8.82a15 15 0 0 1 20 0\", key: \"dnpr2z\" }],\n  [\"line\", { x1: \"12\", x2: \"12.01\", y1: \"20\", y2: \"20\", key: \"of4bc4\" }]\n]);\n\nexport { Wifi as default };\n//# sourceMappingURL=wifi.js.map\n","/**\n * lucide-react v0.279.0 - ISC\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Zap = createLucideIcon(\"Zap\", [\n  [\n    \"polygon\",\n    { points: \"13 2 3 14 12 14 11 22 21 10 12 10 13 2\", key: \"45s27k\" }\n  ]\n]);\n\nexport { Zap as default };\n//# sourceMappingURL=zap.js.map\n","// AI Trackdown Backend API Service\n// Handles server-side execution of ai-trackdown-tools commands\n\nexport interface BackendApiResponse<T> {\n  success: boolean\n  data?: T\n  error?: string\n}\n\nexport class AiTrackdownBackendService {\n  private static instance: AiTrackdownBackendService\n  private readonly baseUrl: string\n\n  constructor(baseUrl: string = 'http://localhost:3001/api') {\n    this.baseUrl = baseUrl\n  }\n\n  static getInstance(): AiTrackdownBackendService {\n    if (!AiTrackdownBackendService.instance) {\n      AiTrackdownBackendService.instance = new AiTrackdownBackendService()\n    }\n    return AiTrackdownBackendService.instance\n  }\n\n  async executeAiTrackdownCommand(command: string, projectPath?: string): Promise<BackendApiResponse<any>> {\n    try {\n      const response = await fetch(`${this.baseUrl}/aitrackdown/execute`, {\n        method: 'POST',\n        headers: {\n          'Content-Type': 'application/json',\n        },\n        body: JSON.stringify({\n          command,\n          projectPath: projectPath || process.cwd()\n        })\n      })\n\n      if (!response.ok) {\n        throw new Error(`API request failed: ${response.status}`)\n      }\n\n      return await response.json()\n    } catch (error) {\n      console.error('Backend API error:', error)\n      return {\n        success: false,\n        error: error instanceof Error ? error.message : 'Unknown error'\n      }\n    }\n  }\n\n  async getEpics(projectPath?: string): Promise<BackendApiResponse<any[]>> {\n    return this.executeAiTrackdownCommand('epic list --format json', projectPath)\n  }\n\n  async getIssues(projectPath?: string): Promise<BackendApiResponse<any[]>> {\n    return this.executeAiTrackdownCommand('issue list --format json', projectPath)\n  }\n\n  async getTasks(projectPath?: string): Promise<BackendApiResponse<any[]>> {\n    return this.executeAiTrackdownCommand('task list --format json', projectPath)\n  }\n\n  async getStatus(projectPath?: string): Promise<BackendApiResponse<any>> {\n    return this.executeAiTrackdownCommand('status --format json', projectPath)\n  }\n\n  async getBacklog(projectPath?: string): Promise<BackendApiResponse<any>> {\n    return this.executeAiTrackdownCommand('backlog --format json', projectPath)\n  }\n}\n\nexport const aiTrackdownBackendService = AiTrackdownBackendService.getInstance()","// AI Trackdown API Service\n// Provides interface to ai-trackdown-tools data\n\nimport { aiTrackdownBackendService } from './aiTrackdownBackend'\n\nexport interface AiTrackdownEpic {\n  id: string\n  title: string\n  status: string\n  priority: string\n  assignee: string\n  created: string\n  updated: string\n  milestone?: string\n}\n\nexport interface AiTrackdownIssue {\n  id: string\n  title: string\n  status: string\n  priority: string\n  assignee: string\n  epic: string\n  created: string\n  updated: string\n  milestone?: string\n}\n\nexport interface AiTrackdownTask {\n  id: string\n  title: string\n  status: string\n  priority: string\n  assignee: string\n  issue: string\n  created: string\n  updated: string\n  milestone?: string\n}\n\nexport class AiTrackdownApiService {\n  private static instance: AiTrackdownApiService\n  \n  static getInstance(): AiTrackdownApiService {\n    if (!AiTrackdownApiService.instance) {\n      AiTrackdownApiService.instance = new AiTrackdownApiService()\n    }\n    return AiTrackdownApiService.instance\n  }\n  \n  async getEpics(projectPath?: string): Promise<AiTrackdownEpic[]> {\n    try {\n      // Try to use the backend service first\n      const response = await aiTrackdownBackendService.getEpics(projectPath)\n      if (response.success && response.data) {\n        return response.data\n      }\n      \n      // Fall back to simulated data\n      return [\n        {\n          id: \"EP-0003\",\n          title: \"Agent Role Improvements\",\n          status: \"PLANNING\",\n          priority: \"MEDIUM\",\n          assignee: \"unassigned\",\n          created: \"2025-07-08\",\n          updated: \"2025-07-08\"\n        },\n        {\n          id: \"EP-0004\",\n          title: \"Agent Role Enhancements\",\n          status: \"COMPLETED\",\n          priority: \"MEDIUM\",\n          assignee: \"unassigned\",\n          created: \"2025-07-08\",\n          updated: \"2025-07-08\"\n        },\n        {\n          id: \"EP-0005\",\n          title: \"CMPM User Guide Development\",\n          status: \"PLANNING\",\n          priority: \"MEDIUM\",\n          assignee: \"unassigned\",\n          created: \"2025-07-08\",\n          updated: \"2025-07-08\"\n        }\n      ]\n    } catch (error) {\n      console.error('Error fetching epics:', error)\n      return []\n    }\n  }\n  \n  async getIssues(projectPath?: string): Promise<AiTrackdownIssue[]> {\n    try {\n      // Try to use the backend service first\n      const response = await aiTrackdownBackendService.getIssues(projectPath)\n      if (response.success && response.data) {\n        return response.data\n      }\n      \n      // Fall back to simulated data\n      return [\n        {\n          id: \"ISS-0001\",\n          title: \"Claude PM Portfolio Manager - Project Setup\",\n          status: \"TODO\",\n          priority: \"MEDIUM\",\n          assignee: \"unassigned\",\n          epic: \"EP-0001\",\n          created: \"2025-07-08\",\n          updated: \"2025-07-08\"\n        },\n        {\n          id: \"ISS-0019\",\n          title: \"Enhance Architect Agent Role Definition\",\n          status: \"COMPLETED\",\n          priority: \"HIGH\",\n          assignee: \"unassigned\",\n          epic: \"EP-0004\",\n          created: \"2025-07-08\",\n          updated: \"2025-07-08\"\n        },\n        {\n          id: \"ISS-0020\",\n          title: \"Enhance Engineer Agent Role Definition\",\n          status: \"COMPLETED\",\n          priority: \"HIGH\",\n          assignee: \"unassigned\",\n          epic: \"EP-0004\",\n          created: \"2025-07-08\",\n          updated: \"2025-07-08\"\n        },\n        {\n          id: \"ISS-0021\",\n          title: \"Enhance QA Agent Role Definition\",\n          status: \"COMPLETED\",\n          priority: \"HIGH\",\n          assignee: \"unassigned\",\n          epic: \"EP-0004\",\n          created: \"2025-07-08\",\n          updated: \"2025-07-08\"\n        },\n        {\n          id: \"ISS-0028\",\n          title: \"User Guide: Getting Started & Installation\",\n          status: \"PLANNING\",\n          priority: \"HIGH\",\n          assignee: \"unassigned\",\n          epic: \"EP-0005\",\n          created: \"2025-07-08\",\n          updated: \"2025-07-08\"\n        },\n        {\n          id: \"ISS-0029\",\n          title: \"User Guide: Architecture & Core Concepts\",\n          status: \"PLANNING\",\n          priority: \"HIGH\",\n          assignee: \"unassigned\",\n          epic: \"EP-0005\",\n          created: \"2025-07-08\",\n          updated: \"2025-07-08\"\n        },\n        {\n          id: \"ISS-0030\",\n          title: \"User Guide: Claude Slash Commands & Orchestration\",\n          status: \"PLANNING\",\n          priority: \"HIGH\",\n          assignee: \"unassigned\",\n          epic: \"EP-0005\",\n          created: \"2025-07-08\",\n          updated: \"2025-07-08\"\n        },\n        {\n          id: \"ISS-0031\",\n          title: \"User Guide: Directory Organization & Best Practices\",\n          status: \"PLANNING\",\n          priority: \"HIGH\",\n          assignee: \"unassigned\",\n          epic: \"EP-0005\",\n          created: \"2025-07-08\",\n          updated: \"2025-07-08\"\n        }\n      ]\n    } catch (error) {\n      console.error('Error fetching issues:', error)\n      return []\n    }\n  }\n  \n  async getTasks(projectPath?: string): Promise<AiTrackdownTask[]> {\n    try {\n      // Try to use the backend service first\n      const response = await aiTrackdownBackendService.getTasks(projectPath)\n      if (response.success && response.data) {\n        return response.data\n      }\n      \n      // Return empty array for now as there are no tasks in the current structure\n      return []\n    } catch (error) {\n      console.error('Error fetching tasks:', error)\n      return []\n    }\n  }\n  \n  async getProjectStatus(projectPath?: string): Promise<{\n    epics: number\n    issues: number\n    tasks: number\n    completedEpics: number\n    completedIssues: number\n    completedTasks: number\n  }> {\n    try {\n      const epics = await this.getEpics(projectPath)\n      const issues = await this.getIssues(projectPath)\n      const tasks = await this.getTasks(projectPath)\n      \n      return {\n        epics: epics.length,\n        issues: issues.length,\n        tasks: tasks.length,\n        completedEpics: epics.filter(e => e.status === 'COMPLETED').length,\n        completedIssues: issues.filter(i => i.status === 'COMPLETED').length,\n        completedTasks: tasks.filter(t => t.status === 'COMPLETED').length\n      }\n    } catch (error) {\n      console.error('Error getting project status:', error)\n      return {\n        epics: 0,\n        issues: 0,\n        tasks: 0,\n        completedEpics: 0,\n        completedIssues: 0,\n        completedTasks: 0\n      }\n    }\n  }\n}\n\nexport const aiTrackdownApiService = AiTrackdownApiService.getInstance()","// Agent Service for Claude PM Framework Integration\n// Manages agent data, assignments, and performance metrics\n\nimport { aiTrackdownBackendService } from './aiTrackdownBackend'\nimport type { \n  Agent, \n  AgentActivity, \n  AgentAssignmentRequest, \n  AgentAssignmentResponse, \n  AgentRegistry, \n  AgentRole, \n  AgentRoleType, \n  AgentStatus,\n  Assignment,\n  PerformanceMetrics,\n  CollaborationPattern,\n  Availability,\n  AgentCapacityInfo\n} from '../types/agent'\n\nexport class AgentService {\n  private static instance: AgentService\n  private agentRegistry: AgentRegistry | null = null\n  private lastUpdate: Date | null = null\n  private readonly updateInterval = 30000 // 30 seconds\n\n  static getInstance(): AgentService {\n    if (!AgentService.instance) {\n      AgentService.instance = new AgentService()\n    }\n    return AgentService.instance\n  }\n\n  private getAgentRoleDefinition(roleType: AgentRoleType): AgentRole {\n    const roleDefinitions: Record<AgentRoleType, AgentRole> = {\n      architect: {\n        type: 'architect',\n        description: 'System architecture and design decisions',\n        capabilities: ['System Design', 'Architecture Review', 'Technical Leadership'],\n        responsibilities: ['Define system architecture', 'Review technical designs', 'Ensure architectural consistency'],\n        requiredSkills: ['Software Architecture', 'Design Patterns', 'System Integration'],\n        authority: 'high'\n      },\n      engineer: {\n        type: 'engineer',\n        description: 'Software development and implementation',\n        capabilities: ['Code Development', 'Feature Implementation', 'Bug Fixing'],\n        responsibilities: ['Write production code', 'Implement features', 'Fix bugs'],\n        requiredSkills: ['Programming', 'Software Development', 'Testing'],\n        authority: 'medium'\n      },\n      qa: {\n        type: 'qa',\n        description: 'Quality assurance and testing',\n        capabilities: ['Test Planning', 'Test Execution', 'Quality Assessment'],\n        responsibilities: ['Test applications', 'Ensure quality standards', 'Report defects'],\n        requiredSkills: ['Testing', 'Quality Assurance', 'Test Automation'],\n        authority: 'medium'\n      },\n      security: {\n        type: 'security',\n        description: 'Security analysis and implementation',\n        capabilities: ['Security Assessment', 'Vulnerability Analysis', 'Security Implementation'],\n        responsibilities: ['Assess security risks', 'Implement security measures', 'Monitor security'],\n        requiredSkills: ['Security', 'Vulnerability Assessment', 'Cryptography'],\n        authority: 'high'\n      },\n      devops: {\n        type: 'devops',\n        description: 'DevOps and deployment management',\n        capabilities: ['CI/CD Setup', 'Infrastructure Management', 'Deployment'],\n        responsibilities: ['Manage deployments', 'Maintain infrastructure', 'Optimize CI/CD'],\n        requiredSkills: ['DevOps', 'CI/CD', 'Infrastructure'],\n        authority: 'medium'\n      },\n      research: {\n        type: 'research',\n        description: 'Research and analysis',\n        capabilities: ['Research', 'Analysis', 'Documentation'],\n        responsibilities: ['Conduct research', 'Analyze requirements', 'Document findings'],\n        requiredSkills: ['Research', 'Analysis', 'Documentation'],\n        authority: 'low'\n      },\n      data: {\n        type: 'data',\n        description: 'Data analysis and management',\n        capabilities: ['Data Analysis', 'Data Processing', 'Data Visualization'],\n        responsibilities: ['Analyze data', 'Process datasets', 'Create visualizations'],\n        requiredSkills: ['Data Analysis', 'SQL', 'Data Visualization'],\n        authority: 'medium'\n      },\n      performance: {\n        type: 'performance',\n        description: 'Performance optimization and monitoring',\n        capabilities: ['Performance Analysis', 'Optimization', 'Monitoring'],\n        responsibilities: ['Monitor performance', 'Optimize systems', 'Identify bottlenecks'],\n        requiredSkills: ['Performance Testing', 'Optimization', 'Monitoring'],\n        authority: 'medium'\n      },\n      documentation: {\n        type: 'documentation',\n        description: 'Technical documentation and knowledge management',\n        capabilities: ['Documentation', 'Knowledge Management', 'Training'],\n        responsibilities: ['Create documentation', 'Maintain knowledge base', 'Provide training'],\n        requiredSkills: ['Technical Writing', 'Documentation', 'Knowledge Management'],\n        authority: 'low'\n      },\n      integration: {\n        type: 'integration',\n        description: 'System integration and API management',\n        capabilities: ['API Development', 'System Integration', 'Data Migration'],\n        responsibilities: ['Integrate systems', 'Develop APIs', 'Manage data migration'],\n        requiredSkills: ['API Development', 'Integration', 'Data Migration'],\n        authority: 'medium'\n      },\n      'code-review': {\n        type: 'code-review',\n        description: 'Code review and quality assurance',\n        capabilities: ['Code Review', 'Quality Assessment', 'Best Practices'],\n        responsibilities: ['Review code', 'Ensure code quality', 'Enforce standards'],\n        requiredSkills: ['Code Review', 'Software Quality', 'Best Practices'],\n        authority: 'medium'\n      },\n      orchestrator: {\n        type: 'orchestrator',\n        description: 'Multi-agent coordination and task management',\n        capabilities: ['Task Coordination', 'Agent Management', 'Workflow Orchestration'],\n        responsibilities: ['Coordinate agents', 'Manage workflows', 'Optimize resource allocation'],\n        requiredSkills: ['Project Management', 'Coordination', 'Resource Management'],\n        authority: 'critical'\n      }\n    }\n\n    return roleDefinitions[roleType]\n  }\n\n  private generateMockAgent(id: string, roleType: AgentRoleType): Agent {\n    const role = this.getAgentRoleDefinition(roleType)\n    const statuses: AgentStatus[] = ['active', 'idle', 'working', 'offline']\n    const status = statuses[Math.floor(Math.random() * statuses.length)]\n    \n    // Generate realistic performance metrics\n    const basePerformance = 70 + Math.random() * 25 // 70-95% base performance\n    const performance: PerformanceMetrics = {\n      completionRate: Math.round(basePerformance),\n      averageTaskTime: Math.round(2 + Math.random() * 6), // 2-8 hours average\n      qualityScore: Math.round(7 + Math.random() * 3), // 7-10 quality score\n      collaborationScore: Math.round(6 + Math.random() * 4), // 6-10 collaboration\n      responsiveness: Math.round(7 + Math.random() * 3), // 7-10 responsiveness\n      ticketsCompleted: Math.floor(Math.random() * 50) + 10, // 10-60 tickets\n      ticketsInProgress: Math.floor(Math.random() * 5) + 1, // 1-5 in progress\n      ticketsPending: Math.floor(Math.random() * 3), // 0-3 pending\n      uptime: Math.round(85 + Math.random() * 15), // 85-100% uptime\n      efficiency: Math.round(basePerformance - 5 + Math.random() * 10) // slight variance\n    }\n\n    // Generate assignments\n    const assignments: Assignment[] = []\n    const assignmentCount = Math.floor(Math.random() * 3) + 1\n    for (let i = 0; i < assignmentCount; i++) {\n      assignments.push({\n        id: `assign-${id}-${i}`,\n        ticketId: `TICKET-${Math.floor(Math.random() * 1000)}`,\n        ticketTitle: `Sample ticket ${i + 1} for ${role.type}`,\n        ticketType: ['epic', 'issue', 'task', 'pr'][Math.floor(Math.random() * 4)] as any,\n        priority: ['critical', 'high', 'medium', 'low'][Math.floor(Math.random() * 4)] as any,\n        startDate: new Date(Date.now() - Math.random() * 7 * 24 * 60 * 60 * 1000),\n        estimatedCompletion: new Date(Date.now() + Math.random() * 7 * 24 * 60 * 60 * 1000),\n        progress: Math.round(Math.random() * 100),\n        status: ['pending', 'in_progress', 'blocked', 'completed'][Math.floor(Math.random() * 4)] as any,\n        timeSpent: Math.floor(Math.random() * 480) + 60, // 1-8 hours\n        blockers: Math.random() > 0.8 ? ['Waiting for review', 'Dependency issue'] : undefined\n      })\n    }\n\n    // Generate collaboration patterns\n    const collaborationPatterns: CollaborationPattern[] = []\n    const collaborationCount = Math.floor(Math.random() * 3) + 1\n    const otherRoles = Object.keys(this.getAgentRoleDefinition('engineer')) as AgentRoleType[]\n    \n    for (let i = 0; i < collaborationCount; i++) {\n      const randomRole = otherRoles[Math.floor(Math.random() * otherRoles.length)]\n      collaborationPatterns.push({\n        agentId: `agent-${randomRole}-${i}`,\n        agentName: `${randomRole.charAt(0).toUpperCase() + randomRole.slice(1)} Agent ${i + 1}`,\n        agentRole: randomRole,\n        collaborationType: ['handoff', 'parallel', 'review', 'support'][Math.floor(Math.random() * 4)] as any,\n        frequency: Math.floor(Math.random() * 10) + 1, // 1-10 interactions per week\n        successRate: Math.round(70 + Math.random() * 30), // 70-100% success rate\n        lastCollaboration: new Date(Date.now() - Math.random() * 7 * 24 * 60 * 60 * 1000)\n      })\n    }\n\n    const availability: Availability = {\n      isAvailable: status === 'active' || status === 'idle',\n      capacity: Math.round(Math.random() * 100),\n      nextAvailableSlot: status === 'working' ? new Date(Date.now() + Math.random() * 4 * 60 * 60 * 1000) : undefined,\n      scheduledMaintenance: Math.random() > 0.8 ? new Date(Date.now() + Math.random() * 48 * 60 * 60 * 1000) : undefined,\n      workingHours: {\n        start: '09:00',\n        end: '17:00',\n        timezone: 'UTC'\n      }\n    }\n\n    return {\n      id,\n      name: `${role.type.charAt(0).toUpperCase() + role.type.slice(1)} Agent`,\n      role,\n      specializations: role.capabilities,\n      status,\n      lastActivity: new Date(Date.now() - Math.random() * 60 * 60 * 1000), // Within last hour\n      currentAssignments: assignments,\n      performanceMetrics: performance,\n      collaborationPatterns,\n      availability\n    }\n  }\n\n  async getAgentRegistry(projectPath?: string): Promise<AgentRegistry> {\n    try {\n      // Check if we need to update the registry\n      if (this.agentRegistry && this.lastUpdate && \n          Date.now() - this.lastUpdate.getTime() < this.updateInterval) {\n        return this.agentRegistry\n      }\n\n      // Try to get agent data from backend\n      const response = await aiTrackdownBackendService.executeAiTrackdownCommand('agent list --format json', projectPath)\n      \n      let agents: Agent[] = []\n      \n      if (response.success && response.data) {\n        // Parse real agent data if available\n        agents = response.data.map((agentData: any) => this.parseAgentData(agentData))\n      } else {\n        // Generate mock agents for different roles\n        const agentRoles: AgentRoleType[] = [\n          'orchestrator', 'architect', 'engineer', 'qa', 'security', \n          'devops', 'research', 'data', 'performance', 'documentation',\n          'integration', 'code-review'\n        ]\n        \n        agents = agentRoles.map(role => this.generateMockAgent(`agent-${role}`, role))\n      }\n\n      // Calculate registry metrics\n      const activeAgents = agents.filter(a => a.status === 'active').length\n      const workingAgents = agents.filter(a => a.status === 'working').length\n      const idleAgents = agents.filter(a => a.status === 'idle').length\n      const offlineAgents = agents.filter(a => a.status === 'offline').length\n\n      this.agentRegistry = {\n        agents,\n        totalAgents: agents.length,\n        activeAgents,\n        workingAgents,\n        idleAgents,\n        offlineAgents,\n        lastUpdated: new Date()\n      }\n\n      this.lastUpdate = new Date()\n      return this.agentRegistry\n    } catch (error) {\n      console.error('Error getting agent registry:', error)\n      \n      // Return empty registry on error\n      return {\n        agents: [],\n        totalAgents: 0,\n        activeAgents: 0,\n        workingAgents: 0,\n        idleAgents: 0,\n        offlineAgents: 0,\n        lastUpdated: new Date()\n      }\n    }\n  }\n\n  private parseAgentData(data: any): Agent {\n    // Parse agent data from backend response\n    // This would be implemented based on the actual response format\n    return this.generateMockAgent(data.id || 'unknown', data.role || 'engineer')\n  }\n\n  async getAgentById(agentId: string, projectPath?: string): Promise<Agent | null> {\n    const registry = await this.getAgentRegistry(projectPath)\n    return registry.agents.find(agent => agent.id === agentId) || null\n  }\n\n  async getAgentsByRole(roleType: AgentRoleType, projectPath?: string): Promise<Agent[]> {\n    const registry = await this.getAgentRegistry(projectPath)\n    return registry.agents.filter(agent => agent.role.type === roleType)\n  }\n\n  async getAgentsByStatus(status: AgentStatus, projectPath?: string): Promise<Agent[]> {\n    const registry = await this.getAgentRegistry(projectPath)\n    return registry.agents.filter(agent => agent.status === status)\n  }\n\n  async getAgentAssignments(agentId: string, projectPath?: string): Promise<Assignment[]> {\n    const agent = await this.getAgentById(agentId, projectPath)\n    return agent?.currentAssignments || []\n  }\n\n  async getAgentActivity(agentId: string, limit = 50, projectPath?: string): Promise<AgentActivity[]> {\n    try {\n      const response = await aiTrackdownBackendService.executeAiTrackdownCommand(\n        `agent activity ${agentId} --limit ${limit} --format json`, \n        projectPath\n      )\n      \n      if (response.success && response.data) {\n        return response.data\n      }\n      \n      // Return mock activity data\n      return this.generateMockActivity(agentId, limit)\n    } catch (error) {\n      console.error('Error getting agent activity:', error)\n      return []\n    }\n  }\n\n  private generateMockActivity(agentId: string, limit: number): AgentActivity[] {\n    const activities: AgentActivity[] = []\n    const activityTypes = ['task_started', 'task_completed', 'task_blocked', 'collaboration_started', 'status_changed']\n    \n    for (let i = 0; i < limit; i++) {\n      const type = activityTypes[Math.floor(Math.random() * activityTypes.length)]\n      activities.push({\n        id: `activity-${agentId}-${i}`,\n        agentId,\n        timestamp: new Date(Date.now() - Math.random() * 7 * 24 * 60 * 60 * 1000),\n        type: type as any,\n        description: `Agent ${type.replace('_', ' ')} - ${i + 1}`,\n        ticketId: Math.random() > 0.5 ? `TICKET-${Math.floor(Math.random() * 1000)}` : undefined,\n        duration: Math.random() > 0.5 ? Math.floor(Math.random() * 120) + 15 : undefined,\n        metadata: {\n          source: 'mock',\n          priority: ['low', 'medium', 'high'][Math.floor(Math.random() * 3)]\n        }\n      })\n    }\n    \n    return activities.sort((a, b) => b.timestamp.getTime() - a.timestamp.getTime())\n  }\n\n  async assignAgentToTicket(request: AgentAssignmentRequest, projectPath?: string): Promise<AgentAssignmentResponse> {\n    try {\n      const response = await aiTrackdownBackendService.executeAiTrackdownCommand(\n        `agent assign ${request.ticketId} --role ${request.requiredRole} --priority ${request.priority}`, \n        projectPath\n      )\n      \n      if (response.success) {\n        return {\n          success: true,\n          assignedAgent: response.data?.agent,\n          estimatedStartTime: new Date(Date.now() + 30 * 60 * 1000), // 30 minutes from now\n          estimatedCompletion: new Date(Date.now() + (request.estimatedDuration || 4) * 60 * 60 * 1000)\n        }\n      }\n      \n      return {\n        success: false,\n        reason: response.error || 'Assignment failed'\n      }\n    } catch (error) {\n      console.error('Error assigning agent:', error)\n      return {\n        success: false,\n        reason: 'Service error'\n      }\n    }\n  }\n\n  async getProjectAgents(projectPath?: string): Promise<Agent[]> {\n    const registry = await this.getAgentRegistry(projectPath)\n    \n    // Filter agents that are relevant to the project\n    // This could be based on project type, recent activity, etc.\n    return registry.agents.filter(agent => \n      agent.status === 'active' || \n      agent.status === 'working' || \n      agent.currentAssignments.length > 0\n    )\n  }\n\n  async getAgentCapacityInfo(agentId: string, projectPath?: string): Promise<AgentCapacityInfo | null> {\n    const agent = await this.getAgentById(agentId, projectPath)\n    if (!agent) return null\n\n    const currentLoad = (agent.currentAssignments.length / 5) * 100 // Assume max 5 concurrent tasks\n    const availableCapacity = Math.max(0, 100 - currentLoad)\n    \n    return {\n      agentId,\n      currentLoad: Math.round(currentLoad),\n      maxCapacity: 5,\n      availableCapacity: Math.round(availableCapacity),\n      queuedTasks: agent.performanceMetrics.ticketsPending,\n      estimatedAvailability: agent.availability.nextAvailableSlot || new Date()\n    }\n  }\n\n  async refreshAgentRegistry(projectPath?: string): Promise<void> {\n    this.agentRegistry = null\n    this.lastUpdate = null\n    await this.getAgentRegistry(projectPath)\n  }\n}\n\nexport const agentService = AgentService.getInstance()","// Claude PM Portfolio Manager - Data Service\n// Reads data from Claude PM framework and managed projects using ai-trackdown-tools CLI\n\nimport { aiTrackdownApiService } from './aiTrackdownApi'\nimport { agentService } from './agentService'\n\nexport interface ProjectData {\n  id: string\n  name: string\n  path: string\n  status: \"active\" | \"inactive\" | \"completed\"\n  healthScore?: number\n  lastActivity?: Date\n  tickets?: TicketData[]\n}\n\nexport interface TicketData {\n  id: string\n  title: string\n  status: \"pending\" | \"in_progress\" | \"completed\" | \"blocked\" | \"todo\" | \"planning\"\n  priority: \"critical\" | \"high\" | \"medium\" | \"low\"\n  milestone: string\n  assignee?: string\n  storyPoints?: number\n  epic?: string\n  type: \"epic\" | \"issue\" | \"task\" | \"pr\"\n  created?: string\n  updated?: string\n  assignedAgents?: string[]\n  agentProgress?: Record<string, number>\n}\n\nexport interface DashboardMetrics {\n  totalProjects: number\n  activeProjects: number\n  openTickets: number\n  healthScore: number\n}\n\nexport interface GitActivity {\n  id: string\n  message: string\n  author: string\n  timestamp: Date\n  project: string\n  sha: string\n}\n\nclass ClaudePmService {\n  private readonly managedProjectsPath = \"/Users/masa/Projects/managed\"\n  \n  private async getTicketAgentAssignments(ticketId: string, projectPath?: string): Promise<{\n    agentIds: string[]\n    progress: Record<string, number>\n  }> {\n    try {\n      // Get agent registry to find assignments\n      const agentRegistry = await agentService.getAgentRegistry(projectPath)\n      \n      const assignedAgents: string[] = []\n      const agentProgress: Record<string, number> = {}\n      \n      // Find agents assigned to this ticket\n      for (const agent of agentRegistry.agents) {\n        const assignment = agent.currentAssignments.find(a => a.ticketId === ticketId)\n        if (assignment) {\n          assignedAgents.push(agent.id)\n          agentProgress[agent.id] = assignment.progress\n        }\n      }\n      \n      return {\n        agentIds: assignedAgents,\n        progress: agentProgress\n      }\n    } catch (error) {\n      console.error(`Error getting agent assignments for ticket ${ticketId}:`, error)\n      return {\n        agentIds: [],\n        progress: {}\n      }\n    }\n  }\n  \n  private async fetchTicketsFromAPI(projectPath: string): Promise<TicketData[]> {\n    try {\n      // Get data from ai-trackdown-tools API service\n      const [epics, issues, tasks] = await Promise.all([\n        aiTrackdownApiService.getEpics(projectPath),\n        aiTrackdownApiService.getIssues(projectPath),\n        aiTrackdownApiService.getTasks(projectPath)\n      ])\n      \n      const tickets: TicketData[] = []\n      \n      // Process epics\n      for (const epic of epics) {\n        const agentAssignments = await this.getTicketAgentAssignments(epic.id, projectPath)\n        tickets.push({\n          id: epic.id,\n          title: epic.title,\n          status: this.normalizeStatus(epic.status),\n          priority: this.normalizePriority(epic.priority),\n          milestone: epic.milestone || 'Unassigned',\n          assignee: epic.assignee,\n          type: 'epic',\n          created: epic.created,\n          updated: epic.updated,\n          assignedAgents: agentAssignments.agentIds,\n          agentProgress: agentAssignments.progress\n        })\n      }\n      \n      // Process issues\n      for (const issue of issues) {\n        const agentAssignments = await this.getTicketAgentAssignments(issue.id, projectPath)\n        tickets.push({\n          id: issue.id,\n          title: issue.title,\n          status: this.normalizeStatus(issue.status),\n          priority: this.normalizePriority(issue.priority),\n          milestone: issue.milestone || 'Unassigned',\n          assignee: issue.assignee,\n          epic: issue.epic,\n          type: 'issue',\n          created: issue.created,\n          updated: issue.updated,\n          assignedAgents: agentAssignments.agentIds,\n          agentProgress: agentAssignments.progress\n        })\n      }\n      \n      // Process tasks\n      for (const task of tasks) {\n        const agentAssignments = await this.getTicketAgentAssignments(task.id, projectPath)\n        tickets.push({\n          id: task.id,\n          title: task.title,\n          status: this.normalizeStatus(task.status),\n          priority: this.normalizePriority(task.priority),\n          milestone: task.milestone || 'Unassigned',\n          assignee: task.assignee,\n          type: 'task',\n          created: task.created,\n          updated: task.updated,\n          assignedAgents: agentAssignments.agentIds,\n          agentProgress: agentAssignments.progress\n        })\n      }\n      \n      return tickets\n    } catch (error) {\n      console.error(`Error fetching tickets for project: ${projectPath}`, error)\n      // Return simulated data based on known structure\n      return await this.getSimulatedTickets(projectPath)\n    }\n  }\n  \n  private async getProjectTickets(projectPath: string): Promise<TicketData[]> {\n    try {\n      // Try to get tickets via API first\n      return await this.fetchTicketsFromAPI(projectPath)\n    } catch (error) {\n      console.error(`Error getting tickets for project: ${projectPath}`, error)\n      return []\n    }\n  }\n  \n  private async getSimulatedTickets(projectPath: string): Promise<TicketData[]> {\n    // For the current portfolio manager project, return actual structure\n    if (projectPath.includes('claude-pm-portfolio-manager')) {\n      return [\n        {\n          id: \"EP-0003\",\n          title: \"Agent Role Improvements\",\n          status: \"planning\",\n          priority: \"medium\",\n          milestone: \"Unassigned\",\n          assignee: \"unassigned\",\n          type: \"epic\",\n          created: \"2025-07-08\",\n          updated: \"2025-07-08\"\n        },\n        {\n          id: \"EP-0004\",\n          title: \"Agent Role Enhancements\",\n          status: \"completed\",\n          priority: \"medium\",\n          milestone: \"Unassigned\",\n          assignee: \"unassigned\",\n          type: \"epic\",\n          created: \"2025-07-08\",\n          updated: \"2025-07-08\"\n        },\n        {\n          id: \"EP-0005\",\n          title: \"CMPM User Guide Development\",\n          status: \"planning\",\n          priority: \"medium\",\n          milestone: \"Unassigned\",\n          assignee: \"unassigned\",\n          type: \"epic\",\n          created: \"2025-07-08\",\n          updated: \"2025-07-08\"\n        },\n        {\n          id: \"ISS-0019\",\n          title: \"Enhance Architect Agent Role Definition\",\n          status: \"completed\",\n          priority: \"high\",\n          milestone: \"Unassigned\",\n          assignee: \"unassigned\",\n          epic: \"EP-0004\",\n          type: \"issue\",\n          created: \"2025-07-08\",\n          updated: \"2025-07-08\"\n        },\n        {\n          id: \"ISS-0020\",\n          title: \"Enhance Engineer Agent Role Definition\",\n          status: \"completed\",\n          priority: \"high\",\n          milestone: \"Unassigned\",\n          assignee: \"unassigned\",\n          epic: \"EP-0004\",\n          type: \"issue\",\n          created: \"2025-07-08\",\n          updated: \"2025-07-08\"\n        },\n        {\n          id: \"ISS-0028\",\n          title: \"User Guide: Getting Started & Installation\",\n          status: \"planning\",\n          priority: \"high\",\n          milestone: \"Unassigned\",\n          assignee: \"unassigned\",\n          epic: \"EP-0005\",\n          type: \"issue\",\n          created: \"2025-07-08\",\n          updated: \"2025-07-08\"\n        },\n        {\n          id: \"ISS-0029\",\n          title: \"User Guide: Architecture & Core Concepts\",\n          status: \"planning\",\n          priority: \"high\",\n          milestone: \"Unassigned\",\n          assignee: \"unassigned\",\n          epic: \"EP-0005\",\n          type: \"issue\",\n          created: \"2025-07-08\",\n          updated: \"2025-07-08\"\n        }\n      ]\n    }\n    \n    // For other projects, return empty array or simulated data\n    return []\n  }\n  \n  private normalizeStatus(status: string): \"pending\" | \"in_progress\" | \"completed\" | \"blocked\" | \"todo\" | \"planning\" {\n    const normalizedStatus = status?.toLowerCase() || 'pending'\n    \n    switch (normalizedStatus) {\n      case 'todo':\n      case 'pending':\n        return 'pending'\n      case 'in_progress':\n      case 'active':\n        return 'in_progress'\n      case 'completed':\n      case 'done':\n        return 'completed'\n      case 'blocked':\n        return 'blocked'\n      case 'planning':\n        return 'planning'\n      default:\n        return 'pending'\n    }\n  }\n  \n  private normalizePriority(priority: string): \"critical\" | \"high\" | \"medium\" | \"low\" {\n    const normalizedPriority = priority?.toLowerCase() || 'medium'\n    \n    switch (normalizedPriority) {\n      case 'critical':\n      case 'urgent':\n        return 'critical'\n      case 'high':\n        return 'high'\n      case 'medium':\n      case 'normal':\n        return 'medium'\n      case 'low':\n        return 'low'\n      default:\n        return 'medium'\n    }\n  }\n\n  async getDashboardMetrics(): Promise<DashboardMetrics> {\n    try {\n      const projects = await this.getProjects()\n      const tickets = await this.getTickets()\n      \n      const activeProjects = projects.filter(p => p.status === \"active\").length\n      const openTickets = tickets.filter(t => t.status !== \"completed\").length\n      const avgHealthScore = projects.reduce((sum, p) => sum + (p.healthScore || 0), 0) / projects.length\n\n      return {\n        totalProjects: projects.length,\n        activeProjects,\n        openTickets,\n        healthScore: Math.round(avgHealthScore),\n      }\n    } catch (error) {\n      console.error('Error getting dashboard metrics:', error)\n      return {\n        totalProjects: 0,\n        activeProjects: 0,\n        openTickets: 0,\n        healthScore: 0,\n      }\n    }\n  }\n\n  async getProjects(): Promise<ProjectData[]> {\n    try {\n      // Get list of directories in managed projects\n      const projectDirs = [\n        \"ai-code-review\",\n        \"ai-power-rankings\", \n        \"ai-power-rankings-data\",\n        \"claude-pm-portfolio-manager\",\n        \"eva-monorepo\",\n        \"git-portfolio-manager\",\n        \"hot-flash\",\n        \"matsuoka-com\",\n        \"mem0ai\",\n        \"py-mcp-ipc\",\n        \"scraper-engine\"\n      ]\n\n      const projects: ProjectData[] = []\n      \n      for (const dir of projectDirs) {\n        const projectPath = `${this.managedProjectsPath}/${dir}`\n        \n        // Get last git activity\n        const lastActivity = await this.getLastGitActivity(projectPath)\n        \n        // Calculate health score\n        const healthScore = await this.getProjectHealth(dir)\n        \n        // Determine status based on recent activity\n        const daysSinceActivity = lastActivity ? \n          Math.floor((Date.now() - lastActivity.getTime()) / (1000 * 60 * 60 * 24)) : 999\n        \n        const status: \"active\" | \"inactive\" | \"completed\" = \n          daysSinceActivity <= 7 ? \"active\" : \n          daysSinceActivity <= 30 ? \"inactive\" : \"completed\"\n\n        // Get tickets for this project\n        const projectTickets = await this.getProjectTickets(projectPath)\n        \n        projects.push({\n          id: dir,\n          name: this.formatProjectName(dir),\n          path: projectPath,\n          status,\n          healthScore,\n          lastActivity,\n          tickets: projectTickets,\n        })\n      }\n\n      return projects.sort((a, b) => {\n        // Sort by status (active first), then by last activity\n        if (a.status !== b.status) {\n          const statusOrder = { active: 0, inactive: 1, completed: 2 }\n          return statusOrder[a.status] - statusOrder[b.status]\n        }\n        return (b.lastActivity?.getTime() || 0) - (a.lastActivity?.getTime() || 0)\n      })\n    } catch (error) {\n      console.error(\"Error reading projects:\", error)\n      // Fallback to basic project list\n      return this.getFallbackProjects()\n    }\n  }\n\n  private async getLastGitActivity(projectPath: string): Promise<Date | undefined> {\n    try {\n      // This would need a backend API to actually read git data\n      // For now, simulate based on project names\n      const recentProjects = [\"claude-pm-portfolio-manager\", \"eva-monorepo\", \"py-mcp-ipc\"]\n      const isRecent = recentProjects.some(name => projectPath.includes(name))\n      \n      if (isRecent) {\n        return new Date(Date.now() - Math.random() * 7 * 24 * 60 * 60 * 1000) // Within last week\n      } else {\n        return new Date(Date.now() - (Math.random() * 30 + 7) * 24 * 60 * 60 * 1000) // 1-5 weeks ago\n      }\n    } catch {\n      return undefined\n    }\n  }\n\n  private formatProjectName(dirName: string): string {\n    return dirName\n      .split('-')\n      .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n      .join(' ')\n  }\n\n  private getFallbackProjects(): ProjectData[] {\n    return [\n      {\n        id: \"claude-pm-portfolio-manager\",\n        name: \"Claude PM Portfolio Manager\",\n        path: \"/Users/masa/Projects/managed/claude-pm-portfolio-manager\",\n        status: \"active\",\n        healthScore: 90,\n        lastActivity: new Date(),\n        tickets: [],\n      },\n      {\n        id: \"mem0ai\",\n        name: \"Mem0 AI OSS\",\n        path: \"/Users/masa/Projects/managed/mem0ai\",\n        status: \"active\",\n        healthScore: 80,\n        lastActivity: new Date(\"2025-07-04\"),\n        tickets: [],\n      },\n    ]\n  }\n\n  async getTickets(): Promise<TicketData[]> {\n    try {\n      // Get tickets from current project\n      const currentProjectTickets = await this.getProjectTickets('/Users/masa/Projects/managed/claude-pm-portfolio-manager')\n      \n      // Get tickets from managed projects\n      const managedProjectTickets: TicketData[] = []\n      const projects = await this.getProjects()\n      \n      for (const project of projects) {\n        try {\n          const projectTickets = await this.getProjectTickets(project.path)\n          managedProjectTickets.push(...projectTickets)\n        } catch (error) {\n          console.error(`Error getting tickets for project ${project.name}:`, error)\n        }\n      }\n      \n      // Combine all tickets and sort by priority and status\n      const allTickets = [...currentProjectTickets, ...managedProjectTickets]\n      \n      return allTickets.sort((a, b) => {\n        // Sort by priority first\n        const priorityOrder = { critical: 0, high: 1, medium: 2, low: 3 }\n        const priorityDiff = priorityOrder[a.priority] - priorityOrder[b.priority]\n        \n        if (priorityDiff !== 0) return priorityDiff\n        \n        // Then by status\n        const statusOrder: Record<string, number> = { \n          in_progress: 0, \n          pending: 1, \n          todo: 1, \n          planning: 2, \n          blocked: 3, \n          completed: 4 \n        }\n        return (statusOrder[a.status] || 5) - (statusOrder[b.status] || 5)\n      })\n    } catch (error) {\n      console.error('Error getting tickets:', error)\n      // Return fallback data if ai-trackdown-tools is not available\n      return this.getFallbackTickets()\n    }\n  }\n  \n  private getFallbackTickets(): TicketData[] {\n    return [\n      {\n        id: \"FALLBACK-001\",\n        title: \"AI Trackdown Tools Integration\",\n        status: \"in_progress\",\n        priority: \"high\",\n        milestone: \"Foundation\",\n        assignee: \"@claude\",\n        type: \"issue\",\n        created: new Date().toISOString(),\n        updated: new Date().toISOString()\n      },\n      {\n        id: \"FALLBACK-002\",\n        title: \"Portfolio Manager Dashboard Enhancement\",\n        status: \"pending\",\n        priority: \"medium\",\n        milestone: \"Foundation\",\n        assignee: \"@claude\",\n        type: \"issue\",\n        created: new Date().toISOString(),\n        updated: new Date().toISOString()\n      }\n    ]\n  }\n\n  async getProjectHealth(_projectId: string): Promise<number> {\n    // Mock health calculation\n    const healthFactors = {\n      hasClaudeMd: 20,\n      recentActivity: 25,\n      testsPresent: 20,\n      dependenciesUpToDate: 15,\n      codeQuality: 20,\n    }\n\n    // For demo purposes, return a calculated score\n    return Object.values(healthFactors).reduce((sum, value) => sum + value, 0)\n  }\n\n  async getRecentActivity(limit = 20): Promise<GitActivity[]> {\n    // Mock recent git activity from various projects\n    const activities: GitActivity[] = [\n      {\n        id: \"act_001\",\n        message: \"feat: update dashboard with real project data\",\n        author: \"Claude Code\",\n        timestamp: new Date(Date.now() - 1800000), // 30 min ago\n        project: \"claude-pm-portfolio-manager\",\n        sha: \"abc123f\"\n      },\n      {\n        id: \"act_002\", \n        message: \"fix: resolve deployment configuration issues\",\n        author: \"masa\",\n        timestamp: new Date(Date.now() - 3600000), // 1 hour ago\n        project: \"eva-monorepo\",\n        sha: \"def456a\"\n      },\n      {\n        id: \"act_003\",\n        message: \"docs: update API documentation\",\n        author: \"Claude Code\", \n        timestamp: new Date(Date.now() - 7200000), // 2 hours ago\n        project: \"py-mcp-ipc\",\n        sha: \"ghi789b\"\n      },\n      {\n        id: \"act_004\",\n        message: \"feat: add new ranking algorithm\",\n        author: \"masa\",\n        timestamp: new Date(Date.now() - 10800000), // 3 hours ago\n        project: \"ai-power-rankings\",\n        sha: \"jkl012c\"\n      },\n      {\n        id: \"act_005\",\n        message: \"refactor: optimize database queries\",\n        author: \"Claude Code\",\n        timestamp: new Date(Date.now() - 14400000), // 4 hours ago\n        project: \"scraper-engine\", \n        sha: \"mno345d\"\n      },\n      {\n        id: \"act_006\",\n        message: \"test: add comprehensive test coverage\",\n        author: \"masa\",\n        timestamp: new Date(Date.now() - 18000000), // 5 hours ago\n        project: \"ai-code-review\",\n        sha: \"pqr678e\"\n      },\n      {\n        id: \"act_007\",\n        message: \"fix: resolve memory leak in data processing\",\n        author: \"Claude Code\",\n        timestamp: new Date(Date.now() - 21600000), // 6 hours ago\n        project: \"mem0ai\",\n        sha: \"stu901f\"\n      },\n      {\n        id: \"act_008\",\n        message: \"feat: implement new UI components\",\n        author: \"masa\", \n        timestamp: new Date(Date.now() - 86400000), // 1 day ago\n        project: \"matsuoka-com\",\n        sha: \"vwx234g\"\n      }\n    ]\n\n    return activities.slice(0, limit)\n  }\n\n  async getProjectAgentSummary(projectPath: string): Promise<{\n    totalAgents: number\n    activeAgents: number\n    workingAgents: number\n    assignedTickets: number\n    averageLoad: number\n  }> {\n    try {\n      const agentRegistry = await agentService.getAgentRegistry(projectPath)\n      const projectAgents = agentRegistry.agents.filter(agent => \n        agent.status === 'active' || \n        agent.status === 'working' || \n        agent.currentAssignments.length > 0\n      )\n      \n      const activeAgents = projectAgents.filter(a => a.status === 'active').length\n      const workingAgents = projectAgents.filter(a => a.status === 'working').length\n      const assignedTickets = projectAgents.reduce((total, agent) => \n        total + agent.currentAssignments.length, 0\n      )\n      const averageLoad = projectAgents.length > 0 ? \n        projectAgents.reduce((total, agent) => total + agent.availability.capacity, 0) / projectAgents.length : 0\n      \n      return {\n        totalAgents: projectAgents.length,\n        activeAgents,\n        workingAgents,\n        assignedTickets,\n        averageLoad: Math.round(averageLoad)\n      }\n    } catch (error) {\n      console.error('Error getting project agent summary:', error)\n      return {\n        totalAgents: 0,\n        activeAgents: 0,\n        workingAgents: 0,\n        assignedTickets: 0,\n        averageLoad: 0\n      }\n    }\n  }\n}\n\nexport const claudePmService = new ClaudePmService()\n","// React hooks for Claude PM data fetching\nimport { useQuery } from \"@tanstack/react-query\"\nimport { claudePmService } from \"../services/claudePmService\"\n\nexport const useClaudePmMetrics = () => {\n  return useQuery({\n    queryKey: [\"claude-pm\", \"metrics\"],\n    queryFn: () => claudePmService.getDashboardMetrics(),\n    staleTime: 30 * 1000, // 30 seconds\n    refetchInterval: 60 * 1000, // Refetch every minute\n  })\n}\n\nexport const useClaudePmProjects = () => {\n  return useQuery({\n    queryKey: [\"claude-pm\", \"projects\"],\n    queryFn: () => claudePmService.getProjects(),\n    staleTime: 60 * 1000, // 1 minute\n  })\n}\n\nexport const useClaudePmTickets = () => {\n  return useQuery({\n    queryKey: [\"claude-pm\", \"tickets\"],\n    queryFn: () => claudePmService.getTickets(),\n    staleTime: 30 * 1000, // 30 seconds\n  })\n}\n\nexport const useProjectHealth = (projectId: string) => {\n  return useQuery({\n    queryKey: [\"claude-pm\", \"project-health\", projectId],\n    queryFn: () => claudePmService.getProjectHealth(projectId),\n    staleTime: 5 * 60 * 1000, // 5 minutes\n    enabled: !!projectId,\n  })\n}\n","import type { ApiKey, BillingData, SpendingReport, UsageMetrics } from \"../types/keyManagement\"\n\nclass KeyManagementService {\n  private getEnvVar(key: string): string {\n    const value = import.meta.env[key]\n    if (!value) {\n      console.warn(`Environment variable ${key} is not set`)\n      return \"\"\n    }\n    return value\n  }\n\n  async fetchOpenAIData(): Promise<{ billing: BillingData; usage: UsageMetrics[] }> {\n    const apiKey = this.getEnvVar(\"VITE_OPENAI_ADMIN_KEY\")\n    if (!apiKey) throw new Error(\"OpenAI admin key not configured\")\n\n    try {\n      // Test admin API access with organizations endpoint\n      const orgResponse = await fetch(\"https://api.openai.com/v1/organizations\", {\n        headers: {\n          Authorization: `Bearer ${apiKey}`,\n          \"Content-Type\": \"application/json\",\n        },\n      })\n\n      const isConnected = orgResponse.ok\n      \n      if (isConnected) {\n        await orgResponse.json()\n      }\n      \n      return {\n        billing: {\n          provider: \"openai\",\n          currentPeriod: {\n            start: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString(),\n            end: new Date().toISOString(),\n            usage: isConnected ? 1850 : 0, // Mock usage when admin connected\n            cost: isConnected ? 18.50 : 0, // Mock cost when admin connected\n            limit: 100,\n          },\n          currency: \"USD\",\n        },\n        usage: [],\n      }\n    } catch (error) {\n      console.error(\"Error fetching OpenAI data:\", error)\n      // Return zero data instead of throwing\n      return {\n        billing: {\n          provider: \"openai\",\n          currentPeriod: {\n            start: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString(),\n            end: new Date().toISOString(),\n            usage: 0,\n            cost: 0,\n          },\n          currency: \"USD\",\n        },\n        usage: [],\n      }\n    }\n  }\n\n  async fetchAnthropicData(): Promise<{ billing: BillingData; usage: UsageMetrics[] }> {\n    const apiKey = this.getEnvVar(\"VITE_ANTHROPIC_ADMIN_KEY\")\n    if (!apiKey) throw new Error(\"Anthropic admin key not configured\")\n\n    try {\n      // Test admin API access with organization users endpoint\n      const usersResponse = await fetch(\"https://api.anthropic.com/v1/organizations/users\", {\n        headers: {\n          \"x-api-key\": apiKey,\n          \"Content-Type\": \"application/json\",\n          \"anthropic-version\": \"2023-06-01\",\n        },\n      })\n\n      const isConnected = usersResponse.ok\n      \n      if (isConnected) {\n        await usersResponse.json()\n      }\n\n      return {\n        billing: {\n          provider: \"anthropic\",\n          currentPeriod: {\n            start: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString(),\n            end: new Date().toISOString(),\n            usage: isConnected ? 450 : 0, // Mock usage when connected\n            cost: isConnected ? 22.50 : 0, // Mock cost when connected\n          },\n          currency: \"USD\",\n        },\n        usage: [],\n      }\n    } catch (error) {\n      console.error(\"Error fetching Anthropic admin data:\", error)\n      return {\n        billing: {\n          provider: \"anthropic\",\n          currentPeriod: {\n            start: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString(),\n            end: new Date().toISOString(),\n            usage: 0,\n            cost: 0,\n          },\n          currency: \"USD\",\n        },\n        usage: [],\n      }\n    }\n  }\n\n  async fetchOpenRouterData(): Promise<{ billing: BillingData; usage: UsageMetrics[] }> {\n    const apiKey = this.getEnvVar(\"VITE_OPENROUTER_API_KEY\")\n    if (!apiKey) throw new Error(\"OpenRouter API key not configured\")\n\n    try {\n      const response = await fetch(\"https://openrouter.ai/api/v1/auth/key\", {\n        headers: {\n          Authorization: `Bearer ${apiKey}`,\n          \"Content-Type\": \"application/json\",\n        },\n      })\n\n      if (!response.ok) {\n        throw new Error(`OpenRouter API error: ${response.status}`)\n      }\n\n      const data = await response.json()\n\n      return {\n        billing: {\n          provider: \"openrouter\",\n          currentPeriod: {\n            start: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString(),\n            end: new Date().toISOString(),\n            usage: data.data?.usage || 0,\n            cost: data.data?.usage || 0,\n            limit: data.data?.limit,\n          },\n          currency: \"USD\",\n        },\n        usage: [],\n      }\n    } catch (error) {\n      console.error(\"Error fetching OpenRouter data:\", error)\n      throw error\n    }\n  }\n\n  async fetchVercelData(): Promise<{ billing: BillingData; usage: UsageMetrics[] }> {\n    const apiKey = this.getEnvVar(\"VITE_VERCEL_API_KEY\")\n    if (!apiKey) throw new Error(\"Vercel API key not configured\")\n\n    try {\n      // Test API connectivity with user endpoint\n      const userResponse = await fetch(\"https://api.vercel.com/v2/user\", {\n        headers: {\n          Authorization: `Bearer ${apiKey}`,\n          \"Content-Type\": \"application/json\",\n        },\n      })\n\n      const isConnected = userResponse.ok\n      \n      if (isConnected) {\n        await userResponse.json()\n      }\n\n      return {\n        billing: {\n          provider: \"vercel\",\n          currentPeriod: {\n            start: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString(),\n            end: new Date().toISOString(),\n            usage: isConnected ? 85 : 0, // Mock usage based on connection\n            cost: isConnected ? 8.50 : 0,\n          },\n          currency: \"USD\",\n        },\n        usage: [],\n      }\n    } catch (error) {\n      console.error(\"Error fetching Vercel data:\", error)\n      return {\n        billing: {\n          provider: \"vercel\",\n          currentPeriod: {\n            start: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString(),\n            end: new Date().toISOString(),\n            usage: 0,\n            cost: 0,\n          },\n          currency: \"USD\",\n        },\n        usage: [],\n      }\n    }\n  }\n\n  async getAllBillingData(): Promise<BillingData[]> {\n    const results = await Promise.allSettled([\n      this.fetchOpenAIData(),\n      this.fetchAnthropicData(),\n      this.fetchOpenRouterData(),\n      this.fetchVercelData(),\n    ])\n\n    return results\n      .filter(\n        (\n          result\n        ): result is PromiseFulfilledResult<{ billing: BillingData; usage: UsageMetrics[] }> =>\n          result.status === \"fulfilled\"\n      )\n      .map(result => result.value.billing)\n  }\n\n  async getActiveKeys(): Promise<ApiKey[]> {\n    const keys: ApiKey[] = []\n\n    if (this.getEnvVar(\"VITE_OPENAI_ADMIN_KEY\")) {\n      keys.push({\n        id: \"openai-1\",\n        name: \"OpenAI Admin Key\",\n        provider: \"openai\",\n        keyType: \"admin\",\n        status: \"active\",\n        createdAt: new Date().toISOString(),\n        permissions: [\"read\", \"write\", \"admin\"],\n      })\n    }\n\n    if (this.getEnvVar(\"VITE_ANTHROPIC_ADMIN_KEY\")) {\n      keys.push({\n        id: \"anthropic-1\",\n        name: \"Anthropic Admin Key\",\n        provider: \"anthropic\",\n        keyType: \"admin\",\n        status: \"active\",\n        createdAt: new Date().toISOString(),\n        permissions: [\"read\", \"write\", \"admin\"],\n      })\n    }\n\n    if (this.getEnvVar(\"VITE_OPENROUTER_API_KEY\")) {\n      keys.push({\n        id: \"openrouter-1\",\n        name: \"OpenRouter API Key\",\n        provider: \"openrouter\",\n        keyType: \"user\",\n        status: \"active\",\n        createdAt: new Date().toISOString(),\n        permissions: [\"read\", \"write\"],\n      })\n    }\n\n    if (this.getEnvVar(\"VITE_VERCEL_API_KEY\")) {\n      keys.push({\n        id: \"vercel-1\",\n        name: \"Vercel API Key\",\n        provider: \"vercel\",\n        keyType: \"user\",\n        status: \"active\",\n        createdAt: new Date().toISOString(),\n        permissions: [\"read\", \"write\", \"deploy\"],\n      })\n    }\n\n    return keys\n  }\n\n  async generateSpendingReport(days = 30): Promise<SpendingReport> {\n    const billingData = await this.getAllBillingData()\n    const totalSpend = billingData.reduce((sum, billing) => sum + billing.currentPeriod.cost, 0)\n\n    const breakdown = billingData.map(billing => ({\n      provider: billing.provider,\n      amount: billing.currentPeriod.cost,\n      percentage: totalSpend > 0 ? (billing.currentPeriod.cost / totalSpend) * 100 : 0,\n    }))\n\n    // Generate mock trend data\n    const trends = Array.from({ length: days }, (_, i) => ({\n      date: new Date(Date.now() - (days - i) * 24 * 60 * 60 * 1000).toISOString().split(\"T\")[0],\n      amount: Math.random() * (totalSpend / days) * 2,\n    }))\n\n    return {\n      totalSpend,\n      periodStart: new Date(Date.now() - days * 24 * 60 * 60 * 1000).toISOString(),\n      periodEnd: new Date().toISOString(),\n      breakdown,\n      trends,\n    }\n  }\n}\n\nexport const keyManagementService = new KeyManagementService()\n","import { useQuery } from \"@tanstack/react-query\"\nimport { DollarSign, Key } from \"lucide-react\"\nimport type React from \"react\"\nimport { Link } from \"react-router-dom\"\nimport { useClaudePmMetrics, useClaudePmTickets } from \"../hooks/useClaudePm\"\nimport { keyManagementService } from \"../services/keyManagementService\"\n\nconst Dashboard: React.FC = () => {\n  const { data: metrics, isLoading: metricsLoading, error: metricsError } = useClaudePmMetrics()\n  const { data: tickets, isLoading: ticketsLoading } = useClaudePmTickets()\n  \n  const { data: activeKeys } = useQuery({\n    queryKey: [\"activeKeys\"],\n    queryFn: () => keyManagementService.getActiveKeys(),\n  })\n\n  const { data: spendingReport } = useQuery({\n    queryKey: [\"spendingReport\"],\n    queryFn: () => keyManagementService.generateSpendingReport(30),\n  })\n\n  if (metricsLoading) {\n    return (\n      <div className=\"flex items-center justify-center h-64\">\n        <div className=\"text-gray-500\">Loading dashboard...</div>\n      </div>\n    )\n  }\n\n  if (metricsError) {\n    return (\n      <div className=\"flex items-center justify-center h-64\">\n        <div className=\"text-red-500\">Error loading dashboard data</div>\n      </div>\n    )\n  }\n  return (\n    <div>\n      <div className=\"mb-8\">\n        <h1 className=\"text-3xl font-bold text-gray-900\">Claude PM Dashboard</h1>\n        <p className=\"mt-2 text-gray-600\">\n          Monitor and manage your Claude PM projects, tickets, and health metrics.\n        </p>\n      </div>\n\n      <div className=\"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-4\">\n        <div className=\"bg-white overflow-hidden shadow rounded-lg\">\n          <div className=\"p-5\">\n            <div className=\"flex items-center\">\n              <div className=\"flex-shrink-0\">\n                <div className=\"w-8 h-8 bg-claude-blue rounded-md flex items-center justify-center\">\n                  <span className=\"text-white font-bold text-sm\">P</span>\n                </div>\n              </div>\n              <div className=\"ml-5 w-0 flex-1\">\n                <dl>\n                  <dt className=\"text-sm font-medium text-gray-500 truncate\">Total Projects</dt>\n                  <dd className=\"text-lg font-medium text-gray-900\">\n                    {metrics?.totalProjects || 0}\n                  </dd>\n                </dl>\n              </div>\n            </div>\n          </div>\n        </div>\n\n        <div className=\"bg-white overflow-hidden shadow rounded-lg\">\n          <div className=\"p-5\">\n            <div className=\"flex items-center\">\n              <div className=\"flex-shrink-0\">\n                <div className=\"w-8 h-8 bg-claude-green rounded-md flex items-center justify-center\">\n                  <span className=\"text-white font-bold text-sm\">A</span>\n                </div>\n              </div>\n              <div className=\"ml-5 w-0 flex-1\">\n                <dl>\n                  <dt className=\"text-sm font-medium text-gray-500 truncate\">Active Projects</dt>\n                  <dd className=\"text-lg font-medium text-gray-900\">\n                    {metrics?.activeProjects || 0}\n                  </dd>\n                </dl>\n              </div>\n            </div>\n          </div>\n        </div>\n\n        <div className=\"bg-white overflow-hidden shadow rounded-lg\">\n          <div className=\"p-5\">\n            <div className=\"flex items-center\">\n              <div className=\"flex-shrink-0\">\n                <div className=\"w-8 h-8 bg-claude-orange rounded-md flex items-center justify-center\">\n                  <span className=\"text-white font-bold text-sm\">T</span>\n                </div>\n              </div>\n              <div className=\"ml-5 w-0 flex-1\">\n                <dl>\n                  <dt className=\"text-sm font-medium text-gray-500 truncate\">Open Tickets</dt>\n                  <dd className=\"text-lg font-medium text-gray-900\">{metrics?.openTickets || 0}</dd>\n                </dl>\n              </div>\n            </div>\n          </div>\n        </div>\n\n        <div className=\"bg-white overflow-hidden shadow rounded-lg\">\n          <div className=\"p-5\">\n            <div className=\"flex items-center\">\n              <div className=\"flex-shrink-0\">\n                <div className=\"w-8 h-8 bg-claude-purple rounded-md flex items-center justify-center\">\n                  <span className=\"text-white font-bold text-sm\">H</span>\n                </div>\n              </div>\n              <div className=\"ml-5 w-0 flex-1\">\n                <dl>\n                  <dt className=\"text-sm font-medium text-gray-500 truncate\">Health Score</dt>\n                  <dd className=\"text-lg font-medium text-gray-900\">\n                    {metrics?.healthScore || \"-\"}%\n                  </dd>\n                </dl>\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      {/* API Key Management Summary */}\n      <div className=\"mt-8\">\n        <div className=\"bg-white shadow rounded-lg\">\n          <div className=\"px-4 py-5 sm:p-6\">\n            <div className=\"flex items-center justify-between mb-4\">\n              <h3 className=\"text-lg leading-6 font-medium text-gray-900\">\n                API Key Management\n              </h3>\n              <Link\n                to=\"/keys\"\n                className=\"text-sm text-claude-blue hover:text-claude-purple font-medium\"\n              >\n                View Details →\n              </Link>\n            </div>\n            \n            <div className=\"grid grid-cols-1 md:grid-cols-3 gap-4\">\n              <div className=\"flex items-center p-4 bg-gray-50 rounded-lg\">\n                <Key className=\"h-8 w-8 text-claude-blue mr-3\" />\n                <div>\n                  <p className=\"text-sm font-medium text-gray-500\">Active Keys</p>\n                  <p className=\"text-xl font-bold text-gray-900\">{activeKeys?.length || 0}</p>\n                </div>\n              </div>\n              \n              <div className=\"flex items-center p-4 bg-gray-50 rounded-lg\">\n                <DollarSign className=\"h-8 w-8 text-claude-green mr-3\" />\n                <div>\n                  <p className=\"text-sm font-medium text-gray-500\">Monthly Spend</p>\n                  <p className=\"text-xl font-bold text-gray-900\">\n                    ${spendingReport?.totalSpend.toFixed(2) || \"0.00\"}\n                  </p>\n                </div>\n              </div>\n              \n              <div className=\"flex items-center p-4 bg-gray-50 rounded-lg\">\n                <div className=\"h-8 w-8 bg-claude-purple rounded-md flex items-center justify-center mr-3\">\n                  <span className=\"text-white font-bold text-sm\">P</span>\n                </div>\n                <div>\n                  <p className=\"text-sm font-medium text-gray-500\">Providers</p>\n                  <p className=\"text-xl font-bold text-gray-900\">{activeKeys ? new Set(activeKeys.map(k => k.provider)).size : 0}</p>\n                </div>\n              </div>\n            </div>\n            \n            {spendingReport && spendingReport.breakdown.length > 0 && (\n              <div className=\"mt-4\">\n                <p className=\"text-sm font-medium text-gray-700 mb-2\">Top Spending Providers:</p>\n                <div className=\"space-y-1\">\n                  {spendingReport.breakdown.slice(0, 3).map((item) => (\n                    <div key={item.provider} className=\"flex justify-between text-sm\">\n                      <span className=\"text-gray-600 capitalize\">{item.provider}</span>\n                      <span className=\"font-medium\">${item.amount.toFixed(2)}</span>\n                    </div>\n                  ))}\n                </div>\n              </div>\n            )}\n          </div>\n        </div>\n      </div>\n\n      <div className=\"mt-8\">\n        <div className=\"bg-white shadow rounded-lg\">\n          <div className=\"px-4 py-5 sm:p-6\">\n            <h3 className=\"text-lg leading-6 font-medium text-gray-900 mb-4\">\n              Welcome to Claude PM Portfolio Manager\n            </h3>\n            <div className=\"text-sm text-gray-600\">\n              <p className=\"mb-4\">\n                This dashboard provides comprehensive monitoring and reporting for projects managed\n                by the Claude PM framework using ai-trackdown-tools for ticket management.\n              </p>\n              <div className=\"space-y-2\">\n                <p>\n                  <strong>Features:</strong>\n                </p>\n                <ul className=\"list-disc pl-5 space-y-1\">\n                  <li>Real-time project health monitoring</li>\n                  <li>AI Trackdown Tools integration</li>\n                  <li>Milestone and sprint tracking</li>\n                  <li>Performance metrics and analytics</li>\n                  <li>Git integration for commit tracking</li>\n                  <li>API key management and billing monitoring</li>\n                </ul>\n              </div>\n              <p className=\"mt-4 text-xs text-gray-500\">\n                To get started, projects will be automatically discovered from the\n                ~/Projects/managed/ directory. Tickets are managed using ai-trackdown-tools CLI.\n              </p>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      <div className=\"mt-8\">\n        <div className=\"bg-white shadow rounded-lg\">\n          <div className=\"px-4 py-5 sm:p-6\">\n            <h3 className=\"text-lg leading-6 font-medium text-gray-900 mb-4\">\n              Recent AI Trackdown Tickets\n            </h3>\n            {ticketsLoading ? (\n              <div className=\"text-gray-500\">Loading tickets...</div>\n            ) : (\n              <div className=\"space-y-3\">\n                {tickets?.slice(0, 5).map(ticket => (\n                  <div\n                    key={ticket.id}\n                    className=\"flex items-center justify-between p-3 border border-gray-200 rounded-md\"\n                  >\n                    <div className=\"flex items-center space-x-3\">\n                      <div\n                        className={`w-3 h-3 rounded-full ${\n                          ticket.status === \"completed\"\n                            ? \"bg-claude-green\"\n                            : ticket.status === \"in_progress\"\n                              ? \"bg-claude-blue\"\n                              : ticket.status === \"blocked\"\n                                ? \"bg-claude-red\"\n                                : \"bg-gray-400\"\n                        }`}\n                      ></div>\n                      <div>\n                        <p className=\"text-sm font-medium text-gray-900\">\n                          [{ticket.id}] {ticket.title}\n                        </p>\n                        <p className=\"text-xs text-gray-500\">\n                          {ticket.type && (\n                            <span className={`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium mr-2 ${\n                              ticket.type === 'epic' ? 'bg-purple-100 text-purple-800' :\n                              ticket.type === 'issue' ? 'bg-blue-100 text-blue-800' :\n                              ticket.type === 'task' ? 'bg-green-100 text-green-800' :\n                              'bg-gray-100 text-gray-800'\n                            }`}>\n                              {ticket.type}\n                            </span>\n                          )}\n                          {ticket.milestone} • {ticket.priority} priority\n                        </p>\n                      </div>\n                    </div>\n                    <div className=\"text-xs text-gray-500 capitalize\">\n                      {ticket.status.replace(\"_\", \" \")}\n                    </div>\n                  </div>\n                ))}\n              </div>\n            )}\n          </div>\n        </div>\n      </div>\n    </div>\n  )\n}\n\nexport default Dashboard\n","import { useQuery } from \"@tanstack/react-query\"\nimport { AlertCircle, DollarSign, Key, TrendingUp } from \"lucide-react\"\nimport type React from \"react\"\nimport { keyManagementService } from \"../services/keyManagementService\"\nimport type { ApiKey, BillingData } from \"../types/keyManagement\"\n\nconst KeyManagement: React.FC = () => {\n  const {\n    data: billingData,\n    isLoading: billingLoading,\n    error: billingError,\n  } = useQuery({\n    queryKey: [\"billing\"],\n    queryFn: () => keyManagementService.getAllBillingData(),\n    refetchInterval: 5 * 60 * 1000, // Refetch every 5 minutes\n  })\n\n  const {\n    data: activeKeys,\n    isLoading: keysLoading,\n    error: keysError,\n  } = useQuery({\n    queryKey: [\"activeKeys\"],\n    queryFn: () => keyManagementService.getActiveKeys(),\n  })\n\n  const {\n    data: spendingReport,\n    isLoading: reportLoading,\n    error: reportError,\n  } = useQuery({\n    queryKey: [\"spendingReport\"],\n    queryFn: () => keyManagementService.generateSpendingReport(30),\n    refetchInterval: 60 * 60 * 1000, // Refetch every hour\n  })\n\n  const isLoading = billingLoading || keysLoading || reportLoading\n  const hasError = billingError || keysError || reportError\n\n  if (isLoading) {\n    return (\n      <div className=\"flex items-center justify-center h-64\">\n        <div className=\"animate-spin rounded-full h-8 w-8 border-b-2 border-claude-blue\"></div>\n      </div>\n    )\n  }\n\n  if (hasError) {\n    return (\n      <div className=\"bg-red-50 border border-red-200 rounded-lg p-4\">\n        <div className=\"flex items-center\">\n          <AlertCircle className=\"h-5 w-5 text-red-400 mr-2\" />\n          <p className=\"text-red-800\">Error loading key management data</p>\n        </div>\n      </div>\n    )\n  }\n\n  return (\n    <div className=\"space-y-6\">\n      {/* Header */}\n      <div className=\"bg-white shadow rounded-lg p-6\">\n        <h2 className=\"text-2xl font-bold text-gray-900 mb-2\">API Key Management</h2>\n        <p className=\"text-gray-600\">\n          Monitor your API keys, billing, and usage across all providers\n        </p>\n      </div>\n\n      {/* Key Stats */}\n      <div className=\"grid grid-cols-1 md:grid-cols-3 gap-6\">\n        <div className=\"bg-white shadow rounded-lg p-6\">\n          <div className=\"flex items-center\">\n            <Key className=\"h-8 w-8 text-claude-blue\" />\n            <div className=\"ml-4\">\n              <p className=\"text-sm font-medium text-gray-500\">Active Keys</p>\n              <p className=\"text-2xl font-bold text-gray-900\">{activeKeys?.length || 0}</p>\n            </div>\n          </div>\n        </div>\n\n        <div className=\"bg-white shadow rounded-lg p-6\">\n          <div className=\"flex items-center\">\n            <DollarSign className=\"h-8 w-8 text-claude-green\" />\n            <div className=\"ml-4\">\n              <p className=\"text-sm font-medium text-gray-500\">Total Spend (30d)</p>\n              <p className=\"text-2xl font-bold text-gray-900\">\n                ${spendingReport?.totalSpend.toFixed(2) || \"0.00\"}\n              </p>\n            </div>\n          </div>\n        </div>\n\n        <div className=\"bg-white shadow rounded-lg p-6\">\n          <div className=\"flex items-center\">\n            <TrendingUp className=\"h-8 w-8 text-claude-purple\" />\n            <div className=\"ml-4\">\n              <p className=\"text-sm font-medium text-gray-500\">Providers</p>\n              <p className=\"text-2xl font-bold text-gray-900\">{billingData?.length || 0}</p>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      {/* Active Keys */}\n      <div className=\"bg-white shadow rounded-lg\">\n        <div className=\"px-6 py-4 border-b border-gray-200\">\n          <h3 className=\"text-lg font-medium text-gray-900\">Active API Keys</h3>\n        </div>\n        <div className=\"px-6 py-4\">\n          {activeKeys && activeKeys.length > 0 ? (\n            <div className=\"overflow-x-auto\">\n              <table className=\"min-w-full divide-y divide-gray-200\">\n                <thead className=\"bg-gray-50\">\n                  <tr>\n                    <th className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\">\n                      Provider\n                    </th>\n                    <th className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\">\n                      Key Type\n                    </th>\n                    <th className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\">\n                      Status\n                    </th>\n                    <th className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\">\n                      Last Used\n                    </th>\n                  </tr>\n                </thead>\n                <tbody className=\"bg-white divide-y divide-gray-200\">\n                  {activeKeys.map((key: ApiKey) => (\n                    <tr key={key.id}>\n                      <td className=\"px-6 py-4 whitespace-nowrap\">\n                        <div className=\"flex items-center\">\n                          <div className=\"text-sm font-medium text-gray-900 capitalize\">\n                            {key.provider}\n                          </div>\n                        </div>\n                      </td>\n                      <td className=\"px-6 py-4 whitespace-nowrap\">\n                        <span className=\"px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800\">\n                          {key.keyType}\n                        </span>\n                      </td>\n                      <td className=\"px-6 py-4 whitespace-nowrap\">\n                        <span\n                          className={`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${\n                            key.status === \"active\"\n                              ? \"bg-green-100 text-green-800\"\n                              : \"bg-red-100 text-red-800\"\n                          }`}\n                        >\n                          {key.status}\n                        </span>\n                      </td>\n                      <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-500\">\n                        {key.lastUsed ? new Date(key.lastUsed).toLocaleDateString() : \"Never\"}\n                      </td>\n                    </tr>\n                  ))}\n                </tbody>\n              </table>\n            </div>\n          ) : (\n            <p className=\"text-gray-500 text-center py-4\">No active keys found</p>\n          )}\n        </div>\n      </div>\n\n      {/* Billing Overview */}\n      <div className=\"bg-white shadow rounded-lg\">\n        <div className=\"px-6 py-4 border-b border-gray-200\">\n          <h3 className=\"text-lg font-medium text-gray-900\">Current Billing Period</h3>\n        </div>\n        <div className=\"px-6 py-4\">\n          {billingData && billingData.length > 0 ? (\n            <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4\">\n              {billingData.map((billing: BillingData) => (\n                <div key={billing.provider} className=\"border rounded-lg p-4\">\n                  <h4 className=\"text-sm font-medium text-gray-900 capitalize mb-2\">\n                    {billing.provider}\n                  </h4>\n                  <div className=\"space-y-1\">\n                    <div className=\"flex justify-between text-sm\">\n                      <span className=\"text-gray-500\">Cost:</span>\n                      <span className=\"font-medium\">${billing.currentPeriod.cost.toFixed(2)}</span>\n                    </div>\n                    {billing.currentPeriod.limit && (\n                      <div className=\"flex justify-between text-sm\">\n                        <span className=\"text-gray-500\">Limit:</span>\n                        <span className=\"font-medium\">\n                          ${billing.currentPeriod.limit.toFixed(2)}\n                        </span>\n                      </div>\n                    )}\n                    <div className=\"flex justify-between text-sm\">\n                      <span className=\"text-gray-500\">Period:</span>\n                      <span className=\"font-medium\">\n                        {new Date(billing.currentPeriod.start).toLocaleDateString()} -\n                        {new Date(billing.currentPeriod.end).toLocaleDateString()}\n                      </span>\n                    </div>\n                  </div>\n                </div>\n              ))}\n            </div>\n          ) : (\n            <p className=\"text-gray-500 text-center py-4\">No billing data available</p>\n          )}\n        </div>\n      </div>\n\n      {/* Spending Breakdown */}\n      {spendingReport && (\n        <div className=\"bg-white shadow rounded-lg\">\n          <div className=\"px-6 py-4 border-b border-gray-200\">\n            <h3 className=\"text-lg font-medium text-gray-900\">Spending Breakdown (Last 30 Days)</h3>\n          </div>\n          <div className=\"px-6 py-4\">\n            <div className=\"space-y-4\">\n              {spendingReport.breakdown.map(item => (\n                <div key={item.provider} className=\"flex items-center justify-between\">\n                  <div className=\"flex items-center\">\n                    <div className=\"text-sm font-medium text-gray-900 capitalize\">\n                      {item.provider}\n                    </div>\n                  </div>\n                  <div className=\"flex items-center space-x-2\">\n                    <div className=\"w-32 bg-gray-200 rounded-full h-2\">\n                      <div\n                        className=\"bg-claude-blue h-2 rounded-full\"\n                        style={{ width: `${item.percentage}%` }}\n                      />\n                    </div>\n                    <div className=\"text-sm text-gray-900 font-medium min-w-16 text-right\">\n                      ${item.amount.toFixed(2)}\n                    </div>\n                    <div className=\"text-sm text-gray-500 min-w-12 text-right\">\n                      {item.percentage.toFixed(1)}%\n                    </div>\n                  </div>\n                </div>\n              ))}\n            </div>\n          </div>\n        </div>\n      )}\n    </div>\n  )\n}\n\nexport default KeyManagement\n","import { FolderOpen, Home, Key, Rocket, MonitorSpeaker } from \"lucide-react\"\nimport type React from \"react\"\nimport { Link, useLocation } from \"react-router-dom\"\n\ninterface LayoutProps {\n  children: React.ReactNode\n}\n\nconst Layout: React.FC<LayoutProps> = ({ children }) => {\n  const location = useLocation()\n\n  const navigation = [\n    { name: \"Dashboard\", href: \"/\", icon: Home },\n    { name: \"Projects\", href: \"/projects\", icon: FolderOpen },\n    { name: \"Processes\", href: \"/processes\", icon: MonitorSpeaker },\n    { name: \"Keys\", href: \"/keys\", icon: Key },\n    { name: \"Deployments\", href: \"/deployments\", icon: Rocket },\n  ]\n\n  return (\n    <div className=\"min-h-screen bg-gray-50\">\n      <nav className=\"bg-white border-b border-gray-200\">\n        <div className=\"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8\">\n          <div className=\"flex justify-between h-16\">\n            <div className=\"flex\">\n              <div className=\"flex-shrink-0 flex items-center\">\n                <h1 className=\"text-xl font-bold text-claude-blue\">Claude PM Portfolio</h1>\n              </div>\n              <div className=\"ml-6 flex space-x-8\">\n                {navigation.map(item => {\n                  const Icon = item.icon\n                  const isActive = location.pathname === item.href\n                  return (\n                    <Link\n                      key={item.name}\n                      to={item.href}\n                      className={`inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium ${\n                        isActive\n                          ? \"border-claude-blue text-claude-blue\"\n                          : \"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300\"\n                      }`}\n                    >\n                      <Icon className=\"w-4 h-4 mr-2\" />\n                      {item.name}\n                    </Link>\n                  )\n                })}\n              </div>\n            </div>\n          </div>\n        </div>\n      </nav>\n\n      <main className=\"max-w-7xl mx-auto py-6 sm:px-6 lg:px-8\">\n        <div className=\"px-4 py-6 sm:px-0\">{children}</div>\n      </main>\n    </div>\n  )\n}\n\nexport default Layout\n","function _typeof(o) {\n  \"@babel/helpers - typeof\";\n\n  return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n    return typeof o;\n  } : function (o) {\n    return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n  }, _typeof(o);\n}\nexport { _typeof as default };","export default function requiredArgs(required, args) {\n  if (args.length < required) {\n    throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n  }\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport default function toDate(argument) {\n  requiredArgs(1, arguments);\n  var argStr = Object.prototype.toString.call(argument);\n\n  // Clone the date\n  if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {\n    // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n    return new Date(argument.getTime());\n  } else if (typeof argument === 'number' || argStr === '[object Number]') {\n    return new Date(argument);\n  } else {\n    if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n      // eslint-disable-next-line no-console\n      console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments\");\n      // eslint-disable-next-line no-console\n      console.warn(new Error().stack);\n    }\n    return new Date(NaN);\n  }\n}","var defaultOptions = {};\nexport function getDefaultOptions() {\n  return defaultOptions;\n}\nexport function setDefaultOptions(newOptions) {\n  defaultOptions = newOptions;\n}","/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport default function getTimezoneOffsetInMilliseconds(date) {\n  var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n  utcDate.setUTCFullYear(date.getFullYear());\n  return date.getTime() - utcDate.getTime();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * @param {Date|Number} dateLeft - the first date to compare\n * @param {Date|Number} dateRight - the second date to compare\n * @returns {Number} the result of the comparison\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n *   new Date(1995, 6, 2),\n *   new Date(1987, 1, 11),\n *   new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * //   Wed Feb 11 1987 00:00:00,\n * //   Mon Jul 10 1989 00:00:00,\n * //   Sun Jul 02 1995 00:00:00\n * // ]\n */\nexport default function compareAsc(dirtyDateLeft, dirtyDateRight) {\n  requiredArgs(2, arguments);\n  var dateLeft = toDate(dirtyDateLeft);\n  var dateRight = toDate(dirtyDateRight);\n  var diff = dateLeft.getTime() - dateRight.getTime();\n  if (diff < 0) {\n    return -1;\n  } else if (diff > 0) {\n    return 1;\n    // Return 0 if diff is 0; return NaN if diff is NaN\n  } else {\n    return diff;\n  }\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar months\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInCalendarMonths(\n *   new Date(2014, 8, 1),\n *   new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nexport default function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) {\n  requiredArgs(2, arguments);\n  var dateLeft = toDate(dirtyDateLeft);\n  var dateRight = toDate(dirtyDateRight);\n  var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();\n  var monthDiff = dateLeft.getMonth() - dateRight.getMonth();\n  return yearDiff * 12 + monthDiff;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of milliseconds\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n *   new Date(2014, 6, 2, 12, 30, 21, 700),\n *   new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport default function differenceInMilliseconds(dateLeft, dateRight) {\n  requiredArgs(2, arguments);\n  return toDate(dateLeft).getTime() - toDate(dateRight).getTime();\n}","var roundingMap = {\n  ceil: Math.ceil,\n  round: Math.round,\n  floor: Math.floor,\n  trunc: function trunc(value) {\n    return value < 0 ? Math.ceil(value) : Math.floor(value);\n  } // Math.trunc is not supported by IE\n};\n\nvar defaultRoundingMethod = 'trunc';\nexport function getRoundingMethod(method) {\n  return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfDay\n * @category Day Helpers\n * @summary Return the end of a day for the given date.\n *\n * @description\n * Return the end of a day for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a day\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a day for 2 September 2014 11:55:00:\n * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 23:59:59.999\n */\nexport default function endOfDay(dirtyDate) {\n  requiredArgs(1, arguments);\n  var date = toDate(dirtyDate);\n  date.setHours(23, 59, 59, 999);\n  return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nexport default function endOfMonth(dirtyDate) {\n  requiredArgs(1, arguments);\n  var date = toDate(dirtyDate);\n  var month = date.getMonth();\n  date.setFullYear(date.getFullYear(), month + 1, 0);\n  date.setHours(23, 59, 59, 999);\n  return date;\n}","import toDate from \"../toDate/index.js\";\nimport endOfDay from \"../endOfDay/index.js\";\nimport endOfMonth from \"../endOfMonth/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isLastDayOfMonth\n * @category Month Helpers\n * @summary Is the given date the last day of a month?\n *\n * @description\n * Is the given date the last day of a month?\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is the last day of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 28 February 2014 the last day of a month?\n * const result = isLastDayOfMonth(new Date(2014, 1, 28))\n * //=> true\n */\nexport default function isLastDayOfMonth(dirtyDate) {\n  requiredArgs(1, arguments);\n  var date = toDate(dirtyDate);\n  return endOfDay(date).getTime() === endOfMonth(date).getTime();\n}","import toDate from \"../toDate/index.js\";\nimport differenceInCalendarMonths from \"../differenceInCalendarMonths/index.js\";\nimport compareAsc from \"../compareAsc/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport isLastDayOfMonth from \"../isLastDayOfMonth/index.js\";\n/**\n * @name differenceInMonths\n * @category Month Helpers\n * @summary Get the number of full months between the given dates.\n *\n * @description\n * Get the number of full months between the given dates using trunc as a default rounding method.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full months\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))\n * //=> 7\n */\nexport default function differenceInMonths(dirtyDateLeft, dirtyDateRight) {\n  requiredArgs(2, arguments);\n  var dateLeft = toDate(dirtyDateLeft);\n  var dateRight = toDate(dirtyDateRight);\n  var sign = compareAsc(dateLeft, dateRight);\n  var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight));\n  var result;\n\n  // Check for the difference of less than month\n  if (difference < 1) {\n    result = 0;\n  } else {\n    if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) {\n      // This will check if the date is end of Feb and assign a higher end of month date\n      // to compare it with Jan\n      dateLeft.setDate(30);\n    }\n    dateLeft.setMonth(dateLeft.getMonth() - sign * difference);\n\n    // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full\n    // If so, result must be decreased by 1 in absolute value\n    var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign;\n\n    // Check for cases of one full calendar month\n    if (isLastDayOfMonth(toDate(dirtyDateLeft)) && difference === 1 && compareAsc(dirtyDateLeft, dateRight) === 1) {\n      isLastMonthNotFull = false;\n    }\n    result = sign * (difference - Number(isLastMonthNotFull));\n  }\n\n  // Prevent negative zero\n  return result === 0 ? 0 : result;\n}","import differenceInMilliseconds from \"../differenceInMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { getRoundingMethod } from \"../_lib/roundingMethods/index.js\";\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @param {Object} [options] - an object with options.\n * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)\n * @returns {Number} the number of seconds\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * const result = differenceInSeconds(\n *   new Date(2014, 6, 2, 12, 30, 20, 0),\n *   new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\nexport default function differenceInSeconds(dateLeft, dateRight, options) {\n  requiredArgs(2, arguments);\n  var diff = differenceInMilliseconds(dateLeft, dateRight) / 1000;\n  return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);\n}","var formatDistanceLocale = {\n  lessThanXSeconds: {\n    one: 'less than a second',\n    other: 'less than {{count}} seconds'\n  },\n  xSeconds: {\n    one: '1 second',\n    other: '{{count}} seconds'\n  },\n  halfAMinute: 'half a minute',\n  lessThanXMinutes: {\n    one: 'less than a minute',\n    other: 'less than {{count}} minutes'\n  },\n  xMinutes: {\n    one: '1 minute',\n    other: '{{count}} minutes'\n  },\n  aboutXHours: {\n    one: 'about 1 hour',\n    other: 'about {{count}} hours'\n  },\n  xHours: {\n    one: '1 hour',\n    other: '{{count}} hours'\n  },\n  xDays: {\n    one: '1 day',\n    other: '{{count}} days'\n  },\n  aboutXWeeks: {\n    one: 'about 1 week',\n    other: 'about {{count}} weeks'\n  },\n  xWeeks: {\n    one: '1 week',\n    other: '{{count}} weeks'\n  },\n  aboutXMonths: {\n    one: 'about 1 month',\n    other: 'about {{count}} months'\n  },\n  xMonths: {\n    one: '1 month',\n    other: '{{count}} months'\n  },\n  aboutXYears: {\n    one: 'about 1 year',\n    other: 'about {{count}} years'\n  },\n  xYears: {\n    one: '1 year',\n    other: '{{count}} years'\n  },\n  overXYears: {\n    one: 'over 1 year',\n    other: 'over {{count}} years'\n  },\n  almostXYears: {\n    one: 'almost 1 year',\n    other: 'almost {{count}} years'\n  }\n};\nvar formatDistance = function formatDistance(token, count, options) {\n  var result;\n  var tokenValue = formatDistanceLocale[token];\n  if (typeof tokenValue === 'string') {\n    result = tokenValue;\n  } else if (count === 1) {\n    result = tokenValue.one;\n  } else {\n    result = tokenValue.other.replace('{{count}}', count.toString());\n  }\n  if (options !== null && options !== void 0 && options.addSuffix) {\n    if (options.comparison && options.comparison > 0) {\n      return 'in ' + result;\n    } else {\n      return result + ' ago';\n    }\n  }\n  return result;\n};\nexport default formatDistance;","export default function buildFormatLongFn(args) {\n  return function () {\n    var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    // TODO: Remove String()\n    var width = options.width ? String(options.width) : args.defaultWidth;\n    var format = args.formats[width] || args.formats[args.defaultWidth];\n    return format;\n  };\n}","import buildFormatLongFn from \"../../../_lib/buildFormatLongFn/index.js\";\nvar dateFormats = {\n  full: 'EEEE, MMMM do, y',\n  long: 'MMMM do, y',\n  medium: 'MMM d, y',\n  short: 'MM/dd/yyyy'\n};\nvar timeFormats = {\n  full: 'h:mm:ss a zzzz',\n  long: 'h:mm:ss a z',\n  medium: 'h:mm:ss a',\n  short: 'h:mm a'\n};\nvar dateTimeFormats = {\n  full: \"{{date}} 'at' {{time}}\",\n  long: \"{{date}} 'at' {{time}}\",\n  medium: '{{date}}, {{time}}',\n  short: '{{date}}, {{time}}'\n};\nvar formatLong = {\n  date: buildFormatLongFn({\n    formats: dateFormats,\n    defaultWidth: 'full'\n  }),\n  time: buildFormatLongFn({\n    formats: timeFormats,\n    defaultWidth: 'full'\n  }),\n  dateTime: buildFormatLongFn({\n    formats: dateTimeFormats,\n    defaultWidth: 'full'\n  })\n};\nexport default formatLong;","var formatRelativeLocale = {\n  lastWeek: \"'last' eeee 'at' p\",\n  yesterday: \"'yesterday at' p\",\n  today: \"'today at' p\",\n  tomorrow: \"'tomorrow at' p\",\n  nextWeek: \"eeee 'at' p\",\n  other: 'P'\n};\nvar formatRelative = function formatRelative(token, _date, _baseDate, _options) {\n  return formatRelativeLocale[token];\n};\nexport default formatRelative;","export default function buildLocalizeFn(args) {\n  return function (dirtyIndex, options) {\n    var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';\n    var valuesArray;\n    if (context === 'formatting' && args.formattingValues) {\n      var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n      var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;\n      valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];\n    } else {\n      var _defaultWidth = args.defaultWidth;\n      var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;\n      valuesArray = args.values[_width] || args.values[_defaultWidth];\n    }\n    var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;\n    // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n    return valuesArray[index];\n  };\n}","import buildLocalizeFn from \"../../../_lib/buildLocalizeFn/index.js\";\nvar eraValues = {\n  narrow: ['B', 'A'],\n  abbreviated: ['BC', 'AD'],\n  wide: ['Before Christ', 'Anno Domini']\n};\nvar quarterValues = {\n  narrow: ['1', '2', '3', '4'],\n  abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],\n  wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nvar monthValues = {\n  narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],\n  abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n  wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']\n};\nvar dayValues = {\n  narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],\n  short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n  abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n  wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\n};\nvar dayPeriodValues = {\n  narrow: {\n    am: 'a',\n    pm: 'p',\n    midnight: 'mi',\n    noon: 'n',\n    morning: 'morning',\n    afternoon: 'afternoon',\n    evening: 'evening',\n    night: 'night'\n  },\n  abbreviated: {\n    am: 'AM',\n    pm: 'PM',\n    midnight: 'midnight',\n    noon: 'noon',\n    morning: 'morning',\n    afternoon: 'afternoon',\n    evening: 'evening',\n    night: 'night'\n  },\n  wide: {\n    am: 'a.m.',\n    pm: 'p.m.',\n    midnight: 'midnight',\n    noon: 'noon',\n    morning: 'morning',\n    afternoon: 'afternoon',\n    evening: 'evening',\n    night: 'night'\n  }\n};\nvar formattingDayPeriodValues = {\n  narrow: {\n    am: 'a',\n    pm: 'p',\n    midnight: 'mi',\n    noon: 'n',\n    morning: 'in the morning',\n    afternoon: 'in the afternoon',\n    evening: 'in the evening',\n    night: 'at night'\n  },\n  abbreviated: {\n    am: 'AM',\n    pm: 'PM',\n    midnight: 'midnight',\n    noon: 'noon',\n    morning: 'in the morning',\n    afternoon: 'in the afternoon',\n    evening: 'in the evening',\n    night: 'at night'\n  },\n  wide: {\n    am: 'a.m.',\n    pm: 'p.m.',\n    midnight: 'midnight',\n    noon: 'noon',\n    morning: 'in the morning',\n    afternoon: 'in the afternoon',\n    evening: 'in the evening',\n    night: 'at night'\n  }\n};\nvar ordinalNumber = function ordinalNumber(dirtyNumber, _options) {\n  var number = Number(dirtyNumber);\n\n  // If ordinal numbers depend on context, for example,\n  // if they are different for different grammatical genders,\n  // use `options.unit`.\n  //\n  // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n  // 'day', 'hour', 'minute', 'second'.\n\n  var rem100 = number % 100;\n  if (rem100 > 20 || rem100 < 10) {\n    switch (rem100 % 10) {\n      case 1:\n        return number + 'st';\n      case 2:\n        return number + 'nd';\n      case 3:\n        return number + 'rd';\n    }\n  }\n  return number + 'th';\n};\nvar localize = {\n  ordinalNumber: ordinalNumber,\n  era: buildLocalizeFn({\n    values: eraValues,\n    defaultWidth: 'wide'\n  }),\n  quarter: buildLocalizeFn({\n    values: quarterValues,\n    defaultWidth: 'wide',\n    argumentCallback: function argumentCallback(quarter) {\n      return quarter - 1;\n    }\n  }),\n  month: buildLocalizeFn({\n    values: monthValues,\n    defaultWidth: 'wide'\n  }),\n  day: buildLocalizeFn({\n    values: dayValues,\n    defaultWidth: 'wide'\n  }),\n  dayPeriod: buildLocalizeFn({\n    values: dayPeriodValues,\n    defaultWidth: 'wide',\n    formattingValues: formattingDayPeriodValues,\n    defaultFormattingWidth: 'wide'\n  })\n};\nexport default localize;","export default function buildMatchFn(args) {\n  return function (string) {\n    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n    var width = options.width;\n    var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];\n    var matchResult = string.match(matchPattern);\n    if (!matchResult) {\n      return null;\n    }\n    var matchedString = matchResult[0];\n    var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];\n    var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {\n      return pattern.test(matchedString);\n    }) : findKey(parsePatterns, function (pattern) {\n      return pattern.test(matchedString);\n    });\n    var value;\n    value = args.valueCallback ? args.valueCallback(key) : key;\n    value = options.valueCallback ? options.valueCallback(value) : value;\n    var rest = string.slice(matchedString.length);\n    return {\n      value: value,\n      rest: rest\n    };\n  };\n}\nfunction findKey(object, predicate) {\n  for (var key in object) {\n    if (object.hasOwnProperty(key) && predicate(object[key])) {\n      return key;\n    }\n  }\n  return undefined;\n}\nfunction findIndex(array, predicate) {\n  for (var key = 0; key < array.length; key++) {\n    if (predicate(array[key])) {\n      return key;\n    }\n  }\n  return undefined;\n}","export default function buildMatchPatternFn(args) {\n  return function (string) {\n    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n    var matchResult = string.match(args.matchPattern);\n    if (!matchResult) return null;\n    var matchedString = matchResult[0];\n    var parseResult = string.match(args.parsePattern);\n    if (!parseResult) return null;\n    var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];\n    value = options.valueCallback ? options.valueCallback(value) : value;\n    var rest = string.slice(matchedString.length);\n    return {\n      value: value,\n      rest: rest\n    };\n  };\n}","import buildMatchFn from \"../../../_lib/buildMatchFn/index.js\";\nimport buildMatchPatternFn from \"../../../_lib/buildMatchPatternFn/index.js\";\nvar matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nvar parseOrdinalNumberPattern = /\\d+/i;\nvar matchEraPatterns = {\n  narrow: /^(b|a)/i,\n  abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n  wide: /^(before christ|before common era|anno domini|common era)/i\n};\nvar parseEraPatterns = {\n  any: [/^b/i, /^(a|c)/i]\n};\nvar matchQuarterPatterns = {\n  narrow: /^[1234]/i,\n  abbreviated: /^q[1234]/i,\n  wide: /^[1234](th|st|nd|rd)? quarter/i\n};\nvar parseQuarterPatterns = {\n  any: [/1/i, /2/i, /3/i, /4/i]\n};\nvar matchMonthPatterns = {\n  narrow: /^[jfmasond]/i,\n  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i\n};\nvar parseMonthPatterns = {\n  narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],\n  any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]\n};\nvar matchDayPatterns = {\n  narrow: /^[smtwf]/i,\n  short: /^(su|mo|tu|we|th|fr|sa)/i,\n  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i\n};\nvar parseDayPatterns = {\n  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]\n};\nvar matchDayPeriodPatterns = {\n  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n  any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i\n};\nvar parseDayPeriodPatterns = {\n  any: {\n    am: /^a/i,\n    pm: /^p/i,\n    midnight: /^mi/i,\n    noon: /^no/i,\n    morning: /morning/i,\n    afternoon: /afternoon/i,\n    evening: /evening/i,\n    night: /night/i\n  }\n};\nvar match = {\n  ordinalNumber: buildMatchPatternFn({\n    matchPattern: matchOrdinalNumberPattern,\n    parsePattern: parseOrdinalNumberPattern,\n    valueCallback: function valueCallback(value) {\n      return parseInt(value, 10);\n    }\n  }),\n  era: buildMatchFn({\n    matchPatterns: matchEraPatterns,\n    defaultMatchWidth: 'wide',\n    parsePatterns: parseEraPatterns,\n    defaultParseWidth: 'any'\n  }),\n  quarter: buildMatchFn({\n    matchPatterns: matchQuarterPatterns,\n    defaultMatchWidth: 'wide',\n    parsePatterns: parseQuarterPatterns,\n    defaultParseWidth: 'any',\n    valueCallback: function valueCallback(index) {\n      return index + 1;\n    }\n  }),\n  month: buildMatchFn({\n    matchPatterns: matchMonthPatterns,\n    defaultMatchWidth: 'wide',\n    parsePatterns: parseMonthPatterns,\n    defaultParseWidth: 'any'\n  }),\n  day: buildMatchFn({\n    matchPatterns: matchDayPatterns,\n    defaultMatchWidth: 'wide',\n    parsePatterns: parseDayPatterns,\n    defaultParseWidth: 'any'\n  }),\n  dayPeriod: buildMatchFn({\n    matchPatterns: matchDayPeriodPatterns,\n    defaultMatchWidth: 'any',\n    parsePatterns: parseDayPeriodPatterns,\n    defaultParseWidth: 'any'\n  })\n};\nexport default match;","import formatDistance from \"./_lib/formatDistance/index.js\";\nimport formatLong from \"./_lib/formatLong/index.js\";\nimport formatRelative from \"./_lib/formatRelative/index.js\";\nimport localize from \"./_lib/localize/index.js\";\nimport match from \"./_lib/match/index.js\";\n/**\n * @type {Locale}\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}\n * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}\n */\nvar locale = {\n  code: 'en-US',\n  formatDistance: formatDistance,\n  formatLong: formatLong,\n  formatRelative: formatRelative,\n  localize: localize,\n  match: match,\n  options: {\n    weekStartsOn: 0 /* Sunday */,\n    firstWeekContainsDate: 1\n  }\n};\nexport default locale;","export default function assign(target, object) {\n  if (target == null) {\n    throw new TypeError('assign requires that input parameter not be null or undefined');\n  }\n  for (var property in object) {\n    if (Object.prototype.hasOwnProperty.call(object, property)) {\n      ;\n      target[property] = object[property];\n    }\n  }\n  return target;\n}","import assign from \"../assign/index.js\";\nexport default function cloneObject(object) {\n  return assign({}, object);\n}","import { getDefaultOptions } from \"../_lib/defaultOptions/index.js\";\nimport compareAsc from \"../compareAsc/index.js\";\nimport differenceInMonths from \"../differenceInMonths/index.js\";\nimport differenceInSeconds from \"../differenceInSeconds/index.js\";\nimport defaultLocale from \"../_lib/defaultLocale/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport cloneObject from \"../_lib/cloneObject/index.js\";\nimport assign from \"../_lib/assign/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MINUTES_IN_DAY = 1440;\nvar MINUTES_IN_ALMOST_TWO_DAYS = 2520;\nvar MINUTES_IN_MONTH = 43200;\nvar MINUTES_IN_TWO_MONTHS = 86400;\n\n/**\n * @name formatDistance\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words.\n *\n * | Distance between dates                                            | Result              |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs                                                     | less than a minute  |\n * | 30 secs ... 1 min 30 secs                                         | 1 minute            |\n * | 1 min 30 secs ... 44 mins 30 secs                                 | [2..44] minutes     |\n * | 44 mins ... 30 secs ... 89 mins 30 secs                           | about 1 hour        |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs                        | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs                 | 1 day               |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs         | [2..30] days        |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month       |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months      |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr                           | [2..12] months      |\n * | 1 yr ... 1 yr 3 months                                            | about 1 year        |\n * | 1 yr 3 months ... 1 yr 9 month s                                  | over 1 year         |\n * | 1 yr 9 months ... 2 yrs                                           | almost 2 years      |\n * | N yrs ... N yrs 3 months                                          | about N years       |\n * | N yrs 3 months ... N yrs 9 months                                 | over N years        |\n * | N yrs 9 months ... N+1 yrs                                        | almost N+1 years    |\n *\n * With `options.includeSeconds == true`:\n * | Distance between dates | Result               |\n * |------------------------|----------------------|\n * | 0 secs ... 5 secs      | less than 5 seconds  |\n * | 5 secs ... 10 secs     | less than 10 seconds |\n * | 10 secs ... 20 secs    | less than 20 seconds |\n * | 20 secs ... 40 secs    | half a minute        |\n * | 40 secs ... 60 secs    | less than a minute   |\n * | 60 secs ... 90 secs    | 1 minute             |\n *\n * @param {Date|Number} date - the date\n * @param {Date|Number} baseDate - the date to compare with\n * @param {Object} [options] - an object with options.\n * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed\n * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @returns {String} the distance in words\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `baseDate` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00, including seconds?\n * const result = formatDistance(\n *   new Date(2015, 0, 1, 0, 0, 15),\n *   new Date(2015, 0, 1, 0, 0, 0),\n *   { includeSeconds: true }\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n *   addSuffix: true\n * })\n * //=> 'about 1 year ago'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n *   locale: eoLocale\n * })\n * //=> 'pli ol 1 jaro'\n */\n\nexport default function formatDistance(dirtyDate, dirtyBaseDate, options) {\n  var _ref, _options$locale;\n  requiredArgs(2, arguments);\n  var defaultOptions = getDefaultOptions();\n  var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : defaultLocale;\n  if (!locale.formatDistance) {\n    throw new RangeError('locale must contain formatDistance property');\n  }\n  var comparison = compareAsc(dirtyDate, dirtyBaseDate);\n  if (isNaN(comparison)) {\n    throw new RangeError('Invalid time value');\n  }\n  var localizeOptions = assign(cloneObject(options), {\n    addSuffix: Boolean(options === null || options === void 0 ? void 0 : options.addSuffix),\n    comparison: comparison\n  });\n  var dateLeft;\n  var dateRight;\n  if (comparison > 0) {\n    dateLeft = toDate(dirtyBaseDate);\n    dateRight = toDate(dirtyDate);\n  } else {\n    dateLeft = toDate(dirtyDate);\n    dateRight = toDate(dirtyBaseDate);\n  }\n  var seconds = differenceInSeconds(dateRight, dateLeft);\n  var offsetInSeconds = (getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft)) / 1000;\n  var minutes = Math.round((seconds - offsetInSeconds) / 60);\n  var months;\n\n  // 0 up to 2 mins\n  if (minutes < 2) {\n    if (options !== null && options !== void 0 && options.includeSeconds) {\n      if (seconds < 5) {\n        return locale.formatDistance('lessThanXSeconds', 5, localizeOptions);\n      } else if (seconds < 10) {\n        return locale.formatDistance('lessThanXSeconds', 10, localizeOptions);\n      } else if (seconds < 20) {\n        return locale.formatDistance('lessThanXSeconds', 20, localizeOptions);\n      } else if (seconds < 40) {\n        return locale.formatDistance('halfAMinute', 0, localizeOptions);\n      } else if (seconds < 60) {\n        return locale.formatDistance('lessThanXMinutes', 1, localizeOptions);\n      } else {\n        return locale.formatDistance('xMinutes', 1, localizeOptions);\n      }\n    } else {\n      if (minutes === 0) {\n        return locale.formatDistance('lessThanXMinutes', 1, localizeOptions);\n      } else {\n        return locale.formatDistance('xMinutes', minutes, localizeOptions);\n      }\n    }\n\n    // 2 mins up to 0.75 hrs\n  } else if (minutes < 45) {\n    return locale.formatDistance('xMinutes', minutes, localizeOptions);\n\n    // 0.75 hrs up to 1.5 hrs\n  } else if (minutes < 90) {\n    return locale.formatDistance('aboutXHours', 1, localizeOptions);\n\n    // 1.5 hrs up to 24 hrs\n  } else if (minutes < MINUTES_IN_DAY) {\n    var hours = Math.round(minutes / 60);\n    return locale.formatDistance('aboutXHours', hours, localizeOptions);\n\n    // 1 day up to 1.75 days\n  } else if (minutes < MINUTES_IN_ALMOST_TWO_DAYS) {\n    return locale.formatDistance('xDays', 1, localizeOptions);\n\n    // 1.75 days up to 30 days\n  } else if (minutes < MINUTES_IN_MONTH) {\n    var days = Math.round(minutes / MINUTES_IN_DAY);\n    return locale.formatDistance('xDays', days, localizeOptions);\n\n    // 1 month up to 2 months\n  } else if (minutes < MINUTES_IN_TWO_MONTHS) {\n    months = Math.round(minutes / MINUTES_IN_MONTH);\n    return locale.formatDistance('aboutXMonths', months, localizeOptions);\n  }\n  months = differenceInMonths(dateRight, dateLeft);\n\n  // 2 months up to 12 months\n  if (months < 12) {\n    var nearestMonth = Math.round(minutes / MINUTES_IN_MONTH);\n    return locale.formatDistance('xMonths', nearestMonth, localizeOptions);\n\n    // 1 year up to max Date\n  } else {\n    var monthsSinceStartOfYear = months % 12;\n    var years = Math.floor(months / 12);\n\n    // N years up to 1 years 3 months\n    if (monthsSinceStartOfYear < 3) {\n      return locale.formatDistance('aboutXYears', years, localizeOptions);\n\n      // N years 3 months up to N years 9 months\n    } else if (monthsSinceStartOfYear < 9) {\n      return locale.formatDistance('overXYears', years, localizeOptions);\n\n      // N years 9 months up to N year 12 months\n    } else {\n      return locale.formatDistance('almostXYears', years + 1, localizeOptions);\n    }\n  }\n}","import distanceInWords from \"../formatDistance/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name formatDistanceToNow\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n * @pure false\n *\n * @description\n * Return the distance between the given date and now in words.\n *\n * | Distance to now                                                   | Result              |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs                                                     | less than a minute  |\n * | 30 secs ... 1 min 30 secs                                         | 1 minute            |\n * | 1 min 30 secs ... 44 mins 30 secs                                 | [2..44] minutes     |\n * | 44 mins ... 30 secs ... 89 mins 30 secs                           | about 1 hour        |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs                        | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs                 | 1 day               |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs         | [2..30] days        |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month       |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months      |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr                           | [2..12] months      |\n * | 1 yr ... 1 yr 3 months                                            | about 1 year        |\n * | 1 yr 3 months ... 1 yr 9 month s                                  | over 1 year         |\n * | 1 yr 9 months ... 2 yrs                                           | almost 2 years      |\n * | N yrs ... N yrs 3 months                                          | about N years       |\n * | N yrs 3 months ... N yrs 9 months                                 | over N years        |\n * | N yrs 9 months ... N+1 yrs                                        | almost N+1 years    |\n *\n * With `options.includeSeconds == true`:\n * | Distance to now     | Result               |\n * |---------------------|----------------------|\n * | 0 secs ... 5 secs   | less than 5 seconds  |\n * | 5 secs ... 10 secs  | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute        |\n * | 40 secs ... 60 secs | less than a minute   |\n * | 60 secs ... 90 secs | 1 minute             |\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * @param {Date|Number} date - the given date\n * @param {Object} [options] - the object with options\n * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed\n * @param {Boolean} [options.addSuffix=false] - result specifies if now is earlier or later than the passed date\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @returns {String} the distance in words\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `formatDistance` property\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * const result = formatDistanceToNow(\n *   new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * const result = formatDistanceToNow(\n *   new Date(2015, 0, 1, 0, 0, 15),\n *   {includeSeconds: true}\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * const result = formatDistanceToNow(\n *   new Date(2016, 0, 1),\n *   {addSuffix: true}\n * )\n * //=> 'in about 1 year'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 August 2016 in Esperanto?\n * const eoLocale = require('date-fns/locale/eo')\n * const result = formatDistanceToNow(\n *   new Date(2016, 7, 1),\n *   {locale: eoLocale}\n * )\n * //=> 'pli ol 1 jaro'\n */\nexport default function formatDistanceToNow(dirtyDate, options) {\n  requiredArgs(1, arguments);\n  return distanceInWords(dirtyDate, Date.now(), options);\n}","import type React from \"react\"\nimport { formatDistanceToNow } from \"date-fns\"\nimport { \n  User, \n  Clock, \n  CheckCircle, \n  AlertCircle, \n  Circle, \n  Zap, \n  TrendingUp, \n  Users,\n  Activity\n} from \"lucide-react\"\nimport type { Agent } from \"../../types/agent\"\n\ninterface AgentCardProps {\n  agent: Agent\n  onClick?: (agent: Agent) => void\n  showDetails?: boolean\n}\n\nconst AgentCard: React.FC<AgentCardProps> = ({ agent, onClick, showDetails = false }) => {\n  const getStatusColor = (status: string) => {\n    switch (status) {\n      case 'active': return 'bg-green-100 text-green-800'\n      case 'working': return 'bg-blue-100 text-blue-800'\n      case 'idle': return 'bg-yellow-100 text-yellow-800'\n      case 'offline': return 'bg-gray-100 text-gray-800'\n      case 'maintenance': return 'bg-purple-100 text-purple-800'\n      case 'overloaded': return 'bg-red-100 text-red-800'\n      default: return 'bg-gray-100 text-gray-800'\n    }\n  }\n\n  const getStatusIcon = (status: string) => {\n    switch (status) {\n      case 'active': return <CheckCircle className=\"w-4 h-4\" />\n      case 'working': return <Zap className=\"w-4 h-4\" />\n      case 'idle': return <Clock className=\"w-4 h-4\" />\n      case 'offline': return <Circle className=\"w-4 h-4\" />\n      case 'maintenance': return <AlertCircle className=\"w-4 h-4\" />\n      case 'overloaded': return <AlertCircle className=\"w-4 h-4\" />\n      default: return <Circle className=\"w-4 h-4\" />\n    }\n  }\n\n  const getPriorityColor = (priority: string) => {\n    switch (priority) {\n      case 'critical': return 'bg-red-500'\n      case 'high': return 'bg-orange-500'\n      case 'medium': return 'bg-yellow-500'\n      case 'low': return 'bg-green-500'\n      default: return 'bg-gray-500'\n    }\n  }\n\n  const activeAssignments = agent.currentAssignments.filter(a => a.status === 'in_progress')\n  const completionRate = agent.performanceMetrics.completionRate\n  const collaborationCount = agent.collaborationPatterns.length\n\n  return (\n    <div \n      className={`bg-white rounded-lg shadow-sm border border-gray-200 hover:shadow-md transition-shadow duration-200 ${\n        onClick ? 'cursor-pointer' : ''\n      }`}\n      onClick={() => onClick?.(agent)}\n    >\n      <div className=\"p-6\">\n        {/* Header */}\n        <div className=\"flex items-start justify-between mb-4\">\n          <div className=\"flex items-center space-x-3\">\n            <div className=\"flex-shrink-0\">\n              <div className=\"w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center\">\n                <User className=\"w-6 h-6 text-blue-600\" />\n              </div>\n            </div>\n            <div>\n              <h3 className=\"text-lg font-semibold text-gray-900\">{agent.name}</h3>\n              <p className=\"text-sm text-gray-500 capitalize\">{agent.role.type}</p>\n            </div>\n          </div>\n          \n          <div className=\"flex items-center space-x-2\">\n            <span className={`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${getStatusColor(agent.status)}`}>\n              {getStatusIcon(agent.status)}\n              <span className=\"ml-1 capitalize\">{agent.status}</span>\n            </span>\n          </div>\n        </div>\n\n        {/* Key Metrics */}\n        <div className=\"grid grid-cols-3 gap-4 mb-4\">\n          <div className=\"text-center\">\n            <div className=\"text-2xl font-bold text-gray-900\">{activeAssignments.length}</div>\n            <div className=\"text-xs text-gray-500\">Active Tasks</div>\n          </div>\n          <div className=\"text-center\">\n            <div className=\"text-2xl font-bold text-green-600\">{completionRate}%</div>\n            <div className=\"text-xs text-gray-500\">Completion Rate</div>\n          </div>\n          <div className=\"text-center\">\n            <div className=\"text-2xl font-bold text-blue-600\">{collaborationCount}</div>\n            <div className=\"text-xs text-gray-500\">Collaborations</div>\n          </div>\n        </div>\n\n        {/* Specializations */}\n        <div className=\"mb-4\">\n          <h4 className=\"text-sm font-medium text-gray-900 mb-2\">Specializations</h4>\n          <div className=\"flex flex-wrap gap-2\">\n            {agent.specializations.slice(0, 3).map((spec, index) => (\n              <span \n                key={index}\n                className=\"inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-gray-100 text-gray-800\"\n              >\n                {spec}\n              </span>\n            ))}\n            {agent.specializations.length > 3 && (\n              <span className=\"inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-gray-100 text-gray-800\">\n                +{agent.specializations.length - 3} more\n              </span>\n            )}\n          </div>\n        </div>\n\n        {/* Current Assignments Preview */}\n        {activeAssignments.length > 0 && (\n          <div className=\"mb-4\">\n            <h4 className=\"text-sm font-medium text-gray-900 mb-2\">Current Assignments</h4>\n            <div className=\"space-y-2\">\n              {activeAssignments.slice(0, 2).map((assignment, index) => (\n                <div key={index} className=\"flex items-center justify-between p-2 bg-gray-50 rounded-md\">\n                  <div className=\"flex items-center space-x-2\">\n                    <div className={`w-2 h-2 rounded-full ${getPriorityColor(assignment.priority)}`} />\n                    <span className=\"text-sm text-gray-900 truncate\">{assignment.ticketTitle}</span>\n                  </div>\n                  <span className=\"text-xs text-gray-500\">{assignment.progress}%</span>\n                </div>\n              ))}\n              {activeAssignments.length > 2 && (\n                <div className=\"text-xs text-gray-500 text-center\">\n                  +{activeAssignments.length - 2} more assignments\n                </div>\n              )}\n            </div>\n          </div>\n        )}\n\n        {/* Performance Indicators */}\n        <div className=\"grid grid-cols-2 gap-4 mb-4\">\n          <div className=\"flex items-center space-x-2\">\n            <TrendingUp className=\"w-4 h-4 text-green-600\" />\n            <div>\n              <div className=\"text-sm font-medium text-gray-900\">{agent.performanceMetrics.qualityScore}/10</div>\n              <div className=\"text-xs text-gray-500\">Quality Score</div>\n            </div>\n          </div>\n          <div className=\"flex items-center space-x-2\">\n            <Users className=\"w-4 h-4 text-blue-600\" />\n            <div>\n              <div className=\"text-sm font-medium text-gray-900\">{agent.performanceMetrics.collaborationScore}/10</div>\n              <div className=\"text-xs text-gray-500\">Collaboration</div>\n            </div>\n          </div>\n        </div>\n\n        {/* Availability */}\n        <div className=\"flex items-center justify-between\">\n          <div className=\"flex items-center space-x-2\">\n            <Activity className=\"w-4 h-4 text-gray-500\" />\n            <span className=\"text-sm text-gray-500\">\n              Last active {formatDistanceToNow(agent.lastActivity, { addSuffix: true })}\n            </span>\n          </div>\n          <div className=\"flex items-center space-x-2\">\n            <div className={`w-2 h-2 rounded-full ${agent.availability.isAvailable ? 'bg-green-500' : 'bg-red-500'}`} />\n            <span className=\"text-sm text-gray-500\">\n              {agent.availability.capacity}% capacity\n            </span>\n          </div>\n        </div>\n\n        {/* Detailed Information */}\n        {showDetails && (\n          <div className=\"mt-4 pt-4 border-t border-gray-200\">\n            <div className=\"grid grid-cols-2 gap-4\">\n              <div>\n                <h5 className=\"text-sm font-medium text-gray-900 mb-2\">Performance</h5>\n                <div className=\"space-y-1\">\n                  <div className=\"flex justify-between text-sm\">\n                    <span className=\"text-gray-500\">Avg Task Time</span>\n                    <span className=\"text-gray-900\">{agent.performanceMetrics.averageTaskTime}h</span>\n                  </div>\n                  <div className=\"flex justify-between text-sm\">\n                    <span className=\"text-gray-500\">Uptime</span>\n                    <span className=\"text-gray-900\">{agent.performanceMetrics.uptime}%</span>\n                  </div>\n                  <div className=\"flex justify-between text-sm\">\n                    <span className=\"text-gray-500\">Efficiency</span>\n                    <span className=\"text-gray-900\">{agent.performanceMetrics.efficiency}%</span>\n                  </div>\n                </div>\n              </div>\n              \n              <div>\n                <h5 className=\"text-sm font-medium text-gray-900 mb-2\">Task Distribution</h5>\n                <div className=\"space-y-1\">\n                  <div className=\"flex justify-between text-sm\">\n                    <span className=\"text-gray-500\">Completed</span>\n                    <span className=\"text-gray-900\">{agent.performanceMetrics.ticketsCompleted}</span>\n                  </div>\n                  <div className=\"flex justify-between text-sm\">\n                    <span className=\"text-gray-500\">In Progress</span>\n                    <span className=\"text-gray-900\">{agent.performanceMetrics.ticketsInProgress}</span>\n                  </div>\n                  <div className=\"flex justify-between text-sm\">\n                    <span className=\"text-gray-500\">Pending</span>\n                    <span className=\"text-gray-900\">{agent.performanceMetrics.ticketsPending}</span>\n                  </div>\n                </div>\n              </div>\n            </div>\n          </div>\n        )}\n      </div>\n    </div>\n  )\n}\n\nexport default AgentCard","import type React from \"react\"\nimport { useState } from \"react\"\nimport { Search, Filter, RefreshCw } from \"lucide-react\"\nimport AgentCard from \"./AgentCard\"\nimport type { Agent, AgentRoleType, AgentStatus } from \"../../types/agent\"\n\ninterface AgentGridProps {\n  agents: Agent[]\n  loading?: boolean\n  onAgentClick?: (agent: Agent) => void\n  onRefresh?: () => void\n}\n\nconst AgentGrid: React.FC<AgentGridProps> = ({ \n  agents, \n  loading = false, \n  onAgentClick, \n  onRefresh \n}) => {\n  const [searchTerm, setSearchTerm] = useState(\"\")\n  const [roleFilter, setRoleFilter] = useState<AgentRoleType | \"all\">(\"all\")\n  const [statusFilter, setStatusFilter] = useState<AgentStatus | \"all\">(\"all\")\n\n  const filteredAgents = agents.filter(agent => {\n    const matchesSearch = agent.name.toLowerCase().includes(searchTerm.toLowerCase()) ||\n                         agent.role.type.toLowerCase().includes(searchTerm.toLowerCase()) ||\n                         agent.specializations.some(spec => spec.toLowerCase().includes(searchTerm.toLowerCase()))\n    \n    const matchesRole = roleFilter === \"all\" || agent.role.type === roleFilter\n    const matchesStatus = statusFilter === \"all\" || agent.status === statusFilter\n\n    return matchesSearch && matchesRole && matchesStatus\n  })\n\n  const roleOptions: Array<{ value: AgentRoleType | \"all\"; label: string }> = [\n    { value: \"all\", label: \"All Roles\" },\n    { value: \"orchestrator\", label: \"Orchestrator\" },\n    { value: \"architect\", label: \"Architect\" },\n    { value: \"engineer\", label: \"Engineer\" },\n    { value: \"qa\", label: \"QA\" },\n    { value: \"security\", label: \"Security\" },\n    { value: \"devops\", label: \"DevOps\" },\n    { value: \"research\", label: \"Research\" },\n    { value: \"data\", label: \"Data\" },\n    { value: \"performance\", label: \"Performance\" },\n    { value: \"documentation\", label: \"Documentation\" },\n    { value: \"integration\", label: \"Integration\" },\n    { value: \"code-review\", label: \"Code Review\" }\n  ]\n\n  const statusOptions: Array<{ value: AgentStatus | \"all\"; label: string }> = [\n    { value: \"all\", label: \"All Statuses\" },\n    { value: \"active\", label: \"Active\" },\n    { value: \"working\", label: \"Working\" },\n    { value: \"idle\", label: \"Idle\" },\n    { value: \"offline\", label: \"Offline\" },\n    { value: \"maintenance\", label: \"Maintenance\" },\n    { value: \"overloaded\", label: \"Overloaded\" }\n  ]\n\n  if (loading) {\n    return (\n      <div className=\"space-y-4\">\n        <div className=\"flex items-center justify-center py-12\">\n          <RefreshCw className=\"w-8 h-8 text-blue-500 animate-spin\" />\n          <span className=\"ml-2 text-gray-600\">Loading agents...</span>\n        </div>\n      </div>\n    )\n  }\n\n  return (\n    <div className=\"space-y-4\">\n      {/* Header with Search and Filters */}\n      <div className=\"flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between\">\n        <div className=\"flex-1 relative\">\n          <Search className=\"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4\" />\n          <input\n            type=\"text\"\n            placeholder=\"Search agents by name, role, or specialization...\"\n            className=\"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500\"\n            value={searchTerm}\n            onChange={(e) => setSearchTerm(e.target.value)}\n          />\n        </div>\n        \n        <div className=\"flex items-center space-x-2\">\n          <div className=\"flex items-center space-x-2\">\n            <Filter className=\"w-4 h-4 text-gray-500\" />\n            <select\n              className=\"border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500\"\n              value={roleFilter}\n              onChange={(e) => setRoleFilter(e.target.value as AgentRoleType | \"all\")}\n            >\n              {roleOptions.map(option => (\n                <option key={option.value} value={option.value}>\n                  {option.label}\n                </option>\n              ))}\n            </select>\n            \n            <select\n              className=\"border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500\"\n              value={statusFilter}\n              onChange={(e) => setStatusFilter(e.target.value as AgentStatus | \"all\")}\n            >\n              {statusOptions.map(option => (\n                <option key={option.value} value={option.value}>\n                  {option.label}\n                </option>\n              ))}\n            </select>\n          </div>\n          \n          {onRefresh && (\n            <button\n              onClick={onRefresh}\n              className=\"flex items-center space-x-2 px-3 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors\"\n            >\n              <RefreshCw className=\"w-4 h-4\" />\n              <span>Refresh</span>\n            </button>\n          )}\n        </div>\n      </div>\n\n      {/* Agent Statistics */}\n      <div className=\"grid grid-cols-1 md:grid-cols-5 gap-4\">\n        <div className=\"bg-white p-4 rounded-lg shadow-sm border border-gray-200\">\n          <div className=\"text-2xl font-bold text-gray-900\">{agents.length}</div>\n          <div className=\"text-sm text-gray-500\">Total Agents</div>\n        </div>\n        <div className=\"bg-white p-4 rounded-lg shadow-sm border border-gray-200\">\n          <div className=\"text-2xl font-bold text-green-600\">\n            {agents.filter(a => a.status === 'active').length}\n          </div>\n          <div className=\"text-sm text-gray-500\">Active</div>\n        </div>\n        <div className=\"bg-white p-4 rounded-lg shadow-sm border border-gray-200\">\n          <div className=\"text-2xl font-bold text-blue-600\">\n            {agents.filter(a => a.status === 'working').length}\n          </div>\n          <div className=\"text-sm text-gray-500\">Working</div>\n        </div>\n        <div className=\"bg-white p-4 rounded-lg shadow-sm border border-gray-200\">\n          <div className=\"text-2xl font-bold text-yellow-600\">\n            {agents.filter(a => a.status === 'idle').length}\n          </div>\n          <div className=\"text-sm text-gray-500\">Idle</div>\n        </div>\n        <div className=\"bg-white p-4 rounded-lg shadow-sm border border-gray-200\">\n          <div className=\"text-2xl font-bold text-red-600\">\n            {agents.filter(a => a.status === 'offline').length}\n          </div>\n          <div className=\"text-sm text-gray-500\">Offline</div>\n        </div>\n      </div>\n\n      {/* Results Summary */}\n      <div className=\"flex items-center justify-between\">\n        <div className=\"text-sm text-gray-500\">\n          {filteredAgents.length === agents.length ? (\n            `Showing all ${agents.length} agents`\n          ) : (\n            `Showing ${filteredAgents.length} of ${agents.length} agents`\n          )}\n        </div>\n        \n        {(searchTerm || roleFilter !== \"all\" || statusFilter !== \"all\") && (\n          <button\n            onClick={() => {\n              setSearchTerm(\"\")\n              setRoleFilter(\"all\")\n              setStatusFilter(\"all\")\n            }}\n            className=\"text-sm text-blue-600 hover:text-blue-700 font-medium\"\n          >\n            Clear filters\n          </button>\n        )}\n      </div>\n\n      {/* Agent Cards Grid */}\n      {filteredAgents.length > 0 ? (\n        <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6\">\n          {filteredAgents.map((agent) => (\n            <AgentCard\n              key={agent.id}\n              agent={agent}\n              onClick={onAgentClick}\n            />\n          ))}\n        </div>\n      ) : (\n        <div className=\"text-center py-12\">\n          <div className=\"text-gray-500 mb-4\">\n            {searchTerm || roleFilter !== \"all\" || statusFilter !== \"all\" ? (\n              <>\n                <h3 className=\"text-lg font-medium text-gray-900 mb-2\">No agents found</h3>\n                <p>Try adjusting your search terms or filters</p>\n              </>\n            ) : (\n              <>\n                <h3 className=\"text-lg font-medium text-gray-900 mb-2\">No agents available</h3>\n                <p>Agent data is currently unavailable or loading</p>\n              </>\n            )}\n          </div>\n        </div>\n      )}\n    </div>\n  )\n}\n\nexport default AgentGrid","import type React from \"react\"\nimport { useState } from \"react\"\nimport { formatDistanceToNow } from \"date-fns\"\nimport { \n  Calendar, \n  Clock, \n  AlertCircle, \n  CheckCircle, \n  Circle, \n  Play, \n  Pause,\n  Filter,\n  ArrowRight\n} from \"lucide-react\"\nimport type { Assignment } from \"../../types/agent\"\n\ninterface AgentAssignmentsProps {\n  assignments: Assignment[]\n  agentId: string\n  onAssignmentClick?: (assignment: Assignment) => void\n}\n\nconst AgentAssignments: React.FC<AgentAssignmentsProps> = ({ \n  assignments, \n  onAssignmentClick \n}) => {\n  const [statusFilter, setStatusFilter] = useState<string>(\"all\")\n  const [priorityFilter, setPriorityFilter] = useState<string>(\"all\")\n\n  const getStatusIcon = (status: string) => {\n    switch (status) {\n      case 'pending': return <Circle className=\"w-4 h-4 text-gray-500\" />\n      case 'in_progress': return <Play className=\"w-4 h-4 text-blue-500\" />\n      case 'blocked': return <Pause className=\"w-4 h-4 text-red-500\" />\n      case 'completed': return <CheckCircle className=\"w-4 h-4 text-green-500\" />\n      default: return <Circle className=\"w-4 h-4 text-gray-500\" />\n    }\n  }\n\n  const getStatusColor = (status: string) => {\n    switch (status) {\n      case 'pending': return 'bg-gray-100 text-gray-800'\n      case 'in_progress': return 'bg-blue-100 text-blue-800'\n      case 'blocked': return 'bg-red-100 text-red-800'\n      case 'completed': return 'bg-green-100 text-green-800'\n      default: return 'bg-gray-100 text-gray-800'\n    }\n  }\n\n  const getPriorityColor = (priority: string) => {\n    switch (priority) {\n      case 'critical': return 'bg-red-500'\n      case 'high': return 'bg-orange-500'\n      case 'medium': return 'bg-yellow-500'\n      case 'low': return 'bg-green-500'\n      default: return 'bg-gray-500'\n    }\n  }\n\n  const getProgressBarColor = (progress: number) => {\n    if (progress >= 80) return 'bg-green-500'\n    if (progress >= 60) return 'bg-blue-500'\n    if (progress >= 40) return 'bg-yellow-500'\n    return 'bg-red-500'\n  }\n\n  const filteredAssignments = assignments.filter(assignment => {\n    const matchesStatus = statusFilter === \"all\" || assignment.status === statusFilter\n    const matchesPriority = priorityFilter === \"all\" || assignment.priority === priorityFilter\n    return matchesStatus && matchesPriority\n  })\n\n  const sortedAssignments = filteredAssignments.sort((a, b) => {\n    // Sort by priority first, then by status\n    const priorityOrder = { critical: 0, high: 1, medium: 2, low: 3 }\n    const statusOrder = { in_progress: 0, pending: 1, blocked: 2, completed: 3 }\n    \n    const priorityDiff = priorityOrder[a.priority] - priorityOrder[b.priority]\n    if (priorityDiff !== 0) return priorityDiff\n    \n    return statusOrder[a.status] - statusOrder[b.status]\n  })\n\n  const statusOptions = [\n    { value: \"all\", label: \"All Statuses\" },\n    { value: \"pending\", label: \"Pending\" },\n    { value: \"in_progress\", label: \"In Progress\" },\n    { value: \"blocked\", label: \"Blocked\" },\n    { value: \"completed\", label: \"Completed\" }\n  ]\n\n  const priorityOptions = [\n    { value: \"all\", label: \"All Priorities\" },\n    { value: \"critical\", label: \"Critical\" },\n    { value: \"high\", label: \"High\" },\n    { value: \"medium\", label: \"Medium\" },\n    { value: \"low\", label: \"Low\" }\n  ]\n\n  return (\n    <div className=\"space-y-4\">\n      {/* Header with Filters */}\n      <div className=\"flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between\">\n        <div>\n          <h3 className=\"text-lg font-semibold text-gray-900\">Current Assignments</h3>\n          <p className=\"text-sm text-gray-500\">\n            {filteredAssignments.length === assignments.length ? (\n              `${assignments.length} total assignments`\n            ) : (\n              `${filteredAssignments.length} of ${assignments.length} assignments`\n            )}\n          </p>\n        </div>\n        \n        <div className=\"flex items-center space-x-2\">\n          <Filter className=\"w-4 h-4 text-gray-500\" />\n          <select\n            className=\"border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500\"\n            value={statusFilter}\n            onChange={(e) => setStatusFilter(e.target.value)}\n          >\n            {statusOptions.map(option => (\n              <option key={option.value} value={option.value}>\n                {option.label}\n              </option>\n            ))}\n          </select>\n          \n          <select\n            className=\"border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500\"\n            value={priorityFilter}\n            onChange={(e) => setPriorityFilter(e.target.value)}\n          >\n            {priorityOptions.map(option => (\n              <option key={option.value} value={option.value}>\n                {option.label}\n              </option>\n            ))}\n          </select>\n        </div>\n      </div>\n\n      {/* Assignment Summary */}\n      <div className=\"grid grid-cols-1 md:grid-cols-4 gap-4\">\n        <div className=\"bg-white p-4 rounded-lg shadow-sm border border-gray-200\">\n          <div className=\"flex items-center justify-between\">\n            <div>\n              <div className=\"text-2xl font-bold text-blue-600\">\n                {assignments.filter(a => a.status === 'in_progress').length}\n              </div>\n              <div className=\"text-sm text-gray-500\">In Progress</div>\n            </div>\n            <Play className=\"w-8 h-8 text-blue-500 opacity-50\" />\n          </div>\n        </div>\n        \n        <div className=\"bg-white p-4 rounded-lg shadow-sm border border-gray-200\">\n          <div className=\"flex items-center justify-between\">\n            <div>\n              <div className=\"text-2xl font-bold text-gray-600\">\n                {assignments.filter(a => a.status === 'pending').length}\n              </div>\n              <div className=\"text-sm text-gray-500\">Pending</div>\n            </div>\n            <Circle className=\"w-8 h-8 text-gray-500 opacity-50\" />\n          </div>\n        </div>\n        \n        <div className=\"bg-white p-4 rounded-lg shadow-sm border border-gray-200\">\n          <div className=\"flex items-center justify-between\">\n            <div>\n              <div className=\"text-2xl font-bold text-red-600\">\n                {assignments.filter(a => a.status === 'blocked').length}\n              </div>\n              <div className=\"text-sm text-gray-500\">Blocked</div>\n            </div>\n            <AlertCircle className=\"w-8 h-8 text-red-500 opacity-50\" />\n          </div>\n        </div>\n        \n        <div className=\"bg-white p-4 rounded-lg shadow-sm border border-gray-200\">\n          <div className=\"flex items-center justify-between\">\n            <div>\n              <div className=\"text-2xl font-bold text-green-600\">\n                {assignments.filter(a => a.status === 'completed').length}\n              </div>\n              <div className=\"text-sm text-gray-500\">Completed</div>\n            </div>\n            <CheckCircle className=\"w-8 h-8 text-green-500 opacity-50\" />\n          </div>\n        </div>\n      </div>\n\n      {/* Assignment Cards */}\n      {sortedAssignments.length > 0 ? (\n        <div className=\"space-y-4\">\n          {sortedAssignments.map((assignment) => (\n            <div\n              key={assignment.id}\n              className={`bg-white rounded-lg shadow-sm border border-gray-200 hover:shadow-md transition-shadow duration-200 ${\n                onAssignmentClick ? 'cursor-pointer' : ''\n              }`}\n              onClick={() => onAssignmentClick?.(assignment)}\n            >\n              <div className=\"p-6\">\n                <div className=\"flex items-start justify-between mb-4\">\n                  <div className=\"flex-1\">\n                    <div className=\"flex items-center space-x-2 mb-2\">\n                      <div className={`w-3 h-3 rounded-full ${getPriorityColor(assignment.priority)}`} />\n                      <span className=\"text-sm font-medium text-gray-500 uppercase\">\n                        {assignment.ticketType}\n                      </span>\n                      <span className=\"text-sm text-gray-400\">•</span>\n                      <span className=\"text-sm font-medium text-gray-900\">\n                        {assignment.ticketId}\n                      </span>\n                    </div>\n                    <h4 className=\"text-lg font-semibold text-gray-900 mb-1\">\n                      {assignment.ticketTitle}\n                    </h4>\n                    <div className=\"flex items-center space-x-4 text-sm text-gray-500\">\n                      <div className=\"flex items-center space-x-1\">\n                        <Calendar className=\"w-4 h-4\" />\n                        <span>Started {formatDistanceToNow(assignment.startDate, { addSuffix: true })}</span>\n                      </div>\n                      {assignment.estimatedCompletion && (\n                        <div className=\"flex items-center space-x-1\">\n                          <Clock className=\"w-4 h-4\" />\n                          <span>\n                            Due {formatDistanceToNow(assignment.estimatedCompletion, { addSuffix: true })}\n                          </span>\n                        </div>\n                      )}\n                    </div>\n                  </div>\n                  \n                  <div className=\"flex items-center space-x-2\">\n                    <span className={`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${getStatusColor(assignment.status)}`}>\n                      {getStatusIcon(assignment.status)}\n                      <span className=\"ml-1 capitalize\">{assignment.status.replace('_', ' ')}</span>\n                    </span>\n                  </div>\n                </div>\n\n                {/* Progress Bar */}\n                <div className=\"mb-4\">\n                  <div className=\"flex items-center justify-between mb-2\">\n                    <span className=\"text-sm font-medium text-gray-900\">Progress</span>\n                    <span className=\"text-sm text-gray-500\">{assignment.progress}%</span>\n                  </div>\n                  <div className=\"w-full bg-gray-200 rounded-full h-2\">\n                    <div\n                      className={`h-2 rounded-full transition-all duration-300 ${getProgressBarColor(assignment.progress)}`}\n                      style={{ width: `${assignment.progress}%` }}\n                    />\n                  </div>\n                </div>\n\n                {/* Time Tracking */}\n                <div className=\"flex items-center justify-between mb-4\">\n                  <div className=\"flex items-center space-x-4\">\n                    <div className=\"flex items-center space-x-1\">\n                      <Clock className=\"w-4 h-4 text-gray-500\" />\n                      <span className=\"text-sm text-gray-500\">\n                        {Math.floor(assignment.timeSpent / 60)}h {assignment.timeSpent % 60}m logged\n                      </span>\n                    </div>\n                    <div className=\"text-sm text-gray-500 capitalize\">\n                      Priority: {assignment.priority}\n                    </div>\n                  </div>\n                  \n                  {onAssignmentClick && (\n                    <div className=\"flex items-center space-x-1 text-blue-600\">\n                      <span className=\"text-sm font-medium\">View Details</span>\n                      <ArrowRight className=\"w-4 h-4\" />\n                    </div>\n                  )}\n                </div>\n\n                {/* Blockers */}\n                {assignment.blockers && assignment.blockers.length > 0 && (\n                  <div className=\"mt-4 p-3 bg-red-50 rounded-lg\">\n                    <div className=\"flex items-center space-x-2 mb-2\">\n                      <AlertCircle className=\"w-4 h-4 text-red-500\" />\n                      <span className=\"text-sm font-medium text-red-800\">Blockers</span>\n                    </div>\n                    <ul className=\"space-y-1\">\n                      {assignment.blockers.map((blocker, index) => (\n                        <li key={index} className=\"text-sm text-red-700\">\n                          • {blocker}\n                        </li>\n                      ))}\n                    </ul>\n                  </div>\n                )}\n              </div>\n            </div>\n          ))}\n        </div>\n      ) : (\n        <div className=\"text-center py-12\">\n          <div className=\"text-gray-500 mb-4\">\n            <h3 className=\"text-lg font-medium text-gray-900 mb-2\">No assignments found</h3>\n            <p>\n              {statusFilter !== \"all\" || priorityFilter !== \"all\" \n                ? \"Try adjusting your filters to see more assignments\"\n                : \"This agent has no current assignments\"\n              }\n            </p>\n          </div>\n        </div>\n      )}\n    </div>\n  )\n}\n\nexport default AgentAssignments","import type React from \"react\"\nimport { useState, useEffect } from \"react\"\nimport { \n  Users, \n  TrendingUp, \n  Clock, \n  RefreshCw,\n  AlertTriangle,\n  CheckCircle,\n  Zap\n} from \"lucide-react\"\nimport { formatDistanceToNow } from \"date-fns\"\nimport AgentGrid from \"./AgentGrid\"\nimport AgentAssignments from \"./AgentAssignments\"\nimport { agentService } from \"../../services/agentService\"\nimport type { Agent, AgentRegistry } from \"../../types/agent\"\n\ninterface AgentInfoProps {\n  projectPath?: string\n  showAllAgents?: boolean\n  onAgentSelect?: (agent: Agent) => void\n}\n\nconst AgentInfo: React.FC<AgentInfoProps> = ({ \n  projectPath, \n  showAllAgents = false, \n  onAgentSelect \n}) => {\n  const [agentRegistry, setAgentRegistry] = useState<AgentRegistry | null>(null)\n  const [loading, setLoading] = useState(true)\n  const [error, setError] = useState<string | null>(null)\n  const [selectedAgent, setSelectedAgent] = useState<Agent | null>(null)\n  const [activeTab, setActiveTab] = useState<'overview' | 'assignments'>('overview')\n\n  useEffect(() => {\n    loadAgentData()\n  }, [projectPath])\n\n  const loadAgentData = async () => {\n    try {\n      setLoading(true)\n      setError(null)\n      \n      const registry = await agentService.getAgentRegistry(projectPath)\n      setAgentRegistry(registry)\n    } catch (err) {\n      setError('Failed to load agent data')\n      console.error('Error loading agent data:', err)\n    } finally {\n      setLoading(false)\n    }\n  }\n\n  const handleAgentClick = (agent: Agent) => {\n    setSelectedAgent(agent)\n    setActiveTab('overview')\n    onAgentSelect?.(agent)\n  }\n\n  const handleRefresh = () => {\n    agentService.refreshAgentRegistry(projectPath)\n    loadAgentData()\n  }\n\n  const getProjectAgents = () => {\n    if (!agentRegistry) return []\n    \n    if (showAllAgents) {\n      return agentRegistry.agents\n    }\n    \n    // Filter to show only agents relevant to this project\n    return agentRegistry.agents.filter(agent => \n      agent.status === 'active' || \n      agent.status === 'working' || \n      agent.currentAssignments.length > 0\n    )\n  }\n\n  const calculateOverallMetrics = () => {\n    if (!agentRegistry) return null\n    \n    const agents = getProjectAgents()\n    if (agents.length === 0) return null\n    \n    const totalTasks = agents.reduce((sum, agent) => \n      sum + agent.currentAssignments.length, 0\n    )\n    \n    const activeTasks = agents.reduce((sum, agent) => \n      sum + agent.currentAssignments.filter(a => a.status === 'in_progress').length, 0\n    )\n    \n    const avgCompletionRate = agents.reduce((sum, agent) => \n      sum + agent.performanceMetrics.completionRate, 0\n    ) / agents.length\n    \n    const avgQualityScore = agents.reduce((sum, agent) => \n      sum + agent.performanceMetrics.qualityScore, 0\n    ) / agents.length\n    \n    return {\n      totalTasks,\n      activeTasks,\n      avgCompletionRate: Math.round(avgCompletionRate),\n      avgQualityScore: Math.round(avgQualityScore * 10) / 10\n    }\n  }\n\n  const agents = getProjectAgents()\n  const metrics = calculateOverallMetrics()\n\n  if (loading) {\n    return (\n      <div className=\"space-y-6\">\n        <div className=\"flex items-center justify-center py-12\">\n          <RefreshCw className=\"w-8 h-8 text-blue-500 animate-spin\" />\n          <span className=\"ml-2 text-gray-600\">Loading agent information...</span>\n        </div>\n      </div>\n    )\n  }\n\n  if (error) {\n    return (\n      <div className=\"space-y-6\">\n        <div className=\"bg-red-50 border border-red-200 rounded-lg p-4\">\n          <div className=\"flex items-center space-x-2\">\n            <AlertTriangle className=\"w-5 h-5 text-red-500\" />\n            <span className=\"text-red-800 font-medium\">Error loading agent data</span>\n          </div>\n          <p className=\"text-red-700 mt-1\">{error}</p>\n          <button\n            onClick={handleRefresh}\n            className=\"mt-3 flex items-center space-x-2 px-3 py-1 bg-red-100 text-red-800 rounded-md hover:bg-red-200 transition-colors\"\n          >\n            <RefreshCw className=\"w-4 h-4\" />\n            <span>Retry</span>\n          </button>\n        </div>\n      </div>\n    )\n  }\n\n  return (\n    <div className=\"space-y-6\">\n      {/* Header */}\n      <div className=\"flex items-center justify-between\">\n        <div>\n          <h2 className=\"text-2xl font-bold text-gray-900\">Agent Information</h2>\n          <p className=\"text-gray-600 mt-1\">\n            {showAllAgents ? 'All agents in the Claude PM Framework' : 'Agents working on this project'}\n          </p>\n        </div>\n        <div className=\"flex items-center space-x-2 text-sm text-gray-500\">\n          <Clock className=\"w-4 h-4\" />\n          <span>\n            Last updated {agentRegistry ? formatDistanceToNow(agentRegistry.lastUpdated, { addSuffix: true }) : 'never'}\n          </span>\n        </div>\n      </div>\n\n      {/* Agent Overview Metrics */}\n      {metrics && (\n        <div className=\"grid grid-cols-1 md:grid-cols-4 gap-4\">\n          <div className=\"bg-white p-6 rounded-lg shadow-sm border border-gray-200\">\n            <div className=\"flex items-center justify-between\">\n              <div>\n                <div className=\"text-3xl font-bold text-blue-600\">{agents.length}</div>\n                <div className=\"text-sm text-gray-500\">Active Agents</div>\n              </div>\n              <Users className=\"w-8 h-8 text-blue-500 opacity-50\" />\n            </div>\n          </div>\n          \n          <div className=\"bg-white p-6 rounded-lg shadow-sm border border-gray-200\">\n            <div className=\"flex items-center justify-between\">\n              <div>\n                <div className=\"text-3xl font-bold text-green-600\">{metrics.activeTasks}</div>\n                <div className=\"text-sm text-gray-500\">Active Tasks</div>\n              </div>\n              <Zap className=\"w-8 h-8 text-green-500 opacity-50\" />\n            </div>\n          </div>\n          \n          <div className=\"bg-white p-6 rounded-lg shadow-sm border border-gray-200\">\n            <div className=\"flex items-center justify-between\">\n              <div>\n                <div className=\"text-3xl font-bold text-yellow-600\">{metrics.avgCompletionRate}%</div>\n                <div className=\"text-sm text-gray-500\">Avg Completion Rate</div>\n              </div>\n              <TrendingUp className=\"w-8 h-8 text-yellow-500 opacity-50\" />\n            </div>\n          </div>\n          \n          <div className=\"bg-white p-6 rounded-lg shadow-sm border border-gray-200\">\n            <div className=\"flex items-center justify-between\">\n              <div>\n                <div className=\"text-3xl font-bold text-purple-600\">{metrics.avgQualityScore}</div>\n                <div className=\"text-sm text-gray-500\">Avg Quality Score</div>\n              </div>\n              <CheckCircle className=\"w-8 h-8 text-purple-500 opacity-50\" />\n            </div>\n          </div>\n        </div>\n      )}\n\n      {/* Agent Status Summary */}\n      {agentRegistry && (\n        <div className=\"bg-white p-6 rounded-lg shadow-sm border border-gray-200\">\n          <h3 className=\"text-lg font-semibold text-gray-900 mb-4\">Agent Status Summary</h3>\n          <div className=\"grid grid-cols-2 md:grid-cols-6 gap-4\">\n            <div className=\"text-center\">\n              <div className=\"text-2xl font-bold text-green-600\">{agentRegistry.activeAgents}</div>\n              <div className=\"text-sm text-gray-500\">Active</div>\n            </div>\n            <div className=\"text-center\">\n              <div className=\"text-2xl font-bold text-blue-600\">{agentRegistry.workingAgents}</div>\n              <div className=\"text-sm text-gray-500\">Working</div>\n            </div>\n            <div className=\"text-center\">\n              <div className=\"text-2xl font-bold text-yellow-600\">{agentRegistry.idleAgents}</div>\n              <div className=\"text-sm text-gray-500\">Idle</div>\n            </div>\n            <div className=\"text-center\">\n              <div className=\"text-2xl font-bold text-gray-600\">{agentRegistry.offlineAgents}</div>\n              <div className=\"text-sm text-gray-500\">Offline</div>\n            </div>\n            <div className=\"text-center\">\n              <div className=\"text-2xl font-bold text-purple-600\">\n                {agentRegistry.agents.filter(a => a.status === 'maintenance').length}\n              </div>\n              <div className=\"text-sm text-gray-500\">Maintenance</div>\n            </div>\n            <div className=\"text-center\">\n              <div className=\"text-2xl font-bold text-red-600\">\n                {agentRegistry.agents.filter(a => a.status === 'overloaded').length}\n              </div>\n              <div className=\"text-sm text-gray-500\">Overloaded</div>\n            </div>\n          </div>\n        </div>\n      )}\n\n      {/* Agent Grid or Selected Agent Details */}\n      {selectedAgent ? (\n        <div className=\"space-y-6\">\n          {/* Agent Detail Header */}\n          <div className=\"bg-white p-6 rounded-lg shadow-sm border border-gray-200\">\n            <div className=\"flex items-center justify-between mb-4\">\n              <button\n                onClick={() => setSelectedAgent(null)}\n                className=\"text-blue-600 hover:text-blue-700 font-medium\"\n              >\n                ← Back to Agent List\n              </button>\n              <button\n                onClick={handleRefresh}\n                className=\"flex items-center space-x-2 px-3 py-1 bg-gray-100 text-gray-700 rounded-md hover:bg-gray-200 transition-colors\"\n              >\n                <RefreshCw className=\"w-4 h-4\" />\n                <span>Refresh</span>\n              </button>\n            </div>\n            \n            <div className=\"flex items-center space-x-4\">\n              <div className=\"w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center\">\n                <Users className=\"w-8 h-8 text-blue-600\" />\n              </div>\n              <div>\n                <h3 className=\"text-xl font-semibold text-gray-900\">{selectedAgent.name}</h3>\n                <p className=\"text-gray-600 capitalize\">{selectedAgent.role.type}</p>\n                <p className=\"text-sm text-gray-500\">{selectedAgent.role.description}</p>\n              </div>\n            </div>\n          </div>\n\n          {/* Agent Detail Tabs */}\n          <div className=\"bg-white rounded-lg shadow-sm border border-gray-200\">\n            <div className=\"border-b border-gray-200\">\n              <nav className=\"flex space-x-8 px-6\">\n                <button\n                  onClick={() => setActiveTab('overview')}\n                  className={`py-4 px-1 border-b-2 font-medium text-sm ${\n                    activeTab === 'overview'\n                      ? 'border-blue-500 text-blue-600'\n                      : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'\n                  }`}\n                >\n                  Overview\n                </button>\n                <button\n                  onClick={() => setActiveTab('assignments')}\n                  className={`py-4 px-1 border-b-2 font-medium text-sm ${\n                    activeTab === 'assignments'\n                      ? 'border-blue-500 text-blue-600'\n                      : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'\n                  }`}\n                >\n                  Assignments ({selectedAgent.currentAssignments.length})\n                </button>\n              </nav>\n            </div>\n\n            <div className=\"p-6\">\n              {activeTab === 'overview' ? (\n                <div className=\"space-y-6\">\n                  {/* Agent Performance Metrics */}\n                  <div className=\"grid grid-cols-1 md:grid-cols-3 gap-4\">\n                    <div className=\"bg-gray-50 p-4 rounded-lg\">\n                      <div className=\"text-2xl font-bold text-green-600\">\n                        {selectedAgent.performanceMetrics.completionRate}%\n                      </div>\n                      <div className=\"text-sm text-gray-500\">Completion Rate</div>\n                    </div>\n                    <div className=\"bg-gray-50 p-4 rounded-lg\">\n                      <div className=\"text-2xl font-bold text-blue-600\">\n                        {selectedAgent.performanceMetrics.qualityScore}/10\n                      </div>\n                      <div className=\"text-sm text-gray-500\">Quality Score</div>\n                    </div>\n                    <div className=\"bg-gray-50 p-4 rounded-lg\">\n                      <div className=\"text-2xl font-bold text-purple-600\">\n                        {selectedAgent.performanceMetrics.averageTaskTime}h\n                      </div>\n                      <div className=\"text-sm text-gray-500\">Avg Task Time</div>\n                    </div>\n                  </div>\n\n                  {/* Specializations */}\n                  <div>\n                    <h4 className=\"text-lg font-semibold text-gray-900 mb-3\">Specializations</h4>\n                    <div className=\"flex flex-wrap gap-2\">\n                      {selectedAgent.specializations.map((spec, index) => (\n                        <span \n                          key={index}\n                          className=\"inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-blue-100 text-blue-800\"\n                        >\n                          {spec}\n                        </span>\n                      ))}\n                    </div>\n                  </div>\n\n                  {/* Collaboration Patterns */}\n                  {selectedAgent.collaborationPatterns.length > 0 && (\n                    <div>\n                      <h4 className=\"text-lg font-semibold text-gray-900 mb-3\">Recent Collaborations</h4>\n                      <div className=\"space-y-2\">\n                        {selectedAgent.collaborationPatterns.slice(0, 3).map((collab, index) => (\n                          <div key={index} className=\"flex items-center justify-between p-3 bg-gray-50 rounded-lg\">\n                            <div className=\"flex items-center space-x-3\">\n                              <div className=\"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center\">\n                                <Users className=\"w-4 h-4 text-gray-600\" />\n                              </div>\n                              <div>\n                                <div className=\"font-medium text-gray-900\">{collab.agentName}</div>\n                                <div className=\"text-sm text-gray-500 capitalize\">{collab.collaborationType}</div>\n                              </div>\n                            </div>\n                            <div className=\"text-right\">\n                              <div className=\"text-sm font-medium text-gray-900\">{collab.successRate}%</div>\n                              <div className=\"text-xs text-gray-500\">Success Rate</div>\n                            </div>\n                          </div>\n                        ))}\n                      </div>\n                    </div>\n                  )}\n                </div>\n              ) : (\n                <AgentAssignments \n                  assignments={selectedAgent.currentAssignments}\n                  agentId={selectedAgent.id}\n                />\n              )}\n            </div>\n          </div>\n        </div>\n      ) : (\n        <AgentGrid\n          agents={agents}\n          loading={false}\n          onAgentClick={handleAgentClick}\n          onRefresh={handleRefresh}\n        />\n      )}\n    </div>\n  )\n}\n\nexport default AgentInfo","import type React from \"react\"\nimport { useParams } from \"react-router-dom\"\nimport { useState, useEffect } from \"react\"\nimport { \n  FolderOpen, \n  Activity, \n  Clock, \n  TrendingUp, \n  CheckCircle, \n  AlertCircle,\n  RefreshCw,\n  BarChart3,\n  GitBranch,\n  Bug,\n  Target\n} from \"lucide-react\"\nimport { formatDistanceToNow } from \"date-fns\"\nimport AgentInfo from \"./AgentInfo/AgentInfo\"\nimport { claudePmService } from \"../services/claudePmService\"\nimport type { ProjectData, TicketData } from \"../services/claudePmService\"\nimport type { Agent } from \"../types/agent\"\n\nconst ProjectDetail: React.FC = () => {\n  const { projectId } = useParams<{ projectId: string }>()\n  const [project, setProject] = useState<ProjectData | null>(null)\n  const [tickets, setTickets] = useState<TicketData[]>([])\n  const [loading, setLoading] = useState(true)\n  const [error, setError] = useState<string | null>(null)\n  const [activeTab, setActiveTab] = useState<'overview' | 'tickets' | 'agents' | 'activity'>('overview')\n  const [, setSelectedAgent] = useState<Agent | null>(null)\n\n  useEffect(() => {\n    if (projectId) {\n      loadProjectData()\n    }\n  }, [projectId])\n\n  const loadProjectData = async () => {\n    try {\n      setLoading(true)\n      setError(null)\n      \n      // Get project data from Claude PM service\n      const projects = await claudePmService.getProjects()\n      const foundProject = projects.find(p => p.id === projectId)\n      \n      if (foundProject) {\n        setProject(foundProject)\n        setTickets(foundProject.tickets || [])\n      } else {\n        setError('Project not found')\n      }\n    } catch (err) {\n      setError('Failed to load project data')\n      console.error('Error loading project data:', err)\n    } finally {\n      setLoading(false)\n    }\n  }\n\n  const getTicketsByStatus = (status: string) => {\n    return tickets.filter(ticket => ticket.status === status)\n  }\n\n  const getTicketsByType = (type: string) => {\n    return tickets.filter(ticket => ticket.type === type)\n  }\n\n  const getTicketsByPriority = (priority: string) => {\n    return tickets.filter(ticket => ticket.priority === priority)\n  }\n\n  const calculateProjectHealth = () => {\n    if (tickets.length === 0) return 0\n    \n    const completedTickets = getTicketsByStatus('completed').length\n    const totalTickets = tickets.length\n    const blockedTickets = getTicketsByStatus('blocked').length\n    const criticalTickets = getTicketsByPriority('critical').length\n    \n    // Calculate health based on completion rate and risk factors\n    const completionRate = (completedTickets / totalTickets) * 100\n    const blockedPenalty = (blockedTickets / totalTickets) * 20\n    const criticalPenalty = (criticalTickets / totalTickets) * 15\n    \n    return Math.max(0, Math.min(100, completionRate - blockedPenalty - criticalPenalty))\n  }\n\n  const handleAgentSelect = (agent: Agent) => {\n    setSelectedAgent(agent)\n  }\n\n  const handleRefresh = () => {\n    loadProjectData()\n  }\n\n  if (loading) {\n    return (\n      <div className=\"flex items-center justify-center py-12\">\n        <RefreshCw className=\"w-8 h-8 text-blue-500 animate-spin\" />\n        <span className=\"ml-2 text-gray-600\">Loading project details...</span>\n      </div>\n    )\n  }\n\n  if (error || !project) {\n    return (\n      <div className=\"space-y-6\">\n        <div className=\"bg-red-50 border border-red-200 rounded-lg p-4\">\n          <div className=\"flex items-center space-x-2\">\n            <AlertCircle className=\"w-5 h-5 text-red-500\" />\n            <span className=\"text-red-800 font-medium\">{error || 'Project not found'}</span>\n          </div>\n          <button\n            onClick={handleRefresh}\n            className=\"mt-3 flex items-center space-x-2 px-3 py-1 bg-red-100 text-red-800 rounded-md hover:bg-red-200 transition-colors\"\n          >\n            <RefreshCw className=\"w-4 h-4\" />\n            <span>Retry</span>\n          </button>\n        </div>\n      </div>\n    )\n  }\n\n  const projectHealth = calculateProjectHealth()\n  const completedTickets = getTicketsByStatus('completed').length\n  const activeTickets = getTicketsByStatus('in_progress').length + getTicketsByStatus('pending').length\n  const blockedTickets = getTicketsByStatus('blocked').length\n\n  return (\n    <div className=\"space-y-6\">\n      {/* Project Header */}\n      <div className=\"bg-white shadow-sm rounded-lg\">\n        <div className=\"px-6 py-4\">\n          <div className=\"flex items-center justify-between\">\n            <div className=\"flex items-center space-x-4\">\n              <div className=\"w-12 h-12 bg-blue-100 rounded-lg flex items-center justify-center\">\n                <FolderOpen className=\"w-6 h-6 text-blue-600\" />\n              </div>\n              <div>\n                <h1 className=\"text-3xl font-bold text-gray-900\">{project.name}</h1>\n                <p className=\"text-gray-600 mt-1\">{project.path}</p>\n              </div>\n            </div>\n            \n            <div className=\"flex items-center space-x-4\">\n              <div className=\"text-right\">\n                <div className={`text-sm font-medium ${\n                  project.status === 'active' ? 'text-green-600' :\n                  project.status === 'inactive' ? 'text-yellow-600' :\n                  'text-gray-600'\n                }`}>\n                  {project.status.charAt(0).toUpperCase() + project.status.slice(1)}\n                </div>\n                <div className=\"text-xs text-gray-500\">\n                  {project.lastActivity && formatDistanceToNow(project.lastActivity, { addSuffix: true })}\n                </div>\n              </div>\n              \n              <button\n                onClick={handleRefresh}\n                className=\"flex items-center space-x-2 px-3 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors\"\n              >\n                <RefreshCw className=\"w-4 h-4\" />\n                <span>Refresh</span>\n              </button>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      {/* Project Metrics */}\n      <div className=\"grid grid-cols-1 md:grid-cols-5 gap-4\">\n        <div className=\"bg-white p-6 rounded-lg shadow-sm border border-gray-200\">\n          <div className=\"flex items-center justify-between\">\n            <div>\n              <div className=\"text-3xl font-bold text-gray-900\">{tickets.length}</div>\n              <div className=\"text-sm text-gray-500\">Total Tickets</div>\n            </div>\n            <Target className=\"w-8 h-8 text-gray-500 opacity-50\" />\n          </div>\n        </div>\n        \n        <div className=\"bg-white p-6 rounded-lg shadow-sm border border-gray-200\">\n          <div className=\"flex items-center justify-between\">\n            <div>\n              <div className=\"text-3xl font-bold text-blue-600\">{activeTickets}</div>\n              <div className=\"text-sm text-gray-500\">Active</div>\n            </div>\n            <Activity className=\"w-8 h-8 text-blue-500 opacity-50\" />\n          </div>\n        </div>\n        \n        <div className=\"bg-white p-6 rounded-lg shadow-sm border border-gray-200\">\n          <div className=\"flex items-center justify-between\">\n            <div>\n              <div className=\"text-3xl font-bold text-green-600\">{completedTickets}</div>\n              <div className=\"text-sm text-gray-500\">Completed</div>\n            </div>\n            <CheckCircle className=\"w-8 h-8 text-green-500 opacity-50\" />\n          </div>\n        </div>\n        \n        <div className=\"bg-white p-6 rounded-lg shadow-sm border border-gray-200\">\n          <div className=\"flex items-center justify-between\">\n            <div>\n              <div className=\"text-3xl font-bold text-red-600\">{blockedTickets}</div>\n              <div className=\"text-sm text-gray-500\">Blocked</div>\n            </div>\n            <Bug className=\"w-8 h-8 text-red-500 opacity-50\" />\n          </div>\n        </div>\n        \n        <div className=\"bg-white p-6 rounded-lg shadow-sm border border-gray-200\">\n          <div className=\"flex items-center justify-between\">\n            <div>\n              <div className={`text-3xl font-bold ${\n                projectHealth >= 80 ? 'text-green-600' :\n                projectHealth >= 60 ? 'text-yellow-600' :\n                'text-red-600'\n              }`}>\n                {Math.round(projectHealth)}%\n              </div>\n              <div className=\"text-sm text-gray-500\">Health Score</div>\n            </div>\n            <TrendingUp className={`w-8 h-8 opacity-50 ${\n              projectHealth >= 80 ? 'text-green-500' :\n              projectHealth >= 60 ? 'text-yellow-500' :\n              'text-red-500'\n            }`} />\n          </div>\n        </div>\n      </div>\n\n      {/* Navigation Tabs */}\n      <div className=\"bg-white rounded-lg shadow-sm border border-gray-200\">\n        <div className=\"border-b border-gray-200\">\n          <nav className=\"flex space-x-8 px-6\">\n            <button\n              onClick={() => setActiveTab('overview')}\n              className={`py-4 px-1 border-b-2 font-medium text-sm ${\n                activeTab === 'overview'\n                  ? 'border-blue-500 text-blue-600'\n                  : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'\n              }`}\n            >\n              Overview\n            </button>\n            <button\n              onClick={() => setActiveTab('tickets')}\n              className={`py-4 px-1 border-b-2 font-medium text-sm ${\n                activeTab === 'tickets'\n                  ? 'border-blue-500 text-blue-600'\n                  : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'\n              }`}\n            >\n              Tickets ({tickets.length})\n            </button>\n            <button\n              onClick={() => setActiveTab('agents')}\n              className={`py-4 px-1 border-b-2 font-medium text-sm ${\n                activeTab === 'agents'\n                  ? 'border-blue-500 text-blue-600'\n                  : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'\n              }`}\n            >\n              Agents\n            </button>\n            <button\n              onClick={() => setActiveTab('activity')}\n              className={`py-4 px-1 border-b-2 font-medium text-sm ${\n                activeTab === 'activity'\n                  ? 'border-blue-500 text-blue-600'\n                  : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'\n              }`}\n            >\n              Activity\n            </button>\n          </nav>\n        </div>\n\n        <div className=\"p-6\">\n          {activeTab === 'overview' && (\n            <div className=\"space-y-6\">\n              {/* Project Overview */}\n              <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6\">\n                <div>\n                  <h3 className=\"text-lg font-semibold text-gray-900 mb-4\">Project Information</h3>\n                  <div className=\"space-y-3\">\n                    <div className=\"flex justify-between\">\n                      <span className=\"text-gray-500\">Project ID</span>\n                      <span className=\"font-medium text-gray-900\">{project.id}</span>\n                    </div>\n                    <div className=\"flex justify-between\">\n                      <span className=\"text-gray-500\">Status</span>\n                      <span className={`font-medium capitalize ${\n                        project.status === 'active' ? 'text-green-600' :\n                        project.status === 'inactive' ? 'text-yellow-600' :\n                        'text-gray-600'\n                      }`}>\n                        {project.status}\n                      </span>\n                    </div>\n                    <div className=\"flex justify-between\">\n                      <span className=\"text-gray-500\">Health Score</span>\n                      <span className={`font-medium ${\n                        (project.healthScore || 0) >= 80 ? 'text-green-600' :\n                        (project.healthScore || 0) >= 60 ? 'text-yellow-600' :\n                        'text-red-600'\n                      }`}>\n                        {project.healthScore || 0}%\n                      </span>\n                    </div>\n                    <div className=\"flex justify-between\">\n                      <span className=\"text-gray-500\">Last Activity</span>\n                      <span className=\"font-medium text-gray-900\">\n                        {project.lastActivity ? formatDistanceToNow(project.lastActivity, { addSuffix: true }) : 'No activity'}\n                      </span>\n                    </div>\n                  </div>\n                </div>\n                \n                <div>\n                  <h3 className=\"text-lg font-semibold text-gray-900 mb-4\">Ticket Distribution</h3>\n                  <div className=\"space-y-3\">\n                    <div className=\"flex justify-between items-center\">\n                      <span className=\"text-gray-500\">Epics</span>\n                      <span className=\"font-medium text-gray-900\">{getTicketsByType('epic').length}</span>\n                    </div>\n                    <div className=\"flex justify-between items-center\">\n                      <span className=\"text-gray-500\">Issues</span>\n                      <span className=\"font-medium text-gray-900\">{getTicketsByType('issue').length}</span>\n                    </div>\n                    <div className=\"flex justify-between items-center\">\n                      <span className=\"text-gray-500\">Tasks</span>\n                      <span className=\"font-medium text-gray-900\">{getTicketsByType('task').length}</span>\n                    </div>\n                    <div className=\"flex justify-between items-center\">\n                      <span className=\"text-gray-500\">Pull Requests</span>\n                      <span className=\"font-medium text-gray-900\">{getTicketsByType('pr').length}</span>\n                    </div>\n                  </div>\n                </div>\n              </div>\n\n              {/* Recent Activity Summary */}\n              <div>\n                <h3 className=\"text-lg font-semibold text-gray-900 mb-4\">Recent Activity</h3>\n                <div className=\"bg-gray-50 rounded-lg p-4 text-center\">\n                  <Clock className=\"w-8 h-8 text-gray-400 mx-auto mb-2\" />\n                  <p className=\"text-gray-500\">Activity tracking coming soon</p>\n                </div>\n              </div>\n            </div>\n          )}\n\n          {activeTab === 'tickets' && (\n            <div className=\"space-y-6\">\n              <div className=\"flex items-center justify-between\">\n                <h3 className=\"text-lg font-semibold text-gray-900\">Project Tickets</h3>\n                <div className=\"flex items-center space-x-2\">\n                  <span className=\"text-sm text-gray-500\">{tickets.length} tickets</span>\n                </div>\n              </div>\n              \n              {tickets.length > 0 ? (\n                <div className=\"space-y-4\">\n                  {tickets.map((ticket) => (\n                    <div key={ticket.id} className=\"bg-gray-50 rounded-lg p-4\">\n                      <div className=\"flex items-center justify-between mb-2\">\n                        <div className=\"flex items-center space-x-2\">\n                          <span className={`w-2 h-2 rounded-full ${\n                            ticket.priority === 'critical' ? 'bg-red-500' :\n                            ticket.priority === 'high' ? 'bg-orange-500' :\n                            ticket.priority === 'medium' ? 'bg-yellow-500' :\n                            'bg-green-500'\n                          }`} />\n                          <span className=\"text-sm font-medium text-gray-500 uppercase\">\n                            {ticket.type}\n                          </span>\n                          <span className=\"text-sm text-gray-400\">•</span>\n                          <span className=\"text-sm font-medium text-gray-900\">\n                            {ticket.id}\n                          </span>\n                        </div>\n                        <span className={`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${\n                          ticket.status === 'completed' ? 'bg-green-100 text-green-800' :\n                          ticket.status === 'in_progress' ? 'bg-blue-100 text-blue-800' :\n                          ticket.status === 'blocked' ? 'bg-red-100 text-red-800' :\n                          'bg-gray-100 text-gray-800'\n                        }`}>\n                          {ticket.status.replace('_', ' ')}\n                        </span>\n                      </div>\n                      <h4 className=\"font-medium text-gray-900 mb-1\">{ticket.title}</h4>\n                      <div className=\"flex items-center space-x-4 text-sm text-gray-500\">\n                        <span>Priority: {ticket.priority}</span>\n                        <span>Milestone: {ticket.milestone}</span>\n                        {ticket.assignee && ticket.assignee !== 'unassigned' && (\n                          <span>Assignee: {ticket.assignee}</span>\n                        )}\n                      </div>\n                    </div>\n                  ))}\n                </div>\n              ) : (\n                <div className=\"text-center py-12\">\n                  <BarChart3 className=\"w-12 h-12 text-gray-400 mx-auto mb-4\" />\n                  <h3 className=\"text-lg font-medium text-gray-900 mb-2\">No tickets found</h3>\n                  <p className=\"text-gray-500\">This project doesn't have any tickets yet.</p>\n                </div>\n              )}\n            </div>\n          )}\n\n          {activeTab === 'agents' && (\n            <AgentInfo\n              projectPath={project.path}\n              showAllAgents={false}\n              onAgentSelect={handleAgentSelect}\n            />\n          )}\n\n          {activeTab === 'activity' && (\n            <div className=\"space-y-6\">\n              <div className=\"flex items-center justify-between\">\n                <h3 className=\"text-lg font-semibold text-gray-900\">Project Activity</h3>\n              </div>\n              \n              <div className=\"bg-gray-50 rounded-lg p-8 text-center\">\n                <GitBranch className=\"w-12 h-12 text-gray-400 mx-auto mb-4\" />\n                <h3 className=\"text-lg font-medium text-gray-900 mb-2\">Activity Feed Coming Soon</h3>\n                <p className=\"text-gray-500\">Git commits, ticket updates, and agent activity will be shown here.</p>\n              </div>\n            </div>\n          )}\n        </div>\n      </div>\n    </div>\n  )\n}\n\nexport default ProjectDetail\n","import { Activity, AlertCircle, CheckCircle, Clock } from \"lucide-react\"\nimport type React from \"react\"\nimport { Link } from \"react-router-dom\"\nimport { useClaudePmProjects } from \"../hooks/useClaudePm\"\n\nconst ProjectList: React.FC = () => {\n  const { data: projects, isLoading, error } = useClaudePmProjects()\n\n  if (isLoading) {\n    return (\n      <div className=\"flex items-center justify-center h-64\">\n        <div className=\"text-gray-500\">Loading projects...</div>\n      </div>\n    )\n  }\n\n  if (error) {\n    return (\n      <div className=\"flex items-center justify-center h-64\">\n        <div className=\"text-red-500\">Error loading projects</div>\n      </div>\n    )\n  }\n  return (\n    <div>\n      <div className=\"mb-8\">\n        <h1 className=\"text-3xl font-bold text-gray-900\">Projects</h1>\n        <p className=\"mt-2 text-gray-600\">All projects managed by Claude PM framework.</p>\n      </div>\n\n      {projects && projects.length > 0 ? (\n        <div className=\"bg-white shadow rounded-lg\">\n          <div className=\"px-4 py-5 sm:p-6\">\n            <div className=\"space-y-4\">\n              {projects.map(project => {\n                const StatusIcon =\n                  project.status === \"active\"\n                    ? Activity\n                    : project.status === \"completed\"\n                      ? CheckCircle\n                      : project.status === \"inactive\"\n                        ? Clock\n                        : AlertCircle\n\n                const statusColor =\n                  project.status === \"active\"\n                    ? \"text-claude-green\"\n                    : project.status === \"completed\"\n                      ? \"text-claude-blue\"\n                      : project.status === \"inactive\"\n                        ? \"text-gray-400\"\n                        : \"text-claude-red\"\n\n                return (\n                  <Link\n                    key={project.id}\n                    to={`/projects/${project.id}`}\n                    className=\"block hover:bg-gray-50 p-4 border border-gray-200 rounded-lg transition-colors\"\n                  >\n                    <div className=\"flex items-center justify-between\">\n                      <div className=\"flex items-center space-x-4\">\n                        <StatusIcon className={`w-5 h-5 ${statusColor}`} />\n                        <div>\n                          <h3 className=\"text-lg font-medium text-gray-900\">{project.name}</h3>\n                          <p className=\"text-sm text-gray-500\">{project.path}</p>\n                          <div className=\"flex items-center space-x-4 mt-2\">\n                            <span\n                              className={`px-2 py-1 text-xs font-medium rounded-full ${\n                                project.status === \"active\"\n                                  ? \"bg-claude-green/10 text-claude-green\"\n                                  : project.status === \"completed\"\n                                    ? \"bg-claude-blue/10 text-claude-blue\"\n                                    : project.status === \"inactive\"\n                                      ? \"bg-gray-100 text-gray-600\"\n                                      : \"bg-claude-red/10 text-claude-red\"\n                              }`}\n                            >\n                              {project.status}\n                            </span>\n                            {project.lastActivity && (\n                              <span className=\"text-xs text-gray-500\">\n                                Last activity: {project.lastActivity.toLocaleDateString()}\n                              </span>\n                            )}\n                          </div>\n                        </div>\n                      </div>\n                      <div className=\"text-right\">\n                        {project.healthScore && (\n                          <div className=\"text-lg font-semibold text-gray-900\">\n                            {project.healthScore}%\n                          </div>\n                        )}\n                        <div className=\"text-xs text-gray-500\">Health Score</div>\n                      </div>\n                    </div>\n                  </Link>\n                )\n              })}\n            </div>\n          </div>\n        </div>\n      ) : (\n        <div className=\"bg-white shadow rounded-lg\">\n          <div className=\"px-4 py-5 sm:p-6\">\n            <div className=\"text-center py-12\">\n              <div className=\"mx-auto h-12 w-12 text-gray-400\">\n                <svg fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n                  <path\n                    strokeLinecap=\"round\"\n                    strokeLinejoin=\"round\"\n                    strokeWidth={2}\n                    d=\"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10\"\n                  />\n                </svg>\n              </div>\n              <h3 className=\"mt-2 text-sm font-medium text-gray-900\">No projects found</h3>\n              <p className=\"mt-1 text-sm text-gray-500\">\n                Projects will be automatically discovered from the ~/Projects/managed/ directory.\n              </p>\n            </div>\n          </div>\n        </div>\n      )}\n    </div>\n  )\n}\n\nexport default ProjectList\n","import type { ProcessData, WebSocketMessage, ClaudeProcess } from '../types/processTracker'\n\nconst API_BASE_URL = 'http://localhost:8083/api'\nconst WS_URL = 'ws://localhost:8082'\n\nclass ProcessTrackerService {\n  private ws: WebSocket | null = null\n  private reconnectAttempts = 0\n  private maxReconnectAttempts = 5\n  private reconnectDelay = 1000\n\n  // HTTP API methods\n  async getProcesses(): Promise<ProcessData> {\n    try {\n      const response = await fetch(`${API_BASE_URL}/processes`)\n      if (!response.ok) {\n        throw new Error(`HTTP error! status: ${response.status}`)\n      }\n      return await response.json()\n    } catch (error) {\n      console.error('Failed to fetch processes:', error)\n      // Fallback to local file data\n      return this.getFallbackData()\n    }\n  }\n\n  async getSystemInfo(): Promise<ProcessData['systemInfo']> {\n    try {\n      const response = await fetch(`${API_BASE_URL}/system`)\n      if (!response.ok) {\n        throw new Error(`HTTP error! status: ${response.status}`)\n      }\n      return await response.json()\n    } catch (error) {\n      console.error('Failed to fetch system info:', error)\n      const fallbackData = await this.getFallbackData()\n      return fallbackData.systemInfo\n    }\n  }\n\n  async startProcess(pid: number): Promise<boolean> {\n    try {\n      const response = await fetch(`${API_BASE_URL}/processes/${pid}/start`, {\n        method: 'POST'\n      })\n      return response.ok\n    } catch (error) {\n      console.error('Failed to start process:', error)\n      return false\n    }\n  }\n\n  async stopProcess(pid: number): Promise<boolean> {\n    try {\n      const response = await fetch(`${API_BASE_URL}/processes/${pid}/stop`, {\n        method: 'POST'\n      })\n      return response.ok\n    } catch (error) {\n      console.error('Failed to stop process:', error)\n      return false\n    }\n  }\n\n  async restartProcess(pid: number): Promise<boolean> {\n    try {\n      const response = await fetch(`${API_BASE_URL}/processes/${pid}/restart`, {\n        method: 'POST'\n      })\n      return response.ok\n    } catch (error) {\n      console.error('Failed to restart process:', error)\n      return false\n    }\n  }\n\n  // WebSocket methods\n  connectWebSocket(\n    onMessage: (message: WebSocketMessage) => void,\n    onError?: (error: Event) => void,\n    onClose?: (event: CloseEvent) => void\n  ): void {\n    try {\n      this.ws = new WebSocket(WS_URL)\n\n      this.ws.onopen = () => {\n        console.log('WebSocket connected')\n        this.reconnectAttempts = 0\n      }\n\n      this.ws.onmessage = (event) => {\n        try {\n          const message: WebSocketMessage = JSON.parse(event.data)\n          onMessage(message)\n        } catch (error) {\n          console.error('Failed to parse WebSocket message:', error)\n        }\n      }\n\n      this.ws.onerror = (error) => {\n        console.error('WebSocket error:', error)\n        onError?.(error)\n      }\n\n      this.ws.onclose = (event) => {\n        console.log('WebSocket disconnected')\n        onClose?.(event)\n        this.handleReconnection(onMessage, onError, onClose)\n      }\n    } catch (error) {\n      console.error('Failed to connect WebSocket:', error)\n    }\n  }\n\n  private handleReconnection(\n    onMessage: (message: WebSocketMessage) => void,\n    onError?: (error: Event) => void,\n    onClose?: (event: CloseEvent) => void\n  ): void {\n    if (this.reconnectAttempts < this.maxReconnectAttempts) {\n      this.reconnectAttempts++\n      console.log(`Attempting to reconnect WebSocket (${this.reconnectAttempts}/${this.maxReconnectAttempts})...`)\n      \n      setTimeout(() => {\n        this.connectWebSocket(onMessage, onError, onClose)\n      }, this.reconnectDelay * this.reconnectAttempts)\n    } else {\n      console.error('Max reconnection attempts reached')\n    }\n  }\n\n  disconnectWebSocket(): void {\n    if (this.ws) {\n      this.ws.close()\n      this.ws = null\n    }\n  }\n\n  getWebSocketStatus(): WebSocket['readyState'] | null {\n    return this.ws?.readyState || null\n  }\n\n  // Fallback data from local files\n  private async getFallbackData(): Promise<ProcessData> {\n    try {\n      // Try to read from the local process-data.json file\n      const response = await fetch('/logs/process-data.json')\n      if (response.ok) {\n        return await response.json()\n      }\n    } catch (error) {\n      console.warn('Could not load fallback data from local file')\n    }\n\n    // Return mock data if all else fails\n    return this.getMockData()\n  }\n\n  private getMockData(): ProcessData {\n    return {\n      timestamp: new Date().toISOString(),\n      processCount: 0,\n      processes: [],\n      dependencies: {},\n      systemInfo: {\n        totalProcesses: 0,\n        runningProcesses: 0,\n        errorProcesses: 0,\n        stoppedProcesses: 0,\n        activePorts: [],\n        totalMemoryUsage: 0,\n        avgCpuUsage: 0\n      }\n    }\n  }\n\n  // Utility methods\n  formatMemoryUsage(bytes: number): string {\n    if (bytes === 0) return '0 B'\n    const k = 1024\n    const sizes = ['B', 'KB', 'MB', 'GB']\n    const i = Math.floor(Math.log(bytes) / Math.log(k))\n    return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i]\n  }\n\n  getProcessTypeColor(type: ClaudeProcess['type']): string {\n    switch (type) {\n      case 'dashboard':\n        return 'bg-claude-blue'\n      case 'monitor':\n        return 'bg-claude-purple'\n      case 'service':\n        return 'bg-claude-green'\n      case 'health':\n        return 'bg-claude-orange'\n      case 'claude':\n        return 'bg-gray-600'\n      default:\n        return 'bg-gray-400'\n    }\n  }\n\n  getStatusColor(status: ClaudeProcess['status']): string {\n    switch (status) {\n      case 'running':\n        return 'text-claude-green bg-green-100'\n      case 'stopped':\n        return 'text-gray-600 bg-gray-100'\n      case 'error':\n        return 'text-claude-red bg-red-100'\n      default:\n        return 'text-gray-600 bg-gray-100'\n    }\n  }\n}\n\nexport const processTrackerService = new ProcessTrackerService()","import { useQuery } from \"@tanstack/react-query\"\nimport { Activity, Clock, Cpu, HardDrive, Play, Square, RotateCcw, Wifi, WifiOff } from \"lucide-react\"\nimport type React from \"react\"\nimport { useState, useEffect, useMemo } from \"react\"\nimport type { ProcessData, ClaudeProcess, WebSocketMessage } from \"../types/processTracker\"\nimport { processTrackerService } from \"../services/processTrackerService\"\n\ninterface ProcessTrackerProps {\n  className?: string\n}\n\nconst ProcessTracker: React.FC<ProcessTrackerProps> = ({ className = \"\" }) => {\n  const [wsConnected, setWsConnected] = useState(false)\n  const [liveData, setLiveData] = useState<ProcessData | null>(null)\n  const [selectedTypes, setSelectedTypes] = useState<Set<string>>(new Set())\n  const [searchTerm, setSearchTerm] = useState(\"\")\n\n  // Fetch initial data via HTTP API\n  const { data: initialData, isLoading, error, refetch } = useQuery({\n    queryKey: [\"processTracker\"],\n    queryFn: () => processTrackerService.getProcesses(),\n    refetchInterval: wsConnected ? false : 5000, // Stop polling when WebSocket is connected\n    retry: 3,\n  })\n\n  // Use live data if available, otherwise fall back to HTTP data\n  const processData = liveData || initialData\n\n  // WebSocket connection\n  useEffect(() => {\n    const handleMessage = (message: WebSocketMessage) => {\n      if (message.type === 'processUpdate') {\n        setLiveData(message.data as ProcessData)\n      }\n    }\n\n    const handleError = (error: Event) => {\n      console.error('WebSocket error:', error)\n      setWsConnected(false)\n    }\n\n    const handleClose = () => {\n      setWsConnected(false)\n    }\n\n    processTrackerService.connectWebSocket(handleMessage, handleError, handleClose)\n    \n    // Check connection status periodically\n    const statusInterval = setInterval(() => {\n      const status = processTrackerService.getWebSocketStatus()\n      setWsConnected(status === WebSocket.OPEN)\n    }, 1000)\n\n    return () => {\n      clearInterval(statusInterval)\n      processTrackerService.disconnectWebSocket()\n    }\n  }, [])\n\n  // Filter and search processes\n  const filteredProcesses = useMemo(() => {\n    if (!processData?.processes) return []\n\n    return processData.processes.filter(process => {\n      const matchesType = selectedTypes.size === 0 || selectedTypes.has(process.type)\n      const matchesSearch = searchTerm === \"\" || \n        process.name.toLowerCase().includes(searchTerm.toLowerCase()) ||\n        process.command.toLowerCase().includes(searchTerm.toLowerCase()) ||\n        process.pid.toString().includes(searchTerm)\n      \n      return matchesType && matchesSearch\n    })\n  }, [processData?.processes, selectedTypes, searchTerm])\n\n  // Get unique process types\n  const processTypes = useMemo(() => {\n    if (!processData?.processes) return []\n    return [...new Set(processData.processes.map(p => p.type))]\n  }, [processData?.processes])\n\n  const handleTypeFilter = (type: string) => {\n    const newSelected = new Set(selectedTypes)\n    if (newSelected.has(type)) {\n      newSelected.delete(type)\n    } else {\n      newSelected.add(type)\n    }\n    setSelectedTypes(newSelected)\n  }\n\n  const handleProcessAction = async (action: 'start' | 'stop' | 'restart', pid: number) => {\n    try {\n      let success = false\n      switch (action) {\n        case 'start':\n          success = await processTrackerService.startProcess(pid)\n          break\n        case 'stop':\n          success = await processTrackerService.stopProcess(pid)\n          break\n        case 'restart':\n          success = await processTrackerService.restartProcess(pid)\n          break\n      }\n      \n      if (success) {\n        // Refresh data after action\n        refetch()\n      } else {\n        console.error(`Failed to ${action} process ${pid}`)\n      }\n    } catch (error) {\n      console.error(`Error ${action}ing process ${pid}:`, error)\n    }\n  }\n\n  if (isLoading) {\n    return (\n      <div className={`flex items-center justify-center h-64 ${className}`}>\n        <div className=\"text-gray-500\">Loading process data...</div>\n      </div>\n    )\n  }\n\n  if (error) {\n    return (\n      <div className={`flex items-center justify-center h-64 ${className}`}>\n        <div className=\"text-red-500\">Error loading process data</div>\n      </div>\n    )\n  }\n\n  return (\n    <div className={`space-y-6 ${className}`}>\n      {/* Header with connection status */}\n      <div className=\"flex items-center justify-between\">\n        <div>\n          <h1 className=\"text-3xl font-bold text-gray-900\">Claude Process Tracker</h1>\n          <p className=\"mt-2 text-gray-600\">\n            Real-time monitoring of Claude processes and services\n          </p>\n        </div>\n        <div className=\"flex items-center space-x-2\">\n          {wsConnected ? (\n            <div className=\"flex items-center text-claude-green\">\n              <Wifi className=\"w-4 h-4 mr-1\" />\n              <span className=\"text-sm font-medium\">Live</span>\n            </div>\n          ) : (\n            <div className=\"flex items-center text-claude-orange\">\n              <WifiOff className=\"w-4 h-4 mr-1\" />\n              <span className=\"text-sm font-medium\">Polling</span>\n            </div>\n          )}\n        </div>\n      </div>\n\n      {/* System Overview Cards */}\n      {processData?.systemInfo && (\n        <div className=\"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-4\">\n          <div className=\"bg-white overflow-hidden shadow rounded-lg\">\n            <div className=\"p-5\">\n              <div className=\"flex items-center\">\n                <div className=\"flex-shrink-0\">\n                  <Activity className=\"h-6 w-6 text-claude-blue\" />\n                </div>\n                <div className=\"ml-5 w-0 flex-1\">\n                  <dl>\n                    <dt className=\"text-sm font-medium text-gray-500 truncate\">Running</dt>\n                    <dd className=\"text-lg font-medium text-gray-900\">\n                      {processData.systemInfo.runningProcesses}/{processData.systemInfo.totalProcesses}\n                    </dd>\n                  </dl>\n                </div>\n              </div>\n            </div>\n          </div>\n\n          <div className=\"bg-white overflow-hidden shadow rounded-lg\">\n            <div className=\"p-5\">\n              <div className=\"flex items-center\">\n                <div className=\"flex-shrink-0\">\n                  <Cpu className=\"h-6 w-6 text-claude-green\" />\n                </div>\n                <div className=\"ml-5 w-0 flex-1\">\n                  <dl>\n                    <dt className=\"text-sm font-medium text-gray-500 truncate\">Avg CPU</dt>\n                    <dd className=\"text-lg font-medium text-gray-900\">\n                      {processData.systemInfo.avgCpuUsage.toFixed(1)}%\n                    </dd>\n                  </dl>\n                </div>\n              </div>\n            </div>\n          </div>\n\n          <div className=\"bg-white overflow-hidden shadow rounded-lg\">\n            <div className=\"p-5\">\n              <div className=\"flex items-center\">\n                <div className=\"flex-shrink-0\">\n                  <HardDrive className=\"h-6 w-6 text-claude-purple\" />\n                </div>\n                <div className=\"ml-5 w-0 flex-1\">\n                  <dl>\n                    <dt className=\"text-sm font-medium text-gray-500 truncate\">Memory</dt>\n                    <dd className=\"text-lg font-medium text-gray-900\">\n                      {processTrackerService.formatMemoryUsage(processData.systemInfo.totalMemoryUsage)}\n                    </dd>\n                  </dl>\n                </div>\n              </div>\n            </div>\n          </div>\n\n          <div className=\"bg-white overflow-hidden shadow rounded-lg\">\n            <div className=\"p-5\">\n              <div className=\"flex items-center\">\n                <div className=\"flex-shrink-0\">\n                  <Clock className=\"h-6 w-6 text-claude-orange\" />\n                </div>\n                <div className=\"ml-5 w-0 flex-1\">\n                  <dl>\n                    <dt className=\"text-sm font-medium text-gray-500 truncate\">Active Ports</dt>\n                    <dd className=\"text-lg font-medium text-gray-900\">\n                      {processData.systemInfo.activePorts.length}\n                    </dd>\n                  </dl>\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n      )}\n\n      {/* Filters and Search */}\n      <div className=\"bg-white shadow rounded-lg p-6\">\n        <div className=\"flex flex-col space-y-4 sm:flex-row sm:space-y-0 sm:space-x-4 sm:items-center sm:justify-between\">\n          <div className=\"flex-1\">\n            <input\n              type=\"text\"\n              placeholder=\"Search processes...\"\n              className=\"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-claude-blue focus:border-transparent\"\n              value={searchTerm}\n              onChange={(e) => setSearchTerm(e.target.value)}\n            />\n          </div>\n          <div className=\"flex flex-wrap gap-2\">\n            {processTypes.map((type) => (\n              <button\n                key={type}\n                onClick={() => handleTypeFilter(type)}\n                className={`px-3 py-1 rounded-full text-sm font-medium transition-colors ${\n                  selectedTypes.has(type)\n                    ? `${processTrackerService.getProcessTypeColor(type as ClaudeProcess['type'])} text-white`\n                    : \"bg-gray-100 text-gray-700 hover:bg-gray-200\"\n                }`}\n              >\n                {type}\n              </button>\n            ))}\n          </div>\n        </div>\n      </div>\n\n      {/* Process Table */}\n      <div className=\"bg-white shadow rounded-lg overflow-hidden\">\n        <div className=\"px-6 py-4 border-b border-gray-200\">\n          <h3 className=\"text-lg font-medium text-gray-900\">\n            Processes ({filteredProcesses.length})\n          </h3>\n        </div>\n        <div className=\"overflow-x-auto\">\n          <table className=\"min-w-full divide-y divide-gray-200\">\n            <thead className=\"bg-gray-50\">\n              <tr>\n                <th className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\">\n                  Process\n                </th>\n                <th className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\">\n                  Status\n                </th>\n                <th className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\">\n                  Resources\n                </th>\n                <th className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\">\n                  Runtime\n                </th>\n                <th className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\">\n                  Last Activity\n                </th>\n                <th className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\">\n                  Actions\n                </th>\n              </tr>\n            </thead>\n            <tbody className=\"bg-white divide-y divide-gray-200\">\n              {filteredProcesses.map((process) => (\n                <tr key={process.pid} className=\"hover:bg-gray-50\">\n                  <td className=\"px-6 py-4 whitespace-nowrap\">\n                    <div className=\"flex items-center\">\n                      <div className={`w-3 h-3 rounded-full mr-3 ${processTrackerService.getProcessTypeColor(process.type)}`} />\n                      <div>\n                        <div className=\"text-sm font-medium text-gray-900\">\n                          {process.name} ({process.pid})\n                        </div>\n                        <div className=\"text-sm text-gray-500 truncate max-w-xs\">\n                          {process.command}\n                        </div>\n                        {process.port && (\n                          <div className=\"text-xs text-claude-blue\">Port: {process.port}</div>\n                        )}\n                      </div>\n                    </div>\n                  </td>\n                  <td className=\"px-6 py-4 whitespace-nowrap\">\n                    <span className={`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${processTrackerService.getStatusColor(process.status)}`}>\n                      {process.status}\n                    </span>\n                  </td>\n                  <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-900\">\n                    <div>CPU: {process.resourceUsage.cpu}%</div>\n                    <div>RAM: {processTrackerService.formatMemoryUsage(process.resourceUsage.memory)}</div>\n                  </td>\n                  <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-900\">\n                    {process.elapsedTime}\n                  </td>\n                  <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-500\">\n                    {new Date(process.lastActivity).toLocaleTimeString()}\n                  </td>\n                  <td className=\"px-6 py-4 whitespace-nowrap text-sm font-medium\">\n                    <div className=\"flex space-x-2\">\n                      {process.status === 'stopped' ? (\n                        <button\n                          onClick={() => handleProcessAction('start', process.pid)}\n                          className=\"text-claude-green hover:text-claude-green-dark\"\n                          aria-label=\"Start process\"\n                        >\n                          <Play className=\"w-4 h-4\" />\n                        </button>\n                      ) : (\n                        <button\n                          onClick={() => handleProcessAction('stop', process.pid)}\n                          className=\"text-claude-red hover:text-red-700\"\n                          aria-label=\"Stop process\"\n                        >\n                          <Square className=\"w-4 h-4\" />\n                        </button>\n                      )}\n                      <button\n                        onClick={() => handleProcessAction('restart', process.pid)}\n                        className=\"text-claude-blue hover:text-claude-purple\"\n                        aria-label=\"Restart process\"\n                      >\n                        <RotateCcw className=\"w-4 h-4\" />\n                      </button>\n                    </div>\n                  </td>\n                </tr>\n              ))}\n            </tbody>\n          </table>\n        </div>\n      </div>\n\n      {/* Footer with last update time */}\n      {processData && (\n        <div className=\"text-center text-sm text-gray-500\">\n          Last updated: {new Date(processData.timestamp).toLocaleString()}\n        </div>\n      )}\n    </div>\n  )\n}\n\nexport default ProcessTracker","import type React from \"react\"\nimport { useState, useMemo } from \"react\"\nimport { Pause, Play, Maximize2 } from \"lucide-react\"\nimport type { ClaudeProcess } from \"../types/processTracker\"\n\ninterface ResponseTickerProps {\n  processes: ClaudeProcess[]\n  className?: string\n}\n\ninterface TickerItem {\n  id: string\n  pid: number\n  processName: string\n  message: string\n  timestamp: string\n  type: 'info' | 'warning' | 'error' | 'success'\n  processType: ClaudeProcess['type']\n}\n\nconst ResponseTicker: React.FC<ResponseTickerProps> = ({ processes, className = \"\" }) => {\n  const [isPaused, setIsPaused] = useState(false)\n  const [selectedItem, setSelectedItem] = useState<TickerItem | null>(null)\n  const [animationSpeed, setAnimationSpeed] = useState(1)\n\n  // Convert processes to ticker items\n  const tickerItems = useMemo(() => {\n    return processes.map((process): TickerItem => ({\n      id: `${process.pid}-${process.lastActivity}`,\n      pid: process.pid,\n      processName: process.name,\n      message: process.lastResponse,\n      timestamp: process.lastActivity,\n      type: getMessageType(process.lastResponse, process.status),\n      processType: process.type\n    }))\n  }, [processes])\n\n  // Determine message type based on content and process status\n  function getMessageType(message: string, status: ClaudeProcess['status']): TickerItem['type'] {\n    if (status === 'error') return 'error'\n    if (status === 'stopped') return 'warning'\n    \n    const lowerMessage = message.toLowerCase()\n    if (lowerMessage.includes('error') || lowerMessage.includes('failed')) return 'error'\n    if (lowerMessage.includes('warning') || lowerMessage.includes('warn')) return 'warning'\n    if (lowerMessage.includes('success') || lowerMessage.includes('completed')) return 'success'\n    \n    return 'info'\n  }\n\n  // Get color classes for message types\n  function getTypeColors(type: TickerItem['type']): string {\n    switch (type) {\n      case 'error':\n        return 'bg-red-100 text-red-800 border-red-200'\n      case 'warning':\n        return 'bg-yellow-100 text-yellow-800 border-yellow-200'\n      case 'success':\n        return 'bg-green-100 text-green-800 border-green-200'\n      case 'info':\n      default:\n        return 'bg-blue-100 text-blue-800 border-blue-200'\n    }\n  }\n\n  // Get process type color\n  function getProcessTypeColor(type: ClaudeProcess['type']): string {\n    switch (type) {\n      case 'dashboard':\n        return 'bg-claude-blue'\n      case 'monitor':\n        return 'bg-claude-purple'\n      case 'service':\n        return 'bg-claude-green'\n      case 'health':\n        return 'bg-claude-orange'\n      case 'claude':\n        return 'bg-gray-600'\n      default:\n        return 'bg-gray-400'\n    }\n  }\n\n  const handleItemClick = (item: TickerItem) => {\n    setSelectedItem(item)\n  }\n\n  const closeModal = () => {\n    setSelectedItem(null)\n  }\n\n  return (\n    <>\n      <div className={`bg-white shadow rounded-lg overflow-hidden ${className}`}>\n        <div className=\"px-6 py-4 border-b border-gray-200 flex items-center justify-between\">\n          <h3 className=\"text-lg font-medium text-gray-900\">Activity Ticker</h3>\n          <div className=\"flex items-center space-x-4\">\n            <div className=\"flex items-center space-x-2\">\n              <label htmlFor=\"speed\" className=\"text-sm text-gray-600\">Speed:</label>\n              <select\n                id=\"speed\"\n                value={animationSpeed}\n                onChange={(e) => setAnimationSpeed(Number(e.target.value))}\n                className=\"text-sm border border-gray-300 rounded px-2 py-1 focus:outline-none focus:ring-2 focus:ring-claude-blue\"\n              >\n                <option value={0.5}>0.5x</option>\n                <option value={1}>1x</option>\n                <option value={1.5}>1.5x</option>\n                <option value={2}>2x</option>\n              </select>\n            </div>\n            <button\n              onClick={() => setIsPaused(!isPaused)}\n              className=\"flex items-center space-x-1 text-claude-blue hover:text-claude-purple transition-colors\"\n              aria-label={isPaused ? \"Resume ticker\" : \"Pause ticker\"}\n            >\n              {isPaused ? <Play className=\"w-4 h-4\" /> : <Pause className=\"w-4 h-4\" />}\n              <span className=\"text-sm\">{isPaused ? \"Resume\" : \"Pause\"}</span>\n            </button>\n          </div>\n        </div>\n\n        <div className=\"relative overflow-hidden h-16 bg-gray-50\">\n          <div\n            className={`flex space-x-4 py-4 ${isPaused ? '' : 'animate-scroll'}`}\n            style={{\n              animationDuration: `${60 / animationSpeed}s`,\n              animationPlayState: isPaused ? 'paused' : 'running'\n            }}\n            onMouseEnter={() => setIsPaused(true)}\n            onMouseLeave={() => setIsPaused(false)}\n          >\n            {/* Duplicate items for seamless scrolling */}\n            {[...tickerItems, ...tickerItems].map((item, index) => (\n              <div\n                key={`${item.id}-${index}`}\n                onClick={() => handleItemClick(item)}\n                className={`flex-shrink-0 flex items-center space-x-3 px-4 py-2 rounded-lg border cursor-pointer hover:shadow-md transition-all ${getTypeColors(item.type)}`}\n              >\n                <div className={`w-2 h-2 rounded-full ${getProcessTypeColor(item.processType)}`} />\n                <div className=\"flex items-center space-x-2\">\n                  <span className=\"font-medium text-sm\">{item.processName}</span>\n                  <span className=\"text-xs text-gray-600\">({item.pid})</span>\n                </div>\n                <div className=\"max-w-xs truncate text-sm\">\n                  {item.message}\n                </div>\n                <div className=\"text-xs text-gray-500\">\n                  {new Date(item.timestamp).toLocaleTimeString()}\n                </div>\n                <Maximize2 className=\"w-3 h-3 opacity-50\" />\n              </div>\n            ))}\n          </div>\n        </div>\n\n        <div className=\"px-6 py-2 bg-gray-50 border-t border-gray-200\">\n          <div className=\"flex items-center justify-between text-xs text-gray-500\">\n            <span>Click any activity to expand • Hover to pause</span>\n            <span>{tickerItems.length} active processes</span>\n          </div>\n        </div>\n      </div>\n\n      {/* Modal for expanded activity */}\n      {selectedItem && (\n        <div className=\"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50\">\n          <div className=\"bg-white rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-96 overflow-hidden\">\n            <div className=\"px-6 py-4 border-b border-gray-200 flex items-center justify-between\">\n              <div className=\"flex items-center space-x-3\">\n                <div className={`w-3 h-3 rounded-full ${getProcessTypeColor(selectedItem.processType)}`} />\n                <h3 className=\"text-lg font-medium text-gray-900\">\n                  {selectedItem.processName} ({selectedItem.pid})\n                </h3>\n                <span className={`px-2 py-1 text-xs font-semibold rounded-full ${getTypeColors(selectedItem.type)}`}>\n                  {selectedItem.type}\n                </span>\n              </div>\n              <button\n                onClick={closeModal}\n                className=\"text-gray-400 hover:text-gray-600 text-xl font-bold\"\n                aria-label=\"Close modal\"\n              >\n                ×\n              </button>\n            </div>\n            \n            <div className=\"px-6 py-4\">\n              <div className=\"space-y-4\">\n                <div>\n                  <label className=\"block text-sm font-medium text-gray-700 mb-1\">\n                    Last Response\n                  </label>\n                  <div className=\"bg-gray-50 rounded-md p-3 text-sm text-gray-900\">\n                    {selectedItem.message}\n                  </div>\n                </div>\n                \n                <div className=\"grid grid-cols-2 gap-4\">\n                  <div>\n                    <label className=\"block text-sm font-medium text-gray-700 mb-1\">\n                      Process Type\n                    </label>\n                    <div className=\"text-sm text-gray-900 capitalize\">\n                      {selectedItem.processType}\n                    </div>\n                  </div>\n                  <div>\n                    <label className=\"block text-sm font-medium text-gray-700 mb-1\">\n                      Last Activity\n                    </label>\n                    <div className=\"text-sm text-gray-900\">\n                      {new Date(selectedItem.timestamp).toLocaleString()}\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n            \n            <div className=\"px-6 py-3 bg-gray-50 border-t border-gray-200 flex justify-end\">\n              <button\n                onClick={closeModal}\n                className=\"px-4 py-2 bg-claude-blue text-white rounded-md hover:bg-claude-purple transition-colors\"\n              >\n                Close\n              </button>\n            </div>\n          </div>\n        </div>\n      )}\n\n    </>\n  )\n}\n\nexport default ResponseTicker","import type React from \"react\"\nimport { useState } from \"react\"\nimport { Play, Square, RotateCcw, CheckSquare, Square as UncheckedSquare } from \"lucide-react\"\nimport type { ClaudeProcess, SystemInfo } from \"../types/processTracker\"\nimport { processTrackerService } from \"../services/processTrackerService\"\n\ninterface ProcessControlsProps {\n  processes: ClaudeProcess[]\n  systemInfo: SystemInfo\n  onRefresh: () => void\n  className?: string\n}\n\nconst ProcessControls: React.FC<ProcessControlsProps> = ({ \n  processes, \n  systemInfo, \n  onRefresh, \n  className = \"\" \n}) => {\n  const [selectedProcesses, setSelectedProcesses] = useState<Set<number>>(new Set())\n  const [isLoading, setIsLoading] = useState<Set<number>>(new Set())\n  const [bulkActionLoading, setBulkActionLoading] = useState(false)\n\n  const handleSelectProcess = (pid: number) => {\n    const newSelected = new Set(selectedProcesses)\n    if (newSelected.has(pid)) {\n      newSelected.delete(pid)\n    } else {\n      newSelected.add(pid)\n    }\n    setSelectedProcesses(newSelected)\n  }\n\n  const handleSelectAll = () => {\n    if (selectedProcesses.size === processes.length) {\n      setSelectedProcesses(new Set())\n    } else {\n      setSelectedProcesses(new Set(processes.map(p => p.pid)))\n    }\n  }\n\n  const handleSingleAction = async (action: 'start' | 'stop' | 'restart', pid: number) => {\n    setIsLoading(prev => new Set(prev).add(pid))\n    \n    try {\n      let success = false\n      switch (action) {\n        case 'start':\n          success = await processTrackerService.startProcess(pid)\n          break\n        case 'stop':\n          success = await processTrackerService.stopProcess(pid)\n          break\n        case 'restart':\n          success = await processTrackerService.restartProcess(pid)\n          break\n      }\n      \n      if (success) {\n        onRefresh()\n      }\n    } catch (error) {\n      console.error(`Error performing ${action} on process ${pid}:`, error)\n    } finally {\n      setIsLoading(prev => {\n        const newSet = new Set(prev)\n        newSet.delete(pid)\n        return newSet\n      })\n    }\n  }\n\n  const handleBulkAction = async (action: 'start' | 'stop' | 'restart') => {\n    if (selectedProcesses.size === 0) return\n\n    setBulkActionLoading(true)\n    \n    try {\n      const promises = Array.from(selectedProcesses).map(async (pid) => {\n        try {\n          switch (action) {\n            case 'start':\n              return await processTrackerService.startProcess(pid)\n            case 'stop':\n              return await processTrackerService.stopProcess(pid)\n            case 'restart':\n              return await processTrackerService.restartProcess(pid)\n          }\n        } catch (error) {\n          console.error(`Error performing ${action} on process ${pid}:`, error)\n          return false\n        }\n      })\n\n      await Promise.all(promises)\n      onRefresh()\n      setSelectedProcesses(new Set())\n    } catch (error) {\n      console.error(`Error performing bulk ${action}:`, error)\n    } finally {\n      setBulkActionLoading(false)\n    }\n  }\n\n  const getMemoryUsagePercentage = (memory: number): number => {\n    const totalSystemMemory = 16 * 1024 * 1024 * 1024 // Assume 16GB system memory\n    return (memory / totalSystemMemory) * 100\n  }\n\n  const getStatusCounts = () => {\n    return processes.reduce((acc, process) => {\n      acc[process.status] = (acc[process.status] || 0) + 1\n      return acc\n    }, {} as Record<string, number>)\n  }\n\n  const statusCounts = getStatusCounts()\n\n  return (\n    <div className={`space-y-6 ${className}`}>\n      {/* Resource Monitoring Widgets */}\n      <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4\">\n        <div className=\"bg-white p-4 rounded-lg shadow border\">\n          <div className=\"flex items-center justify-between\">\n            <div>\n              <p className=\"text-sm font-medium text-gray-600\">System Memory</p>\n              <p className=\"text-2xl font-bold text-gray-900\">\n                {processTrackerService.formatMemoryUsage(systemInfo.totalMemoryUsage)}\n              </p>\n            </div>\n            <div className=\"w-12 h-12 bg-claude-purple rounded-lg flex items-center justify-center\">\n              <div className=\"w-6 h-6 bg-white rounded-sm\" />\n            </div>\n          </div>\n          <div className=\"mt-2\">\n            <div className=\"flex items-center\">\n              <div className=\"flex-1 bg-gray-200 rounded-full h-2 mr-2\">\n                <div \n                  className=\"bg-claude-purple h-2 rounded-full transition-all duration-300\"\n                  style={{ width: `${Math.min(getMemoryUsagePercentage(systemInfo.totalMemoryUsage), 100)}%` }}\n                />\n              </div>\n              <span className=\"text-xs text-gray-500\">\n                {getMemoryUsagePercentage(systemInfo.totalMemoryUsage).toFixed(1)}%\n              </span>\n            </div>\n          </div>\n        </div>\n\n        <div className=\"bg-white p-4 rounded-lg shadow border\">\n          <div className=\"flex items-center justify-between\">\n            <div>\n              <p className=\"text-sm font-medium text-gray-600\">Avg CPU Usage</p>\n              <p className=\"text-2xl font-bold text-gray-900\">\n                {systemInfo.avgCpuUsage.toFixed(1)}%\n              </p>\n            </div>\n            <div className=\"w-12 h-12 bg-claude-green rounded-lg flex items-center justify-center\">\n              <div className=\"w-6 h-6 bg-white rounded-sm\" />\n            </div>\n          </div>\n          <div className=\"mt-2\">\n            <div className=\"flex items-center\">\n              <div className=\"flex-1 bg-gray-200 rounded-full h-2 mr-2\">\n                <div \n                  className=\"bg-claude-green h-2 rounded-full transition-all duration-300\"\n                  style={{ width: `${Math.min(systemInfo.avgCpuUsage, 100)}%` }}\n                />\n              </div>\n              <span className=\"text-xs text-gray-500\">Real-time</span>\n            </div>\n          </div>\n        </div>\n\n        <div className=\"bg-white p-4 rounded-lg shadow border\">\n          <div className=\"flex items-center justify-between\">\n            <div>\n              <p className=\"text-sm font-medium text-gray-600\">Active Ports</p>\n              <p className=\"text-2xl font-bold text-gray-900\">\n                {systemInfo.activePorts.length}\n              </p>\n            </div>\n            <div className=\"w-12 h-12 bg-claude-blue rounded-lg flex items-center justify-center\">\n              <div className=\"w-6 h-6 bg-white rounded-sm\" />\n            </div>\n          </div>\n          <div className=\"mt-2\">\n            <div className=\"flex flex-wrap gap-1\">\n              {systemInfo.activePorts.slice(0, 3).map(port => (\n                <span key={port} className=\"text-xs bg-claude-blue text-white px-2 py-1 rounded\">\n                  {port}\n                </span>\n              ))}\n              {systemInfo.activePorts.length > 3 && (\n                <span className=\"text-xs text-gray-500\">+{systemInfo.activePorts.length - 3}</span>\n              )}\n            </div>\n          </div>\n        </div>\n\n        <div className=\"bg-white p-4 rounded-lg shadow border\">\n          <div className=\"flex items-center justify-between\">\n            <div>\n              <p className=\"text-sm font-medium text-gray-600\">Process Health</p>\n              <p className=\"text-2xl font-bold text-gray-900\">\n                {((statusCounts.running || 0) / systemInfo.totalProcesses * 100).toFixed(0)}%\n              </p>\n            </div>\n            <div className=\"w-12 h-12 bg-claude-orange rounded-lg flex items-center justify-center\">\n              <div className=\"w-6 h-6 bg-white rounded-sm\" />\n            </div>\n          </div>\n          <div className=\"mt-2\">\n            <div className=\"flex items-center text-xs text-gray-600\">\n              <span className=\"text-claude-green mr-2\">●</span>\n              {statusCounts.running || 0} Running\n              <span className=\"text-claude-red ml-3 mr-2\">●</span>\n              {statusCounts.stopped || 0} Stopped\n            </div>\n          </div>\n        </div>\n      </div>\n\n      {/* Bulk Actions Panel */}\n      <div className=\"bg-white rounded-lg shadow border\">\n        <div className=\"px-6 py-4 border-b border-gray-200\">\n          <div className=\"flex items-center justify-between\">\n            <h3 className=\"text-lg font-medium text-gray-900\">Bulk Process Management</h3>\n            <div className=\"flex items-center space-x-2\">\n              <button\n                onClick={handleSelectAll}\n                className=\"flex items-center space-x-2 text-sm text-claude-blue hover:text-claude-purple transition-colors\"\n              >\n                {selectedProcesses.size === processes.length ? (\n                  <CheckSquare className=\"w-4 h-4\" />\n                ) : (\n                  <UncheckedSquare className=\"w-4 h-4\" />\n                )}\n                <span>\n                  {selectedProcesses.size === processes.length ? 'Deselect All' : 'Select All'}\n                </span>\n              </button>\n            </div>\n          </div>\n        </div>\n\n        <div className=\"px-6 py-4\">\n          <div className=\"flex items-center justify-between mb-4\">\n            <div className=\"text-sm text-gray-600\">\n              {selectedProcesses.size} of {processes.length} processes selected\n            </div>\n            <div className=\"flex space-x-2\">\n              <button\n                onClick={() => handleBulkAction('start')}\n                disabled={selectedProcesses.size === 0 || bulkActionLoading}\n                className=\"flex items-center space-x-1 px-3 py-2 bg-claude-green text-white rounded-md hover:bg-green-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors\"\n              >\n                <Play className=\"w-4 h-4\" />\n                <span>Start Selected</span>\n              </button>\n              <button\n                onClick={() => handleBulkAction('stop')}\n                disabled={selectedProcesses.size === 0 || bulkActionLoading}\n                className=\"flex items-center space-x-1 px-3 py-2 bg-claude-red text-white rounded-md hover:bg-red-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors\"\n              >\n                <Square className=\"w-4 h-4\" />\n                <span>Stop Selected</span>\n              </button>\n              <button\n                onClick={() => handleBulkAction('restart')}\n                disabled={selectedProcesses.size === 0 || bulkActionLoading}\n                className=\"flex items-center space-x-1 px-3 py-2 bg-claude-blue text-white rounded-md hover:bg-claude-purple disabled:opacity-50 disabled:cursor-not-allowed transition-colors\"\n              >\n                <RotateCcw className=\"w-4 h-4\" />\n                <span>Restart Selected</span>\n              </button>\n            </div>\n          </div>\n\n          {/* Process Selection List */}\n          <div className=\"space-y-2 max-h-64 overflow-y-auto\">\n            {processes.map(process => (\n              <div\n                key={process.pid}\n                className={`flex items-center space-x-3 p-3 rounded-lg border transition-colors ${\n                  selectedProcesses.has(process.pid) ? 'border-claude-blue bg-blue-50' : 'border-gray-200 hover:bg-gray-50'\n                }`}\n              >\n                <button\n                  onClick={() => handleSelectProcess(process.pid)}\n                  className=\"flex-shrink-0\"\n                >\n                  {selectedProcesses.has(process.pid) ? (\n                    <CheckSquare className=\"w-4 h-4 text-claude-blue\" />\n                  ) : (\n                    <UncheckedSquare className=\"w-4 h-4 text-gray-400\" />\n                  )}\n                </button>\n                \n                <div className={`w-3 h-3 rounded-full ${processTrackerService.getProcessTypeColor(process.type)}`} />\n                \n                <div className=\"flex-1 min-w-0\">\n                  <div className=\"flex items-center space-x-2\">\n                    <span className=\"font-medium text-sm text-gray-900\">\n                      {process.name} ({process.pid})\n                    </span>\n                    <span className={`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${processTrackerService.getStatusColor(process.status)}`}>\n                      {process.status}\n                    </span>\n                  </div>\n                  <div className=\"text-xs text-gray-500 truncate\">\n                    CPU: {process.resourceUsage.cpu}% | Memory: {processTrackerService.formatMemoryUsage(process.resourceUsage.memory)}\n                  </div>\n                </div>\n\n                <div className=\"flex space-x-1\">\n                  {process.status === 'stopped' ? (\n                    <button\n                      onClick={() => handleSingleAction('start', process.pid)}\n                      disabled={isLoading.has(process.pid)}\n                      className=\"p-1 text-claude-green hover:text-green-600 disabled:opacity-50 transition-colors\"\n                      aria-label=\"Start process\"\n                    >\n                      <Play className=\"w-4 h-4\" />\n                    </button>\n                  ) : (\n                    <button\n                      onClick={() => handleSingleAction('stop', process.pid)}\n                      disabled={isLoading.has(process.pid)}\n                      className=\"p-1 text-claude-red hover:text-red-600 disabled:opacity-50 transition-colors\"\n                      aria-label=\"Stop process\"\n                    >\n                      <Square className=\"w-4 h-4\" />\n                    </button>\n                  )}\n                  <button\n                    onClick={() => handleSingleAction('restart', process.pid)}\n                    disabled={isLoading.has(process.pid)}\n                    className=\"p-1 text-claude-blue hover:text-claude-purple disabled:opacity-50 transition-colors\"\n                    aria-label=\"Restart process\"\n                  >\n                    <RotateCcw className=\"w-4 h-4\" />\n                  </button>\n                </div>\n              </div>\n            ))}\n          </div>\n        </div>\n      </div>\n    </div>\n  )\n}\n\nexport default ProcessControls","import { useQuery } from \"@tanstack/react-query\"\nimport type React from \"react\"\nimport { useState } from \"react\"\nimport ProcessTracker from \"./ProcessTracker\"\nimport ResponseTicker from \"./ResponseTicker\"\nimport ProcessControls from \"./ProcessControls\"\nimport { processTrackerService } from \"../services/processTrackerService\"\n\ntype ViewMode = 'overview' | 'controls' | 'tracker'\n\nconst ProcessDashboard: React.FC = () => {\n  const [viewMode, setViewMode] = useState<ViewMode>('overview')\n\n  // Fetch process data\n  const { data: processData, isLoading, error, refetch } = useQuery({\n    queryKey: [\"processDashboard\"],\n    queryFn: () => processTrackerService.getProcesses(),\n    refetchInterval: 5000, // Refresh every 5 seconds\n    retry: 3,\n  })\n\n  if (isLoading) {\n    return (\n      <div className=\"flex items-center justify-center h-64\">\n        <div className=\"text-gray-500\">Loading process dashboard...</div>\n      </div>\n    )\n  }\n\n  if (error) {\n    return (\n      <div className=\"flex items-center justify-center h-64\">\n        <div className=\"text-red-500\">Error loading process dashboard</div>\n      </div>\n    )\n  }\n\n  const processes = processData?.processes || []\n  const systemInfo = processData?.systemInfo\n\n  return (\n    <div className=\"space-y-6\">\n      {/* Header with view mode switcher */}\n      <div className=\"flex items-center justify-between\">\n        <div>\n          <h1 className=\"text-3xl font-bold text-gray-900\">Claude Process Dashboard</h1>\n          <p className=\"mt-2 text-gray-600\">\n            Real-time monitoring and management of Claude processes\n          </p>\n        </div>\n        <div className=\"flex space-x-1 bg-gray-100 rounded-lg p-1\">\n          <button\n            onClick={() => setViewMode('overview')}\n            className={`px-4 py-2 rounded-md text-sm font-medium transition-colors ${\n              viewMode === 'overview'\n                ? 'bg-white text-claude-blue shadow-sm'\n                : 'text-gray-600 hover:text-gray-900'\n            }`}\n          >\n            Overview\n          </button>\n          <button\n            onClick={() => setViewMode('tracker')}\n            className={`px-4 py-2 rounded-md text-sm font-medium transition-colors ${\n              viewMode === 'tracker'\n                ? 'bg-white text-claude-blue shadow-sm'\n                : 'text-gray-600 hover:text-gray-900'\n            }`}\n          >\n            Detailed Tracker\n          </button>\n          <button\n            onClick={() => setViewMode('controls')}\n            className={`px-4 py-2 rounded-md text-sm font-medium transition-colors ${\n              viewMode === 'controls'\n                ? 'bg-white text-claude-blue shadow-sm'\n                : 'text-gray-600 hover:text-gray-900'\n            }`}\n          >\n            Controls\n          </button>\n        </div>\n      </div>\n\n      {/* Activity Ticker - Always shown */}\n      <ResponseTicker processes={processes} />\n\n      {/* Conditional Content based on view mode */}\n      {viewMode === 'overview' && (\n        <div className=\"grid grid-cols-1 xl:grid-cols-3 gap-6\">\n          {/* System Overview */}\n          {systemInfo && (\n            <div className=\"xl:col-span-1\">\n              <div className=\"bg-white shadow rounded-lg\">\n                <div className=\"px-6 py-4 border-b border-gray-200\">\n                  <h3 className=\"text-lg font-medium text-gray-900\">System Overview</h3>\n                </div>\n                <div className=\"p-6 space-y-4\">\n                  <div className=\"flex items-center justify-between\">\n                    <span className=\"text-sm text-gray-600\">Total Processes</span>\n                    <span className=\"font-medium\">{systemInfo.totalProcesses}</span>\n                  </div>\n                  <div className=\"flex items-center justify-between\">\n                    <span className=\"text-sm text-gray-600\">Running</span>\n                    <span className=\"font-medium text-claude-green\">{systemInfo.runningProcesses}</span>\n                  </div>\n                  <div className=\"flex items-center justify-between\">\n                    <span className=\"text-sm text-gray-600\">Stopped</span>\n                    <span className=\"font-medium text-claude-red\">{systemInfo.stoppedProcesses}</span>\n                  </div>\n                  <div className=\"flex items-center justify-between\">\n                    <span className=\"text-sm text-gray-600\">Memory Usage</span>\n                    <span className=\"font-medium\">\n                      {processTrackerService.formatMemoryUsage(systemInfo.totalMemoryUsage)}\n                    </span>\n                  </div>\n                  <div className=\"flex items-center justify-between\">\n                    <span className=\"text-sm text-gray-600\">Avg CPU</span>\n                    <span className=\"font-medium\">{systemInfo.avgCpuUsage.toFixed(1)}%</span>\n                  </div>\n                  <div className=\"flex items-center justify-between\">\n                    <span className=\"text-sm text-gray-600\">Active Ports</span>\n                    <span className=\"font-medium\">{systemInfo.activePorts.length}</span>\n                  </div>\n                </div>\n              </div>\n            </div>\n          )}\n\n          {/* Process Summary */}\n          <div className=\"xl:col-span-2\">\n            <div className=\"bg-white shadow rounded-lg\">\n              <div className=\"px-6 py-4 border-b border-gray-200\">\n                <h3 className=\"text-lg font-medium text-gray-900\">Process Summary</h3>\n              </div>\n              <div className=\"p-6\">\n                <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n                  {Object.entries(\n                    processes.reduce((acc, process) => {\n                      const type = process.type\n                      if (!acc[type]) {\n                        acc[type] = { count: 0, running: 0, memory: 0 }\n                      }\n                      acc[type].count++\n                      if (process.status === 'running') acc[type].running++\n                      acc[type].memory += process.resourceUsage.memory\n                      return acc\n                    }, {} as Record<string, { count: number; running: number; memory: number }>)\n                  ).map(([type, stats]) => (\n                    <div key={type} className=\"p-4 bg-gray-50 rounded-lg\">\n                      <div className=\"flex items-center space-x-2 mb-2\">\n                        <div className={`w-3 h-3 rounded-full ${processTrackerService.getProcessTypeColor(type as any)}`} />\n                        <span className=\"font-medium capitalize\">{type}</span>\n                      </div>\n                      <div className=\"text-sm text-gray-600 space-y-1\">\n                        <div>Total: {stats.count}</div>\n                        <div>Running: {stats.running}</div>\n                        <div>Memory: {processTrackerService.formatMemoryUsage(stats.memory)}</div>\n                      </div>\n                    </div>\n                  ))}\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n      )}\n\n      {viewMode === 'tracker' && (\n        <ProcessTracker className=\"mt-6\" />\n      )}\n\n      {viewMode === 'controls' && systemInfo && (\n        <ProcessControls \n          processes={processes}\n          systemInfo={systemInfo}\n          onRefresh={() => refetch()}\n          className=\"mt-6\"\n        />\n      )}\n\n      {/* Quick Actions (always visible) */}\n      <div className=\"bg-white shadow rounded-lg\">\n        <div className=\"px-6 py-4\">\n          <div className=\"flex items-center justify-between\">\n            <div className=\"text-sm text-gray-600\">\n              Last updated: {processData ? new Date(processData.timestamp).toLocaleString() : 'Never'}\n            </div>\n            <div className=\"flex space-x-2\">\n              <button\n                onClick={() => refetch()}\n                className=\"px-3 py-1 text-sm bg-claude-blue text-white rounded-md hover:bg-claude-purple transition-colors\"\n              >\n                Refresh\n              </button>\n              <button\n                onClick={() => setViewMode('tracker')}\n                className=\"px-3 py-1 text-sm border border-claude-blue text-claude-blue rounded-md hover:bg-claude-blue hover:text-white transition-colors\"\n              >\n                View Details\n              </button>\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n  )\n}\n\nexport default ProcessDashboard","import type { VercelDeployment, VercelProject } from '../types/vercelDeployments'\n\nclass VercelService {\n  private getEnvVar(key: string): string {\n    const value = import.meta.env[key]\n    if (!value) {\n      console.warn(`Environment variable ${key} is not set`)\n      return \"\"\n    }\n    return value\n  }\n\n  private async makeRequest<T>(endpoint: string): Promise<T> {\n    const apiKey = this.getEnvVar(\"VITE_VERCEL_API_KEY\")\n    if (!apiKey) throw new Error(\"Vercel API key not configured\")\n\n    const response = await fetch(`https://api.vercel.com${endpoint}`, {\n      headers: {\n        Authorization: `Bearer ${apiKey}`,\n        \"Content-Type\": \"application/json\",\n      },\n    })\n\n    if (!response.ok) {\n      throw new Error(`Vercel API error: ${response.status} ${response.statusText}`)\n    }\n\n    return response.json()\n  }\n\n  async getProjects(): Promise<VercelProject[]> {\n    try {\n      const response = await this.makeRequest<{ projects: VercelProject[] }>(\"/v9/projects\")\n      return response.projects || []\n    } catch (error) {\n      console.error(\"Error fetching Vercel projects:\", error)\n      // Return mock data for development\n      return this.getMockProjects()\n    }\n  }\n\n  async getDeployments(limit = 20): Promise<VercelDeployment[]> {\n    try {\n      const response = await this.makeRequest<{ deployments: VercelDeployment[] }>\n        (`/v6/deployments?limit=${limit}`)\n      return response.deployments || []\n    } catch (error) {\n      console.error(\"Error fetching Vercel deployments:\", error)\n      // Return mock data for development\n      return this.getMockDeployments().slice(0, limit)\n    }\n  }\n\n  private getMockProjects(): VercelProject[] {\n    return [\n      {\n        id: \"prj_claude-pm-portfolio\",\n        name: \"claude-pm-portfolio-manager\", \n        accountId: \"team_123\",\n        createdAt: Date.now() - 86400000 * 30,\n        updatedAt: Date.now() - 3600000,\n        framework: \"vite\",\n        publicSource: false,\n        live: true,\n        latestDeployments: []\n      },\n      {\n        id: \"prj_ai-power-rankings\",\n        name: \"ai-power-rankings\",\n        accountId: \"team_123\", \n        createdAt: Date.now() - 86400000 * 60,\n        updatedAt: Date.now() - 86400000 * 2,\n        framework: \"nextjs\",\n        publicSource: false,\n        live: true,\n        latestDeployments: []\n      },\n      {\n        id: \"prj_matsuoka-com\",\n        name: \"matsuoka-com\",\n        accountId: \"team_123\",\n        createdAt: Date.now() - 86400000 * 90,\n        updatedAt: Date.now() - 86400000 * 5,\n        framework: \"nextjs\",\n        publicSource: false,\n        live: true,\n        latestDeployments: []\n      }\n    ]\n  }\n\n  private getMockDeployments(): VercelDeployment[] {\n    const now = Date.now()\n    return [\n      {\n        uid: \"dpl_123abc\",\n        name: \"claude-pm-portfolio-manager\",\n        url: \"claude-pm-portfolio-manager-git-main.vercel.app\",\n        created: now - 3600000,\n        createdAt: now - 3600000,\n        state: \"READY\",\n        readyState: \"READY\",\n        type: \"LAMBDAS\",\n        meta: { githubCommitRef: \"main\", githubCommitSha: \"abc123\" },\n        target: \"production\",\n        aliasAssigned: true,\n        aliasError: null,\n        buildingAt: now - 3600000,\n        ready: now - 3540000,\n        creator: {\n          uid: \"user_123\",\n          username: \"masa\",\n          email: \"masa@example.com\"\n        }\n      },\n      {\n        uid: \"dpl_456def\", \n        name: \"ai-power-rankings\",\n        url: \"ai-power-rankings-git-main.vercel.app\",\n        created: now - 7200000,\n        createdAt: now - 7200000,\n        state: \"READY\",\n        readyState: \"READY\",\n        type: \"LAMBDAS\",\n        meta: { githubCommitRef: \"main\", githubCommitSha: \"def456\" },\n        target: \"production\", \n        aliasAssigned: true,\n        aliasError: null,\n        buildingAt: now - 7200000,\n        ready: now - 7080000,\n        creator: {\n          uid: \"user_123\",\n          username: \"masa\",\n          email: \"masa@example.com\"\n        }\n      },\n      {\n        uid: \"dpl_789ghi\",\n        name: \"matsuoka-com\", \n        url: \"matsuoka-com-git-main.vercel.app\",\n        created: now - 86400000,\n        createdAt: now - 86400000,\n        state: \"READY\",\n        readyState: \"READY\",\n        type: \"LAMBDAS\",\n        meta: { githubCommitRef: \"main\", githubCommitSha: \"ghi789\" },\n        target: \"production\",\n        aliasAssigned: true, \n        aliasError: null,\n        buildingAt: now - 86400000,\n        ready: now - 86390000,\n        creator: {\n          uid: \"user_123\",\n          username: \"masa\",\n          email: \"masa@example.com\"\n        }\n      },\n      {\n        uid: \"dpl_building\",\n        name: \"eva-monorepo\",\n        url: \"eva-monorepo-git-feature.vercel.app\", \n        created: now - 300000,\n        createdAt: now - 300000,\n        state: \"BUILDING\",\n        readyState: \"BUILDING\",\n        type: \"LAMBDAS\",\n        meta: { githubCommitRef: \"feature/updates\", githubCommitSha: \"building123\" },\n        target: \"preview\",\n        aliasAssigned: false,\n        aliasError: null,\n        buildingAt: now - 300000,\n        ready: undefined,\n        creator: {\n          uid: \"user_123\",\n          username: \"masa\",\n          email: \"masa@example.com\"\n        }\n      }\n    ]\n  }\n\n  async getProjectDeployments(projectId: string, limit = 10): Promise<VercelDeployment[]> {\n    try {\n      const response = await this.makeRequest<{ deployments: VercelDeployment[] }>\n        (`/v6/deployments?projectId=${projectId}&limit=${limit}`)\n      return response.deployments || []\n    } catch (error) {\n      console.error(`Error fetching deployments for project ${projectId}:`, error)\n      return []\n    }\n  }\n\n  async getDeploymentDetails(deploymentId: string): Promise<VercelDeployment | null> {\n    try {\n      const deployment = await this.makeRequest<VercelDeployment>(`/v13/deployments/${deploymentId}`)\n      return deployment\n    } catch (error) {\n      console.error(`Error fetching deployment details for ${deploymentId}:`, error)\n      return null\n    }\n  }\n\n  async getUserInfo() {\n    try {\n      const user = await this.makeRequest<{ user: any }>(\"/v2/user\")\n      return user.user\n    } catch (error) {\n      console.error(\"Error fetching Vercel user info:\", error)\n      return null\n    }\n  }\n\n  // Helper method to get deployment status with color coding\n  getDeploymentStatusInfo(state: VercelDeployment['state']) {\n    switch (state) {\n      case 'READY':\n        return { color: 'green', label: 'Ready', icon: '✅' }\n      case 'BUILDING':\n        return { color: 'blue', label: 'Building', icon: '🔄' }\n      case 'ERROR':\n        return { color: 'red', label: 'Error', icon: '❌' }\n      case 'QUEUED':\n        return { color: 'yellow', label: 'Queued', icon: '⏳' }\n      case 'INITIALIZING':\n        return { color: 'gray', label: 'Initializing', icon: '🔄' }\n      case 'CANCELED':\n        return { color: 'gray', label: 'Canceled', icon: '🚫' }\n      default:\n        return { color: 'gray', label: state, icon: '❓' }\n    }\n  }\n\n  // Helper to format deployment duration\n  getDeploymentDuration(deployment: VercelDeployment): string {\n    if (!deployment.ready || !deployment.buildingAt) return 'N/A'\n    \n    const duration = deployment.ready - deployment.buildingAt\n    if (duration < 60000) return `${Math.round(duration / 1000)}s`\n    return `${Math.round(duration / 60000)}m ${Math.round((duration % 60000) / 1000)}s`\n  }\n\n  // Helper to get relative time\n  getRelativeTime(timestamp: number): string {\n    const now = Date.now()\n    const diff = now - timestamp\n    \n    if (diff < 60000) return 'just now'\n    if (diff < 3600000) return `${Math.round(diff / 60000)}m ago`\n    if (diff < 86400000) return `${Math.round(diff / 3600000)}h ago`\n    return `${Math.round(diff / 86400000)}d ago`\n  }\n}\n\nexport const vercelService = new VercelService()","import { useQuery } from \"@tanstack/react-query\"\nimport { AlertCircle, Calendar, Clock, ExternalLink, GitBranch, Rocket, Server } from \"lucide-react\"\nimport type React from \"react\"\nimport { vercelService } from \"../services/vercelService\"\nimport type { VercelDeployment, VercelProject } from \"../types/vercelDeployments\"\n\nconst VercelDeployments: React.FC = () => {\n  const { data: projects, isLoading: projectsLoading, error: projectsError } = useQuery({\n    queryKey: [\"vercelProjects\"],\n    queryFn: () => vercelService.getProjects(),\n    refetchInterval: 5 * 60 * 1000, // Refetch every 5 minutes\n  })\n\n  const { data: deployments, isLoading: deploymentsLoading, error: deploymentsError } = useQuery({\n    queryKey: [\"vercelDeployments\"],\n    queryFn: () => vercelService.getDeployments(50),\n    refetchInterval: 30 * 1000, // Refetch every 30 seconds for real-time updates\n  })\n\n  const { data: userInfo } = useQuery({\n    queryKey: [\"vercelUser\"],\n    queryFn: () => vercelService.getUserInfo(),\n  })\n\n  const isLoading = projectsLoading || deploymentsLoading\n  const hasError = projectsError || deploymentsError\n\n  // Calculate stats\n  const activeDeployments = deployments?.filter(d => ['BUILDING', 'QUEUED', 'INITIALIZING'].includes(d.state)).length || 0\n  const recentDeployments = deployments?.filter(d => Date.now() - d.createdAt < 24 * 60 * 60 * 1000).length || 0\n  const productionDeployments = deployments?.filter(d => d.target === 'production').length || 0\n\n  if (isLoading) {\n    return (\n      <div className=\"flex items-center justify-center h-64\">\n        <div className=\"animate-spin rounded-full h-8 w-8 border-b-2 border-claude-blue\"></div>\n      </div>\n    )\n  }\n\n  if (hasError) {\n    return (\n      <div className=\"bg-red-50 border border-red-200 rounded-lg p-4\">\n        <div className=\"flex items-center\">\n          <AlertCircle className=\"h-5 w-5 text-red-400 mr-2\" />\n          <p className=\"text-red-800\">Error loading Vercel deployment data</p>\n        </div>\n      </div>\n    )\n  }\n\n  return (\n    <div className=\"space-y-6\">\n      {/* Header */}\n      <div className=\"bg-white shadow rounded-lg p-6\">\n        <div className=\"flex items-center justify-between\">\n          <div>\n            <h2 className=\"text-2xl font-bold text-gray-900 mb-2\">Vercel Deployments</h2>\n            <p className=\"text-gray-600\">Monitor your Vercel projects and deployment status</p>\n          </div>\n          {userInfo && (\n            <div className=\"text-right\">\n              <p className=\"text-sm text-gray-500\">Logged in as</p>\n              <p className=\"font-medium text-gray-900\">{userInfo.username || userInfo.name}</p>\n            </div>\n          )}\n        </div>\n      </div>\n\n      {/* Stats */}\n      <div className=\"grid grid-cols-1 md:grid-cols-4 gap-6\">\n        <div className=\"bg-white shadow rounded-lg p-6\">\n          <div className=\"flex items-center\">\n            <Server className=\"h-8 w-8 text-claude-blue\" />\n            <div className=\"ml-4\">\n              <p className=\"text-sm font-medium text-gray-500\">Total Projects</p>\n              <p className=\"text-2xl font-bold text-gray-900\">{projects?.length || 0}</p>\n            </div>\n          </div>\n        </div>\n\n        <div className=\"bg-white shadow rounded-lg p-6\">\n          <div className=\"flex items-center\">\n            <Rocket className=\"h-8 w-8 text-claude-green\" />\n            <div className=\"ml-4\">\n              <p className=\"text-sm font-medium text-gray-500\">Active Deployments</p>\n              <p className=\"text-2xl font-bold text-gray-900\">{activeDeployments}</p>\n            </div>\n          </div>\n        </div>\n\n        <div className=\"bg-white shadow rounded-lg p-6\">\n          <div className=\"flex items-center\">\n            <Calendar className=\"h-8 w-8 text-claude-purple\" />\n            <div className=\"ml-4\">\n              <p className=\"text-sm font-medium text-gray-500\">Today</p>\n              <p className=\"text-2xl font-bold text-gray-900\">{recentDeployments}</p>\n            </div>\n          </div>\n        </div>\n\n        <div className=\"bg-white shadow rounded-lg p-6\">\n          <div className=\"flex items-center\">\n            <GitBranch className=\"h-8 w-8 text-claude-orange\" />\n            <div className=\"ml-4\">\n              <p className=\"text-sm font-medium text-gray-500\">Production</p>\n              <p className=\"text-2xl font-bold text-gray-900\">{productionDeployments}</p>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      {/* Recent Deployments */}\n      <div className=\"bg-white shadow rounded-lg\">\n        <div className=\"px-6 py-4 border-b border-gray-200\">\n          <h3 className=\"text-lg font-medium text-gray-900\">Recent Deployments</h3>\n        </div>\n        <div className=\"px-6 py-4\">\n          {deployments && deployments.length > 0 ? (\n            <div className=\"space-y-4\">\n              {deployments.slice(0, 10).map((deployment: VercelDeployment) => {\n                const statusInfo = vercelService.getDeploymentStatusInfo(deployment.state)\n                const relativeTime = vercelService.getRelativeTime(deployment.createdAt)\n                const duration = vercelService.getDeploymentDuration(deployment)\n                \n                return (\n                  <div\n                    key={deployment.uid}\n                    className=\"flex items-center justify-between p-4 border border-gray-200 rounded-lg hover:bg-gray-50\"\n                  >\n                    <div className=\"flex items-center space-x-4\">\n                      <span className=\"text-2xl\">{statusInfo.icon}</span>\n                      <div>\n                        <div className=\"flex items-center space-x-2\">\n                          <h4 className=\"font-medium text-gray-900\">{deployment.name}</h4>\n                          <span className={`px-2 py-1 text-xs rounded-full ${\n                            deployment.target === 'production' \n                              ? 'bg-green-100 text-green-800'\n                              : deployment.target === 'preview'\n                              ? 'bg-blue-100 text-blue-800'\n                              : 'bg-gray-100 text-gray-800'\n                          }`}>\n                            {deployment.target}\n                          </span>\n                        </div>\n                        <div className=\"flex items-center space-x-4 text-sm text-gray-500 mt-1\">\n                          <span className=\"flex items-center\">\n                            <Clock className=\"h-4 w-4 mr-1\" />\n                            {relativeTime}\n                          </span>\n                          {deployment.meta?.githubCommitMessage && (\n                            <span className=\"flex items-center\">\n                              <GitBranch className=\"h-4 w-4 mr-1\" />\n                              {deployment.meta.githubCommitMessage.slice(0, 50)}\n                              {deployment.meta.githubCommitMessage.length > 50 ? '...' : ''}\n                            </span>\n                          )}\n                          {duration !== 'N/A' && (\n                            <span>Duration: {duration}</span>\n                          )}\n                        </div>\n                      </div>\n                    </div>\n                    \n                    <div className=\"flex items-center space-x-2\">\n                      <span className={`px-3 py-1 text-sm font-medium rounded-full ${\n                        statusInfo.color === 'green' ? 'bg-green-100 text-green-800' :\n                        statusInfo.color === 'blue' ? 'bg-blue-100 text-blue-800' :\n                        statusInfo.color === 'red' ? 'bg-red-100 text-red-800' :\n                        statusInfo.color === 'yellow' ? 'bg-yellow-100 text-yellow-800' :\n                        'bg-gray-100 text-gray-800'\n                      }`}>\n                        {statusInfo.label}\n                      </span>\n                      \n                      {deployment.url && deployment.state === 'READY' && (\n                        <a\n                          href={`https://${deployment.url}`}\n                          target=\"_blank\"\n                          rel=\"noopener noreferrer\"\n                          className=\"p-2 text-gray-400 hover:text-gray-600\"\n                        >\n                          <ExternalLink className=\"h-4 w-4\" />\n                        </a>\n                      )}\n                    </div>\n                  </div>\n                )\n              })}\n            </div>\n          ) : (\n            <p className=\"text-gray-500 text-center py-8\">No deployments found</p>\n          )}\n        </div>\n      </div>\n\n      {/* Projects Overview */}\n      <div className=\"bg-white shadow rounded-lg\">\n        <div className=\"px-6 py-4 border-b border-gray-200\">\n          <h3 className=\"text-lg font-medium text-gray-900\">Projects</h3>\n        </div>\n        <div className=\"px-6 py-4\">\n          {projects && projects.length > 0 ? (\n            <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n              {projects.map((project: VercelProject) => (\n                <div key={project.id} className=\"border border-gray-200 rounded-lg p-4\">\n                  <div className=\"flex items-center justify-between mb-2\">\n                    <h4 className=\"font-medium text-gray-900\">{project.name}</h4>\n                    <span className={`w-3 h-3 rounded-full ${\n                      project.live ? 'bg-green-400' : 'bg-gray-400'\n                    }`} />\n                  </div>\n                  <div className=\"space-y-1 text-sm text-gray-600\">\n                    {project.framework && (\n                      <p>Framework: {project.framework}</p>\n                    )}\n                    {project.link?.repo && (\n                      <p className=\"flex items-center\">\n                        <GitBranch className=\"h-4 w-4 mr-1\" />\n                        {project.link.org}/{project.link.repo}\n                      </p>\n                    )}\n                    <p>Updated: {vercelService.getRelativeTime(project.updatedAt)}</p>\n                  </div>\n                </div>\n              ))}\n            </div>\n          ) : (\n            <p className=\"text-gray-500 text-center py-8\">No projects found</p>\n          )}\n        </div>\n      </div>\n    </div>\n  )\n}\n\nexport default VercelDeployments","import { QueryClient, QueryClientProvider } from \"@tanstack/react-query\"\nimport { Route, BrowserRouter as Router, Routes } from \"react-router-dom\"\nimport Dashboard from \"./components/Dashboard\"\nimport KeyManagement from \"./components/KeyManagement\"\nimport Layout from \"./components/Layout\"\nimport ProjectDetail from \"./components/ProjectDetail\"\nimport ProjectList from \"./components/ProjectList\"\nimport ProcessDashboard from \"./components/ProcessDashboard\"\nimport VercelDeployments from \"./components/VercelDeployments\"\n\nconst queryClient = new QueryClient({\n  defaultOptions: {\n    queries: {\n      staleTime: 5 * 60 * 1000, // 5 minutes\n      cacheTime: 10 * 60 * 1000, // 10 minutes\n    },\n  },\n})\n\nfunction App() {\n  return (\n    <QueryClientProvider client={queryClient}>\n      <Router>\n        <Layout>\n          <Routes>\n            <Route path=\"/\" element={<Dashboard />} />\n            <Route path=\"/projects\" element={<ProjectList />} />\n            <Route path=\"/projects/:projectId\" element={<ProjectDetail />} />\n            <Route path=\"/processes\" element={<ProcessDashboard />} />\n            <Route path=\"/keys\" element={<KeyManagement />} />\n            <Route path=\"/deployments\" element={<VercelDeployments />} />\n          </Routes>\n        </Layout>\n      </Router>\n    </QueryClientProvider>\n  )\n}\n\nexport default App\n","import { useState, useEffect, useRef } from 'react'\nimport { ProcessData, ActivityData, WebSocketMessage } from '../types/processTracker'\n\ninterface UseWebSocketReturn {\n  processData: ProcessData | null\n  activityData: ActivityData | null\n  isConnected: boolean\n  error: string | null\n  reconnectAttempts: number\n  lastUpdate: Date | null\n}\n\ninterface UseWebSocketOptions {\n  url?: string\n  autoReconnect?: boolean\n  maxReconnectAttempts?: number\n  reconnectInterval?: number\n}\n\nexport function useWebSocket(options: UseWebSocketOptions = {}): UseWebSocketReturn {\n  const {\n    url = 'ws://localhost:8082',\n    autoReconnect = true,\n    maxReconnectAttempts = 10,\n    reconnectInterval = 5000\n  } = options\n\n  const [processData, setProcessData] = useState<ProcessData | null>(null)\n  const [activityData, setActivityData] = useState<ActivityData | null>(null)\n  const [isConnected, setIsConnected] = useState(false)\n  const [error, setError] = useState<string | null>(null)\n  const [reconnectAttempts, setReconnectAttempts] = useState(0)\n  const [lastUpdate, setLastUpdate] = useState<Date | null>(null)\n\n  const wsRef = useRef<WebSocket | null>(null)\n  const reconnectTimeoutRef = useRef<NodeJS.Timeout | null>(null)\n  const mountedRef = useRef(true)\n\n  const connect = () => {\n    if (!mountedRef.current) return\n\n    try {\n      const ws = new WebSocket(url)\n      wsRef.current = ws\n\n      ws.onopen = () => {\n        if (!mountedRef.current) return\n        \n        console.log('🔗 WebSocket connected to process tracker')\n        setIsConnected(true)\n        setError(null)\n        setReconnectAttempts(0)\n        setLastUpdate(new Date())\n      }\n\n      ws.onmessage = (event) => {\n        if (!mountedRef.current) return\n\n        try {\n          const message: WebSocketMessage = JSON.parse(event.data)\n          setLastUpdate(new Date())\n\n          switch (message.type) {\n            case 'processUpdate':\n              setProcessData(message.data as ProcessData)\n              console.log('📊 Process data updated:', (message.data as ProcessData).processCount, 'processes')\n              break\n            \n            case 'activityUpdate':\n              setActivityData(message.data as ActivityData)\n              console.log('📝 Activity data updated:', (message.data as ActivityData).count, 'responses')\n              break\n            \n            case 'systemUpdate':\n              // Handle system updates if needed\n              console.log('⚙️ System update received')\n              break\n            \n            default:\n              console.warn('🤷 Unknown WebSocket message type:', message.type)\n          }\n        } catch (err) {\n          console.error('❌ Error parsing WebSocket message:', err)\n          setError(`Failed to parse message: ${err instanceof Error ? err.message : 'Unknown error'}`)\n        }\n      }\n\n      ws.onclose = (event) => {\n        if (!mountedRef.current) return\n\n        console.log('🔌 WebSocket disconnected:', event.code, event.reason)\n        setIsConnected(false)\n        wsRef.current = null\n\n        // Auto-reconnect if enabled and not a clean close\n        if (autoReconnect && event.code !== 1000 && reconnectAttempts < maxReconnectAttempts) {\n          const nextAttempt = reconnectAttempts + 1\n          setReconnectAttempts(nextAttempt)\n          setError(`Connection lost. Reconnecting... (${nextAttempt}/${maxReconnectAttempts})`)\n          \n          reconnectTimeoutRef.current = setTimeout(() => {\n            if (mountedRef.current) {\n              console.log(`🔄 Reconnection attempt ${nextAttempt}/${maxReconnectAttempts}`)\n              connect()\n            }\n          }, reconnectInterval)\n        } else if (reconnectAttempts >= maxReconnectAttempts) {\n          setError(`Failed to reconnect after ${maxReconnectAttempts} attempts`)\n        }\n      }\n\n      ws.onerror = (event) => {\n        if (!mountedRef.current) return\n        \n        console.error('❌ WebSocket error:', event)\n        setError('WebSocket connection error')\n      }\n\n    } catch (err) {\n      console.error('❌ Error creating WebSocket:', err)\n      setError(`Connection failed: ${err instanceof Error ? err.message : 'Unknown error'}`)\n    }\n  }\n\n  const disconnect = () => {\n    if (reconnectTimeoutRef.current) {\n      clearTimeout(reconnectTimeoutRef.current)\n      reconnectTimeoutRef.current = null\n    }\n\n    if (wsRef.current) {\n      wsRef.current.close(1000, 'Manual disconnect')\n      wsRef.current = null\n    }\n\n    setIsConnected(false)\n  }\n\n  // Initial connection and cleanup\n  useEffect(() => {\n    mountedRef.current = true\n    connect()\n\n    return () => {\n      mountedRef.current = false\n      disconnect()\n    }\n  }, [url])\n\n  // Cleanup on unmount\n  useEffect(() => {\n    return () => {\n      mountedRef.current = false\n      disconnect()\n    }\n  }, [])\n\n  return {\n    processData,\n    activityData,\n    isConnected,\n    error,\n    reconnectAttempts,\n    lastUpdate\n  }\n}\n\nexport default useWebSocket","import { useState } from 'react'\nimport { ClaudeProcess } from '../../types/processTracker'\n\ninterface ProcessActionsProps {\n  process: ClaudeProcess\n  onAction: (pid: number, action: 'stop' | 'restart' | 'kill') => void\n  disabled?: boolean\n}\n\nexport default function ProcessActions({ process, onAction, disabled = false }: ProcessActionsProps) {\n  const [confirmAction, setConfirmAction] = useState<'stop' | 'restart' | 'kill' | null>(null)\n  const [isLoading, setIsLoading] = useState(false)\n\n  const handleAction = async (action: 'stop' | 'restart' | 'kill') => {\n    if (disabled) return\n    \n    setIsLoading(true)\n    try {\n      await onAction(process.pid, action)\n      setConfirmAction(null)\n    } catch (error) {\n      console.error(`Failed to ${action} process:`, error)\n    } finally {\n      setIsLoading(false)\n    }\n  }\n\n  const getActionIcon = (action: string) => {\n    switch (action) {\n      case 'stop':\n        return '⏸'\n      case 'restart':\n        return '🔄'\n      case 'kill':\n        return '⚠'\n      default:\n        return '•'\n    }\n  }\n\n  const getActionColor = (action: string) => {\n    switch (action) {\n      case 'stop':\n        return 'border-yellow-300 text-yellow-700 hover:bg-yellow-50'\n      case 'restart':\n        return 'border-blue-300 text-blue-700 hover:bg-blue-50'\n      case 'kill':\n        return 'border-red-300 text-red-700 hover:bg-red-50'\n      default:\n        return 'border-gray-300 text-gray-700 hover:bg-gray-50'\n    }\n  }\n\n  const isSystemCritical = (proc: ClaudeProcess) => {\n    return proc.type === 'monitor' || proc.port === 8082 || proc.port === 8081\n  }\n\n  if (confirmAction) {\n    return (\n      <div className=\"flex items-center space-x-2\">\n        <span className=\"text-xs text-gray-600\">\n          {confirmAction === 'kill' ? 'Force kill' : confirmAction.charAt(0).toUpperCase() + confirmAction.slice(1)} \n          PID {process.pid}?\n        </span>\n        <button\n          onClick={() => handleAction(confirmAction)}\n          disabled={isLoading}\n          className={`px-2 py-1 text-xs border rounded ${\n            isLoading \n              ? 'border-gray-200 text-gray-400 bg-gray-50' \n              : 'border-red-300 text-red-700 hover:bg-red-50'\n          }`}\n        >\n          {isLoading ? '...' : 'Confirm'}\n        </button>\n        <button\n          onClick={() => setConfirmAction(null)}\n          disabled={isLoading}\n          className=\"px-2 py-1 text-xs border border-gray-300 text-gray-700 hover:bg-gray-50 rounded\"\n        >\n          Cancel\n        </button>\n      </div>\n    )\n  }\n\n  return (\n    <div className=\"flex items-center space-x-1\">\n      {/* Stop/Pause */}\n      {process.status === 'running' && (\n        <button\n          onClick={() => setConfirmAction('stop')}\n          disabled={disabled || isSystemCritical(process)}\n          className={`px-2 py-1 text-xs border rounded ${\n            disabled || isSystemCritical(process)\n              ? 'border-gray-200 text-gray-400 bg-gray-50 cursor-not-allowed'\n              : getActionColor('stop')\n          }`}\n          title={isSystemCritical(process) ? 'System critical process - cannot stop' : 'Stop process'}\n        >\n          {getActionIcon('stop')}\n        </button>\n      )}\n\n      {/* Restart */}\n      <button\n        onClick={() => setConfirmAction('restart')}\n        disabled={disabled || isSystemCritical(process)}\n        className={`px-2 py-1 text-xs border rounded ${\n          disabled || isSystemCritical(process)\n            ? 'border-gray-200 text-gray-400 bg-gray-50 cursor-not-allowed'\n            : getActionColor('restart')\n        }`}\n        title={isSystemCritical(process) ? 'System critical process - restart with caution' : 'Restart process'}\n      >\n        {getActionIcon('restart')}\n      </button>\n\n      {/* Force Kill - Only for non-critical processes */}\n      {!isSystemCritical(process) && (\n        <button\n          onClick={() => setConfirmAction('kill')}\n          disabled={disabled}\n          className={`px-2 py-1 text-xs border rounded ${\n            disabled\n              ? 'border-gray-200 text-gray-400 bg-gray-50 cursor-not-allowed'\n              : getActionColor('kill')\n          }`}\n          title=\"Force kill process (use with caution)\"\n        >\n          {getActionIcon('kill')}\n        </button>\n      )}\n\n      {isSystemCritical(process) && (\n        <span className=\"text-xs text-blue-600 font-medium bg-blue-50 px-2 py-1 rounded\">\n          🔒 Protected\n        </span>\n      )}\n    </div>\n  )\n}","import { useState } from 'react'\nimport { ClaudeProcess, ProcessData } from '../../types/processTracker'\nimport ProcessActions from './ProcessActions'\n// import { processControlService } from '../../services/processControl'\n\ninterface ProcessTableProps {\n  data: ProcessData | null\n  loading: boolean\n  error: string | null\n}\n\ninterface SortConfig {\n  key: keyof ClaudeProcess | null\n  direction: 'asc' | 'desc'\n}\n\nexport default function ProcessTable({ data, loading, error }: ProcessTableProps) {\n  const [sortConfig, setSortConfig] = useState<SortConfig>({ key: null, direction: 'asc' })\n  const [filter, setFilter] = useState('')\n\n  const formatMemory = (bytes: number) => {\n    const mb = bytes / (1024 * 1024)\n    return `${mb.toFixed(1)} MB`\n  }\n\n  const formatUptime = (elapsedTime: string) => {\n    return elapsedTime\n  }\n\n  const getStatusIcon = (status: string) => {\n    switch (status) {\n      case 'running':\n        return <span className=\"text-green-500\">●</span>\n      case 'error':\n        return <span className=\"text-red-500\">●</span>\n      case 'stopped':\n        return <span className=\"text-yellow-500\">●</span>\n      default:\n        return <span className=\"text-gray-500\">●</span>\n    }\n  }\n\n  const handleSort = (key: keyof ClaudeProcess) => {\n    let direction: 'asc' | 'desc' = 'asc'\n    if (sortConfig.key === key && sortConfig.direction === 'asc') {\n      direction = 'desc'\n    }\n    setSortConfig({ key, direction })\n  }\n\n  const sortedAndFilteredProcesses = () => {\n    if (!data?.processes) return []\n\n    let filtered = data.processes.filter(process => \n      process.name.toLowerCase().includes(filter.toLowerCase()) ||\n      process.type.toLowerCase().includes(filter.toLowerCase()) ||\n      process.pid.toString().includes(filter) ||\n      (process.port && process.port.toString().includes(filter))\n    )\n\n    if (sortConfig.key) {\n      filtered.sort((a, b) => {\n        const aValue = a[sortConfig.key!]\n        const bValue = b[sortConfig.key!]\n        \n        if (aValue != null && bValue != null) {\n          if (aValue < bValue) {\n            return sortConfig.direction === 'asc' ? -1 : 1\n          }\n          if (aValue > bValue) {\n            return sortConfig.direction === 'asc' ? 1 : -1\n          }\n        }\n        return 0\n      })\n    }\n\n    return filtered\n  }\n\n  const getSortIcon = (key: keyof ClaudeProcess) => {\n    if (sortConfig.key !== key) {\n      return <span className=\"text-gray-400\">↕</span>\n    }\n    return sortConfig.direction === 'asc' ? \n      <span className=\"text-blue-500\">↑</span> : \n      <span className=\"text-blue-500\">↓</span>\n  }\n\n  if (loading) {\n    return (\n      <div className=\"bg-white rounded-lg shadow p-6\">\n        <div className=\"animate-pulse\">\n          <div className=\"h-4 bg-gray-200 rounded w-1/4 mb-4\"></div>\n          <div className=\"space-y-3\">\n            {[...Array(5)].map((_, i) => (\n              <div key={i} className=\"h-4 bg-gray-200 rounded\"></div>\n            ))}\n          </div>\n        </div>\n      </div>\n    )\n  }\n\n  if (error) {\n    return (\n      <div className=\"bg-white rounded-lg shadow p-6\">\n        <div className=\"text-red-600 text-center\">\n          <p className=\"font-semibold\">Error loading process data</p>\n          <p className=\"text-sm mt-1\">{error}</p>\n        </div>\n      </div>\n    )\n  }\n\n  const processes = sortedAndFilteredProcesses()\n\n  return (\n    <div className=\"bg-white rounded-lg shadow\">\n      <div className=\"p-6 border-b border-gray-200\">\n        <div className=\"flex justify-between items-center\">\n          <h2 className=\"text-lg font-semibold text-gray-900\">\n            Process Monitor ({data?.processCount || 0} processes)\n          </h2>\n          <div className=\"flex items-center space-x-2\">\n            <input\n              type=\"text\"\n              placeholder=\"Filter processes...\"\n              value={filter}\n              onChange={(e) => setFilter(e.target.value)}\n              className=\"px-3 py-1 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500\"\n            />\n            <div className=\"text-xs text-gray-500\">\n              Last updated: {data?.timestamp ? new Date(data.timestamp).toLocaleTimeString() : 'Never'}\n            </div>\n          </div>\n        </div>\n      </div>\n\n      <div className=\"overflow-x-auto\">\n        <table className=\"min-w-full divide-y divide-gray-200\">\n          <thead className=\"bg-gray-50\">\n            <tr>\n              <th \n                onClick={() => handleSort('status')}\n                className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100\"\n              >\n                <div className=\"flex items-center space-x-1\">\n                  <span>Status</span>\n                  {getSortIcon('status')}\n                </div>\n              </th>\n              <th \n                onClick={() => handleSort('pid')}\n                className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100\"\n              >\n                <div className=\"flex items-center space-x-1\">\n                  <span>PID</span>\n                  {getSortIcon('pid')}\n                </div>\n              </th>\n              <th \n                onClick={() => handleSort('name')}\n                className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100\"\n              >\n                <div className=\"flex items-center space-x-1\">\n                  <span>Name</span>\n                  {getSortIcon('name')}\n                </div>\n              </th>\n              <th \n                onClick={() => handleSort('type')}\n                className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100\"\n              >\n                <div className=\"flex items-center space-x-1\">\n                  <span>Type</span>\n                  {getSortIcon('type')}\n                </div>\n              </th>\n              <th \n                onClick={() => handleSort('port')}\n                className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100\"\n              >\n                <div className=\"flex items-center space-x-1\">\n                  <span>Port</span>\n                  {getSortIcon('port')}\n                </div>\n              </th>\n              <th className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\">\n                CPU %\n              </th>\n              <th className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\">\n                Memory\n              </th>\n              <th className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\">\n                Uptime\n              </th>\n              <th className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\">\n                Last Activity\n              </th>\n              <th className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider\">\n                Actions\n              </th>\n            </tr>\n          </thead>\n          <tbody className=\"bg-white divide-y divide-gray-200\">\n            {processes.map((process) => (\n              <tr key={process.pid} className=\"hover:bg-gray-50\">\n                <td className=\"px-6 py-4 whitespace-nowrap\">\n                  <div className=\"flex items-center\">\n                    {getStatusIcon(process.status)}\n                    <span className=\"ml-2 text-sm font-medium text-gray-900 capitalize\">\n                      {process.status}\n                    </span>\n                  </div>\n                </td>\n                <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-900 font-mono\">\n                  {process.pid}\n                </td>\n                <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-900\">\n                  {process.name}\n                </td>\n                <td className=\"px-6 py-4 whitespace-nowrap\">\n                  <span className=\"inline-flex px-2 py-1 text-xs font-semibold rounded-full bg-blue-100 text-blue-800\">\n                    {process.type}\n                  </span>\n                </td>\n                <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-900 font-mono\">\n                  {process.port || '—'}\n                </td>\n                <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-900 font-mono\">\n                  <div className=\"flex items-center\">\n                    <div className=\"flex-1\">\n                      <div className=\"flex items-center\">\n                        <span className=\"text-sm font-medium\">\n                          {process.resourceUsage.cpu.toFixed(1)}%\n                        </span>\n                      </div>\n                      <div className=\"w-16 bg-gray-200 rounded-full h-1 mt-1\">\n                        <div \n                          className=\"bg-blue-600 h-1 rounded-full\" \n                          style={{ width: `${Math.min(process.resourceUsage.cpu, 100)}%` }}\n                        ></div>\n                      </div>\n                    </div>\n                  </div>\n                </td>\n                <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-900 font-mono\">\n                  <div className=\"flex flex-col\">\n                    <span>{formatMemory(process.resourceUsage.memory)}</span>\n                    <span className=\"text-xs text-gray-500\">\n                      {process.resourceUsage.memoryPercent.toFixed(1)}%\n                    </span>\n                  </div>\n                </td>\n                <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-900 font-mono\">\n                  {formatUptime(process.elapsedTime)}\n                </td>\n                <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-500\">\n                  <div className=\"max-w-xs truncate\" title={process.lastResponse}>\n                    {new Date(process.lastActivity).toLocaleTimeString()}\n                  </div>\n                  <div className=\"text-xs text-gray-400 max-w-xs truncate\" title={process.lastResponse}>\n                    {process.lastResponse}\n                  </div>\n                </td>\n                <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-500\">\n                  <ProcessActions process={process} onAction={() => {}} />\n                </td>\n              </tr>\n            ))}\n          </tbody>\n        </table>\n      </div>\n\n      {processes.length === 0 && (\n        <div className=\"text-center py-8 text-gray-500\">\n          <p>No processes match your filter criteria</p>\n        </div>\n      )}\n    </div>\n  )\n}","import { useState, useEffect } from 'react'\nimport { ActivityData } from '../../types/processTracker'\n\ninterface ActivityFeedProps {\n  data: ActivityData | null\n  loading: boolean\n  error: string | null\n  maxItems?: number\n}\n\ninterface FilterConfig {\n  type: 'all' | 'info' | 'warning' | 'error'\n  priority: 'all' | 'low' | 'medium' | 'high'\n  source: string\n}\n\nexport default function ActivityFeed({ data, loading, error, maxItems = 50 }: ActivityFeedProps) {\n  const [filter, setFilter] = useState<FilterConfig>({\n    type: 'all',\n    priority: 'all',\n    source: ''\n  })\n  const [isAutoScroll, setIsAutoScroll] = useState(true)\n\n  const getTypeIcon = (type: string) => {\n    switch (type) {\n      case 'info':\n        return <span className=\"text-blue-500\">ℹ</span>\n      case 'warning':\n        return <span className=\"text-yellow-500\">⚠</span>\n      case 'error':\n        return <span className=\"text-red-500\">✕</span>\n      default:\n        return <span className=\"text-gray-500\">•</span>\n    }\n  }\n\n  const getTypeColor = (type: string) => {\n    switch (type) {\n      case 'info':\n        return 'text-blue-600 bg-blue-50 border-blue-200'\n      case 'warning':\n        return 'text-yellow-600 bg-yellow-50 border-yellow-200'\n      case 'error':\n        return 'text-red-600 bg-red-50 border-red-200'\n      default:\n        return 'text-gray-600 bg-gray-50 border-gray-200'\n    }\n  }\n\n  const getPriorityColor = (priority: string) => {\n    switch (priority) {\n      case 'high':\n        return 'bg-red-100 text-red-800'\n      case 'medium':\n        return 'bg-yellow-100 text-yellow-800'\n      case 'low':\n        return 'bg-green-100 text-green-800'\n      default:\n        return 'bg-gray-100 text-gray-800'\n    }\n  }\n\n  const formatTimeAgo = (timestamp: string) => {\n    const now = new Date()\n    const time = new Date(timestamp)\n    const diffMs = now.getTime() - time.getTime()\n    const diffSeconds = Math.floor(diffMs / 1000)\n    const diffMinutes = Math.floor(diffSeconds / 60)\n    const diffHours = Math.floor(diffMinutes / 60)\n\n    if (diffSeconds < 60) {\n      return `${diffSeconds}s ago`\n    } else if (diffMinutes < 60) {\n      return `${diffMinutes}m ago`\n    } else if (diffHours < 24) {\n      return `${diffHours}h ago`\n    } else {\n      return time.toLocaleDateString()\n    }\n  }\n\n  const truncateMessage = (message: string, maxLength: number = 80) => {\n    if (message.length <= maxLength) return message\n    return message.substring(0, maxLength) + '...'\n  }\n\n  const filteredActivities = () => {\n    if (!data?.responses) return []\n\n    let filtered = data.responses.filter(activity => {\n      const typeMatch = filter.type === 'all' || activity.type === filter.type\n      const priorityMatch = filter.priority === 'all' || activity.priority === filter.priority\n      const sourceMatch = !filter.source || activity.source.toLowerCase().includes(filter.source.toLowerCase())\n      \n      return typeMatch && priorityMatch && sourceMatch\n    })\n\n    // Sort by timestamp (newest first) and limit\n    return filtered\n      .sort((a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime())\n      .slice(0, maxItems)\n  }\n\n  // Auto-scroll to top when new activities arrive\n  useEffect(() => {\n    if (isAutoScroll && data) {\n      const feedContainer = document.getElementById('activity-feed-container')\n      if (feedContainer) {\n        feedContainer.scrollTop = 0\n      }\n    }\n  }, [data, isAutoScroll])\n\n  const getUniqueSourceOptions = () => {\n    if (!data?.responses) return []\n    const sources = [...new Set(data.responses.map(activity => activity.source))]\n    return sources.sort()\n  }\n\n  if (loading) {\n    return (\n      <div className=\"bg-white rounded-lg shadow p-6\">\n        <div className=\"animate-pulse\">\n          <div className=\"h-4 bg-gray-200 rounded w-1/3 mb-4\"></div>\n          <div className=\"space-y-3\">\n            {[...Array(8)].map((_, i) => (\n              <div key={i} className=\"flex space-x-3\">\n                <div className=\"h-4 w-4 bg-gray-200 rounded\"></div>\n                <div className=\"flex-1\">\n                  <div className=\"h-3 bg-gray-200 rounded w-3/4 mb-1\"></div>\n                  <div className=\"h-2 bg-gray-200 rounded w-1/2\"></div>\n                </div>\n              </div>\n            ))}\n          </div>\n        </div>\n      </div>\n    )\n  }\n\n  if (error) {\n    return (\n      <div className=\"bg-white rounded-lg shadow p-6\">\n        <div className=\"text-red-600 text-center\">\n          <p className=\"font-semibold\">Error loading activity feed</p>\n          <p className=\"text-sm mt-1\">{error}</p>\n        </div>\n      </div>\n    )\n  }\n\n  const activities = filteredActivities()\n\n  return (\n    <div className=\"bg-white rounded-lg shadow\">\n      <div className=\"p-6 border-b border-gray-200\">\n        <div className=\"flex justify-between items-center mb-4\">\n          <h2 className=\"text-lg font-semibold text-gray-900\">\n            Activity Feed ({data?.count || 0} total responses)\n          </h2>\n          <div className=\"flex items-center space-x-2\">\n            <button\n              onClick={() => setIsAutoScroll(!isAutoScroll)}\n              className={`px-3 py-1 text-xs rounded ${\n                isAutoScroll \n                  ? 'bg-blue-100 text-blue-800' \n                  : 'bg-gray-100 text-gray-600'\n              }`}\n            >\n              Auto-scroll: {isAutoScroll ? 'ON' : 'OFF'}\n            </button>\n            <div className=\"text-xs text-gray-500\">\n              Last updated: {data?.timestamp ? new Date(data.timestamp).toLocaleTimeString() : 'Never'}\n            </div>\n          </div>\n        </div>\n\n        {/* Filters */}\n        <div className=\"flex flex-wrap gap-4 text-sm\">\n          <div className=\"flex items-center space-x-2\">\n            <label className=\"text-gray-600 font-medium\">Type:</label>\n            <select\n              value={filter.type}\n              onChange={(e) => setFilter(prev => ({ ...prev, type: e.target.value as any }))}\n              className=\"px-2 py-1 border border-gray-300 rounded text-sm focus:ring-2 focus:ring-blue-500\"\n            >\n              <option value=\"all\">All</option>\n              <option value=\"info\">Info</option>\n              <option value=\"warning\">Warning</option>\n              <option value=\"error\">Error</option>\n            </select>\n          </div>\n\n          <div className=\"flex items-center space-x-2\">\n            <label className=\"text-gray-600 font-medium\">Priority:</label>\n            <select\n              value={filter.priority}\n              onChange={(e) => setFilter(prev => ({ ...prev, priority: e.target.value as any }))}\n              className=\"px-2 py-1 border border-gray-300 rounded text-sm focus:ring-2 focus:ring-blue-500\"\n            >\n              <option value=\"all\">All</option>\n              <option value=\"high\">High</option>\n              <option value=\"medium\">Medium</option>\n              <option value=\"low\">Low</option>\n            </select>\n          </div>\n\n          <div className=\"flex items-center space-x-2\">\n            <label className=\"text-gray-600 font-medium\">Source:</label>\n            <select\n              value={filter.source}\n              onChange={(e) => setFilter(prev => ({ ...prev, source: e.target.value }))}\n              className=\"px-2 py-1 border border-gray-300 rounded text-sm focus:ring-2 focus:ring-blue-500\"\n            >\n              <option value=\"\">All Sources</option>\n              {getUniqueSourceOptions().map(source => (\n                <option key={source} value={source}>{source}</option>\n              ))}\n            </select>\n          </div>\n\n          {(filter.type !== 'all' || filter.priority !== 'all' || filter.source) && (\n            <button\n              onClick={() => setFilter({ type: 'all', priority: 'all', source: '' })}\n              className=\"px-2 py-1 text-xs bg-gray-100 hover:bg-gray-200 rounded\"\n            >\n              Clear Filters\n            </button>\n          )}\n        </div>\n      </div>\n\n      {/* Activity List */}\n      <div \n        id=\"activity-feed-container\"\n        className=\"max-h-96 overflow-y-auto\"\n      >\n        {activities.length === 0 ? (\n          <div className=\"text-center py-8 text-gray-500\">\n            <p>No activities match your filter criteria</p>\n          </div>\n        ) : (\n          <div className=\"divide-y divide-gray-100\">\n            {activities.map((activity) => (\n              <div key={activity.id} className=\"p-4 hover:bg-gray-50\">\n                <div className=\"flex items-start space-x-3\">\n                  <div className=\"flex-shrink-0 mt-1\">\n                    {getTypeIcon(activity.type)}\n                  </div>\n                  \n                  <div className=\"flex-1 min-w-0\">\n                    <div className=\"flex items-center justify-between mb-1\">\n                      <div className=\"flex items-center space-x-2\">\n                        <span className={`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${getPriorityColor(activity.priority)}`}>\n                          {activity.priority}\n                        </span>\n                        <span className={`inline-flex px-2 py-1 text-xs rounded border ${getTypeColor(activity.type)}`}>\n                          {activity.type}\n                        </span>\n                      </div>\n                      <span className=\"text-xs text-gray-500\">\n                        {formatTimeAgo(activity.timestamp)}\n                      </span>\n                    </div>\n                    \n                    <p className=\"text-sm text-gray-900 mb-1\" title={activity.message}>\n                      {truncateMessage(activity.message)}\n                    </p>\n                    \n                    <div className=\"flex items-center justify-between\">\n                      <span className=\"text-xs text-gray-500\">\n                        {activity.source}\n                      </span>\n                      <span className=\"text-xs text-gray-400 font-mono\">\n                        {new Date(activity.timestamp).toLocaleTimeString()}\n                      </span>\n                    </div>\n                    \n                    {activity.raw && activity.raw !== activity.message && (\n                      <details className=\"mt-2\">\n                        <summary className=\"text-xs text-gray-400 cursor-pointer hover:text-gray-600\">\n                          Show raw message\n                        </summary>\n                        <div className=\"mt-1 text-xs text-gray-600 bg-gray-50 p-2 rounded border font-mono whitespace-pre-wrap break-all\">\n                          {activity.raw}\n                        </div>\n                      </details>\n                    )}\n                  </div>\n                </div>\n              </div>\n            ))}\n          </div>\n        )}\n      </div>\n\n      {activities.length >= maxItems && (\n        <div className=\"px-4 py-2 border-t border-gray-200 text-center\">\n          <span className=\"text-xs text-gray-500\">\n            Showing latest {maxItems} activities (filtered from {data?.count || 0} total)\n          </span>\n        </div>\n      )}\n    </div>\n  )\n}","import { ProcessData, SystemInfo } from '../../types/processTracker'\n\ninterface SystemMetricsProps {\n  data: ProcessData | null\n  loading: boolean\n  error: string | null\n}\n\nexport default function SystemMetrics({ data, loading, error }: SystemMetricsProps) {\n  const formatMemory = (bytes: number) => {\n    const gb = bytes / (1024 * 1024 * 1024)\n    if (gb >= 1) {\n      return `${gb.toFixed(1)} GB`\n    }\n    const mb = bytes / (1024 * 1024)\n    return `${mb.toFixed(0)} MB`\n  }\n\n  const getSystemHealth = (systemInfo: SystemInfo) => {\n    const healthScore = (systemInfo.runningProcesses / systemInfo.totalProcesses) * 100\n    \n    if (healthScore >= 95) return { status: 'Excellent', color: 'text-green-600 bg-green-50 border-green-200' }\n    if (healthScore >= 85) return { status: 'Good', color: 'text-green-600 bg-green-50 border-green-200' }\n    if (healthScore >= 70) return { status: 'Fair', color: 'text-yellow-600 bg-yellow-50 border-yellow-200' }\n    if (healthScore >= 50) return { status: 'Poor', color: 'text-orange-600 bg-orange-50 border-orange-200' }\n    return { status: 'Critical', color: 'text-red-600 bg-red-50 border-red-200' }\n  }\n\n  const getCpuColor = (cpuUsage: number) => {\n    if (cpuUsage >= 80) return 'bg-red-500'\n    if (cpuUsage >= 60) return 'bg-orange-500'\n    if (cpuUsage >= 40) return 'bg-yellow-500'\n    return 'bg-green-500'\n  }\n\n  const getMemoryColor = (memoryPercent: number) => {\n    if (memoryPercent >= 85) return 'bg-red-500'\n    if (memoryPercent >= 70) return 'bg-orange-500'\n    if (memoryPercent >= 50) return 'bg-yellow-500'\n    return 'bg-green-500'\n  }\n\n  if (loading) {\n    return (\n      <div className=\"bg-white rounded-lg shadow p-6\">\n        <div className=\"animate-pulse\">\n          <div className=\"h-4 bg-gray-200 rounded w-1/3 mb-6\"></div>\n          <div className=\"grid grid-cols-1 md:grid-cols-3 gap-6\">\n            {[...Array(6)].map((_, i) => (\n              <div key={i} className=\"space-y-3\">\n                <div className=\"h-3 bg-gray-200 rounded w-1/2\"></div>\n                <div className=\"h-8 bg-gray-200 rounded\"></div>\n                <div className=\"h-2 bg-gray-200 rounded w-3/4\"></div>\n              </div>\n            ))}\n          </div>\n        </div>\n      </div>\n    )\n  }\n\n  if (error) {\n    return (\n      <div className=\"bg-white rounded-lg shadow p-6\">\n        <div className=\"text-red-600 text-center\">\n          <p className=\"font-semibold\">Error loading system metrics</p>\n          <p className=\"text-sm mt-1\">{error}</p>\n        </div>\n      </div>\n    )\n  }\n\n  if (!data?.systemInfo) {\n    return (\n      <div className=\"bg-white rounded-lg shadow p-6\">\n        <div className=\"text-gray-500 text-center\">\n          <p>No system metrics available</p>\n        </div>\n      </div>\n    )\n  }\n\n  const systemInfo = data.systemInfo\n  const health = getSystemHealth(systemInfo)\n  const memoryPercentage = Math.min((systemInfo.totalMemoryUsage / (16 * 1024 * 1024 * 1024)) * 100, 100) // Assume 16GB system\n\n  return (\n    <div className=\"bg-white rounded-lg shadow\">\n      <div className=\"p-6 border-b border-gray-200\">\n        <div className=\"flex justify-between items-center\">\n          <h2 className=\"text-lg font-semibold text-gray-900\">System Metrics</h2>\n          <div className=\"text-xs text-gray-500\">\n            Last updated: {data.timestamp ? new Date(data.timestamp).toLocaleTimeString() : 'Never'}\n          </div>\n        </div>\n      </div>\n\n      <div className=\"p-6\">\n        {/* Overall System Health */}\n        <div className=\"mb-8\">\n          <div className=\"flex items-center justify-between mb-2\">\n            <h3 className=\"text-sm font-medium text-gray-700\">Overall System Health</h3>\n            <div className={`px-3 py-1 text-sm font-medium rounded-lg border ${health.color}`}>\n              {health.status}\n            </div>\n          </div>\n          <div className=\"text-xs text-gray-500\">\n            {systemInfo.runningProcesses} of {systemInfo.totalProcesses} processes running\n          </div>\n        </div>\n\n        {/* Key Metrics Grid */}\n        <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-8\">\n          {/* Total Processes */}\n          <div className=\"bg-gray-50 rounded-lg p-4\">\n            <div className=\"flex items-center justify-between mb-2\">\n              <span className=\"text-sm font-medium text-gray-600\">Total Processes</span>\n              <span className=\"text-2xl font-bold text-gray-900\">{systemInfo.totalProcesses}</span>\n            </div>\n            <div className=\"text-xs text-gray-500\">\n              Running: {systemInfo.runningProcesses} • \n              Stopped: {systemInfo.stoppedProcesses} • \n              Error: {systemInfo.errorProcesses}\n            </div>\n          </div>\n\n          {/* Average CPU Usage */}\n          <div className=\"bg-gray-50 rounded-lg p-4\">\n            <div className=\"flex items-center justify-between mb-2\">\n              <span className=\"text-sm font-medium text-gray-600\">Avg CPU Usage</span>\n              <span className=\"text-2xl font-bold text-gray-900\">{systemInfo.avgCpuUsage.toFixed(1)}%</span>\n            </div>\n            <div className=\"w-full bg-gray-200 rounded-full h-2\">\n              <div \n                className={`h-2 rounded-full ${getCpuColor(systemInfo.avgCpuUsage)}`}\n                style={{ width: `${Math.min(systemInfo.avgCpuUsage, 100)}%` }}\n              ></div>\n            </div>\n          </div>\n\n          {/* Total Memory Usage */}\n          <div className=\"bg-gray-50 rounded-lg p-4\">\n            <div className=\"flex items-center justify-between mb-2\">\n              <span className=\"text-sm font-medium text-gray-600\">Memory Usage</span>\n              <span className=\"text-2xl font-bold text-gray-900\">{formatMemory(systemInfo.totalMemoryUsage)}</span>\n            </div>\n            <div className=\"w-full bg-gray-200 rounded-full h-2 mb-1\">\n              <div \n                className={`h-2 rounded-full ${getMemoryColor(memoryPercentage)}`}\n                style={{ width: `${memoryPercentage}%` }}\n              ></div>\n            </div>\n            <div className=\"text-xs text-gray-500\">\n              ~{memoryPercentage.toFixed(1)}% of system memory\n            </div>\n          </div>\n        </div>\n\n        {/* Active Ports */}\n        <div className=\"mb-6\">\n          <h3 className=\"text-sm font-medium text-gray-700 mb-3\">Active Ports ({systemInfo.activePorts.length})</h3>\n          <div className=\"flex flex-wrap gap-2\">\n            {systemInfo.activePorts.length > 0 ? (\n              systemInfo.activePorts.map((port) => (\n                <span \n                  key={port}\n                  className=\"inline-flex items-center px-3 py-1 text-sm font-medium bg-blue-100 text-blue-800 rounded-full\"\n                >\n                  :{port}\n                </span>\n              ))\n            ) : (\n              <span className=\"text-sm text-gray-500\">No active ports detected</span>\n            )}\n          </div>\n        </div>\n\n        {/* Process Status Breakdown */}\n        <div className=\"grid grid-cols-2 md:grid-cols-4 gap-4\">\n          <div className=\"text-center\">\n            <div className=\"text-2xl font-bold text-green-600\">{systemInfo.runningProcesses}</div>\n            <div className=\"text-xs text-gray-500 uppercase tracking-wider\">Running</div>\n          </div>\n          \n          <div className=\"text-center\">\n            <div className=\"text-2xl font-bold text-yellow-600\">{systemInfo.stoppedProcesses}</div>\n            <div className=\"text-xs text-gray-500 uppercase tracking-wider\">Stopped</div>\n          </div>\n          \n          <div className=\"text-center\">\n            <div className=\"text-2xl font-bold text-red-600\">{systemInfo.errorProcesses}</div>\n            <div className=\"text-xs text-gray-500 uppercase tracking-wider\">Error</div>\n          </div>\n          \n          <div className=\"text-center\">\n            <div className=\"text-2xl font-bold text-blue-600\">{systemInfo.activePorts.length}</div>\n            <div className=\"text-xs text-gray-500 uppercase tracking-wider\">Ports</div>\n          </div>\n        </div>\n\n        {/* Resource Usage Alert */}\n        {(systemInfo.avgCpuUsage > 80 || memoryPercentage > 85) && (\n          <div className=\"mt-6 p-4 bg-yellow-50 border border-yellow-200 rounded-lg\">\n            <div className=\"flex items-center\">\n              <span className=\"text-yellow-600 mr-2\">⚠</span>\n              <div>\n                <p className=\"text-sm font-medium text-yellow-800\">High Resource Usage Detected</p>\n                <p className=\"text-xs text-yellow-700 mt-1\">\n                  {systemInfo.avgCpuUsage > 80 && `CPU usage is at ${systemInfo.avgCpuUsage.toFixed(1)}%. `}\n                  {memoryPercentage > 85 && `Memory usage is at ${memoryPercentage.toFixed(1)}%.`}\n                  Consider reviewing process resource consumption.\n                </p>\n              </div>\n            </div>\n          </div>\n        )}\n      </div>\n    </div>\n  )\n}","import { useState } from 'react'\nimport useWebSocket from '../../hooks/useWebSocket'\nimport ProcessTable from './ProcessTable'\nimport ActivityFeed from './ActivityFeed'\nimport SystemMetrics from './SystemMetrics'\n\nexport default function ProcessMonitor() {\n  const [activeTab, setActiveTab] = useState<'processes' | 'activity' | 'metrics'>('processes')\n  \n  const {\n    processData,\n    activityData,\n    isConnected,\n    error,\n    reconnectAttempts,\n    lastUpdate\n  } = useWebSocket()\n\n  const getConnectionStatus = () => {\n    if (isConnected) {\n      return { \n        status: 'Connected', \n        color: 'text-green-600 bg-green-50 border-green-200',\n        icon: '●'\n      }\n    }\n    \n    if (reconnectAttempts > 0) {\n      return { \n        status: `Reconnecting (${reconnectAttempts}/10)`, \n        color: 'text-yellow-600 bg-yellow-50 border-yellow-200',\n        icon: '⟳'\n      }\n    }\n    \n    return { \n      status: 'Disconnected', \n      color: 'text-red-600 bg-red-50 border-red-200',\n      icon: '●'\n    }\n  }\n\n  const connectionStatus = getConnectionStatus()\n  const loading = !isConnected && !error\n\n  return (\n    <div className=\"min-h-screen bg-gray-50\">\n      {/* Header */}\n      <div className=\"bg-white border-b border-gray-200\">\n        <div className=\"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8\">\n          <div className=\"flex justify-between items-center py-6\">\n            <div>\n              <h1 className=\"text-2xl font-bold text-gray-900\">\n                Claude Process Tracking Dashboard\n              </h1>\n              <p className=\"mt-1 text-sm text-gray-500\">\n                Real-time monitoring of Claude PM processes and system activity\n              </p>\n            </div>\n            \n            {/* Connection Status */}\n            <div className=\"flex items-center space-x-4\">\n              <div className={`flex items-center px-3 py-1 text-sm font-medium rounded-lg border ${connectionStatus.color}`}>\n                <span className=\"mr-2\">{connectionStatus.icon}</span>\n                {connectionStatus.status}\n              </div>\n              \n              {lastUpdate && (\n                <div className=\"text-xs text-gray-500\">\n                  Last update: {lastUpdate.toLocaleTimeString()}\n                </div>\n              )}\n            </div>\n          </div>\n\n          {/* Navigation Tabs */}\n          <div className=\"flex space-x-8 border-b border-gray-200\">\n            <button\n              onClick={() => setActiveTab('processes')}\n              className={`py-2 px-1 border-b-2 font-medium text-sm ${\n                activeTab === 'processes'\n                  ? 'border-blue-500 text-blue-600'\n                  : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'\n              }`}\n            >\n              Processes\n              {processData && (\n                <span className=\"ml-2 bg-gray-100 text-gray-600 py-0.5 px-2 rounded-full text-xs\">\n                  {processData.processCount}\n                </span>\n              )}\n            </button>\n            \n            <button\n              onClick={() => setActiveTab('activity')}\n              className={`py-2 px-1 border-b-2 font-medium text-sm ${\n                activeTab === 'activity'\n                  ? 'border-blue-500 text-blue-600'\n                  : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'\n              }`}\n            >\n              Activity Feed\n              {activityData && (\n                <span className=\"ml-2 bg-gray-100 text-gray-600 py-0.5 px-2 rounded-full text-xs\">\n                  {activityData.count}\n                </span>\n              )}\n            </button>\n            \n            <button\n              onClick={() => setActiveTab('metrics')}\n              className={`py-2 px-1 border-b-2 font-medium text-sm ${\n                activeTab === 'metrics'\n                  ? 'border-blue-500 text-blue-600'\n                  : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'\n              }`}\n            >\n              System Metrics\n              {processData?.systemInfo && (\n                <span className=\"ml-2 bg-gray-100 text-gray-600 py-0.5 px-2 rounded-full text-xs\">\n                  {processData.systemInfo.runningProcesses}/{processData.systemInfo.totalProcesses}\n                </span>\n              )}\n            </button>\n          </div>\n        </div>\n      </div>\n\n      {/* Main Content */}\n      <div className=\"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8\">\n        {/* Error State */}\n        {error && !isConnected && (\n          <div className=\"mb-6 bg-red-50 border border-red-200 rounded-lg p-4\">\n            <div className=\"flex items-center\">\n              <span className=\"text-red-600 mr-2\">⚠</span>\n              <div>\n                <h3 className=\"text-sm font-medium text-red-800\">Connection Error</h3>\n                <p className=\"text-sm text-red-700 mt-1\">{error}</p>\n                <p className=\"text-xs text-red-600 mt-2\">\n                  The dashboard will attempt to reconnect automatically. \n                  Ensure the process tracking services are running.\n                </p>\n              </div>\n            </div>\n          </div>\n        )}\n\n        {/* Quick Stats Overview */}\n        {isConnected && processData && (\n          <div className=\"grid grid-cols-1 md:grid-cols-4 gap-6 mb-8\">\n            <div className=\"bg-white rounded-lg shadow p-6\">\n              <div className=\"flex items-center\">\n                <div className=\"flex-shrink-0\">\n                  <div className=\"w-8 h-8 bg-blue-100 rounded-md flex items-center justify-center\">\n                    <span className=\"text-blue-600 text-sm font-medium\">\n                      {processData.systemInfo.runningProcesses}\n                    </span>\n                  </div>\n                </div>\n                <div className=\"ml-4\">\n                  <p className=\"text-sm font-medium text-gray-500\">Running Processes</p>\n                  <p className=\"text-xs text-gray-400\">\n                    {processData.systemInfo.totalProcesses} total\n                  </p>\n                </div>\n              </div>\n            </div>\n\n            <div className=\"bg-white rounded-lg shadow p-6\">\n              <div className=\"flex items-center\">\n                <div className=\"flex-shrink-0\">\n                  <div className=\"w-8 h-8 bg-green-100 rounded-md flex items-center justify-center\">\n                    <span className=\"text-green-600 text-sm font-medium\">\n                      {processData.systemInfo.avgCpuUsage.toFixed(0)}%\n                    </span>\n                  </div>\n                </div>\n                <div className=\"ml-4\">\n                  <p className=\"text-sm font-medium text-gray-500\">Avg CPU</p>\n                  <p className=\"text-xs text-gray-400\">System average</p>\n                </div>\n              </div>\n            </div>\n\n            <div className=\"bg-white rounded-lg shadow p-6\">\n              <div className=\"flex items-center\">\n                <div className=\"flex-shrink-0\">\n                  <div className=\"w-8 h-8 bg-purple-100 rounded-md flex items-center justify-center\">\n                    <span className=\"text-purple-600 text-sm font-medium\">\n                      {(processData.systemInfo.totalMemoryUsage / (1024 * 1024 * 1024)).toFixed(1)}\n                    </span>\n                  </div>\n                </div>\n                <div className=\"ml-4\">\n                  <p className=\"text-sm font-medium text-gray-500\">Memory (GB)</p>\n                  <p className=\"text-xs text-gray-400\">Total usage</p>\n                </div>\n              </div>\n            </div>\n\n            <div className=\"bg-white rounded-lg shadow p-6\">\n              <div className=\"flex items-center\">\n                <div className=\"flex-shrink-0\">\n                  <div className=\"w-8 h-8 bg-orange-100 rounded-md flex items-center justify-center\">\n                    <span className=\"text-orange-600 text-sm font-medium\">\n                      {processData.systemInfo.activePorts.length}\n                    </span>\n                  </div>\n                </div>\n                <div className=\"ml-4\">\n                  <p className=\"text-sm font-medium text-gray-500\">Active Ports</p>\n                  <p className=\"text-xs text-gray-400\">\n                    {processData.systemInfo.activePorts.join(', ')}\n                  </p>\n                </div>\n              </div>\n            </div>\n          </div>\n        )}\n\n        {/* Tab Content */}\n        <div className=\"space-y-6\">\n          {activeTab === 'processes' && (\n            <ProcessTable\n              data={processData}\n              loading={loading}\n              error={!isConnected ? error : null}\n            />\n          )}\n          \n          {activeTab === 'activity' && (\n            <ActivityFeed\n              data={activityData}\n              loading={loading}\n              error={!isConnected ? error : null}\n              maxItems={100}\n            />\n          )}\n          \n          {activeTab === 'metrics' && (\n            <SystemMetrics\n              data={processData}\n              loading={loading}\n              error={!isConnected ? error : null}\n            />\n          )}\n        </div>\n\n        {/* Footer Info */}\n        <div className=\"mt-12 text-center text-xs text-gray-400\">\n          <p>\n            Claude PM Process Tracking Dashboard • \n            Phase 2: Frontend Components & Real-time UI • \n            WebSocket: {isConnected ? 'ws://localhost:8082' : 'Disconnected'}\n          </p>\n          {processData && (\n            <p className=\"mt-1\">\n              Backend services operational on ports 8081 (HTTP API), 8082 (WebSocket), 8083 (Additional API)\n            </p>\n          )}\n        </div>\n      </div>\n    </div>\n  )\n}","// Claude PM Portfolio Manager - NPM Package Entry Point\n// Export main components and utilities for use as a dependency\n\n// Main App Component\nexport { default as App } from './App';\n\n// Core Components\nexport { default as Dashboard } from './components/Dashboard';\nexport { default as ProjectList } from './components/ProjectList';\nexport { default as ProjectDetail } from './components/ProjectDetail';\nexport { default as ProcessTracker } from './components/ProcessTracker';\nexport { default as ProcessMonitor } from './components/ProcessMonitor/ProcessMonitor';\nexport { default as Layout } from './components/Layout';\n\n// Agent Information Components\nexport { default as AgentInfo } from './components/AgentInfo/AgentInfo';\nexport { default as AgentGrid } from './components/AgentInfo/AgentGrid';\nexport { default as AgentCard } from './components/AgentInfo/AgentCard';\nexport { default as AgentAssignments } from './components/AgentInfo/AgentAssignments';\n\n// Services\nexport { claudePmService } from './services/claudePmService';\nexport { processTrackerService } from './services/processTrackerService';\nexport { agentService } from './services/agentService';\nexport { aiTrackdownApiService } from './services/aiTrackdownApi';\n// Note: keyManagementService and vercelService excluded from build due to environment dependencies\n\n// Hooks\nexport { useClaudePmMetrics, useClaudePmProjects, useClaudePmTickets, useProjectHealth } from './hooks/useClaudePm';\nexport { useWebSocket } from './hooks/useWebSocket';\n\n// Types\nexport * from './types/processTracker';\nexport * from './types/agent';\nexport * from './types/keyManagement';\nexport * from './types/vercelDeployments';\n\n// Version\nexport const version = '1.0.0';"],"names":["f","require$$0","k","l","m","p","q","c","a","g","b","d","e","h","reactJsxRuntime_production_min","React","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_PROVIDER_TYPE","REACT_CONTEXT_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_LAZY_TYPE","REACT_OFFSCREEN_TYPE","MAYBE_ITERATOR_SYMBOL","FAUX_ITERATOR_SYMBOL","getIteratorFn","maybeIterable","maybeIterator","ReactSharedInternals","error","format","_len2","args","_key2","printWarning","level","ReactDebugCurrentFrame","stack","argsWithFormat","item","enableScopeAPI","enableCacheElement","enableTransitionTracing","enableLegacyHidden","enableDebugTracing","REACT_MODULE_REFERENCE","isValidElementType","type","getWrappedName","outerType","innerType","wrapperName","displayName","functionName","getContextName","getComponentNameFromType","context","provider","outerName","lazyComponent","payload","init","assign","disabledDepth","prevLog","prevInfo","prevWarn","prevError","prevGroup","prevGroupCollapsed","prevGroupEnd","disabledLog","disableLogs","props","reenableLogs","ReactCurrentDispatcher","prefix","describeBuiltInComponentFrame","name","source","ownerFn","x","match","reentry","componentFrameCache","PossiblyWeakMap","describeNativeComponentFrame","fn","construct","frame","control","previousPrepareStackTrace","previousDispatcher","Fake","sample","sampleLines","controlLines","s","_frame","syntheticFrame","describeFunctionComponentFrame","shouldConstruct","Component","prototype","describeUnknownElementTypeFrameInDEV","hasOwnProperty","loggedTypeFailures","setCurrentlyValidatingElement","element","owner","checkPropTypes","typeSpecs","values","location","componentName","has","typeSpecName","error$1","err","ex","isArrayImpl","isArray","typeName","value","hasToStringTag","willCoercionThrow","testStringCoercion","checkKeyStringCoercion","ReactCurrentOwner","RESERVED_PROPS","specialPropKeyWarningShown","specialPropRefWarningShown","didWarnAboutStringRefs","hasValidRef","config","getter","hasValidKey","warnIfStringRefCannotBeAutoConverted","self","defineKeyPropWarningGetter","warnAboutAccessingKey","defineRefPropWarningGetter","warnAboutAccessingRef","ReactElement","key","ref","jsxDEV","maybeKey","propName","defaultProps","ReactCurrentOwner$1","ReactDebugCurrentFrame$1","setCurrentlyValidatingElement$1","propTypesMisspellWarningShown","isValidElement","object","getDeclarationErrorAddendum","getSourceInfoErrorAddendum","fileName","lineNumber","ownerHasKeyUseWarning","getCurrentComponentErrorInfo","parentType","info","parentName","validateExplicitKey","currentComponentErrorInfo","childOwner","validateChildKeys","node","i","child","iteratorFn","iterator","step","validatePropTypes","propTypes","_name","validateFragmentProps","fragment","keys","didWarnAboutKeySpread","jsxWithValidation","isStaticChildren","validType","sourceInfo","typeString","children","beforeExample","afterExample","jsxWithValidationStatic","jsxWithValidationDynamic","jsx","jsxs","reactJsxRuntime_development","jsxRuntimeModule","require$$1","Subscribable","listener","identity","isServer","noop","functionalUpdate","updater","input","isValidTimeout","timeUntilStale","updatedAt","staleTime","parseQueryArgs","arg1","arg2","arg3","isQueryKey","parseFilterArgs","matchQuery","filters","query","exact","fetchStatus","predicate","queryKey","stale","hashQueryKeyByOptions","partialMatchKey","isActive","matchMutation","mutation","fetching","mutationKey","hashQueryKey","options","_","val","isPlainObject","result","partialDeepEqual","replaceEqualDeep","array","isPlainArray","aSize","bItems","bSize","copy","equalItems","shallowEqualObjects","o","hasObjectPrototype","ctor","prot","sleep","timeout","resolve","scheduleMicrotask","callback","getAbortController","replaceData","prevData","data","FocusManager","onFocus","_this$cleanup","setup","_this$cleanup2","focused","focusManager","onlineEvents","OnlineManager","onOnline","event","online","onlineManager","defaultRetryDelay","failureCount","canFetch","networkMode","CancelledError","isCancelledError","createRetryer","isRetryCancelled","isResolved","continueFn","promiseResolve","promiseReject","promise","outerResolve","outerReject","cancel","cancelOptions","reject","cancelRetry","continueRetry","shouldPause","pause","continueResolve","canContinue","run","promiseOrValue","_config$retry","_config$retryDelay","retry","retryDelay","delay","shouldRetry","defaultLogger","createNotifyManager","queue","transactions","notifyFn","batchNotifyFn","batch","flush","schedule","batchCalls","originalQueue","notifyManager","Removable","newCacheTime","Query","getDefaultState","newData","state","setStateOptions","_this$retryer","observer","_this$retryer2","_this$retryer3","fetchOptions","_this$options$behavio","_context$fetchOptions","_this$retryer4","abortController","queryFnContext","addSignalProperty","fetchFn","_context$fetchOptions2","onError","_this$cache$config$on","_this$cache$config","_this$cache$config$on2","_this$cache$config2","_this$cache$config$on3","_this$cache$config3","_this$cache$config$on4","_this$cache$config4","action","reducer","_action$meta","_action$dataUpdatedAt","hasData","initialDataUpdatedAt","QueryCache","client","_options$queryHash","queryHash","queryInMap","Mutation","_this$retryer$continu","executeMutation","_this$options$retry","restored","_this$mutationCache$c3","_this$mutationCache$c4","_this$options$onSucce","_this$options2","_this$mutationCache$c5","_this$mutationCache$c6","_this$options$onSettl","_this$options3","_this$mutationCache$c","_this$mutationCache$c2","_this$options$onMutat","_this$options","_this$mutationCache$c7","_this$mutationCache$c8","_this$options$onError","_this$options4","_this$mutationCache$c9","_this$mutationCache$c10","_this$options$onSettl2","_this$options5","MutationCache","_this$resuming","pausedMutations","infiniteQueryBehavior","_context$fetchOptions3","_context$fetchOptions4","_context$state$data","_context$state$data2","refetchPage","fetchMore","pageParam","isFetchingNextPage","isFetchingPreviousPage","oldPages","oldPageParams","newPageParams","cancelled","_context$signal","_context$signal2","queryFn","buildNewPages","pages","param","page","previous","fetchPage","manual","queryFnResult","getNextPageParam","getPreviousPageParam","QueryClient","_this$unsubscribeFocu","_this$unsubscribeOnli","_this$queryCache$find","parsedOptions","cachedData","queryKeyOrFilters","defaultedOptions","_this$queryCache$find2","queryCache","refetchFilters","promises","_ref","_filters$refetchType","_options$cancelRefetc","firstMatchingDefaults","QueryObserver","shouldFetchOnMount","shouldFetchOn","notifyOptions","prevOptions","prevQuery","mounted","shouldFetchOptionally","nextRefetchInterval","shouldAssignObserverCurrentProperties","trackedResult","_fetchOptions$cancelR","_this$options$refetch","nextInterval","prevResult","prevResultState","prevResultOptions","queryChange","queryInitialState","prevQueryResult","dataUpdatedAt","errorUpdatedAt","status","isPreviousData","isPlaceholderData","fetchOnMount","fetchOptionally","selectError","placeholderData","isFetching","isLoading","isError","isStale","nextResult","defaultNotifyOptions","shouldNotifyListeners","notifyOnChangeProps","notifyOnChangePropsValue","includedProps","typedKey","shouldLoadOnMount","field","optimisticResult","is","objectIs","useState","useEffect","useLayoutEffect","useDebugValue","useSyncExternalStore$2","subscribe","getSnapshot","_useState","inst","forceUpdate","checkIfSnapshotChanged","latestGetSnapshot","nextValue","useSyncExternalStore$1","shim","useSyncExternalStoreShim_production","y","didWarnOld18Alpha","didWarnUncachedGetSnapshot","cachedValue","useSyncExternalStoreShim_development","shimModule","useSyncExternalStore","defaultContext","QueryClientSharingContext","getQueryClientContext","contextSharing","useQueryClient","queryClient","QueryClientProvider","Context","IsRestoringContext","useIsRestoring","createValue","isReset","QueryErrorResetBoundaryContext","useQueryErrorResetBoundary","shouldThrowError","_useErrorBoundary","params","ensurePreventErrorBoundaryRetry","errorResetBoundary","useClearResetErrorBoundary","getHasError","useErrorBoundary","ensureStaleTime","willFetch","isRestoring","shouldSuspend","fetchOptimistic","useBaseQuery","Observer","onStoreChange","unsubscribe","useQuery","_extends","target","Action","PopStateEventType","createBrowserHistory","createBrowserLocation","window","globalHistory","pathname","search","hash","createLocation","createBrowserHref","to","createPath","getUrlBasedHistory","invariant","message","warning","cond","createKey","getHistoryState","index","current","parsePath","path","parsedPath","hashIndex","searchIndex","getLocation","createHref","validateLocation","v5Compat","getIndex","handlePop","nextIndex","delta","history","push","historyState","url","replace","createURL","base","href","n","ResultType","matchRoutes","routes","locationArg","basename","matchRoutesImpl","allowPartial","stripBasename","branches","flattenRoutes","rankRouteBranches","matches","decoded","decodePath","matchRouteBranch","parentsMeta","parentPath","flattenRoute","route","relativePath","meta","joinPaths","routesMeta","computeScore","_route$path","exploded","explodeOptionalSegments","segments","first","rest","isOptional","required","restExploded","subpath","compareIndexes","paramRe","dynamicSegmentValue","indexRouteValue","emptySegmentValue","staticSegmentValue","splatPenalty","isSplat","initialScore","score","segment","branch","matchedParams","matchedPathname","end","remainingPathname","matchPath","normalizePathname","pattern","matcher","compiledParams","compilePath","pathnameBase","captureGroups","memo","paramName","splatValue","caseSensitive","regexpSource","v","startIndex","nextChar","resolvePath","fromPathname","toPathname","resolvePathname","normalizeSearch","normalizeHash","getInvalidPathError","char","dest","getPathContributingMatches","getResolveToMatches","v7_relativeSplatPath","pathMatches","idx","resolveTo","toArg","routePathnames","locationPathname","isPathRelative","isEmptyPath","from","routePathnameIndex","toSegments","hasExplicitTrailingSlash","hasCurrentTrailingSlash","paths","isRouteErrorResponse","validMutationMethodsArr","validRequestMethodsArr","DataRouterContext","DataRouterStateContext","AwaitContext","NavigationContext","LocationContext","RouteContext","RouteErrorContext","useHref","_temp","relative","useInRouterContext","UNSAFE_invariant","navigator","useResolvedPath","joinedPathname","useLocation","navigateEffectWarning","useIsomorphicLayoutEffect","cb","useNavigate","isDataRoute","useNavigateStable","useNavigateUnstable","dataRouterContext","future","routePathnamesJson","UNSAFE_getResolveToMatches","activeRef","UNSAFE_warning","useParams","routeMatch","_temp2","useRoutes","useRoutesImpl","dataRouterState","parentMatches","parentParams","parentPathname","parentPathnameBase","parentRoute","warningOnce","locationFromContext","_parsedLocationArg$pa","parsedLocationArg","parentSegments","renderedMatches","_renderMatches","DefaultErrorComponent","useRouteError","lightgrey","preStyles","codeStyles","devInfo","defaultErrorElement","RenderErrorBoundary","errorInfo","RenderedRoute","routeContext","_dataRouterState","_future","errors","errorIndex","renderFallback","fallbackIndex","loaderData","needsToRunLoader","outlet","shouldRenderHydrateFallback","errorElement","hydrateFallbackElement","getChildren","DataRouterHook","DataRouterStateHook","getDataRouterConsoleError","hookName","useDataRouterContext","ctx","useDataRouterState","useRouteContext","useCurrentRouteId","thisRoute","useRouteId","_state$errors","routeId","router","id","alreadyWarned$1","alreadyWarned","warnOnce","logDeprecation","flag","msg","link","logV6DeprecationWarnings","renderFuture","routerFuture","Route","_props","Router","_ref5","basenameProp","locationProp","navigationType","staticProp","navigationContext","locationContext","trailingPathname","Routes","_ref6","createRoutesFromChildren","treePath","_objectWithoutPropertiesLoose","excluded","sourceKeys","defaultMethod","defaultEncType","isHtmlElement","isButtonElement","isFormElement","isInputElement","isModifiedEvent","shouldProcessLinkClick","_formDataSupportsSubmitter","isFormDataSubmitterSupported","supportedFormEncTypes","getFormEncType","encType","getFormSubmissionInfo","method","formData","body","attr","form","_excluded","_excluded2","_excluded3","REACT_ROUTER_VERSION","ViewTransitionContext","FetchersContext","START_TRANSITION","startTransitionImpl","BrowserRouter","_ref4","historyRef","setStateImpl","v7_startTransition","setState","newState","UNSAFE_logV6DeprecationWarnings","isBrowser","ABSOLUTE_URL_REGEX","Link","_ref7","onClick","reloadDocument","preventScrollReset","viewTransition","UNSAFE_NavigationContext","absoluteHref","isExternal","currentUrl","targetUrl","internalOnClick","useLinkClickHandler","handleClick","NavLink","_ref8","ariaCurrentProp","classNameProp","styleProp","routerState","UNSAFE_DataRouterStateContext","isTransitioning","useViewTransitionState","nextLocationPathname","endSlashPosition","isPending","renderProps","ariaCurrent","className","style","Form","_ref9","forwardedRef","fetcherKey","navigate","onSubmit","submit","useSubmit","formAction","useFormAction","formMethod","submitHandler","submitter","submitMethod","UNSAFE_DataRouterContext","replaceProp","validateClientSideSubmission","fetcherId","getUniqueFetcherId","currentRouteId","UNSAFE_useRouteId","UNSAFE_RouteContext","indexValues","qs","opts","vtContext","currentPath","nextPath","defaultAttributes","toKebabCase","string","createLucideIcon","iconName","iconNode","forwardRef","color","size","strokeWidth","absoluteStrokeWidth","createElement","tag","attrs","Activity","AlertCircle","AlertTriangle","ArrowRight","BarChart3","Bug","Calendar","CheckCircle","CheckSquare","Circle","Clock","Cpu","DollarSign","ExternalLink","Filter","FolderOpen","GitBranch","HardDrive","Home","Key","Maximize2","MonitorSpeaker","Pause","Play","RefreshCw","Rocket","RotateCcw","Search","Server","Square","Target","TrendingUp","User","Users","WifiOff","Wifi","Zap","_AiTrackdownBackendService","baseUrl","__publicField","command","projectPath","response","AiTrackdownBackendService","aiTrackdownBackendService","_AiTrackdownApiService","epics","issues","tasks","t","AiTrackdownApiService","aiTrackdownApiService","_AgentService","roleType","role","statuses","basePerformance","performance","assignments","assignmentCount","collaborationPatterns","collaborationCount","otherRoles","randomRole","availability","agents","agentData","activeAgents","workingAgents","idleAgents","offlineAgents","agentId","agent","limit","activities","activityTypes","request","_a","currentLoad","availableCapacity","AgentService","agentService","ClaudePmService","ticketId","agentRegistry","assignedAgents","agentProgress","assignment","tickets","epic","agentAssignments","issue","task","priority","projects","activeProjects","openTickets","avgHealthScore","sum","projectDirs","dir","lastActivity","healthScore","daysSinceActivity","projectTickets","statusOrder","_b","dirName","word","currentProjectTickets","managedProjectTickets","project","priorityOrder","priorityDiff","_projectId","projectAgents","assignedTickets","total","averageLoad","claudePmService","useClaudePmMetrics","useClaudePmProjects","useClaudePmTickets","useProjectHealth","projectId","KeyManagementService","apiKey","orgResponse","isConnected","usersResponse","_c","userResponse","days","billingData","totalSpend","billing","breakdown","trends","keyManagementService","Dashboard","metrics","metricsLoading","metricsError","ticketsLoading","activeKeys","spendingReport","ticket","KeyManagement","billingLoading","billingError","keysLoading","keysError","reportLoading","reportError","hasError","Layout","navigation","Icon","_typeof","requiredArgs","toDate","argument","argStr","defaultOptions","getDefaultOptions","getTimezoneOffsetInMilliseconds","date","utcDate","compareAsc","dirtyDateLeft","dirtyDateRight","dateLeft","dateRight","diff","differenceInCalendarMonths","yearDiff","monthDiff","differenceInMilliseconds","roundingMap","defaultRoundingMethod","getRoundingMethod","endOfDay","dirtyDate","endOfMonth","month","isLastDayOfMonth","differenceInMonths","sign","difference","isLastMonthNotFull","differenceInSeconds","formatDistanceLocale","formatDistance","token","count","tokenValue","formatDistance$2","buildFormatLongFn","width","dateFormats","timeFormats","dateTimeFormats","formatLong","formatLong$1","formatRelativeLocale","formatRelative","_date","_baseDate","_options","formatRelative$1","buildLocalizeFn","dirtyIndex","valuesArray","defaultWidth","_defaultWidth","_width","eraValues","quarterValues","monthValues","dayValues","dayPeriodValues","formattingDayPeriodValues","ordinalNumber","dirtyNumber","number","rem100","localize","quarter","localize$1","buildMatchFn","matchPattern","matchResult","matchedString","parsePatterns","findIndex","findKey","buildMatchPatternFn","parseResult","matchOrdinalNumberPattern","parseOrdinalNumberPattern","matchEraPatterns","parseEraPatterns","matchQuarterPatterns","parseQuarterPatterns","matchMonthPatterns","parseMonthPatterns","matchDayPatterns","parseDayPatterns","matchDayPeriodPatterns","parseDayPeriodPatterns","match$1","locale","defaultLocale","property","cloneObject","MINUTES_IN_DAY","MINUTES_IN_ALMOST_TWO_DAYS","MINUTES_IN_MONTH","MINUTES_IN_TWO_MONTHS","dirtyBaseDate","_options$locale","comparison","localizeOptions","seconds","offsetInSeconds","minutes","months","hours","nearestMonth","monthsSinceStartOfYear","years","formatDistanceToNow","distanceInWords","AgentCard","showDetails","getStatusColor","getStatusIcon","getPriorityColor","activeAssignments","completionRate","spec","AgentGrid","loading","onAgentClick","onRefresh","searchTerm","setSearchTerm","roleFilter","setRoleFilter","statusFilter","setStatusFilter","filteredAgents","matchesSearch","matchesRole","matchesStatus","roleOptions","statusOptions","option","Fragment","AgentAssignments","onAssignmentClick","priorityFilter","setPriorityFilter","getProgressBarColor","progress","filteredAssignments","matchesPriority","sortedAssignments","priorityOptions","blocker","AgentInfo","showAllAgents","onAgentSelect","setAgentRegistry","setLoading","setError","selectedAgent","setSelectedAgent","activeTab","setActiveTab","loadAgentData","registry","handleAgentClick","handleRefresh","getProjectAgents","calculateOverallMetrics","totalTasks","activeTasks","avgCompletionRate","avgQualityScore","collab","ProjectDetail","setProject","setTickets","loadProjectData","foundProject","getTicketsByStatus","getTicketsByType","getTicketsByPriority","calculateProjectHealth","completedTickets","totalTickets","blockedTickets","criticalTickets","blockedPenalty","criticalPenalty","handleAgentSelect","projectHealth","activeTickets","ProjectList","StatusIcon","statusColor","API_BASE_URL","WS_URL","ProcessTrackerService","pid","onMessage","onClose","bytes","sizes","processTrackerService","ProcessTracker","wsConnected","setWsConnected","liveData","setLiveData","selectedTypes","setSelectedTypes","initialData","refetch","processData","handleMessage","handleError","handleClose","statusInterval","filteredProcesses","useMemo","process","matchesType","processTypes","handleTypeFilter","newSelected","handleProcessAction","success","ResponseTicker","processes","isPaused","setIsPaused","selectedItem","setSelectedItem","animationSpeed","setAnimationSpeed","tickerItems","getMessageType","lowerMessage","getTypeColors","getProcessTypeColor","handleItemClick","closeModal","ProcessControls","systemInfo","selectedProcesses","setSelectedProcesses","setIsLoading","bulkActionLoading","setBulkActionLoading","handleSelectProcess","handleSelectAll","handleSingleAction","prev","newSet","handleBulkAction","getMemoryUsagePercentage","memory","statusCounts","acc","port","UncheckedSquare","ProcessDashboard","viewMode","setViewMode","stats","VercelService","endpoint","now","deploymentId","deployment","duration","timestamp","vercelService","VercelDeployments","projectsLoading","projectsError","deployments","deploymentsLoading","deploymentsError","userInfo","activeDeployments","recentDeployments","productionDeployments","statusInfo","relativeTime","App","useWebSocket","autoReconnect","maxReconnectAttempts","reconnectInterval","setProcessData","activityData","setActivityData","setIsConnected","reconnectAttempts","setReconnectAttempts","lastUpdate","setLastUpdate","wsRef","useRef","reconnectTimeoutRef","mountedRef","connect","ws","nextAttempt","disconnect","ProcessActions","onAction","disabled","confirmAction","setConfirmAction","handleAction","getActionIcon","getActionColor","isSystemCritical","proc","ProcessTable","sortConfig","setSortConfig","filter","setFilter","formatMemory","formatUptime","elapsedTime","handleSort","direction","sortedAndFilteredProcesses","filtered","aValue","bValue","getSortIcon","ActivityFeed","maxItems","isAutoScroll","setIsAutoScroll","getTypeIcon","getTypeColor","formatTimeAgo","time","diffMs","diffSeconds","diffMinutes","diffHours","truncateMessage","maxLength","filteredActivities","activity","typeMatch","priorityMatch","sourceMatch","feedContainer","getUniqueSourceOptions","SystemMetrics","gb","getSystemHealth","getCpuColor","cpuUsage","getMemoryColor","memoryPercent","health","memoryPercentage","ProcessMonitor","connectionStatus","version"],"mappings":";;;;;;;;;;;;;;;;;;;;;AASa,MAAIA,IAAEC,IAAiBC,IAAE,OAAO,IAAI,eAAe,GAAEC,IAAE,OAAO,IAAI,gBAAgB,GAAEC,IAAE,OAAO,UAAU,gBAAe,IAAEJ,EAAE,mDAAmD,mBAAkBK,IAAE,EAAC,KAAI,IAAG,KAAI,IAAG,QAAO,IAAG,UAAS,GAAE;AAClP,WAASC,EAAEC,GAAEC,GAAEC,GAAE;AAAC,Q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IAAsB,OAAR99B;AAAA,UAAQ;AAAA,QAChC;AAAA,MAAA,GAEJ;AAAA,MAGAoK,gBAAAA,EAAAA,KAAC,OAAI,EAAA,WAAU,2CACb,UAAA;AAAA,QAAAA,gBAAAA,OAAC,KAAE,EAAA,UAAA;AAAA,UAAA;AAAA,UAGW0zB,IAAc,wBAAwB;AAAA,QAAA,GACpD;AAAA,QACCkP,KACC7iC,gBAAAA,EAAA,IAAC,KAAE,EAAA,WAAU,QAAO,UAEpB,kGAAA;AAAA,MAAA,GAEJ;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ;AClOO,MAAMmsC,KAAU;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108]}