var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
(function polyfill() {
  const relList = document.createElement("link").relList;
  if (relList && relList.supports && relList.supports("modulepreload")) {
    return;
  }
  for (const link of document.querySelectorAll('link[rel="modulepreload"]')) {
    processPreload(link);
  }
  new MutationObserver((mutations) => {
    for (const mutation of mutations) {
      if (mutation.type !== "childList") {
        continue;
      }
      for (const node of mutation.addedNodes) {
        if (node.tagName === "LINK" && node.rel === "modulepreload")
          processPreload(node);
      }
    }
  }).observe(document, { childList: true, subtree: true });
  function getFetchOpts(link) {
    const fetchOpts = {};
    if (link.integrity) fetchOpts.integrity = link.integrity;
    if (link.referrerPolicy) fetchOpts.referrerPolicy = link.referrerPolicy;
    if (link.crossOrigin === "use-credentials")
      fetchOpts.credentials = "include";
    else if (link.crossOrigin === "anonymous") fetchOpts.credentials = "omit";
    else fetchOpts.credentials = "same-origin";
    return fetchOpts;
  }
  function processPreload(link) {
    if (link.ep)
      return;
    link.ep = true;
    const fetchOpts = getFetchOpts(link);
    fetch(link.href, fetchOpts);
  }
})();
function getDefaultExportFromCjs(x) {
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
}
var jsxRuntime = { exports: {} };
var reactJsxRuntime_production = {};
/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var REACT_ELEMENT_TYPE$2 = Symbol.for("react.transitional.element"), REACT_FRAGMENT_TYPE$2 = Symbol.for("react.fragment");
function jsxProd(type, config, maybeKey) {
  var key = null;
  void 0 !== maybeKey && (key = "" + maybeKey);
  void 0 !== config.key && (key = "" + config.key);
  if ("key" in config) {
    maybeKey = {};
    for (var propName in config)
      "key" !== propName && (maybeKey[propName] = config[propName]);
  } else maybeKey = config;
  config = maybeKey.ref;
  return {
    $$typeof: REACT_ELEMENT_TYPE$2,
    type,
    key,
    ref: void 0 !== config ? config : null,
    props: maybeKey
  };
}
reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE$2;
reactJsxRuntime_production.jsx = jsxProd;
reactJsxRuntime_production.jsxs = jsxProd;
{
  jsxRuntime.exports = reactJsxRuntime_production;
}
var jsxRuntimeExports = jsxRuntime.exports;
var react = { exports: {} };
var react_production = {};
/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var REACT_ELEMENT_TYPE$1 = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE$2 = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE$1 = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE$1 = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE$1 = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE$1 = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE$1 = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE$1 = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE$1 = Symbol.for("react.suspense"), REACT_MEMO_TYPE$1 = Symbol.for("react.memo"), REACT_LAZY_TYPE$1 = Symbol.for("react.lazy"), MAYBE_ITERATOR_SYMBOL$1 = Symbol.iterator;
function getIteratorFn$1(maybeIterable) {
  if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
  maybeIterable = MAYBE_ITERATOR_SYMBOL$1 && maybeIterable[MAYBE_ITERATOR_SYMBOL$1] || maybeIterable["@@iterator"];
  return "function" === typeof maybeIterable ? maybeIterable : null;
}
var ReactNoopUpdateQueue = {
  isMounted: function() {
    return false;
  },
  enqueueForceUpdate: function() {
  },
  enqueueReplaceState: function() {
  },
  enqueueSetState: function() {
  }
}, assign$1 = Object.assign, emptyObject = {};
function Component(props, context, updater) {
  this.props = props;
  this.context = context;
  this.refs = emptyObject;
  this.updater = updater || ReactNoopUpdateQueue;
}
Component.prototype.isReactComponent = {};
Component.prototype.setState = function(partialState, callback) {
  if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
    throw Error(
      "takes an object of state variables to update or a function which returns an object of state variables."
    );
  this.updater.enqueueSetState(this, partialState, callback, "setState");
};
Component.prototype.forceUpdate = function(callback) {
  this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
};
function ComponentDummy() {
}
ComponentDummy.prototype = Component.prototype;
function PureComponent(props, context, updater) {
  this.props = props;
  this.context = context;
  this.refs = emptyObject;
  this.updater = updater || ReactNoopUpdateQueue;
}
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
pureComponentPrototype.constructor = PureComponent;
assign$1(pureComponentPrototype, Component.prototype);
pureComponentPrototype.isPureReactComponent = true;
var isArrayImpl$1 = Array.isArray, ReactSharedInternals$2 = { H: null, A: null, T: null, S: null, V: null }, hasOwnProperty$2 = Object.prototype.hasOwnProperty;
function ReactElement(type, key, self2, source, owner, props) {
  self2 = props.ref;
  return {
    $$typeof: REACT_ELEMENT_TYPE$1,
    type,
    key,
    ref: void 0 !== self2 ? self2 : null,
    props
  };
}
function cloneAndReplaceKey(oldElement, newKey) {
  return ReactElement(
    oldElement.type,
    newKey,
    void 0,
    void 0,
    void 0,
    oldElement.props
  );
}
function isValidElement(object) {
  return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE$1;
}
function escape$1(key) {
  var escaperLookup = { "=": "=0", ":": "=2" };
  return "$" + key.replace(/[=:]/g, function(match) {
    return escaperLookup[match];
  });
}
var userProvidedKeyEscapeRegex = /\/+/g;
function getElementKey(element, index2) {
  return "object" === typeof element && null !== element && null != element.key ? escape$1("" + element.key) : index2.toString(36);
}
function noop$1$2() {
}
function resolveThenable(thenable) {
  switch (thenable.status) {
    case "fulfilled":
      return thenable.value;
    case "rejected":
      throw thenable.reason;
    default:
      switch ("string" === typeof thenable.status ? thenable.then(noop$1$2, noop$1$2) : (thenable.status = "pending", thenable.then(
        function(fulfilledValue) {
          "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
        },
        function(error) {
          "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
        }
      )), thenable.status) {
        case "fulfilled":
          return thenable.value;
        case "rejected":
          throw thenable.reason;
      }
  }
  throw thenable;
}
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
  var type = typeof children;
  if ("undefined" === type || "boolean" === type) children = null;
  var invokeCallback = false;
  if (null === children) invokeCallback = true;
  else
    switch (type) {
      case "bigint":
      case "string":
      case "number":
        invokeCallback = true;
        break;
      case "object":
        switch (children.$$typeof) {
          case REACT_ELEMENT_TYPE$1:
          case REACT_PORTAL_TYPE$2:
            invokeCallback = true;
            break;
          case REACT_LAZY_TYPE$1:
            return invokeCallback = children._init, mapIntoArray(
              invokeCallback(children._payload),
              array,
              escapedPrefix,
              nameSoFar,
              callback
            );
        }
    }
  if (invokeCallback)
    return callback = callback(children), invokeCallback = "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar, isArrayImpl$1(callback) ? (escapedPrefix = "", null != invokeCallback && (escapedPrefix = invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c2) {
      return c2;
    })) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(
      callback,
      escapedPrefix + (null == callback.key || children && children.key === callback.key ? "" : ("" + callback.key).replace(
        userProvidedKeyEscapeRegex,
        "$&/"
      ) + "/") + invokeCallback
    )), array.push(callback)), 1;
  invokeCallback = 0;
  var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
  if (isArrayImpl$1(children))
    for (var i2 = 0; i2 < children.length; i2++)
      nameSoFar = children[i2], type = nextNamePrefix + getElementKey(nameSoFar, i2), invokeCallback += mapIntoArray(
        nameSoFar,
        array,
        escapedPrefix,
        type,
        callback
      );
  else if (i2 = getIteratorFn$1(children), "function" === typeof i2)
    for (children = i2.call(children), i2 = 0; !(nameSoFar = children.next()).done; )
      nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i2++), invokeCallback += mapIntoArray(
        nameSoFar,
        array,
        escapedPrefix,
        type,
        callback
      );
  else if ("object" === type) {
    if ("function" === typeof children.then)
      return mapIntoArray(
        resolveThenable(children),
        array,
        escapedPrefix,
        nameSoFar,
        callback
      );
    array = String(children);
    throw Error(
      "Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
    );
  }
  return invokeCallback;
}
function mapChildren(children, func, context) {
  if (null == children) return children;
  var result = [], count = 0;
  mapIntoArray(children, result, "", "", function(child) {
    return func.call(context, child, count++);
  });
  return result;
}
function lazyInitializer(payload) {
  if (-1 === payload._status) {
    var ctor = payload._result;
    ctor = ctor();
    ctor.then(
      function(moduleObject) {
        if (0 === payload._status || -1 === payload._status)
          payload._status = 1, payload._result = moduleObject;
      },
      function(error) {
        if (0 === payload._status || -1 === payload._status)
          payload._status = 2, payload._result = error;
      }
    );
    -1 === payload._status && (payload._status = 0, payload._result = ctor);
  }
  if (1 === payload._status) return payload._result.default;
  throw payload._result;
}
var reportGlobalError$1 = "function" === typeof reportError ? reportError : function(error) {
  if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
    var event = new window.ErrorEvent("error", {
      bubbles: true,
      cancelable: true,
      message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
      error
    });
    if (!window.dispatchEvent(event)) return;
  } else if ("object" === typeof process && "function" === typeof process.emit) {
    process.emit("uncaughtException", error);
    return;
  }
  console.error(error);
};
function noop$6() {
}
react_production.Children = {
  map: mapChildren,
  forEach: function(children, forEachFunc, forEachContext) {
    mapChildren(
      children,
      function() {
        forEachFunc.apply(this, arguments);
      },
      forEachContext
    );
  },
  count: function(children) {
    var n2 = 0;
    mapChildren(children, function() {
      n2++;
    });
    return n2;
  },
  toArray: function(children) {
    return mapChildren(children, function(child) {
      return child;
    }) || [];
  },
  only: function(children) {
    if (!isValidElement(children))
      throw Error(
        "React.Children.only expected to receive a single React element child."
      );
    return children;
  }
};
react_production.Component = Component;
react_production.Fragment = REACT_FRAGMENT_TYPE$1;
react_production.Profiler = REACT_PROFILER_TYPE$1;
react_production.PureComponent = PureComponent;
react_production.StrictMode = REACT_STRICT_MODE_TYPE$1;
react_production.Suspense = REACT_SUSPENSE_TYPE$1;
react_production.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals$2;
react_production.__COMPILER_RUNTIME = {
  __proto__: null,
  c: function(size) {
    return ReactSharedInternals$2.H.useMemoCache(size);
  }
};
react_production.cache = function(fn) {
  return function() {
    return fn.apply(null, arguments);
  };
};
react_production.cloneElement = function(element, config, children) {
  if (null === element || void 0 === element)
    throw Error(
      "The argument must be a React element, but you passed " + element + "."
    );
  var props = assign$1({}, element.props), key = element.key, owner = void 0;
  if (null != config)
    for (propName in void 0 !== config.ref && (owner = void 0), void 0 !== config.key && (key = "" + config.key), config)
      !hasOwnProperty$2.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
  var propName = arguments.length - 2;
  if (1 === propName) props.children = children;
  else if (1 < propName) {
    for (var childArray = Array(propName), i2 = 0; i2 < propName; i2++)
      childArray[i2] = arguments[i2 + 2];
    props.children = childArray;
  }
  return ReactElement(element.type, key, void 0, void 0, owner, props);
};
react_production.createContext = function(defaultValue) {
  defaultValue = {
    $$typeof: REACT_CONTEXT_TYPE$1,
    _currentValue: defaultValue,
    _currentValue2: defaultValue,
    _threadCount: 0,
    Provider: null,
    Consumer: null
  };
  defaultValue.Provider = defaultValue;
  defaultValue.Consumer = {
    $$typeof: REACT_CONSUMER_TYPE$1,
    _context: defaultValue
  };
  return defaultValue;
};
react_production.createElement = function(type, config, children) {
  var propName, props = {}, key = null;
  if (null != config)
    for (propName in void 0 !== config.key && (key = "" + config.key), config)
      hasOwnProperty$2.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (props[propName] = config[propName]);
  var childrenLength = arguments.length - 2;
  if (1 === childrenLength) props.children = children;
  else if (1 < childrenLength) {
    for (var childArray = Array(childrenLength), i2 = 0; i2 < childrenLength; i2++)
      childArray[i2] = arguments[i2 + 2];
    props.children = childArray;
  }
  if (type && type.defaultProps)
    for (propName in childrenLength = type.defaultProps, childrenLength)
      void 0 === props[propName] && (props[propName] = childrenLength[propName]);
  return ReactElement(type, key, void 0, void 0, null, props);
};
react_production.createRef = function() {
  return { current: null };
};
react_production.forwardRef = function(render) {
  return { $$typeof: REACT_FORWARD_REF_TYPE$1, render };
};
react_production.isValidElement = isValidElement;
react_production.lazy = function(ctor) {
  return {
    $$typeof: REACT_LAZY_TYPE$1,
    _payload: { _status: -1, _result: ctor },
    _init: lazyInitializer
  };
};
react_production.memo = function(type, compare) {
  return {
    $$typeof: REACT_MEMO_TYPE$1,
    type,
    compare: void 0 === compare ? null : compare
  };
};
react_production.startTransition = function(scope) {
  var prevTransition = ReactSharedInternals$2.T, currentTransition = {};
  ReactSharedInternals$2.T = currentTransition;
  try {
    var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals$2.S;
    null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
    "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop$6, reportGlobalError$1);
  } catch (error) {
    reportGlobalError$1(error);
  } finally {
    ReactSharedInternals$2.T = prevTransition;
  }
};
react_production.unstable_useCacheRefresh = function() {
  return ReactSharedInternals$2.H.useCacheRefresh();
};
react_production.use = function(usable) {
  return ReactSharedInternals$2.H.use(usable);
};
react_production.useActionState = function(action, initialState2, permalink) {
  return ReactSharedInternals$2.H.useActionState(action, initialState2, permalink);
};
react_production.useCallback = function(callback, deps) {
  return ReactSharedInternals$2.H.useCallback(callback, deps);
};
react_production.useContext = function(Context) {
  return ReactSharedInternals$2.H.useContext(Context);
};
react_production.useDebugValue = function() {
};
react_production.useDeferredValue = function(value, initialValue) {
  return ReactSharedInternals$2.H.useDeferredValue(value, initialValue);
};
react_production.useEffect = function(create, createDeps, update) {
  var dispatcher = ReactSharedInternals$2.H;
  if ("function" === typeof update)
    throw Error(
      "useEffect CRUD overload is not enabled in this build of React."
    );
  return dispatcher.useEffect(create, createDeps);
};
react_production.useId = function() {
  return ReactSharedInternals$2.H.useId();
};
react_production.useImperativeHandle = function(ref, create, deps) {
  return ReactSharedInternals$2.H.useImperativeHandle(ref, create, deps);
};
react_production.useInsertionEffect = function(create, deps) {
  return ReactSharedInternals$2.H.useInsertionEffect(create, deps);
};
react_production.useLayoutEffect = function(create, deps) {
  return ReactSharedInternals$2.H.useLayoutEffect(create, deps);
};
react_production.useMemo = function(create, deps) {
  return ReactSharedInternals$2.H.useMemo(create, deps);
};
react_production.useOptimistic = function(passthrough, reducer) {
  return ReactSharedInternals$2.H.useOptimistic(passthrough, reducer);
};
react_production.useReducer = function(reducer, initialArg, init) {
  return ReactSharedInternals$2.H.useReducer(reducer, initialArg, init);
};
react_production.useRef = function(initialValue) {
  return ReactSharedInternals$2.H.useRef(initialValue);
};
react_production.useState = function(initialState2) {
  return ReactSharedInternals$2.H.useState(initialState2);
};
react_production.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
  return ReactSharedInternals$2.H.useSyncExternalStore(
    subscribe,
    getSnapshot,
    getServerSnapshot
  );
};
react_production.useTransition = function() {
  return ReactSharedInternals$2.H.useTransition();
};
react_production.version = "19.1.1";
{
  react.exports = react_production;
}
var reactExports = react.exports;
const React$4 = /* @__PURE__ */ getDefaultExportFromCjs(reactExports);
var client = { exports: {} };
var reactDomClient_production = {};
var scheduler = { exports: {} };
var scheduler_production = {};
/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
(function(exports) {
  function push2(heap, node) {
    var index2 = heap.length;
    heap.push(node);
    a: for (; 0 < index2; ) {
      var parentIndex = index2 - 1 >>> 1, parent = heap[parentIndex];
      if (0 < compare(parent, node))
        heap[parentIndex] = node, heap[index2] = parent, index2 = parentIndex;
      else break a;
    }
  }
  function peek2(heap) {
    return 0 === heap.length ? null : heap[0];
  }
  function pop2(heap) {
    if (0 === heap.length) return null;
    var first = heap[0], last = heap.pop();
    if (last !== first) {
      heap[0] = last;
      a: for (var index2 = 0, length = heap.length, halfLength = length >>> 1; index2 < halfLength; ) {
        var leftIndex = 2 * (index2 + 1) - 1, left = heap[leftIndex], rightIndex = leftIndex + 1, right = heap[rightIndex];
        if (0 > compare(left, last))
          rightIndex < length && 0 > compare(right, left) ? (heap[index2] = right, heap[rightIndex] = last, index2 = rightIndex) : (heap[index2] = left, heap[leftIndex] = last, index2 = leftIndex);
        else if (rightIndex < length && 0 > compare(right, last))
          heap[index2] = right, heap[rightIndex] = last, index2 = rightIndex;
        else break a;
      }
    }
    return first;
  }
  function compare(a2, b) {
    var diff = a2.sortIndex - b.sortIndex;
    return 0 !== diff ? diff : a2.id - b.id;
  }
  exports.unstable_now = void 0;
  if ("object" === typeof performance && "function" === typeof performance.now) {
    var localPerformance = performance;
    exports.unstable_now = function() {
      return localPerformance.now();
    };
  } else {
    var localDate = Date, initialTime = localDate.now();
    exports.unstable_now = function() {
      return localDate.now() - initialTime;
    };
  }
  var taskQueue = [], timerQueue = [], taskIdCounter = 1, currentTask = null, currentPriorityLevel = 3, isPerformingWork = false, isHostCallbackScheduled = false, isHostTimeoutScheduled = false, needsPaint = false, localSetTimeout = "function" === typeof setTimeout ? setTimeout : null, localClearTimeout = "function" === typeof clearTimeout ? clearTimeout : null, localSetImmediate = "undefined" !== typeof setImmediate ? setImmediate : null;
  function advanceTimers(currentTime) {
    for (var timer = peek2(timerQueue); null !== timer; ) {
      if (null === timer.callback) pop2(timerQueue);
      else if (timer.startTime <= currentTime)
        pop2(timerQueue), timer.sortIndex = timer.expirationTime, push2(taskQueue, timer);
      else break;
      timer = peek2(timerQueue);
    }
  }
  function handleTimeout(currentTime) {
    isHostTimeoutScheduled = false;
    advanceTimers(currentTime);
    if (!isHostCallbackScheduled)
      if (null !== peek2(taskQueue))
        isHostCallbackScheduled = true, isMessageLoopRunning || (isMessageLoopRunning = true, schedulePerformWorkUntilDeadline());
      else {
        var firstTimer = peek2(timerQueue);
        null !== firstTimer && requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
      }
  }
  var isMessageLoopRunning = false, taskTimeoutID = -1, frameInterval = 5, startTime = -1;
  function shouldYieldToHost() {
    return needsPaint ? true : exports.unstable_now() - startTime < frameInterval ? false : true;
  }
  function performWorkUntilDeadline() {
    needsPaint = false;
    if (isMessageLoopRunning) {
      var currentTime = exports.unstable_now();
      startTime = currentTime;
      var hasMoreWork = true;
      try {
        a: {
          isHostCallbackScheduled = false;
          isHostTimeoutScheduled && (isHostTimeoutScheduled = false, localClearTimeout(taskTimeoutID), taskTimeoutID = -1);
          isPerformingWork = true;
          var previousPriorityLevel = currentPriorityLevel;
          try {
            b: {
              advanceTimers(currentTime);
              for (currentTask = peek2(taskQueue); null !== currentTask && !(currentTask.expirationTime > currentTime && shouldYieldToHost()); ) {
                var callback = currentTask.callback;
                if ("function" === typeof callback) {
                  currentTask.callback = null;
                  currentPriorityLevel = currentTask.priorityLevel;
                  var continuationCallback = callback(
                    currentTask.expirationTime <= currentTime
                  );
                  currentTime = exports.unstable_now();
                  if ("function" === typeof continuationCallback) {
                    currentTask.callback = continuationCallback;
                    advanceTimers(currentTime);
                    hasMoreWork = true;
                    break b;
                  }
                  currentTask === peek2(taskQueue) && pop2(taskQueue);
                  advanceTimers(currentTime);
                } else pop2(taskQueue);
                currentTask = peek2(taskQueue);
              }
              if (null !== currentTask) hasMoreWork = true;
              else {
                var firstTimer = peek2(timerQueue);
                null !== firstTimer && requestHostTimeout(
                  handleTimeout,
                  firstTimer.startTime - currentTime
                );
                hasMoreWork = false;
              }
            }
            break a;
          } finally {
            currentTask = null, currentPriorityLevel = previousPriorityLevel, isPerformingWork = false;
          }
          hasMoreWork = void 0;
        }
      } finally {
        hasMoreWork ? schedulePerformWorkUntilDeadline() : isMessageLoopRunning = false;
      }
    }
  }
  var schedulePerformWorkUntilDeadline;
  if ("function" === typeof localSetImmediate)
    schedulePerformWorkUntilDeadline = function() {
      localSetImmediate(performWorkUntilDeadline);
    };
  else if ("undefined" !== typeof MessageChannel) {
    var channel = new MessageChannel(), port = channel.port2;
    channel.port1.onmessage = performWorkUntilDeadline;
    schedulePerformWorkUntilDeadline = function() {
      port.postMessage(null);
    };
  } else
    schedulePerformWorkUntilDeadline = function() {
      localSetTimeout(performWorkUntilDeadline, 0);
    };
  function requestHostTimeout(callback, ms) {
    taskTimeoutID = localSetTimeout(function() {
      callback(exports.unstable_now());
    }, ms);
  }
  exports.unstable_IdlePriority = 5;
  exports.unstable_ImmediatePriority = 1;
  exports.unstable_LowPriority = 4;
  exports.unstable_NormalPriority = 3;
  exports.unstable_Profiling = null;
  exports.unstable_UserBlockingPriority = 2;
  exports.unstable_cancelCallback = function(task) {
    task.callback = null;
  };
  exports.unstable_forceFrameRate = function(fps) {
    0 > fps || 125 < fps ? console.error(
      "forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"
    ) : frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5;
  };
  exports.unstable_getCurrentPriorityLevel = function() {
    return currentPriorityLevel;
  };
  exports.unstable_next = function(eventHandler) {
    switch (currentPriorityLevel) {
      case 1:
      case 2:
      case 3:
        var priorityLevel = 3;
        break;
      default:
        priorityLevel = currentPriorityLevel;
    }
    var previousPriorityLevel = currentPriorityLevel;
    currentPriorityLevel = priorityLevel;
    try {
      return eventHandler();
    } finally {
      currentPriorityLevel = previousPriorityLevel;
    }
  };
  exports.unstable_requestPaint = function() {
    needsPaint = true;
  };
  exports.unstable_runWithPriority = function(priorityLevel, eventHandler) {
    switch (priorityLevel) {
      case 1:
      case 2:
      case 3:
      case 4:
      case 5:
        break;
      default:
        priorityLevel = 3;
    }
    var previousPriorityLevel = currentPriorityLevel;
    currentPriorityLevel = priorityLevel;
    try {
      return eventHandler();
    } finally {
      currentPriorityLevel = previousPriorityLevel;
    }
  };
  exports.unstable_scheduleCallback = function(priorityLevel, callback, options) {
    var currentTime = exports.unstable_now();
    "object" === typeof options && null !== options ? (options = options.delay, options = "number" === typeof options && 0 < options ? currentTime + options : currentTime) : options = currentTime;
    switch (priorityLevel) {
      case 1:
        var timeout = -1;
        break;
      case 2:
        timeout = 250;
        break;
      case 5:
        timeout = 1073741823;
        break;
      case 4:
        timeout = 1e4;
        break;
      default:
        timeout = 5e3;
    }
    timeout = options + timeout;
    priorityLevel = {
      id: taskIdCounter++,
      callback,
      priorityLevel,
      startTime: options,
      expirationTime: timeout,
      sortIndex: -1
    };
    options > currentTime ? (priorityLevel.sortIndex = options, push2(timerQueue, priorityLevel), null === peek2(taskQueue) && priorityLevel === peek2(timerQueue) && (isHostTimeoutScheduled ? (localClearTimeout(taskTimeoutID), taskTimeoutID = -1) : isHostTimeoutScheduled = true, requestHostTimeout(handleTimeout, options - currentTime))) : (priorityLevel.sortIndex = timeout, push2(taskQueue, priorityLevel), isHostCallbackScheduled || isPerformingWork || (isHostCallbackScheduled = true, isMessageLoopRunning || (isMessageLoopRunning = true, schedulePerformWorkUntilDeadline())));
    return priorityLevel;
  };
  exports.unstable_shouldYield = shouldYieldToHost;
  exports.unstable_wrapCallback = function(callback) {
    var parentPriorityLevel = currentPriorityLevel;
    return function() {
      var previousPriorityLevel = currentPriorityLevel;
      currentPriorityLevel = parentPriorityLevel;
      try {
        return callback.apply(this, arguments);
      } finally {
        currentPriorityLevel = previousPriorityLevel;
      }
    };
  };
})(scheduler_production);
{
  scheduler.exports = scheduler_production;
}
var schedulerExports = scheduler.exports;
var reactDom = { exports: {} };
var reactDom_production = {};
/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var React$3 = reactExports;
function formatProdErrorMessage$3(code) {
  var url = "https://react.dev/errors/" + code;
  if (1 < arguments.length) {
    url += "?args[]=" + encodeURIComponent(arguments[1]);
    for (var i2 = 2; i2 < arguments.length; i2++)
      url += "&args[]=" + encodeURIComponent(arguments[i2]);
  }
  return "Minified React error #" + code + "; visit " + url + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
}
function noop$5() {
}
var Internals = {
  d: {
    f: noop$5,
    r: function() {
      throw Error(formatProdErrorMessage$3(522));
    },
    D: noop$5,
    C: noop$5,
    L: noop$5,
    m: noop$5,
    X: noop$5,
    S: noop$5,
    M: noop$5
  },
  p: 0,
  findDOMNode: null
}, REACT_PORTAL_TYPE$1 = Symbol.for("react.portal");
function createPortal$1(children, containerInfo, implementation) {
  var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
  return {
    $$typeof: REACT_PORTAL_TYPE$1,
    key: null == key ? null : "" + key,
    children,
    containerInfo,
    implementation
  };
}
var ReactSharedInternals$1 = React$3.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
function getCrossOriginStringAs(as, input) {
  if ("font" === as) return "";
  if ("string" === typeof input)
    return "use-credentials" === input ? input : "";
}
reactDom_production.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
reactDom_production.createPortal = function(children, container) {
  var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
  if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType)
    throw Error(formatProdErrorMessage$3(299));
  return createPortal$1(children, container, null, key);
};
reactDom_production.flushSync = function(fn) {
  var previousTransition = ReactSharedInternals$1.T, previousUpdatePriority = Internals.p;
  try {
    if (ReactSharedInternals$1.T = null, Internals.p = 2, fn) return fn();
  } finally {
    ReactSharedInternals$1.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f();
  }
};
reactDom_production.preconnect = function(href, options) {
  "string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
};
reactDom_production.prefetchDNS = function(href) {
  "string" === typeof href && Internals.d.D(href);
};
reactDom_production.preinit = function(href, options) {
  if ("string" === typeof href && options && "string" === typeof options.as) {
    var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
    "style" === as ? Internals.d.S(
      href,
      "string" === typeof options.precedence ? options.precedence : void 0,
      {
        crossOrigin,
        integrity,
        fetchPriority
      }
    ) : "script" === as && Internals.d.X(href, {
      crossOrigin,
      integrity,
      fetchPriority,
      nonce: "string" === typeof options.nonce ? options.nonce : void 0
    });
  }
};
reactDom_production.preinitModule = function(href, options) {
  if ("string" === typeof href)
    if ("object" === typeof options && null !== options) {
      if (null == options.as || "script" === options.as) {
        var crossOrigin = getCrossOriginStringAs(
          options.as,
          options.crossOrigin
        );
        Internals.d.M(href, {
          crossOrigin,
          integrity: "string" === typeof options.integrity ? options.integrity : void 0,
          nonce: "string" === typeof options.nonce ? options.nonce : void 0
        });
      }
    } else null == options && Internals.d.M(href);
};
reactDom_production.preload = function(href, options) {
  if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
    var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
    Internals.d.L(href, as, {
      crossOrigin,
      integrity: "string" === typeof options.integrity ? options.integrity : void 0,
      nonce: "string" === typeof options.nonce ? options.nonce : void 0,
      type: "string" === typeof options.type ? options.type : void 0,
      fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
      referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
      imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
      imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
      media: "string" === typeof options.media ? options.media : void 0
    });
  }
};
reactDom_production.preloadModule = function(href, options) {
  if ("string" === typeof href)
    if (options) {
      var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
      Internals.d.m(href, {
        as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
        crossOrigin,
        integrity: "string" === typeof options.integrity ? options.integrity : void 0
      });
    } else Internals.d.m(href);
};
reactDom_production.requestFormReset = function(form) {
  Internals.d.r(form);
};
reactDom_production.unstable_batchedUpdates = function(fn, a2) {
  return fn(a2);
};
reactDom_production.useFormState = function(action, initialState2, permalink) {
  return ReactSharedInternals$1.H.useFormState(action, initialState2, permalink);
};
reactDom_production.useFormStatus = function() {
  return ReactSharedInternals$1.H.useHostTransitionStatus();
};
reactDom_production.version = "19.1.1";
function checkDCE$1() {
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") {
    return;
  }
  try {
    __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE$1);
  } catch (err) {
    console.error(err);
  }
}
{
  checkDCE$1();
  reactDom.exports = reactDom_production;
}
var reactDomExports = reactDom.exports;
/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var Scheduler = schedulerExports, React$2 = reactExports, ReactDOM$1 = reactDomExports;
function formatProdErrorMessage$2(code) {
  var url = "https://react.dev/errors/" + code;
  if (1 < arguments.length) {
    url += "?args[]=" + encodeURIComponent(arguments[1]);
    for (var i2 = 2; i2 < arguments.length; i2++)
      url += "&args[]=" + encodeURIComponent(arguments[i2]);
  }
  return "Minified React error #" + code + "; visit " + url + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
}
function isValidContainer(node) {
  return !(!node || 1 !== node.nodeType && 9 !== node.nodeType && 11 !== node.nodeType);
}
function getNearestMountedFiber(fiber) {
  var node = fiber, nearestMounted = fiber;
  if (fiber.alternate) for (; node.return; ) node = node.return;
  else {
    fiber = node;
    do
      node = fiber, 0 !== (node.flags & 4098) && (nearestMounted = node.return), fiber = node.return;
    while (fiber);
  }
  return 3 === node.tag ? nearestMounted : null;
}
function getSuspenseInstanceFromFiber(fiber) {
  if (13 === fiber.tag) {
    var suspenseState = fiber.memoizedState;
    null === suspenseState && (fiber = fiber.alternate, null !== fiber && (suspenseState = fiber.memoizedState));
    if (null !== suspenseState) return suspenseState.dehydrated;
  }
  return null;
}
function assertIsMounted(fiber) {
  if (getNearestMountedFiber(fiber) !== fiber)
    throw Error(formatProdErrorMessage$2(188));
}
function findCurrentFiberUsingSlowPath(fiber) {
  var alternate = fiber.alternate;
  if (!alternate) {
    alternate = getNearestMountedFiber(fiber);
    if (null === alternate) throw Error(formatProdErrorMessage$2(188));
    return alternate !== fiber ? null : fiber;
  }
  for (var a2 = fiber, b = alternate; ; ) {
    var parentA = a2.return;
    if (null === parentA) break;
    var parentB = parentA.alternate;
    if (null === parentB) {
      b = parentA.return;
      if (null !== b) {
        a2 = b;
        continue;
      }
      break;
    }
    if (parentA.child === parentB.child) {
      for (parentB = parentA.child; parentB; ) {
        if (parentB === a2) return assertIsMounted(parentA), fiber;
        if (parentB === b) return assertIsMounted(parentA), alternate;
        parentB = parentB.sibling;
      }
      throw Error(formatProdErrorMessage$2(188));
    }
    if (a2.return !== b.return) a2 = parentA, b = parentB;
    else {
      for (var didFindChild = false, child$0 = parentA.child; child$0; ) {
        if (child$0 === a2) {
          didFindChild = true;
          a2 = parentA;
          b = parentB;
          break;
        }
        if (child$0 === b) {
          didFindChild = true;
          b = parentA;
          a2 = parentB;
          break;
        }
        child$0 = child$0.sibling;
      }
      if (!didFindChild) {
        for (child$0 = parentB.child; child$0; ) {
          if (child$0 === a2) {
            didFindChild = true;
            a2 = parentB;
            b = parentA;
            break;
          }
          if (child$0 === b) {
            didFindChild = true;
            b = parentB;
            a2 = parentA;
            break;
          }
          child$0 = child$0.sibling;
        }
        if (!didFindChild) throw Error(formatProdErrorMessage$2(189));
      }
    }
    if (a2.alternate !== b) throw Error(formatProdErrorMessage$2(190));
  }
  if (3 !== a2.tag) throw Error(formatProdErrorMessage$2(188));
  return a2.stateNode.current === a2 ? fiber : alternate;
}
function findCurrentHostFiberImpl(node) {
  var tag = node.tag;
  if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node;
  for (node = node.child; null !== node; ) {
    tag = findCurrentHostFiberImpl(node);
    if (null !== tag) return tag;
    node = node.sibling;
  }
  return null;
}
var assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_PROVIDER_TYPE = Symbol.for("react.provider"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy");
var REACT_ACTIVITY_TYPE = Symbol.for("react.activity");
var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
function getIteratorFn(maybeIterable) {
  if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
  maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
  return "function" === typeof maybeIterable ? maybeIterable : null;
}
var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
function getComponentNameFromType(type) {
  if (null == type) return null;
  if ("function" === typeof type)
    return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
  if ("string" === typeof type) return type;
  switch (type) {
    case REACT_FRAGMENT_TYPE:
      return "Fragment";
    case REACT_PROFILER_TYPE:
      return "Profiler";
    case REACT_STRICT_MODE_TYPE:
      return "StrictMode";
    case REACT_SUSPENSE_TYPE:
      return "Suspense";
    case REACT_SUSPENSE_LIST_TYPE:
      return "SuspenseList";
    case REACT_ACTIVITY_TYPE:
      return "Activity";
  }
  if ("object" === typeof type)
    switch (type.$$typeof) {
      case REACT_PORTAL_TYPE:
        return "Portal";
      case REACT_CONTEXT_TYPE:
        return (type.displayName || "Context") + ".Provider";
      case REACT_CONSUMER_TYPE:
        return (type._context.displayName || "Context") + ".Consumer";
      case REACT_FORWARD_REF_TYPE:
        var innerType = type.render;
        type = type.displayName;
        type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
        return type;
      case REACT_MEMO_TYPE:
        return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
      case REACT_LAZY_TYPE:
        innerType = type._payload;
        type = type._init;
        try {
          return getComponentNameFromType(type(innerType));
        } catch (x) {
        }
    }
  return null;
}
var isArrayImpl = Array.isArray, ReactSharedInternals = React$2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ReactDOMSharedInternals = ReactDOM$1.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, sharedNotPendingObject = {
  pending: false,
  data: null,
  method: null,
  action: null
}, valueStack = [], index = -1;
function createCursor(defaultValue) {
  return { current: defaultValue };
}
function pop(cursor) {
  0 > index || (cursor.current = valueStack[index], valueStack[index] = null, index--);
}
function push(cursor, value) {
  index++;
  valueStack[index] = cursor.current;
  cursor.current = value;
}
var contextStackCursor = createCursor(null), contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null), hostTransitionProviderCursor = createCursor(null);
function pushHostContainer(fiber, nextRootInstance) {
  push(rootInstanceStackCursor, nextRootInstance);
  push(contextFiberStackCursor, fiber);
  push(contextStackCursor, null);
  switch (nextRootInstance.nodeType) {
    case 9:
    case 11:
      fiber = (fiber = nextRootInstance.documentElement) ? (fiber = fiber.namespaceURI) ? getOwnHostContext(fiber) : 0 : 0;
      break;
    default:
      if (fiber = nextRootInstance.tagName, nextRootInstance = nextRootInstance.namespaceURI)
        nextRootInstance = getOwnHostContext(nextRootInstance), fiber = getChildHostContextProd(nextRootInstance, fiber);
      else
        switch (fiber) {
          case "svg":
            fiber = 1;
            break;
          case "math":
            fiber = 2;
            break;
          default:
            fiber = 0;
        }
  }
  pop(contextStackCursor);
  push(contextStackCursor, fiber);
}
function popHostContainer() {
  pop(contextStackCursor);
  pop(contextFiberStackCursor);
  pop(rootInstanceStackCursor);
}
function pushHostContext(fiber) {
  null !== fiber.memoizedState && push(hostTransitionProviderCursor, fiber);
  var context = contextStackCursor.current;
  var JSCompiler_inline_result = getChildHostContextProd(context, fiber.type);
  context !== JSCompiler_inline_result && (push(contextFiberStackCursor, fiber), push(contextStackCursor, JSCompiler_inline_result));
}
function popHostContext(fiber) {
  contextFiberStackCursor.current === fiber && (pop(contextStackCursor), pop(contextFiberStackCursor));
  hostTransitionProviderCursor.current === fiber && (pop(hostTransitionProviderCursor), HostTransitionContext._currentValue = sharedNotPendingObject);
}
var hasOwnProperty$1 = Object.prototype.hasOwnProperty, scheduleCallback$3 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, now = Scheduler.unstable_now, getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel, ImmediatePriority = Scheduler.unstable_ImmediatePriority, UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, NormalPriority$1 = Scheduler.unstable_NormalPriority, LowPriority = Scheduler.unstable_LowPriority, IdlePriority = Scheduler.unstable_IdlePriority, log$1 = Scheduler.log, unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, rendererID = null, injectedHook = null;
function setIsStrictModeForDevtools(newIsStrictMode) {
  "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode);
  if (injectedHook && "function" === typeof injectedHook.setStrictMode)
    try {
      injectedHook.setStrictMode(rendererID, newIsStrictMode);
    } catch (err) {
    }
}
var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, log = Math.log, LN2 = Math.LN2;
function clz32Fallback(x) {
  x >>>= 0;
  return 0 === x ? 32 : 31 - (log(x) / LN2 | 0) | 0;
}
var nextTransitionLane = 256, nextRetryLane = 4194304;
function getHighestPriorityLanes(lanes) {
  var pendingSyncLanes = lanes & 42;
  if (0 !== pendingSyncLanes) return pendingSyncLanes;
  switch (lanes & -lanes) {
    case 1:
      return 1;
    case 2:
      return 2;
    case 4:
      return 4;
    case 8:
      return 8;
    case 16:
      return 16;
    case 32:
      return 32;
    case 64:
      return 64;
    case 128:
      return 128;
    case 256:
    case 512:
    case 1024:
    case 2048:
    case 4096:
    case 8192:
    case 16384:
    case 32768:
    case 65536:
    case 131072:
    case 262144:
    case 524288:
    case 1048576:
    case 2097152:
      return lanes & 4194048;
    case 4194304:
    case 8388608:
    case 16777216:
    case 33554432:
      return lanes & 62914560;
    case 67108864:
      return 67108864;
    case 134217728:
      return 134217728;
    case 268435456:
      return 268435456;
    case 536870912:
      return 536870912;
    case 1073741824:
      return 0;
    default:
      return lanes;
  }
}
function getNextLanes(root2, wipLanes, rootHasPendingCommit) {
  var pendingLanes = root2.pendingLanes;
  if (0 === pendingLanes) return 0;
  var nextLanes = 0, suspendedLanes = root2.suspendedLanes, pingedLanes = root2.pingedLanes;
  root2 = root2.warmLanes;
  var nonIdlePendingLanes = pendingLanes & 134217727;
  0 !== nonIdlePendingLanes ? (pendingLanes = nonIdlePendingLanes & ~suspendedLanes, 0 !== pendingLanes ? nextLanes = getHighestPriorityLanes(pendingLanes) : (pingedLanes &= nonIdlePendingLanes, 0 !== pingedLanes ? nextLanes = getHighestPriorityLanes(pingedLanes) : rootHasPendingCommit || (rootHasPendingCommit = nonIdlePendingLanes & ~root2, 0 !== rootHasPendingCommit && (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : (nonIdlePendingLanes = pendingLanes & ~suspendedLanes, 0 !== nonIdlePendingLanes ? nextLanes = getHighestPriorityLanes(nonIdlePendingLanes) : 0 !== pingedLanes ? nextLanes = getHighestPriorityLanes(pingedLanes) : rootHasPendingCommit || (rootHasPendingCommit = pendingLanes & ~root2, 0 !== rootHasPendingCommit && (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))));
  return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && (suspendedLanes = nextLanes & -nextLanes, rootHasPendingCommit = wipLanes & -wipLanes, suspendedLanes >= rootHasPendingCommit || 32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048)) ? wipLanes : nextLanes;
}
function checkIfRootIsPrerendering(root2, renderLanes2) {
  return 0 === (root2.pendingLanes & ~(root2.suspendedLanes & ~root2.pingedLanes) & renderLanes2);
}
function computeExpirationTime(lane, currentTime) {
  switch (lane) {
    case 1:
    case 2:
    case 4:
    case 8:
    case 64:
      return currentTime + 250;
    case 16:
    case 32:
    case 128:
    case 256:
    case 512:
    case 1024:
    case 2048:
    case 4096:
    case 8192:
    case 16384:
    case 32768:
    case 65536:
    case 131072:
    case 262144:
    case 524288:
    case 1048576:
    case 2097152:
      return currentTime + 5e3;
    case 4194304:
    case 8388608:
    case 16777216:
    case 33554432:
      return -1;
    case 67108864:
    case 134217728:
    case 268435456:
    case 536870912:
    case 1073741824:
      return -1;
    default:
      return -1;
  }
}
function claimNextTransitionLane() {
  var lane = nextTransitionLane;
  nextTransitionLane <<= 1;
  0 === (nextTransitionLane & 4194048) && (nextTransitionLane = 256);
  return lane;
}
function claimNextRetryLane() {
  var lane = nextRetryLane;
  nextRetryLane <<= 1;
  0 === (nextRetryLane & 62914560) && (nextRetryLane = 4194304);
  return lane;
}
function createLaneMap(initial) {
  for (var laneMap = [], i2 = 0; 31 > i2; i2++) laneMap.push(initial);
  return laneMap;
}
function markRootUpdated$1(root2, updateLane) {
  root2.pendingLanes |= updateLane;
  268435456 !== updateLane && (root2.suspendedLanes = 0, root2.pingedLanes = 0, root2.warmLanes = 0);
}
function markRootFinished(root2, finishedLanes, remainingLanes, spawnedLane, updatedLanes, suspendedRetryLanes) {
  var previouslyPendingLanes = root2.pendingLanes;
  root2.pendingLanes = remainingLanes;
  root2.suspendedLanes = 0;
  root2.pingedLanes = 0;
  root2.warmLanes = 0;
  root2.expiredLanes &= remainingLanes;
  root2.entangledLanes &= remainingLanes;
  root2.errorRecoveryDisabledLanes &= remainingLanes;
  root2.shellSuspendCounter = 0;
  var entanglements = root2.entanglements, expirationTimes = root2.expirationTimes, hiddenUpdates = root2.hiddenUpdates;
  for (remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) {
    var index$5 = 31 - clz32(remainingLanes), lane = 1 << index$5;
    entanglements[index$5] = 0;
    expirationTimes[index$5] = -1;
    var hiddenUpdatesForLane = hiddenUpdates[index$5];
    if (null !== hiddenUpdatesForLane)
      for (hiddenUpdates[index$5] = null, index$5 = 0; index$5 < hiddenUpdatesForLane.length; index$5++) {
        var update = hiddenUpdatesForLane[index$5];
        null !== update && (update.lane &= -536870913);
      }
    remainingLanes &= ~lane;
  }
  0 !== spawnedLane && markSpawnedDeferredLane(root2, spawnedLane, 0);
  0 !== suspendedRetryLanes && 0 === updatedLanes && 0 !== root2.tag && (root2.suspendedLanes |= suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes));
}
function markSpawnedDeferredLane(root2, spawnedLane, entangledLanes) {
  root2.pendingLanes |= spawnedLane;
  root2.suspendedLanes &= ~spawnedLane;
  var spawnedLaneIndex = 31 - clz32(spawnedLane);
  root2.entangledLanes |= spawnedLane;
  root2.entanglements[spawnedLaneIndex] = root2.entanglements[spawnedLaneIndex] | 1073741824 | entangledLanes & 4194090;
}
function markRootEntangled(root2, entangledLanes) {
  var rootEntangledLanes = root2.entangledLanes |= entangledLanes;
  for (root2 = root2.entanglements; rootEntangledLanes; ) {
    var index$6 = 31 - clz32(rootEntangledLanes), lane = 1 << index$6;
    lane & entangledLanes | root2[index$6] & entangledLanes && (root2[index$6] |= entangledLanes);
    rootEntangledLanes &= ~lane;
  }
}
function getBumpedLaneForHydrationByLane(lane) {
  switch (lane) {
    case 2:
      lane = 1;
      break;
    case 8:
      lane = 4;
      break;
    case 32:
      lane = 16;
      break;
    case 256:
    case 512:
    case 1024:
    case 2048:
    case 4096:
    case 8192:
    case 16384:
    case 32768:
    case 65536:
    case 131072:
    case 262144:
    case 524288:
    case 1048576:
    case 2097152:
    case 4194304:
    case 8388608:
    case 16777216:
    case 33554432:
      lane = 128;
      break;
    case 268435456:
      lane = 134217728;
      break;
    default:
      lane = 0;
  }
  return lane;
}
function lanesToEventPriority(lanes) {
  lanes &= -lanes;
  return 2 < lanes ? 8 < lanes ? 0 !== (lanes & 134217727) ? 32 : 268435456 : 8 : 2;
}
function resolveUpdatePriority() {
  var updatePriority = ReactDOMSharedInternals.p;
  if (0 !== updatePriority) return updatePriority;
  updatePriority = window.event;
  return void 0 === updatePriority ? 32 : getEventPriority(updatePriority.type);
}
function runWithPriority(priority, fn) {
  var previousPriority = ReactDOMSharedInternals.p;
  try {
    return ReactDOMSharedInternals.p = priority, fn();
  } finally {
    ReactDOMSharedInternals.p = previousPriority;
  }
}
var randomKey = Math.random().toString(36).slice(2), internalInstanceKey = "__reactFiber$" + randomKey, internalPropsKey = "__reactProps$" + randomKey, internalContainerInstanceKey = "__reactContainer$" + randomKey, internalEventHandlersKey = "__reactEvents$" + randomKey, internalEventHandlerListenersKey = "__reactListeners$" + randomKey, internalEventHandlesSetKey = "__reactHandles$" + randomKey, internalRootNodeResourcesKey = "__reactResources$" + randomKey, internalHoistableMarker = "__reactMarker$" + randomKey;
function detachDeletedInstance(node) {
  delete node[internalInstanceKey];
  delete node[internalPropsKey];
  delete node[internalEventHandlersKey];
  delete node[internalEventHandlerListenersKey];
  delete node[internalEventHandlesSetKey];
}
function getClosestInstanceFromNode(targetNode) {
  var targetInst = targetNode[internalInstanceKey];
  if (targetInst) return targetInst;
  for (var parentNode = targetNode.parentNode; parentNode; ) {
    if (targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey]) {
      parentNode = targetInst.alternate;
      if (null !== targetInst.child || null !== parentNode && null !== parentNode.child)
        for (targetNode = getParentSuspenseInstance(targetNode); null !== targetNode; ) {
          if (parentNode = targetNode[internalInstanceKey]) return parentNode;
          targetNode = getParentSuspenseInstance(targetNode);
        }
      return targetInst;
    }
    targetNode = parentNode;
    parentNode = targetNode.parentNode;
  }
  return null;
}
function getInstanceFromNode(node) {
  if (node = node[internalInstanceKey] || node[internalContainerInstanceKey]) {
    var tag = node.tag;
    if (5 === tag || 6 === tag || 13 === tag || 26 === tag || 27 === tag || 3 === tag)
      return node;
  }
  return null;
}
function getNodeFromInstance(inst) {
  var tag = inst.tag;
  if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return inst.stateNode;
  throw Error(formatProdErrorMessage$2(33));
}
function getResourcesFromRoot(root2) {
  var resources2 = root2[internalRootNodeResourcesKey];
  resources2 || (resources2 = root2[internalRootNodeResourcesKey] = { hoistableStyles: /* @__PURE__ */ new Map(), hoistableScripts: /* @__PURE__ */ new Map() });
  return resources2;
}
function markNodeAsHoistable(node) {
  node[internalHoistableMarker] = true;
}
var allNativeEvents = /* @__PURE__ */ new Set(), registrationNameDependencies = {};
function registerTwoPhaseEvent(registrationName, dependencies) {
  registerDirectEvent(registrationName, dependencies);
  registerDirectEvent(registrationName + "Capture", dependencies);
}
function registerDirectEvent(registrationName, dependencies) {
  registrationNameDependencies[registrationName] = dependencies;
  for (registrationName = 0; registrationName < dependencies.length; registrationName++)
    allNativeEvents.add(dependencies[registrationName]);
}
var VALID_ATTRIBUTE_NAME_REGEX = RegExp(
  "^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"
), illegalAttributeNameCache = {}, validatedAttributeNameCache = {};
function isAttributeNameSafe(attributeName) {
  if (hasOwnProperty$1.call(validatedAttributeNameCache, attributeName))
    return true;
  if (hasOwnProperty$1.call(illegalAttributeNameCache, attributeName)) return false;
  if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName))
    return validatedAttributeNameCache[attributeName] = true;
  illegalAttributeNameCache[attributeName] = true;
  return false;
}
function setValueForAttribute(node, name, value) {
  if (isAttributeNameSafe(name))
    if (null === value) node.removeAttribute(name);
    else {
      switch (typeof value) {
        case "undefined":
        case "function":
        case "symbol":
          node.removeAttribute(name);
          return;
        case "boolean":
          var prefix$8 = name.toLowerCase().slice(0, 5);
          if ("data-" !== prefix$8 && "aria-" !== prefix$8) {
            node.removeAttribute(name);
            return;
          }
      }
      node.setAttribute(name, "" + value);
    }
}
function setValueForKnownAttribute(node, name, value) {
  if (null === value) node.removeAttribute(name);
  else {
    switch (typeof value) {
      case "undefined":
      case "function":
      case "symbol":
      case "boolean":
        node.removeAttribute(name);
        return;
    }
    node.setAttribute(name, "" + value);
  }
}
function setValueForNamespacedAttribute(node, namespace, name, value) {
  if (null === value) node.removeAttribute(name);
  else {
    switch (typeof value) {
      case "undefined":
      case "function":
      case "symbol":
      case "boolean":
        node.removeAttribute(name);
        return;
    }
    node.setAttributeNS(namespace, name, "" + value);
  }
}
var prefix, suffix;
function describeBuiltInComponentFrame(name) {
  if (void 0 === prefix)
    try {
      throw Error();
    } catch (x) {
      var match = x.stack.trim().match(/\n( *(at )?)/);
      prefix = match && match[1] || "";
      suffix = -1 < x.stack.indexOf("\n    at") ? " (<anonymous>)" : -1 < x.stack.indexOf("@") ? "@unknown:0:0" : "";
    }
  return "\n" + prefix + name + suffix;
}
var reentry = false;
function describeNativeComponentFrame(fn, construct) {
  if (!fn || reentry) return "";
  reentry = true;
  var previousPrepareStackTrace = Error.prepareStackTrace;
  Error.prepareStackTrace = void 0;
  try {
    var RunInRootFrame = {
      DetermineComponentFrameRoot: function() {
        try {
          if (construct) {
            var Fake = function() {
              throw Error();
            };
            Object.defineProperty(Fake.prototype, "props", {
              set: function() {
                throw Error();
              }
            });
            if ("object" === typeof Reflect && Reflect.construct) {
              try {
                Reflect.construct(Fake, []);
              } catch (x) {
                var control = x;
              }
              Reflect.construct(fn, [], Fake);
            } else {
              try {
                Fake.call();
              } catch (x$9) {
                control = x$9;
              }
              fn.call(Fake.prototype);
            }
          } else {
            try {
              throw Error();
            } catch (x$10) {
              control = x$10;
            }
            (Fake = fn()) && "function" === typeof Fake.catch && Fake.catch(function() {
            });
          }
        } catch (sample) {
          if (sample && control && "string" === typeof sample.stack)
            return [sample.stack, control.stack];
        }
        return [null, null];
      }
    };
    RunInRootFrame.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
    var namePropDescriptor = Object.getOwnPropertyDescriptor(
      RunInRootFrame.DetermineComponentFrameRoot,
      "name"
    );
    namePropDescriptor && namePropDescriptor.configurable && Object.defineProperty(
      RunInRootFrame.DetermineComponentFrameRoot,
      "name",
      { value: "DetermineComponentFrameRoot" }
    );
    var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], controlStack = _RunInRootFrame$Deter[1];
    if (sampleStack && controlStack) {
      var sampleLines = sampleStack.split("\n"), controlLines = controlStack.split("\n");
      for (namePropDescriptor = RunInRootFrame = 0; RunInRootFrame < sampleLines.length && !sampleLines[RunInRootFrame].includes("DetermineComponentFrameRoot"); )
        RunInRootFrame++;
      for (; namePropDescriptor < controlLines.length && !controlLines[namePropDescriptor].includes(
        "DetermineComponentFrameRoot"
      ); )
        namePropDescriptor++;
      if (RunInRootFrame === sampleLines.length || namePropDescriptor === controlLines.length)
        for (RunInRootFrame = sampleLines.length - 1, namePropDescriptor = controlLines.length - 1; 1 <= RunInRootFrame && 0 <= namePropDescriptor && sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]; )
          namePropDescriptor--;
      for (; 1 <= RunInRootFrame && 0 <= namePropDescriptor; RunInRootFrame--, namePropDescriptor--)
        if (sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) {
          if (1 !== RunInRootFrame || 1 !== namePropDescriptor) {
            do
              if (RunInRootFrame--, namePropDescriptor--, 0 > namePropDescriptor || sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) {
                var frame = "\n" + sampleLines[RunInRootFrame].replace(" at new ", " at ");
                fn.displayName && frame.includes("<anonymous>") && (frame = frame.replace("<anonymous>", fn.displayName));
                return frame;
              }
            while (1 <= RunInRootFrame && 0 <= namePropDescriptor);
          }
          break;
        }
    }
  } finally {
    reentry = false, Error.prepareStackTrace = previousPrepareStackTrace;
  }
  return (previousPrepareStackTrace = fn ? fn.displayName || fn.name : "") ? describeBuiltInComponentFrame(previousPrepareStackTrace) : "";
}
function describeFiber(fiber) {
  switch (fiber.tag) {
    case 26:
    case 27:
    case 5:
      return describeBuiltInComponentFrame(fiber.type);
    case 16:
      return describeBuiltInComponentFrame("Lazy");
    case 13:
      return describeBuiltInComponentFrame("Suspense");
    case 19:
      return describeBuiltInComponentFrame("SuspenseList");
    case 0:
    case 15:
      return describeNativeComponentFrame(fiber.type, false);
    case 11:
      return describeNativeComponentFrame(fiber.type.render, false);
    case 1:
      return describeNativeComponentFrame(fiber.type, true);
    case 31:
      return describeBuiltInComponentFrame("Activity");
    default:
      return "";
  }
}
function getStackByFiberInDevAndProd(workInProgress2) {
  try {
    var info = "";
    do
      info += describeFiber(workInProgress2), workInProgress2 = workInProgress2.return;
    while (workInProgress2);
    return info;
  } catch (x) {
    return "\nError generating stack: " + x.message + "\n" + x.stack;
  }
}
function getToStringValue(value) {
  switch (typeof value) {
    case "bigint":
    case "boolean":
    case "number":
    case "string":
    case "undefined":
      return value;
    case "object":
      return value;
    default:
      return "";
  }
}
function isCheckable(elem) {
  var type = elem.type;
  return (elem = elem.nodeName) && "input" === elem.toLowerCase() && ("checkbox" === type || "radio" === type);
}
function trackValueOnNode(node) {
  var valueField = isCheckable(node) ? "checked" : "value", descriptor = Object.getOwnPropertyDescriptor(
    node.constructor.prototype,
    valueField
  ), currentValue = "" + node[valueField];
  if (!node.hasOwnProperty(valueField) && "undefined" !== typeof descriptor && "function" === typeof descriptor.get && "function" === typeof descriptor.set) {
    var get2 = descriptor.get, set2 = descriptor.set;
    Object.defineProperty(node, valueField, {
      configurable: true,
      get: function() {
        return get2.call(this);
      },
      set: function(value) {
        currentValue = "" + value;
        set2.call(this, value);
      }
    });
    Object.defineProperty(node, valueField, {
      enumerable: descriptor.enumerable
    });
    return {
      getValue: function() {
        return currentValue;
      },
      setValue: function(value) {
        currentValue = "" + value;
      },
      stopTracking: function() {
        node._valueTracker = null;
        delete node[valueField];
      }
    };
  }
}
function track(node) {
  node._valueTracker || (node._valueTracker = trackValueOnNode(node));
}
function updateValueIfChanged(node) {
  if (!node) return false;
  var tracker = node._valueTracker;
  if (!tracker) return true;
  var lastValue = tracker.getValue();
  var value = "";
  node && (value = isCheckable(node) ? node.checked ? "true" : "false" : node.value);
  node = value;
  return node !== lastValue ? (tracker.setValue(node), true) : false;
}
function getActiveElement(doc) {
  doc = doc || ("undefined" !== typeof document ? document : void 0);
  if ("undefined" === typeof doc) return null;
  try {
    return doc.activeElement || doc.body;
  } catch (e2) {
    return doc.body;
  }
}
var escapeSelectorAttributeValueInsideDoubleQuotesRegex = /[\n"\\]/g;
function escapeSelectorAttributeValueInsideDoubleQuotes(value) {
  return value.replace(
    escapeSelectorAttributeValueInsideDoubleQuotesRegex,
    function(ch) {
      return "\\" + ch.charCodeAt(0).toString(16) + " ";
    }
  );
}
function updateInput(element, value, defaultValue, lastDefaultValue, checked, defaultChecked, type, name) {
  element.name = "";
  null != type && "function" !== typeof type && "symbol" !== typeof type && "boolean" !== typeof type ? element.type = type : element.removeAttribute("type");
  if (null != value)
    if ("number" === type) {
      if (0 === value && "" === element.value || element.value != value)
        element.value = "" + getToStringValue(value);
    } else
      element.value !== "" + getToStringValue(value) && (element.value = "" + getToStringValue(value));
  else
    "submit" !== type && "reset" !== type || element.removeAttribute("value");
  null != value ? setDefaultValue(element, type, getToStringValue(value)) : null != defaultValue ? setDefaultValue(element, type, getToStringValue(defaultValue)) : null != lastDefaultValue && element.removeAttribute("value");
  null == checked && null != defaultChecked && (element.defaultChecked = !!defaultChecked);
  null != checked && (element.checked = checked && "function" !== typeof checked && "symbol" !== typeof checked);
  null != name && "function" !== typeof name && "symbol" !== typeof name && "boolean" !== typeof name ? element.name = "" + getToStringValue(name) : element.removeAttribute("name");
}
function initInput(element, value, defaultValue, checked, defaultChecked, type, name, isHydrating2) {
  null != type && "function" !== typeof type && "symbol" !== typeof type && "boolean" !== typeof type && (element.type = type);
  if (null != value || null != defaultValue) {
    if (!("submit" !== type && "reset" !== type || void 0 !== value && null !== value))
      return;
    defaultValue = null != defaultValue ? "" + getToStringValue(defaultValue) : "";
    value = null != value ? "" + getToStringValue(value) : defaultValue;
    isHydrating2 || value === element.value || (element.value = value);
    element.defaultValue = value;
  }
  checked = null != checked ? checked : defaultChecked;
  checked = "function" !== typeof checked && "symbol" !== typeof checked && !!checked;
  element.checked = isHydrating2 ? element.checked : !!checked;
  element.defaultChecked = !!checked;
  null != name && "function" !== typeof name && "symbol" !== typeof name && "boolean" !== typeof name && (element.name = name);
}
function setDefaultValue(node, type, value) {
  "number" === type && getActiveElement(node.ownerDocument) === node || node.defaultValue === "" + value || (node.defaultValue = "" + value);
}
function updateOptions(node, multiple, propValue, setDefaultSelected) {
  node = node.options;
  if (multiple) {
    multiple = {};
    for (var i2 = 0; i2 < propValue.length; i2++)
      multiple["$" + propValue[i2]] = true;
    for (propValue = 0; propValue < node.length; propValue++)
      i2 = multiple.hasOwnProperty("$" + node[propValue].value), node[propValue].selected !== i2 && (node[propValue].selected = i2), i2 && setDefaultSelected && (node[propValue].defaultSelected = true);
  } else {
    propValue = "" + getToStringValue(propValue);
    multiple = null;
    for (i2 = 0; i2 < node.length; i2++) {
      if (node[i2].value === propValue) {
        node[i2].selected = true;
        setDefaultSelected && (node[i2].defaultSelected = true);
        return;
      }
      null !== multiple || node[i2].disabled || (multiple = node[i2]);
    }
    null !== multiple && (multiple.selected = true);
  }
}
function updateTextarea(element, value, defaultValue) {
  if (null != value && (value = "" + getToStringValue(value), value !== element.value && (element.value = value), null == defaultValue)) {
    element.defaultValue !== value && (element.defaultValue = value);
    return;
  }
  element.defaultValue = null != defaultValue ? "" + getToStringValue(defaultValue) : "";
}
function initTextarea(element, value, defaultValue, children) {
  if (null == value) {
    if (null != children) {
      if (null != defaultValue) throw Error(formatProdErrorMessage$2(92));
      if (isArrayImpl(children)) {
        if (1 < children.length) throw Error(formatProdErrorMessage$2(93));
        children = children[0];
      }
      defaultValue = children;
    }
    null == defaultValue && (defaultValue = "");
    value = defaultValue;
  }
  defaultValue = getToStringValue(value);
  element.defaultValue = defaultValue;
  children = element.textContent;
  children === defaultValue && "" !== children && null !== children && (element.value = children);
}
function setTextContent(node, text) {
  if (text) {
    var firstChild = node.firstChild;
    if (firstChild && firstChild === node.lastChild && 3 === firstChild.nodeType) {
      firstChild.nodeValue = text;
      return;
    }
  }
  node.textContent = text;
}
var unitlessNumbers = new Set(
  "animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(
    " "
  )
);
function setValueForStyle(style2, styleName, value) {
  var isCustomProperty = 0 === styleName.indexOf("--");
  null == value || "boolean" === typeof value || "" === value ? isCustomProperty ? style2.setProperty(styleName, "") : "float" === styleName ? style2.cssFloat = "" : style2[styleName] = "" : isCustomProperty ? style2.setProperty(styleName, value) : "number" !== typeof value || 0 === value || unitlessNumbers.has(styleName) ? "float" === styleName ? style2.cssFloat = value : style2[styleName] = ("" + value).trim() : style2[styleName] = value + "px";
}
function setValueForStyles(node, styles, prevStyles) {
  if (null != styles && "object" !== typeof styles)
    throw Error(formatProdErrorMessage$2(62));
  node = node.style;
  if (null != prevStyles) {
    for (var styleName in prevStyles)
      !prevStyles.hasOwnProperty(styleName) || null != styles && styles.hasOwnProperty(styleName) || (0 === styleName.indexOf("--") ? node.setProperty(styleName, "") : "float" === styleName ? node.cssFloat = "" : node[styleName] = "");
    for (var styleName$16 in styles)
      styleName = styles[styleName$16], styles.hasOwnProperty(styleName$16) && prevStyles[styleName$16] !== styleName && setValueForStyle(node, styleName$16, styleName);
  } else
    for (var styleName$17 in styles)
      styles.hasOwnProperty(styleName$17) && setValueForStyle(node, styleName$17, styles[styleName$17]);
}
function isCustomElement(tagName) {
  if (-1 === tagName.indexOf("-")) return false;
  switch (tagName) {
    case "annotation-xml":
    case "color-profile":
    case "font-face":
    case "font-face-src":
    case "font-face-uri":
    case "font-face-format":
    case "font-face-name":
    case "missing-glyph":
      return false;
    default:
      return true;
  }
}
var aliases = /* @__PURE__ */ new Map([
  ["acceptCharset", "accept-charset"],
  ["htmlFor", "for"],
  ["httpEquiv", "http-equiv"],
  ["crossOrigin", "crossorigin"],
  ["accentHeight", "accent-height"],
  ["alignmentBaseline", "alignment-baseline"],
  ["arabicForm", "arabic-form"],
  ["baselineShift", "baseline-shift"],
  ["capHeight", "cap-height"],
  ["clipPath", "clip-path"],
  ["clipRule", "clip-rule"],
  ["colorInterpolation", "color-interpolation"],
  ["colorInterpolationFilters", "color-interpolation-filters"],
  ["colorProfile", "color-profile"],
  ["colorRendering", "color-rendering"],
  ["dominantBaseline", "dominant-baseline"],
  ["enableBackground", "enable-background"],
  ["fillOpacity", "fill-opacity"],
  ["fillRule", "fill-rule"],
  ["floodColor", "flood-color"],
  ["floodOpacity", "flood-opacity"],
  ["fontFamily", "font-family"],
  ["fontSize", "font-size"],
  ["fontSizeAdjust", "font-size-adjust"],
  ["fontStretch", "font-stretch"],
  ["fontStyle", "font-style"],
  ["fontVariant", "font-variant"],
  ["fontWeight", "font-weight"],
  ["glyphName", "glyph-name"],
  ["glyphOrientationHorizontal", "glyph-orientation-horizontal"],
  ["glyphOrientationVertical", "glyph-orientation-vertical"],
  ["horizAdvX", "horiz-adv-x"],
  ["horizOriginX", "horiz-origin-x"],
  ["imageRendering", "image-rendering"],
  ["letterSpacing", "letter-spacing"],
  ["lightingColor", "lighting-color"],
  ["markerEnd", "marker-end"],
  ["markerMid", "marker-mid"],
  ["markerStart", "marker-start"],
  ["overlinePosition", "overline-position"],
  ["overlineThickness", "overline-thickness"],
  ["paintOrder", "paint-order"],
  ["panose-1", "panose-1"],
  ["pointerEvents", "pointer-events"],
  ["renderingIntent", "rendering-intent"],
  ["shapeRendering", "shape-rendering"],
  ["stopColor", "stop-color"],
  ["stopOpacity", "stop-opacity"],
  ["strikethroughPosition", "strikethrough-position"],
  ["strikethroughThickness", "strikethrough-thickness"],
  ["strokeDasharray", "stroke-dasharray"],
  ["strokeDashoffset", "stroke-dashoffset"],
  ["strokeLinecap", "stroke-linecap"],
  ["strokeLinejoin", "stroke-linejoin"],
  ["strokeMiterlimit", "stroke-miterlimit"],
  ["strokeOpacity", "stroke-opacity"],
  ["strokeWidth", "stroke-width"],
  ["textAnchor", "text-anchor"],
  ["textDecoration", "text-decoration"],
  ["textRendering", "text-rendering"],
  ["transformOrigin", "transform-origin"],
  ["underlinePosition", "underline-position"],
  ["underlineThickness", "underline-thickness"],
  ["unicodeBidi", "unicode-bidi"],
  ["unicodeRange", "unicode-range"],
  ["unitsPerEm", "units-per-em"],
  ["vAlphabetic", "v-alphabetic"],
  ["vHanging", "v-hanging"],
  ["vIdeographic", "v-ideographic"],
  ["vMathematical", "v-mathematical"],
  ["vectorEffect", "vector-effect"],
  ["vertAdvY", "vert-adv-y"],
  ["vertOriginX", "vert-origin-x"],
  ["vertOriginY", "vert-origin-y"],
  ["wordSpacing", "word-spacing"],
  ["writingMode", "writing-mode"],
  ["xmlnsXlink", "xmlns:xlink"],
  ["xHeight", "x-height"]
]), isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;
function sanitizeURL(url) {
  return isJavaScriptProtocol.test("" + url) ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')" : url;
}
var currentReplayingEvent = null;
function getEventTarget(nativeEvent) {
  nativeEvent = nativeEvent.target || nativeEvent.srcElement || window;
  nativeEvent.correspondingUseElement && (nativeEvent = nativeEvent.correspondingUseElement);
  return 3 === nativeEvent.nodeType ? nativeEvent.parentNode : nativeEvent;
}
var restoreTarget = null, restoreQueue = null;
function restoreStateOfTarget(target) {
  var internalInstance = getInstanceFromNode(target);
  if (internalInstance && (target = internalInstance.stateNode)) {
    var props = target[internalPropsKey] || null;
    a: switch (target = internalInstance.stateNode, internalInstance.type) {
      case "input":
        updateInput(
          target,
          props.value,
          props.defaultValue,
          props.defaultValue,
          props.checked,
          props.defaultChecked,
          props.type,
          props.name
        );
        internalInstance = props.name;
        if ("radio" === props.type && null != internalInstance) {
          for (props = target; props.parentNode; ) props = props.parentNode;
          props = props.querySelectorAll(
            'input[name="' + escapeSelectorAttributeValueInsideDoubleQuotes(
              "" + internalInstance
            ) + '"][type="radio"]'
          );
          for (internalInstance = 0; internalInstance < props.length; internalInstance++) {
            var otherNode = props[internalInstance];
            if (otherNode !== target && otherNode.form === target.form) {
              var otherProps = otherNode[internalPropsKey] || null;
              if (!otherProps) throw Error(formatProdErrorMessage$2(90));
              updateInput(
                otherNode,
                otherProps.value,
                otherProps.defaultValue,
                otherProps.defaultValue,
                otherProps.checked,
                otherProps.defaultChecked,
                otherProps.type,
                otherProps.name
              );
            }
          }
          for (internalInstance = 0; internalInstance < props.length; internalInstance++)
            otherNode = props[internalInstance], otherNode.form === target.form && updateValueIfChanged(otherNode);
        }
        break a;
      case "textarea":
        updateTextarea(target, props.value, props.defaultValue);
        break a;
      case "select":
        internalInstance = props.value, null != internalInstance && updateOptions(target, !!props.multiple, internalInstance, false);
    }
  }
}
var isInsideEventHandler = false;
function batchedUpdates$1(fn, a2, b) {
  if (isInsideEventHandler) return fn(a2, b);
  isInsideEventHandler = true;
  try {
    var JSCompiler_inline_result = fn(a2);
    return JSCompiler_inline_result;
  } finally {
    if (isInsideEventHandler = false, null !== restoreTarget || null !== restoreQueue) {
      if (flushSyncWork$1(), restoreTarget && (a2 = restoreTarget, fn = restoreQueue, restoreQueue = restoreTarget = null, restoreStateOfTarget(a2), fn))
        for (a2 = 0; a2 < fn.length; a2++) restoreStateOfTarget(fn[a2]);
    }
  }
}
function getListener(inst, registrationName) {
  var stateNode = inst.stateNode;
  if (null === stateNode) return null;
  var props = stateNode[internalPropsKey] || null;
  if (null === props) return null;
  stateNode = props[registrationName];
  a: switch (registrationName) {
    case "onClick":
    case "onClickCapture":
    case "onDoubleClick":
    case "onDoubleClickCapture":
    case "onMouseDown":
    case "onMouseDownCapture":
    case "onMouseMove":
    case "onMouseMoveCapture":
    case "onMouseUp":
    case "onMouseUpCapture":
    case "onMouseEnter":
      (props = !props.disabled) || (inst = inst.type, props = !("button" === inst || "input" === inst || "select" === inst || "textarea" === inst));
      inst = !props;
      break a;
    default:
      inst = false;
  }
  if (inst) return null;
  if (stateNode && "function" !== typeof stateNode)
    throw Error(
      formatProdErrorMessage$2(231, registrationName, typeof stateNode)
    );
  return stateNode;
}
var canUseDOM$1 = !("undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement), passiveBrowserEventsSupported = false;
if (canUseDOM$1)
  try {
    var options = {};
    Object.defineProperty(options, "passive", {
      get: function() {
        passiveBrowserEventsSupported = true;
      }
    });
    window.addEventListener("test", options, options);
    window.removeEventListener("test", options, options);
  } catch (e2) {
    passiveBrowserEventsSupported = false;
  }
var root$1 = null, startText = null, fallbackText = null;
function getData() {
  if (fallbackText) return fallbackText;
  var start, startValue = startText, startLength = startValue.length, end, endValue = "value" in root$1 ? root$1.value : root$1.textContent, endLength = endValue.length;
  for (start = 0; start < startLength && startValue[start] === endValue[start]; start++) ;
  var minEnd = startLength - start;
  for (end = 1; end <= minEnd && startValue[startLength - end] === endValue[endLength - end]; end++) ;
  return fallbackText = endValue.slice(start, 1 < end ? 1 - end : void 0);
}
function getEventCharCode(nativeEvent) {
  var keyCode = nativeEvent.keyCode;
  "charCode" in nativeEvent ? (nativeEvent = nativeEvent.charCode, 0 === nativeEvent && 13 === keyCode && (nativeEvent = 13)) : nativeEvent = keyCode;
  10 === nativeEvent && (nativeEvent = 13);
  return 32 <= nativeEvent || 13 === nativeEvent ? nativeEvent : 0;
}
function functionThatReturnsTrue() {
  return true;
}
function functionThatReturnsFalse() {
  return false;
}
function createSyntheticEvent(Interface) {
  function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) {
    this._reactName = reactName;
    this._targetInst = targetInst;
    this.type = reactEventType;
    this.nativeEvent = nativeEvent;
    this.target = nativeEventTarget;
    this.currentTarget = null;
    for (var propName in Interface)
      Interface.hasOwnProperty(propName) && (reactName = Interface[propName], this[propName] = reactName ? reactName(nativeEvent) : nativeEvent[propName]);
    this.isDefaultPrevented = (null != nativeEvent.defaultPrevented ? nativeEvent.defaultPrevented : false === nativeEvent.returnValue) ? functionThatReturnsTrue : functionThatReturnsFalse;
    this.isPropagationStopped = functionThatReturnsFalse;
    return this;
  }
  assign(SyntheticBaseEvent.prototype, {
    preventDefault: function() {
      this.defaultPrevented = true;
      var event = this.nativeEvent;
      event && (event.preventDefault ? event.preventDefault() : "unknown" !== typeof event.returnValue && (event.returnValue = false), this.isDefaultPrevented = functionThatReturnsTrue);
    },
    stopPropagation: function() {
      var event = this.nativeEvent;
      event && (event.stopPropagation ? event.stopPropagation() : "unknown" !== typeof event.cancelBubble && (event.cancelBubble = true), this.isPropagationStopped = functionThatReturnsTrue);
    },
    persist: function() {
    },
    isPersistent: functionThatReturnsTrue
  });
  return SyntheticBaseEvent;
}
var EventInterface = {
  eventPhase: 0,
  bubbles: 0,
  cancelable: 0,
  timeStamp: function(event) {
    return event.timeStamp || Date.now();
  },
  defaultPrevented: 0,
  isTrusted: 0
}, SyntheticEvent = createSyntheticEvent(EventInterface), UIEventInterface = assign({}, EventInterface, { view: 0, detail: 0 }), SyntheticUIEvent = createSyntheticEvent(UIEventInterface), lastMovementX, lastMovementY, lastMouseEvent, MouseEventInterface = assign({}, UIEventInterface, {
  screenX: 0,
  screenY: 0,
  clientX: 0,
  clientY: 0,
  pageX: 0,
  pageY: 0,
  ctrlKey: 0,
  shiftKey: 0,
  altKey: 0,
  metaKey: 0,
  getModifierState: getEventModifierState,
  button: 0,
  buttons: 0,
  relatedTarget: function(event) {
    return void 0 === event.relatedTarget ? event.fromElement === event.srcElement ? event.toElement : event.fromElement : event.relatedTarget;
  },
  movementX: function(event) {
    if ("movementX" in event) return event.movementX;
    event !== lastMouseEvent && (lastMouseEvent && "mousemove" === event.type ? (lastMovementX = event.screenX - lastMouseEvent.screenX, lastMovementY = event.screenY - lastMouseEvent.screenY) : lastMovementY = lastMovementX = 0, lastMouseEvent = event);
    return lastMovementX;
  },
  movementY: function(event) {
    return "movementY" in event ? event.movementY : lastMovementY;
  }
}), SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface), DragEventInterface = assign({}, MouseEventInterface, { dataTransfer: 0 }), SyntheticDragEvent = createSyntheticEvent(DragEventInterface), FocusEventInterface = assign({}, UIEventInterface, { relatedTarget: 0 }), SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface), AnimationEventInterface = assign({}, EventInterface, {
  animationName: 0,
  elapsedTime: 0,
  pseudoElement: 0
}), SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface), ClipboardEventInterface = assign({}, EventInterface, {
  clipboardData: function(event) {
    return "clipboardData" in event ? event.clipboardData : window.clipboardData;
  }
}), SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface), CompositionEventInterface = assign({}, EventInterface, { data: 0 }), SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface), normalizeKey = {
  Esc: "Escape",
  Spacebar: " ",
  Left: "ArrowLeft",
  Up: "ArrowUp",
  Right: "ArrowRight",
  Down: "ArrowDown",
  Del: "Delete",
  Win: "OS",
  Menu: "ContextMenu",
  Apps: "ContextMenu",
  Scroll: "ScrollLock",
  MozPrintableKey: "Unidentified"
}, translateToKey = {
  8: "Backspace",
  9: "Tab",
  12: "Clear",
  13: "Enter",
  16: "Shift",
  17: "Control",
  18: "Alt",
  19: "Pause",
  20: "CapsLock",
  27: "Escape",
  32: " ",
  33: "PageUp",
  34: "PageDown",
  35: "End",
  36: "Home",
  37: "ArrowLeft",
  38: "ArrowUp",
  39: "ArrowRight",
  40: "ArrowDown",
  45: "Insert",
  46: "Delete",
  112: "F1",
  113: "F2",
  114: "F3",
  115: "F4",
  116: "F5",
  117: "F6",
  118: "F7",
  119: "F8",
  120: "F9",
  121: "F10",
  122: "F11",
  123: "F12",
  144: "NumLock",
  145: "ScrollLock",
  224: "Meta"
}, modifierKeyToProp = {
  Alt: "altKey",
  Control: "ctrlKey",
  Meta: "metaKey",
  Shift: "shiftKey"
};
function modifierStateGetter(keyArg) {
  var nativeEvent = this.nativeEvent;
  return nativeEvent.getModifierState ? nativeEvent.getModifierState(keyArg) : (keyArg = modifierKeyToProp[keyArg]) ? !!nativeEvent[keyArg] : false;
}
function getEventModifierState() {
  return modifierStateGetter;
}
var KeyboardEventInterface = assign({}, UIEventInterface, {
  key: function(nativeEvent) {
    if (nativeEvent.key) {
      var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
      if ("Unidentified" !== key) return key;
    }
    return "keypress" === nativeEvent.type ? (nativeEvent = getEventCharCode(nativeEvent), 13 === nativeEvent ? "Enter" : String.fromCharCode(nativeEvent)) : "keydown" === nativeEvent.type || "keyup" === nativeEvent.type ? translateToKey[nativeEvent.keyCode] || "Unidentified" : "";
  },
  code: 0,
  location: 0,
  ctrlKey: 0,
  shiftKey: 0,
  altKey: 0,
  metaKey: 0,
  repeat: 0,
  locale: 0,
  getModifierState: getEventModifierState,
  charCode: function(event) {
    return "keypress" === event.type ? getEventCharCode(event) : 0;
  },
  keyCode: function(event) {
    return "keydown" === event.type || "keyup" === event.type ? event.keyCode : 0;
  },
  which: function(event) {
    return "keypress" === event.type ? getEventCharCode(event) : "keydown" === event.type || "keyup" === event.type ? event.keyCode : 0;
  }
}), SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface), PointerEventInterface = assign({}, MouseEventInterface, {
  pointerId: 0,
  width: 0,
  height: 0,
  pressure: 0,
  tangentialPressure: 0,
  tiltX: 0,
  tiltY: 0,
  twist: 0,
  pointerType: 0,
  isPrimary: 0
}), SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface), TouchEventInterface = assign({}, UIEventInterface, {
  touches: 0,
  targetTouches: 0,
  changedTouches: 0,
  altKey: 0,
  metaKey: 0,
  ctrlKey: 0,
  shiftKey: 0,
  getModifierState: getEventModifierState
}), SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface), TransitionEventInterface = assign({}, EventInterface, {
  propertyName: 0,
  elapsedTime: 0,
  pseudoElement: 0
}), SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface), WheelEventInterface = assign({}, MouseEventInterface, {
  deltaX: function(event) {
    return "deltaX" in event ? event.deltaX : "wheelDeltaX" in event ? -event.wheelDeltaX : 0;
  },
  deltaY: function(event) {
    return "deltaY" in event ? event.deltaY : "wheelDeltaY" in event ? -event.wheelDeltaY : "wheelDelta" in event ? -event.wheelDelta : 0;
  },
  deltaZ: 0,
  deltaMode: 0
}), SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface), ToggleEventInterface = assign({}, EventInterface, {
  newState: 0,
  oldState: 0
}), SyntheticToggleEvent = createSyntheticEvent(ToggleEventInterface), END_KEYCODES = [9, 13, 27, 32], canUseCompositionEvent = canUseDOM$1 && "CompositionEvent" in window, documentMode = null;
canUseDOM$1 && "documentMode" in document && (documentMode = document.documentMode);
var canUseTextInputEvent = canUseDOM$1 && "TextEvent" in window && !documentMode, useFallbackCompositionData = canUseDOM$1 && (!canUseCompositionEvent || documentMode && 8 < documentMode && 11 >= documentMode), SPACEBAR_CHAR = String.fromCharCode(32), hasSpaceKeypress = false;
function isFallbackCompositionEnd(domEventName, nativeEvent) {
  switch (domEventName) {
    case "keyup":
      return -1 !== END_KEYCODES.indexOf(nativeEvent.keyCode);
    case "keydown":
      return 229 !== nativeEvent.keyCode;
    case "keypress":
    case "mousedown":
    case "focusout":
      return true;
    default:
      return false;
  }
}
function getDataFromCustomEvent(nativeEvent) {
  nativeEvent = nativeEvent.detail;
  return "object" === typeof nativeEvent && "data" in nativeEvent ? nativeEvent.data : null;
}
var isComposing = false;
function getNativeBeforeInputChars(domEventName, nativeEvent) {
  switch (domEventName) {
    case "compositionend":
      return getDataFromCustomEvent(nativeEvent);
    case "keypress":
      if (32 !== nativeEvent.which) return null;
      hasSpaceKeypress = true;
      return SPACEBAR_CHAR;
    case "textInput":
      return domEventName = nativeEvent.data, domEventName === SPACEBAR_CHAR && hasSpaceKeypress ? null : domEventName;
    default:
      return null;
  }
}
function getFallbackBeforeInputChars(domEventName, nativeEvent) {
  if (isComposing)
    return "compositionend" === domEventName || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent) ? (domEventName = getData(), fallbackText = startText = root$1 = null, isComposing = false, domEventName) : null;
  switch (domEventName) {
    case "paste":
      return null;
    case "keypress":
      if (!(nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) || nativeEvent.ctrlKey && nativeEvent.altKey) {
        if (nativeEvent.char && 1 < nativeEvent.char.length)
          return nativeEvent.char;
        if (nativeEvent.which) return String.fromCharCode(nativeEvent.which);
      }
      return null;
    case "compositionend":
      return useFallbackCompositionData && "ko" !== nativeEvent.locale ? null : nativeEvent.data;
    default:
      return null;
  }
}
var supportedInputTypes = {
  color: true,
  date: true,
  datetime: true,
  "datetime-local": true,
  email: true,
  month: true,
  number: true,
  password: true,
  range: true,
  search: true,
  tel: true,
  text: true,
  time: true,
  url: true,
  week: true
};
function isTextInputElement(elem) {
  var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
  return "input" === nodeName ? !!supportedInputTypes[elem.type] : "textarea" === nodeName ? true : false;
}
function createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) {
  restoreTarget ? restoreQueue ? restoreQueue.push(target) : restoreQueue = [target] : restoreTarget = target;
  inst = accumulateTwoPhaseListeners(inst, "onChange");
  0 < inst.length && (nativeEvent = new SyntheticEvent(
    "onChange",
    "change",
    null,
    nativeEvent,
    target
  ), dispatchQueue.push({ event: nativeEvent, listeners: inst }));
}
var activeElement$1 = null, activeElementInst$1 = null;
function runEventInBatch(dispatchQueue) {
  processDispatchQueue(dispatchQueue, 0);
}
function getInstIfValueChanged(targetInst) {
  var targetNode = getNodeFromInstance(targetInst);
  if (updateValueIfChanged(targetNode)) return targetInst;
}
function getTargetInstForChangeEvent(domEventName, targetInst) {
  if ("change" === domEventName) return targetInst;
}
var isInputEventSupported = false;
if (canUseDOM$1) {
  var JSCompiler_inline_result$jscomp$282;
  if (canUseDOM$1) {
    var isSupported$jscomp$inline_417 = "oninput" in document;
    if (!isSupported$jscomp$inline_417) {
      var element$jscomp$inline_418 = document.createElement("div");
      element$jscomp$inline_418.setAttribute("oninput", "return;");
      isSupported$jscomp$inline_417 = "function" === typeof element$jscomp$inline_418.oninput;
    }
    JSCompiler_inline_result$jscomp$282 = isSupported$jscomp$inline_417;
  } else JSCompiler_inline_result$jscomp$282 = false;
  isInputEventSupported = JSCompiler_inline_result$jscomp$282 && (!document.documentMode || 9 < document.documentMode);
}
function stopWatchingForValueChange() {
  activeElement$1 && (activeElement$1.detachEvent("onpropertychange", handlePropertyChange), activeElementInst$1 = activeElement$1 = null);
}
function handlePropertyChange(nativeEvent) {
  if ("value" === nativeEvent.propertyName && getInstIfValueChanged(activeElementInst$1)) {
    var dispatchQueue = [];
    createAndAccumulateChangeEvent(
      dispatchQueue,
      activeElementInst$1,
      nativeEvent,
      getEventTarget(nativeEvent)
    );
    batchedUpdates$1(runEventInBatch, dispatchQueue);
  }
}
function handleEventsForInputEventPolyfill(domEventName, target, targetInst) {
  "focusin" === domEventName ? (stopWatchingForValueChange(), activeElement$1 = target, activeElementInst$1 = targetInst, activeElement$1.attachEvent("onpropertychange", handlePropertyChange)) : "focusout" === domEventName && stopWatchingForValueChange();
}
function getTargetInstForInputEventPolyfill(domEventName) {
  if ("selectionchange" === domEventName || "keyup" === domEventName || "keydown" === domEventName)
    return getInstIfValueChanged(activeElementInst$1);
}
function getTargetInstForClickEvent(domEventName, targetInst) {
  if ("click" === domEventName) return getInstIfValueChanged(targetInst);
}
function getTargetInstForInputOrChangeEvent(domEventName, targetInst) {
  if ("input" === domEventName || "change" === domEventName)
    return getInstIfValueChanged(targetInst);
}
function is$3(x, y) {
  return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
}
var objectIs$2 = "function" === typeof Object.is ? Object.is : is$3;
function shallowEqual(objA, objB) {
  if (objectIs$2(objA, objB)) return true;
  if ("object" !== typeof objA || null === objA || "object" !== typeof objB || null === objB)
    return false;
  var keysA = Object.keys(objA), keysB = Object.keys(objB);
  if (keysA.length !== keysB.length) return false;
  for (keysB = 0; keysB < keysA.length; keysB++) {
    var currentKey = keysA[keysB];
    if (!hasOwnProperty$1.call(objB, currentKey) || !objectIs$2(objA[currentKey], objB[currentKey]))
      return false;
  }
  return true;
}
function getLeafNode(node) {
  for (; node && node.firstChild; ) node = node.firstChild;
  return node;
}
function getNodeForCharacterOffset(root2, offset) {
  var node = getLeafNode(root2);
  root2 = 0;
  for (var nodeEnd; node; ) {
    if (3 === node.nodeType) {
      nodeEnd = root2 + node.textContent.length;
      if (root2 <= offset && nodeEnd >= offset)
        return { node, offset: offset - root2 };
      root2 = nodeEnd;
    }
    a: {
      for (; node; ) {
        if (node.nextSibling) {
          node = node.nextSibling;
          break a;
        }
        node = node.parentNode;
      }
      node = void 0;
    }
    node = getLeafNode(node);
  }
}
function containsNode(outerNode, innerNode) {
  return outerNode && innerNode ? outerNode === innerNode ? true : outerNode && 3 === outerNode.nodeType ? false : innerNode && 3 === innerNode.nodeType ? containsNode(outerNode, innerNode.parentNode) : "contains" in outerNode ? outerNode.contains(innerNode) : outerNode.compareDocumentPosition ? !!(outerNode.compareDocumentPosition(innerNode) & 16) : false : false;
}
function getActiveElementDeep(containerInfo) {
  containerInfo = null != containerInfo && null != containerInfo.ownerDocument && null != containerInfo.ownerDocument.defaultView ? containerInfo.ownerDocument.defaultView : window;
  for (var element = getActiveElement(containerInfo.document); element instanceof containerInfo.HTMLIFrameElement; ) {
    try {
      var JSCompiler_inline_result = "string" === typeof element.contentWindow.location.href;
    } catch (err) {
      JSCompiler_inline_result = false;
    }
    if (JSCompiler_inline_result) containerInfo = element.contentWindow;
    else break;
    element = getActiveElement(containerInfo.document);
  }
  return element;
}
function hasSelectionCapabilities(elem) {
  var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
  return nodeName && ("input" === nodeName && ("text" === elem.type || "search" === elem.type || "tel" === elem.type || "url" === elem.type || "password" === elem.type) || "textarea" === nodeName || "true" === elem.contentEditable);
}
var skipSelectionChangeEvent = canUseDOM$1 && "documentMode" in document && 11 >= document.documentMode, activeElement = null, activeElementInst = null, lastSelection = null, mouseDown = false;
function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
  var doc = nativeEventTarget.window === nativeEventTarget ? nativeEventTarget.document : 9 === nativeEventTarget.nodeType ? nativeEventTarget : nativeEventTarget.ownerDocument;
  mouseDown || null == activeElement || activeElement !== getActiveElement(doc) || (doc = activeElement, "selectionStart" in doc && hasSelectionCapabilities(doc) ? doc = { start: doc.selectionStart, end: doc.selectionEnd } : (doc = (doc.ownerDocument && doc.ownerDocument.defaultView || window).getSelection(), doc = {
    anchorNode: doc.anchorNode,
    anchorOffset: doc.anchorOffset,
    focusNode: doc.focusNode,
    focusOffset: doc.focusOffset
  }), lastSelection && shallowEqual(lastSelection, doc) || (lastSelection = doc, doc = accumulateTwoPhaseListeners(activeElementInst, "onSelect"), 0 < doc.length && (nativeEvent = new SyntheticEvent(
    "onSelect",
    "select",
    null,
    nativeEvent,
    nativeEventTarget
  ), dispatchQueue.push({ event: nativeEvent, listeners: doc }), nativeEvent.target = activeElement)));
}
function makePrefixMap(styleProp, eventName) {
  var prefixes = {};
  prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
  prefixes["Webkit" + styleProp] = "webkit" + eventName;
  prefixes["Moz" + styleProp] = "moz" + eventName;
  return prefixes;
}
var vendorPrefixes = {
  animationend: makePrefixMap("Animation", "AnimationEnd"),
  animationiteration: makePrefixMap("Animation", "AnimationIteration"),
  animationstart: makePrefixMap("Animation", "AnimationStart"),
  transitionrun: makePrefixMap("Transition", "TransitionRun"),
  transitionstart: makePrefixMap("Transition", "TransitionStart"),
  transitioncancel: makePrefixMap("Transition", "TransitionCancel"),
  transitionend: makePrefixMap("Transition", "TransitionEnd")
}, prefixedEventNames = {}, style = {};
canUseDOM$1 && (style = document.createElement("div").style, "AnimationEvent" in window || (delete vendorPrefixes.animationend.animation, delete vendorPrefixes.animationiteration.animation, delete vendorPrefixes.animationstart.animation), "TransitionEvent" in window || delete vendorPrefixes.transitionend.transition);
function getVendorPrefixedEventName(eventName) {
  if (prefixedEventNames[eventName]) return prefixedEventNames[eventName];
  if (!vendorPrefixes[eventName]) return eventName;
  var prefixMap = vendorPrefixes[eventName], styleProp;
  for (styleProp in prefixMap)
    if (prefixMap.hasOwnProperty(styleProp) && styleProp in style)
      return prefixedEventNames[eventName] = prefixMap[styleProp];
  return eventName;
}
var ANIMATION_END = getVendorPrefixedEventName("animationend"), ANIMATION_ITERATION = getVendorPrefixedEventName("animationiteration"), ANIMATION_START = getVendorPrefixedEventName("animationstart"), TRANSITION_RUN = getVendorPrefixedEventName("transitionrun"), TRANSITION_START = getVendorPrefixedEventName("transitionstart"), TRANSITION_CANCEL = getVendorPrefixedEventName("transitioncancel"), TRANSITION_END = getVendorPrefixedEventName("transitionend"), topLevelEventsToReactNames = /* @__PURE__ */ new Map(), simpleEventPluginEvents = "abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(
  " "
);
simpleEventPluginEvents.push("scrollEnd");
function registerSimpleEvent(domEventName, reactName) {
  topLevelEventsToReactNames.set(domEventName, reactName);
  registerTwoPhaseEvent(reactName, [domEventName]);
}
var CapturedStacks = /* @__PURE__ */ new WeakMap();
function createCapturedValueAtFiber(value, source) {
  if ("object" === typeof value && null !== value) {
    var existing = CapturedStacks.get(value);
    if (void 0 !== existing) return existing;
    source = {
      value,
      source,
      stack: getStackByFiberInDevAndProd(source)
    };
    CapturedStacks.set(value, source);
    return source;
  }
  return {
    value,
    source,
    stack: getStackByFiberInDevAndProd(source)
  };
}
var concurrentQueues = [], concurrentQueuesIndex = 0, concurrentlyUpdatedLanes = 0;
function finishQueueingConcurrentUpdates() {
  for (var endIndex = concurrentQueuesIndex, i2 = concurrentlyUpdatedLanes = concurrentQueuesIndex = 0; i2 < endIndex; ) {
    var fiber = concurrentQueues[i2];
    concurrentQueues[i2++] = null;
    var queue = concurrentQueues[i2];
    concurrentQueues[i2++] = null;
    var update = concurrentQueues[i2];
    concurrentQueues[i2++] = null;
    var lane = concurrentQueues[i2];
    concurrentQueues[i2++] = null;
    if (null !== queue && null !== update) {
      var pending = queue.pending;
      null === pending ? update.next = update : (update.next = pending.next, pending.next = update);
      queue.pending = update;
    }
    0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane);
  }
}
function enqueueUpdate$1(fiber, queue, update, lane) {
  concurrentQueues[concurrentQueuesIndex++] = fiber;
  concurrentQueues[concurrentQueuesIndex++] = queue;
  concurrentQueues[concurrentQueuesIndex++] = update;
  concurrentQueues[concurrentQueuesIndex++] = lane;
  concurrentlyUpdatedLanes |= lane;
  fiber.lanes |= lane;
  fiber = fiber.alternate;
  null !== fiber && (fiber.lanes |= lane);
}
function enqueueConcurrentHookUpdate(fiber, queue, update, lane) {
  enqueueUpdate$1(fiber, queue, update, lane);
  return getRootForUpdatedFiber(fiber);
}
function enqueueConcurrentRenderForLane(fiber, lane) {
  enqueueUpdate$1(fiber, null, null, lane);
  return getRootForUpdatedFiber(fiber);
}
function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) {
  sourceFiber.lanes |= lane;
  var alternate = sourceFiber.alternate;
  null !== alternate && (alternate.lanes |= lane);
  for (var isHidden = false, parent = sourceFiber.return; null !== parent; )
    parent.childLanes |= lane, alternate = parent.alternate, null !== alternate && (alternate.childLanes |= lane), 22 === parent.tag && (sourceFiber = parent.stateNode, null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = true)), sourceFiber = parent, parent = parent.return;
  return 3 === sourceFiber.tag ? (parent = sourceFiber.stateNode, isHidden && null !== update && (isHidden = 31 - clz32(lane), sourceFiber = parent.hiddenUpdates, alternate = sourceFiber[isHidden], null === alternate ? sourceFiber[isHidden] = [update] : alternate.push(update), update.lane = lane | 536870912), parent) : null;
}
function getRootForUpdatedFiber(sourceFiber) {
  if (50 < nestedUpdateCount)
    throw nestedUpdateCount = 0, rootWithNestedUpdates = null, Error(formatProdErrorMessage$2(185));
  for (var parent = sourceFiber.return; null !== parent; )
    sourceFiber = parent, parent = sourceFiber.return;
  return 3 === sourceFiber.tag ? sourceFiber.stateNode : null;
}
var emptyContextObject = {};
function FiberNode(tag, pendingProps, key, mode) {
  this.tag = tag;
  this.key = key;
  this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null;
  this.index = 0;
  this.refCleanup = this.ref = null;
  this.pendingProps = pendingProps;
  this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null;
  this.mode = mode;
  this.subtreeFlags = this.flags = 0;
  this.deletions = null;
  this.childLanes = this.lanes = 0;
  this.alternate = null;
}
function createFiberImplClass(tag, pendingProps, key, mode) {
  return new FiberNode(tag, pendingProps, key, mode);
}
function shouldConstruct(Component2) {
  Component2 = Component2.prototype;
  return !(!Component2 || !Component2.isReactComponent);
}
function createWorkInProgress(current2, pendingProps) {
  var workInProgress2 = current2.alternate;
  null === workInProgress2 ? (workInProgress2 = createFiberImplClass(
    current2.tag,
    pendingProps,
    current2.key,
    current2.mode
  ), workInProgress2.elementType = current2.elementType, workInProgress2.type = current2.type, workInProgress2.stateNode = current2.stateNode, workInProgress2.alternate = current2, current2.alternate = workInProgress2) : (workInProgress2.pendingProps = pendingProps, workInProgress2.type = current2.type, workInProgress2.flags = 0, workInProgress2.subtreeFlags = 0, workInProgress2.deletions = null);
  workInProgress2.flags = current2.flags & 65011712;
  workInProgress2.childLanes = current2.childLanes;
  workInProgress2.lanes = current2.lanes;
  workInProgress2.child = current2.child;
  workInProgress2.memoizedProps = current2.memoizedProps;
  workInProgress2.memoizedState = current2.memoizedState;
  workInProgress2.updateQueue = current2.updateQueue;
  pendingProps = current2.dependencies;
  workInProgress2.dependencies = null === pendingProps ? null : { lanes: pendingProps.lanes, firstContext: pendingProps.firstContext };
  workInProgress2.sibling = current2.sibling;
  workInProgress2.index = current2.index;
  workInProgress2.ref = current2.ref;
  workInProgress2.refCleanup = current2.refCleanup;
  return workInProgress2;
}
function resetWorkInProgress(workInProgress2, renderLanes2) {
  workInProgress2.flags &= 65011714;
  var current2 = workInProgress2.alternate;
  null === current2 ? (workInProgress2.childLanes = 0, workInProgress2.lanes = renderLanes2, workInProgress2.child = null, workInProgress2.subtreeFlags = 0, workInProgress2.memoizedProps = null, workInProgress2.memoizedState = null, workInProgress2.updateQueue = null, workInProgress2.dependencies = null, workInProgress2.stateNode = null) : (workInProgress2.childLanes = current2.childLanes, workInProgress2.lanes = current2.lanes, workInProgress2.child = current2.child, workInProgress2.subtreeFlags = 0, workInProgress2.deletions = null, workInProgress2.memoizedProps = current2.memoizedProps, workInProgress2.memoizedState = current2.memoizedState, workInProgress2.updateQueue = current2.updateQueue, workInProgress2.type = current2.type, renderLanes2 = current2.dependencies, workInProgress2.dependencies = null === renderLanes2 ? null : {
    lanes: renderLanes2.lanes,
    firstContext: renderLanes2.firstContext
  });
  return workInProgress2;
}
function createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes) {
  var fiberTag = 0;
  owner = type;
  if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1);
  else if ("string" === typeof type)
    fiberTag = isHostHoistableType(
      type,
      pendingProps,
      contextStackCursor.current
    ) ? 26 : "html" === type || "head" === type || "body" === type ? 27 : 5;
  else
    a: switch (type) {
      case REACT_ACTIVITY_TYPE:
        return type = createFiberImplClass(31, pendingProps, key, mode), type.elementType = REACT_ACTIVITY_TYPE, type.lanes = lanes, type;
      case REACT_FRAGMENT_TYPE:
        return createFiberFromFragment(pendingProps.children, mode, lanes, key);
      case REACT_STRICT_MODE_TYPE:
        fiberTag = 8;
        mode |= 24;
        break;
      case REACT_PROFILER_TYPE:
        return type = createFiberImplClass(12, pendingProps, key, mode | 2), type.elementType = REACT_PROFILER_TYPE, type.lanes = lanes, type;
      case REACT_SUSPENSE_TYPE:
        return type = createFiberImplClass(13, pendingProps, key, mode), type.elementType = REACT_SUSPENSE_TYPE, type.lanes = lanes, type;
      case REACT_SUSPENSE_LIST_TYPE:
        return type = createFiberImplClass(19, pendingProps, key, mode), type.elementType = REACT_SUSPENSE_LIST_TYPE, type.lanes = lanes, type;
      default:
        if ("object" === typeof type && null !== type)
          switch (type.$$typeof) {
            case REACT_PROVIDER_TYPE:
            case REACT_CONTEXT_TYPE:
              fiberTag = 10;
              break a;
            case REACT_CONSUMER_TYPE:
              fiberTag = 9;
              break a;
            case REACT_FORWARD_REF_TYPE:
              fiberTag = 11;
              break a;
            case REACT_MEMO_TYPE:
              fiberTag = 14;
              break a;
            case REACT_LAZY_TYPE:
              fiberTag = 16;
              owner = null;
              break a;
          }
        fiberTag = 29;
        pendingProps = Error(
          formatProdErrorMessage$2(130, null === type ? "null" : typeof type, "")
        );
        owner = null;
    }
  key = createFiberImplClass(fiberTag, pendingProps, key, mode);
  key.elementType = type;
  key.type = owner;
  key.lanes = lanes;
  return key;
}
function createFiberFromFragment(elements, mode, lanes, key) {
  elements = createFiberImplClass(7, elements, key, mode);
  elements.lanes = lanes;
  return elements;
}
function createFiberFromText(content, mode, lanes) {
  content = createFiberImplClass(6, content, null, mode);
  content.lanes = lanes;
  return content;
}
function createFiberFromPortal(portal, mode, lanes) {
  mode = createFiberImplClass(
    4,
    null !== portal.children ? portal.children : [],
    portal.key,
    mode
  );
  mode.lanes = lanes;
  mode.stateNode = {
    containerInfo: portal.containerInfo,
    pendingChildren: null,
    implementation: portal.implementation
  };
  return mode;
}
var forkStack = [], forkStackIndex = 0, treeForkProvider = null, treeForkCount = 0, idStack = [], idStackIndex = 0, treeContextProvider = null, treeContextId = 1, treeContextOverflow = "";
function pushTreeFork(workInProgress2, totalChildren) {
  forkStack[forkStackIndex++] = treeForkCount;
  forkStack[forkStackIndex++] = treeForkProvider;
  treeForkProvider = workInProgress2;
  treeForkCount = totalChildren;
}
function pushTreeId(workInProgress2, totalChildren, index2) {
  idStack[idStackIndex++] = treeContextId;
  idStack[idStackIndex++] = treeContextOverflow;
  idStack[idStackIndex++] = treeContextProvider;
  treeContextProvider = workInProgress2;
  var baseIdWithLeadingBit = treeContextId;
  workInProgress2 = treeContextOverflow;
  var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;
  baseIdWithLeadingBit &= ~(1 << baseLength);
  index2 += 1;
  var length = 32 - clz32(totalChildren) + baseLength;
  if (30 < length) {
    var numberOfOverflowBits = baseLength - baseLength % 5;
    length = (baseIdWithLeadingBit & (1 << numberOfOverflowBits) - 1).toString(32);
    baseIdWithLeadingBit >>= numberOfOverflowBits;
    baseLength -= numberOfOverflowBits;
    treeContextId = 1 << 32 - clz32(totalChildren) + baseLength | index2 << baseLength | baseIdWithLeadingBit;
    treeContextOverflow = length + workInProgress2;
  } else
    treeContextId = 1 << length | index2 << baseLength | baseIdWithLeadingBit, treeContextOverflow = workInProgress2;
}
function pushMaterializedTreeId(workInProgress2) {
  null !== workInProgress2.return && (pushTreeFork(workInProgress2, 1), pushTreeId(workInProgress2, 1, 0));
}
function popTreeContext(workInProgress2) {
  for (; workInProgress2 === treeForkProvider; )
    treeForkProvider = forkStack[--forkStackIndex], forkStack[forkStackIndex] = null, treeForkCount = forkStack[--forkStackIndex], forkStack[forkStackIndex] = null;
  for (; workInProgress2 === treeContextProvider; )
    treeContextProvider = idStack[--idStackIndex], idStack[idStackIndex] = null, treeContextOverflow = idStack[--idStackIndex], idStack[idStackIndex] = null, treeContextId = idStack[--idStackIndex], idStack[idStackIndex] = null;
}
var hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = false, hydrationErrors = null, rootOrSingletonContext = false, HydrationMismatchException = Error(formatProdErrorMessage$2(519));
function throwOnHydrationMismatch(fiber) {
  var error = Error(formatProdErrorMessage$2(418, ""));
  queueHydrationError(createCapturedValueAtFiber(error, fiber));
  throw HydrationMismatchException;
}
function prepareToHydrateHostInstance(fiber) {
  var instance2 = fiber.stateNode, type = fiber.type, props = fiber.memoizedProps;
  instance2[internalInstanceKey] = fiber;
  instance2[internalPropsKey] = props;
  switch (type) {
    case "dialog":
      listenToNonDelegatedEvent("cancel", instance2);
      listenToNonDelegatedEvent("close", instance2);
      break;
    case "iframe":
    case "object":
    case "embed":
      listenToNonDelegatedEvent("load", instance2);
      break;
    case "video":
    case "audio":
      for (type = 0; type < mediaEventTypes.length; type++)
        listenToNonDelegatedEvent(mediaEventTypes[type], instance2);
      break;
    case "source":
      listenToNonDelegatedEvent("error", instance2);
      break;
    case "img":
    case "image":
    case "link":
      listenToNonDelegatedEvent("error", instance2);
      listenToNonDelegatedEvent("load", instance2);
      break;
    case "details":
      listenToNonDelegatedEvent("toggle", instance2);
      break;
    case "input":
      listenToNonDelegatedEvent("invalid", instance2);
      initInput(
        instance2,
        props.value,
        props.defaultValue,
        props.checked,
        props.defaultChecked,
        props.type,
        props.name,
        true
      );
      track(instance2);
      break;
    case "select":
      listenToNonDelegatedEvent("invalid", instance2);
      break;
    case "textarea":
      listenToNonDelegatedEvent("invalid", instance2), initTextarea(instance2, props.value, props.defaultValue, props.children), track(instance2);
  }
  type = props.children;
  "string" !== typeof type && "number" !== typeof type && "bigint" !== typeof type || instance2.textContent === "" + type || true === props.suppressHydrationWarning || checkForUnmatchedText(instance2.textContent, type) ? (null != props.popover && (listenToNonDelegatedEvent("beforetoggle", instance2), listenToNonDelegatedEvent("toggle", instance2)), null != props.onScroll && listenToNonDelegatedEvent("scroll", instance2), null != props.onScrollEnd && listenToNonDelegatedEvent("scrollend", instance2), null != props.onClick && (instance2.onclick = noop$1$1), instance2 = true) : instance2 = false;
  instance2 || throwOnHydrationMismatch(fiber);
}
function popToNextHostParent(fiber) {
  for (hydrationParentFiber = fiber.return; hydrationParentFiber; )
    switch (hydrationParentFiber.tag) {
      case 5:
      case 13:
        rootOrSingletonContext = false;
        return;
      case 27:
      case 3:
        rootOrSingletonContext = true;
        return;
      default:
        hydrationParentFiber = hydrationParentFiber.return;
    }
}
function popHydrationState(fiber) {
  if (fiber !== hydrationParentFiber) return false;
  if (!isHydrating) return popToNextHostParent(fiber), isHydrating = true, false;
  var tag = fiber.tag, JSCompiler_temp;
  if (JSCompiler_temp = 3 !== tag && 27 !== tag) {
    if (JSCompiler_temp = 5 === tag)
      JSCompiler_temp = fiber.type, JSCompiler_temp = !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || shouldSetTextContent(fiber.type, fiber.memoizedProps);
    JSCompiler_temp = !JSCompiler_temp;
  }
  JSCompiler_temp && nextHydratableInstance && throwOnHydrationMismatch(fiber);
  popToNextHostParent(fiber);
  if (13 === tag) {
    fiber = fiber.memoizedState;
    fiber = null !== fiber ? fiber.dehydrated : null;
    if (!fiber) throw Error(formatProdErrorMessage$2(317));
    a: {
      fiber = fiber.nextSibling;
      for (tag = 0; fiber; ) {
        if (8 === fiber.nodeType)
          if (JSCompiler_temp = fiber.data, "/$" === JSCompiler_temp) {
            if (0 === tag) {
              nextHydratableInstance = getNextHydratable(fiber.nextSibling);
              break a;
            }
            tag--;
          } else
            "$" !== JSCompiler_temp && "$!" !== JSCompiler_temp && "$?" !== JSCompiler_temp || tag++;
        fiber = fiber.nextSibling;
      }
      nextHydratableInstance = null;
    }
  } else
    27 === tag ? (tag = nextHydratableInstance, isSingletonScope(fiber.type) ? (fiber = previousHydratableOnEnteringScopedSingleton, previousHydratableOnEnteringScopedSingleton = null, nextHydratableInstance = fiber) : nextHydratableInstance = tag) : nextHydratableInstance = hydrationParentFiber ? getNextHydratable(fiber.stateNode.nextSibling) : null;
  return true;
}
function resetHydrationState() {
  nextHydratableInstance = hydrationParentFiber = null;
  isHydrating = false;
}
function upgradeHydrationErrorsToRecoverable() {
  var queuedErrors = hydrationErrors;
  null !== queuedErrors && (null === workInProgressRootRecoverableErrors ? workInProgressRootRecoverableErrors = queuedErrors : workInProgressRootRecoverableErrors.push.apply(
    workInProgressRootRecoverableErrors,
    queuedErrors
  ), hydrationErrors = null);
  return queuedErrors;
}
function queueHydrationError(error) {
  null === hydrationErrors ? hydrationErrors = [error] : hydrationErrors.push(error);
}
var valueCursor = createCursor(null), currentlyRenderingFiber$1 = null, lastContextDependency = null;
function pushProvider(providerFiber, context, nextValue) {
  push(valueCursor, context._currentValue);
  context._currentValue = nextValue;
}
function popProvider(context) {
  context._currentValue = valueCursor.current;
  pop(valueCursor);
}
function scheduleContextWorkOnParentPath(parent, renderLanes2, propagationRoot) {
  for (; null !== parent; ) {
    var alternate = parent.alternate;
    (parent.childLanes & renderLanes2) !== renderLanes2 ? (parent.childLanes |= renderLanes2, null !== alternate && (alternate.childLanes |= renderLanes2)) : null !== alternate && (alternate.childLanes & renderLanes2) !== renderLanes2 && (alternate.childLanes |= renderLanes2);
    if (parent === propagationRoot) break;
    parent = parent.return;
  }
}
function propagateContextChanges(workInProgress2, contexts, renderLanes2, forcePropagateEntireTree) {
  var fiber = workInProgress2.child;
  null !== fiber && (fiber.return = workInProgress2);
  for (; null !== fiber; ) {
    var list = fiber.dependencies;
    if (null !== list) {
      var nextFiber = fiber.child;
      list = list.firstContext;
      a: for (; null !== list; ) {
        var dependency = list;
        list = fiber;
        for (var i2 = 0; i2 < contexts.length; i2++)
          if (dependency.context === contexts[i2]) {
            list.lanes |= renderLanes2;
            dependency = list.alternate;
            null !== dependency && (dependency.lanes |= renderLanes2);
            scheduleContextWorkOnParentPath(
              list.return,
              renderLanes2,
              workInProgress2
            );
            forcePropagateEntireTree || (nextFiber = null);
            break a;
          }
        list = dependency.next;
      }
    } else if (18 === fiber.tag) {
      nextFiber = fiber.return;
      if (null === nextFiber) throw Error(formatProdErrorMessage$2(341));
      nextFiber.lanes |= renderLanes2;
      list = nextFiber.alternate;
      null !== list && (list.lanes |= renderLanes2);
      scheduleContextWorkOnParentPath(nextFiber, renderLanes2, workInProgress2);
      nextFiber = null;
    } else nextFiber = fiber.child;
    if (null !== nextFiber) nextFiber.return = fiber;
    else
      for (nextFiber = fiber; null !== nextFiber; ) {
        if (nextFiber === workInProgress2) {
          nextFiber = null;
          break;
        }
        fiber = nextFiber.sibling;
        if (null !== fiber) {
          fiber.return = nextFiber.return;
          nextFiber = fiber;
          break;
        }
        nextFiber = nextFiber.return;
      }
    fiber = nextFiber;
  }
}
function propagateParentContextChanges(current2, workInProgress2, renderLanes2, forcePropagateEntireTree) {
  current2 = null;
  for (var parent = workInProgress2, isInsidePropagationBailout = false; null !== parent; ) {
    if (!isInsidePropagationBailout) {
      if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = true;
      else if (0 !== (parent.flags & 262144)) break;
    }
    if (10 === parent.tag) {
      var currentParent = parent.alternate;
      if (null === currentParent) throw Error(formatProdErrorMessage$2(387));
      currentParent = currentParent.memoizedProps;
      if (null !== currentParent) {
        var context = parent.type;
        objectIs$2(parent.pendingProps.value, currentParent.value) || (null !== current2 ? current2.push(context) : current2 = [context]);
      }
    } else if (parent === hostTransitionProviderCursor.current) {
      currentParent = parent.alternate;
      if (null === currentParent) throw Error(formatProdErrorMessage$2(387));
      currentParent.memoizedState.memoizedState !== parent.memoizedState.memoizedState && (null !== current2 ? current2.push(HostTransitionContext) : current2 = [HostTransitionContext]);
    }
    parent = parent.return;
  }
  null !== current2 && propagateContextChanges(
    workInProgress2,
    current2,
    renderLanes2,
    forcePropagateEntireTree
  );
  workInProgress2.flags |= 262144;
}
function checkIfContextChanged(currentDependencies) {
  for (currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) {
    if (!objectIs$2(
      currentDependencies.context._currentValue,
      currentDependencies.memoizedValue
    ))
      return true;
    currentDependencies = currentDependencies.next;
  }
  return false;
}
function prepareToReadContext(workInProgress2) {
  currentlyRenderingFiber$1 = workInProgress2;
  lastContextDependency = null;
  workInProgress2 = workInProgress2.dependencies;
  null !== workInProgress2 && (workInProgress2.firstContext = null);
}
function readContext(context) {
  return readContextForConsumer(currentlyRenderingFiber$1, context);
}
function readContextDuringReconciliation(consumer, context) {
  null === currentlyRenderingFiber$1 && prepareToReadContext(consumer);
  return readContextForConsumer(consumer, context);
}
function readContextForConsumer(consumer, context) {
  var value = context._currentValue;
  context = { context, memoizedValue: value, next: null };
  if (null === lastContextDependency) {
    if (null === consumer) throw Error(formatProdErrorMessage$2(308));
    lastContextDependency = context;
    consumer.dependencies = { lanes: 0, firstContext: context };
    consumer.flags |= 524288;
  } else lastContextDependency = lastContextDependency.next = context;
  return value;
}
var AbortControllerLocal = "undefined" !== typeof AbortController ? AbortController : function() {
  var listeners = [], signal = this.signal = {
    aborted: false,
    addEventListener: function(type, listener) {
      listeners.push(listener);
    }
  };
  this.abort = function() {
    signal.aborted = true;
    listeners.forEach(function(listener) {
      return listener();
    });
  };
}, scheduleCallback$2 = Scheduler.unstable_scheduleCallback, NormalPriority = Scheduler.unstable_NormalPriority, CacheContext = {
  $$typeof: REACT_CONTEXT_TYPE,
  Consumer: null,
  Provider: null,
  _currentValue: null,
  _currentValue2: null,
  _threadCount: 0
};
function createCache() {
  return {
    controller: new AbortControllerLocal(),
    data: /* @__PURE__ */ new Map(),
    refCount: 0
  };
}
function releaseCache(cache) {
  cache.refCount--;
  0 === cache.refCount && scheduleCallback$2(NormalPriority, function() {
    cache.controller.abort();
  });
}
var currentEntangledListeners = null, currentEntangledPendingCount = 0, currentEntangledLane = 0, currentEntangledActionThenable = null;
function entangleAsyncAction(transition, thenable) {
  if (null === currentEntangledListeners) {
    var entangledListeners = currentEntangledListeners = [];
    currentEntangledPendingCount = 0;
    currentEntangledLane = requestTransitionLane();
    currentEntangledActionThenable = {
      status: "pending",
      value: void 0,
      then: function(resolve) {
        entangledListeners.push(resolve);
      }
    };
  }
  currentEntangledPendingCount++;
  thenable.then(pingEngtangledActionScope, pingEngtangledActionScope);
  return thenable;
}
function pingEngtangledActionScope() {
  if (0 === --currentEntangledPendingCount && null !== currentEntangledListeners) {
    null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled");
    var listeners = currentEntangledListeners;
    currentEntangledListeners = null;
    currentEntangledLane = 0;
    currentEntangledActionThenable = null;
    for (var i2 = 0; i2 < listeners.length; i2++) (0, listeners[i2])();
  }
}
function chainThenableValue(thenable, result) {
  var listeners = [], thenableWithOverride = {
    status: "pending",
    value: null,
    reason: null,
    then: function(resolve) {
      listeners.push(resolve);
    }
  };
  thenable.then(
    function() {
      thenableWithOverride.status = "fulfilled";
      thenableWithOverride.value = result;
      for (var i2 = 0; i2 < listeners.length; i2++) (0, listeners[i2])(result);
    },
    function(error) {
      thenableWithOverride.status = "rejected";
      thenableWithOverride.reason = error;
      for (error = 0; error < listeners.length; error++)
        (0, listeners[error])(void 0);
    }
  );
  return thenableWithOverride;
}
var prevOnStartTransitionFinish = ReactSharedInternals.S;
ReactSharedInternals.S = function(transition, returnValue) {
  "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && entangleAsyncAction(transition, returnValue);
  null !== prevOnStartTransitionFinish && prevOnStartTransitionFinish(transition, returnValue);
};
var resumedCache = createCursor(null);
function peekCacheFromPool() {
  var cacheResumedFromPreviousRender = resumedCache.current;
  return null !== cacheResumedFromPreviousRender ? cacheResumedFromPreviousRender : workInProgressRoot.pooledCache;
}
function pushTransition(offscreenWorkInProgress, prevCachePool) {
  null === prevCachePool ? push(resumedCache, resumedCache.current) : push(resumedCache, prevCachePool.pool);
}
function getSuspendedCache() {
  var cacheFromPool = peekCacheFromPool();
  return null === cacheFromPool ? null : { parent: CacheContext._currentValue, pool: cacheFromPool };
}
var SuspenseException = Error(formatProdErrorMessage$2(460)), SuspenseyCommitException = Error(formatProdErrorMessage$2(474)), SuspenseActionException = Error(formatProdErrorMessage$2(542)), noopSuspenseyCommitThenable = { then: function() {
} };
function isThenableResolved(thenable) {
  thenable = thenable.status;
  return "fulfilled" === thenable || "rejected" === thenable;
}
function noop$3() {
}
function trackUsedThenable(thenableState2, thenable, index2) {
  index2 = thenableState2[index2];
  void 0 === index2 ? thenableState2.push(thenable) : index2 !== thenable && (thenable.then(noop$3, noop$3), thenable = index2);
  switch (thenable.status) {
    case "fulfilled":
      return thenable.value;
    case "rejected":
      throw thenableState2 = thenable.reason, checkIfUseWrappedInAsyncCatch(thenableState2), thenableState2;
    default:
      if ("string" === typeof thenable.status) thenable.then(noop$3, noop$3);
      else {
        thenableState2 = workInProgressRoot;
        if (null !== thenableState2 && 100 < thenableState2.shellSuspendCounter)
          throw Error(formatProdErrorMessage$2(482));
        thenableState2 = thenable;
        thenableState2.status = "pending";
        thenableState2.then(
          function(fulfilledValue) {
            if ("pending" === thenable.status) {
              var fulfilledThenable = thenable;
              fulfilledThenable.status = "fulfilled";
              fulfilledThenable.value = fulfilledValue;
            }
          },
          function(error) {
            if ("pending" === thenable.status) {
              var rejectedThenable = thenable;
              rejectedThenable.status = "rejected";
              rejectedThenable.reason = error;
            }
          }
        );
      }
      switch (thenable.status) {
        case "fulfilled":
          return thenable.value;
        case "rejected":
          throw thenableState2 = thenable.reason, checkIfUseWrappedInAsyncCatch(thenableState2), thenableState2;
      }
      suspendedThenable = thenable;
      throw SuspenseException;
  }
}
var suspendedThenable = null;
function getSuspendedThenable() {
  if (null === suspendedThenable) throw Error(formatProdErrorMessage$2(459));
  var thenable = suspendedThenable;
  suspendedThenable = null;
  return thenable;
}
function checkIfUseWrappedInAsyncCatch(rejectedReason) {
  if (rejectedReason === SuspenseException || rejectedReason === SuspenseActionException)
    throw Error(formatProdErrorMessage$2(483));
}
var hasForceUpdate = false;
function initializeUpdateQueue(fiber) {
  fiber.updateQueue = {
    baseState: fiber.memoizedState,
    firstBaseUpdate: null,
    lastBaseUpdate: null,
    shared: { pending: null, lanes: 0, hiddenCallbacks: null },
    callbacks: null
  };
}
function cloneUpdateQueue(current2, workInProgress2) {
  current2 = current2.updateQueue;
  workInProgress2.updateQueue === current2 && (workInProgress2.updateQueue = {
    baseState: current2.baseState,
    firstBaseUpdate: current2.firstBaseUpdate,
    lastBaseUpdate: current2.lastBaseUpdate,
    shared: current2.shared,
    callbacks: null
  });
}
function createUpdate(lane) {
  return { lane, tag: 0, payload: null, callback: null, next: null };
}
function enqueueUpdate(fiber, update, lane) {
  var updateQueue = fiber.updateQueue;
  if (null === updateQueue) return null;
  updateQueue = updateQueue.shared;
  if (0 !== (executionContext & 2)) {
    var pending = updateQueue.pending;
    null === pending ? update.next = update : (update.next = pending.next, pending.next = update);
    updateQueue.pending = update;
    update = getRootForUpdatedFiber(fiber);
    markUpdateLaneFromFiberToRoot(fiber, null, lane);
    return update;
  }
  enqueueUpdate$1(fiber, updateQueue, update, lane);
  return getRootForUpdatedFiber(fiber);
}
function entangleTransitions(root2, fiber, lane) {
  fiber = fiber.updateQueue;
  if (null !== fiber && (fiber = fiber.shared, 0 !== (lane & 4194048))) {
    var queueLanes = fiber.lanes;
    queueLanes &= root2.pendingLanes;
    lane |= queueLanes;
    fiber.lanes = lane;
    markRootEntangled(root2, lane);
  }
}
function enqueueCapturedUpdate(workInProgress2, capturedUpdate) {
  var queue = workInProgress2.updateQueue, current2 = workInProgress2.alternate;
  if (null !== current2 && (current2 = current2.updateQueue, queue === current2)) {
    var newFirst = null, newLast = null;
    queue = queue.firstBaseUpdate;
    if (null !== queue) {
      do {
        var clone = {
          lane: queue.lane,
          tag: queue.tag,
          payload: queue.payload,
          callback: null,
          next: null
        };
        null === newLast ? newFirst = newLast = clone : newLast = newLast.next = clone;
        queue = queue.next;
      } while (null !== queue);
      null === newLast ? newFirst = newLast = capturedUpdate : newLast = newLast.next = capturedUpdate;
    } else newFirst = newLast = capturedUpdate;
    queue = {
      baseState: current2.baseState,
      firstBaseUpdate: newFirst,
      lastBaseUpdate: newLast,
      shared: current2.shared,
      callbacks: current2.callbacks
    };
    workInProgress2.updateQueue = queue;
    return;
  }
  workInProgress2 = queue.lastBaseUpdate;
  null === workInProgress2 ? queue.firstBaseUpdate = capturedUpdate : workInProgress2.next = capturedUpdate;
  queue.lastBaseUpdate = capturedUpdate;
}
var didReadFromEntangledAsyncAction = false;
function suspendIfUpdateReadFromEntangledAsyncAction() {
  if (didReadFromEntangledAsyncAction) {
    var entangledActionThenable = currentEntangledActionThenable;
    if (null !== entangledActionThenable) throw entangledActionThenable;
  }
}
function processUpdateQueue(workInProgress$jscomp$0, props, instance$jscomp$0, renderLanes2) {
  didReadFromEntangledAsyncAction = false;
  var queue = workInProgress$jscomp$0.updateQueue;
  hasForceUpdate = false;
  var firstBaseUpdate = queue.firstBaseUpdate, lastBaseUpdate = queue.lastBaseUpdate, pendingQueue = queue.shared.pending;
  if (null !== pendingQueue) {
    queue.shared.pending = null;
    var lastPendingUpdate = pendingQueue, firstPendingUpdate = lastPendingUpdate.next;
    lastPendingUpdate.next = null;
    null === lastBaseUpdate ? firstBaseUpdate = firstPendingUpdate : lastBaseUpdate.next = firstPendingUpdate;
    lastBaseUpdate = lastPendingUpdate;
    var current2 = workInProgress$jscomp$0.alternate;
    null !== current2 && (current2 = current2.updateQueue, pendingQueue = current2.lastBaseUpdate, pendingQueue !== lastBaseUpdate && (null === pendingQueue ? current2.firstBaseUpdate = firstPendingUpdate : pendingQueue.next = firstPendingUpdate, current2.lastBaseUpdate = lastPendingUpdate));
  }
  if (null !== firstBaseUpdate) {
    var newState = queue.baseState;
    lastBaseUpdate = 0;
    current2 = firstPendingUpdate = lastPendingUpdate = null;
    pendingQueue = firstBaseUpdate;
    do {
      var updateLane = pendingQueue.lane & -536870913, isHiddenUpdate = updateLane !== pendingQueue.lane;
      if (isHiddenUpdate ? (workInProgressRootRenderLanes & updateLane) === updateLane : (renderLanes2 & updateLane) === updateLane) {
        0 !== updateLane && updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction = true);
        null !== current2 && (current2 = current2.next = {
          lane: 0,
          tag: pendingQueue.tag,
          payload: pendingQueue.payload,
          callback: null,
          next: null
        });
        a: {
          var workInProgress2 = workInProgress$jscomp$0, update = pendingQueue;
          updateLane = props;
          var instance2 = instance$jscomp$0;
          switch (update.tag) {
            case 1:
              workInProgress2 = update.payload;
              if ("function" === typeof workInProgress2) {
                newState = workInProgress2.call(instance2, newState, updateLane);
                break a;
              }
              newState = workInProgress2;
              break a;
            case 3:
              workInProgress2.flags = workInProgress2.flags & -65537 | 128;
            case 0:
              workInProgress2 = update.payload;
              updateLane = "function" === typeof workInProgress2 ? workInProgress2.call(instance2, newState, updateLane) : workInProgress2;
              if (null === updateLane || void 0 === updateLane) break a;
              newState = assign({}, newState, updateLane);
              break a;
            case 2:
              hasForceUpdate = true;
          }
        }
        updateLane = pendingQueue.callback;
        null !== updateLane && (workInProgress$jscomp$0.flags |= 64, isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), isHiddenUpdate = queue.callbacks, null === isHiddenUpdate ? queue.callbacks = [updateLane] : isHiddenUpdate.push(updateLane));
      } else
        isHiddenUpdate = {
          lane: updateLane,
          tag: pendingQueue.tag,
          payload: pendingQueue.payload,
          callback: pendingQueue.callback,
          next: null
        }, null === current2 ? (firstPendingUpdate = current2 = isHiddenUpdate, lastPendingUpdate = newState) : current2 = current2.next = isHiddenUpdate, lastBaseUpdate |= updateLane;
      pendingQueue = pendingQueue.next;
      if (null === pendingQueue)
        if (pendingQueue = queue.shared.pending, null === pendingQueue)
          break;
        else
          isHiddenUpdate = pendingQueue, pendingQueue = isHiddenUpdate.next, isHiddenUpdate.next = null, queue.lastBaseUpdate = isHiddenUpdate, queue.shared.pending = null;
    } while (1);
    null === current2 && (lastPendingUpdate = newState);
    queue.baseState = lastPendingUpdate;
    queue.firstBaseUpdate = firstPendingUpdate;
    queue.lastBaseUpdate = current2;
    null === firstBaseUpdate && (queue.shared.lanes = 0);
    workInProgressRootSkippedLanes |= lastBaseUpdate;
    workInProgress$jscomp$0.lanes = lastBaseUpdate;
    workInProgress$jscomp$0.memoizedState = newState;
  }
}
function callCallback(callback, context) {
  if ("function" !== typeof callback)
    throw Error(formatProdErrorMessage$2(191, callback));
  callback.call(context);
}
function commitCallbacks(updateQueue, context) {
  var callbacks = updateQueue.callbacks;
  if (null !== callbacks)
    for (updateQueue.callbacks = null, updateQueue = 0; updateQueue < callbacks.length; updateQueue++)
      callCallback(callbacks[updateQueue], context);
}
var currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0);
function pushHiddenContext(fiber, context) {
  fiber = entangledRenderLanes;
  push(prevEntangledRenderLanesCursor, fiber);
  push(currentTreeHiddenStackCursor, context);
  entangledRenderLanes = fiber | context.baseLanes;
}
function reuseHiddenContextOnStack() {
  push(prevEntangledRenderLanesCursor, entangledRenderLanes);
  push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current);
}
function popHiddenContext() {
  entangledRenderLanes = prevEntangledRenderLanesCursor.current;
  pop(currentTreeHiddenStackCursor);
  pop(prevEntangledRenderLanesCursor);
}
var renderLanes = 0, currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = false, didScheduleRenderPhaseUpdateDuringThisPass = false, shouldDoubleInvokeUserFnsInHooksDEV = false, localIdCounter = 0, thenableIndexCounter$1 = 0, thenableState$1 = null, globalClientIdCounter = 0;
function throwInvalidHookError() {
  throw Error(formatProdErrorMessage$2(321));
}
function areHookInputsEqual(nextDeps, prevDeps) {
  if (null === prevDeps) return false;
  for (var i2 = 0; i2 < prevDeps.length && i2 < nextDeps.length; i2++)
    if (!objectIs$2(nextDeps[i2], prevDeps[i2])) return false;
  return true;
}
function renderWithHooks(current2, workInProgress2, Component2, props, secondArg, nextRenderLanes) {
  renderLanes = nextRenderLanes;
  currentlyRenderingFiber = workInProgress2;
  workInProgress2.memoizedState = null;
  workInProgress2.updateQueue = null;
  workInProgress2.lanes = 0;
  ReactSharedInternals.H = null === current2 || null === current2.memoizedState ? HooksDispatcherOnMount : HooksDispatcherOnUpdate;
  shouldDoubleInvokeUserFnsInHooksDEV = false;
  nextRenderLanes = Component2(props, secondArg);
  shouldDoubleInvokeUserFnsInHooksDEV = false;
  didScheduleRenderPhaseUpdateDuringThisPass && (nextRenderLanes = renderWithHooksAgain(
    workInProgress2,
    Component2,
    props,
    secondArg
  ));
  finishRenderingHooks(current2);
  return nextRenderLanes;
}
function finishRenderingHooks(current2) {
  ReactSharedInternals.H = ContextOnlyDispatcher;
  var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next;
  renderLanes = 0;
  workInProgressHook = currentHook = currentlyRenderingFiber = null;
  didScheduleRenderPhaseUpdate = false;
  thenableIndexCounter$1 = 0;
  thenableState$1 = null;
  if (didRenderTooFewHooks) throw Error(formatProdErrorMessage$2(300));
  null === current2 || didReceiveUpdate || (current2 = current2.dependencies, null !== current2 && checkIfContextChanged(current2) && (didReceiveUpdate = true));
}
function renderWithHooksAgain(workInProgress2, Component2, props, secondArg) {
  currentlyRenderingFiber = workInProgress2;
  var numberOfReRenders = 0;
  do {
    didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null);
    thenableIndexCounter$1 = 0;
    didScheduleRenderPhaseUpdateDuringThisPass = false;
    if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage$2(301));
    numberOfReRenders += 1;
    workInProgressHook = currentHook = null;
    if (null != workInProgress2.updateQueue) {
      var children = workInProgress2.updateQueue;
      children.lastEffect = null;
      children.events = null;
      children.stores = null;
      null != children.memoCache && (children.memoCache.index = 0);
    }
    ReactSharedInternals.H = HooksDispatcherOnRerender;
    children = Component2(props, secondArg);
  } while (didScheduleRenderPhaseUpdateDuringThisPass);
  return children;
}
function TransitionAwareHostComponent() {
  var dispatcher = ReactSharedInternals.H, maybeThenable = dispatcher.useState()[0];
  maybeThenable = "function" === typeof maybeThenable.then ? useThenable(maybeThenable) : maybeThenable;
  dispatcher = dispatcher.useState()[0];
  (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && (currentlyRenderingFiber.flags |= 1024);
  return maybeThenable;
}
function checkDidRenderIdHook() {
  var didRenderIdHook = 0 !== localIdCounter;
  localIdCounter = 0;
  return didRenderIdHook;
}
function bailoutHooks(current2, workInProgress2, lanes) {
  workInProgress2.updateQueue = current2.updateQueue;
  workInProgress2.flags &= -2053;
  current2.lanes &= ~lanes;
}
function resetHooksOnUnwind(workInProgress2) {
  if (didScheduleRenderPhaseUpdate) {
    for (workInProgress2 = workInProgress2.memoizedState; null !== workInProgress2; ) {
      var queue = workInProgress2.queue;
      null !== queue && (queue.pending = null);
      workInProgress2 = workInProgress2.next;
    }
    didScheduleRenderPhaseUpdate = false;
  }
  renderLanes = 0;
  workInProgressHook = currentHook = currentlyRenderingFiber = null;
  didScheduleRenderPhaseUpdateDuringThisPass = false;
  thenableIndexCounter$1 = localIdCounter = 0;
  thenableState$1 = null;
}
function mountWorkInProgressHook() {
  var hook = {
    memoizedState: null,
    baseState: null,
    baseQueue: null,
    queue: null,
    next: null
  };
  null === workInProgressHook ? currentlyRenderingFiber.memoizedState = workInProgressHook = hook : workInProgressHook = workInProgressHook.next = hook;
  return workInProgressHook;
}
function updateWorkInProgressHook() {
  if (null === currentHook) {
    var nextCurrentHook = currentlyRenderingFiber.alternate;
    nextCurrentHook = null !== nextCurrentHook ? nextCurrentHook.memoizedState : null;
  } else nextCurrentHook = currentHook.next;
  var nextWorkInProgressHook = null === workInProgressHook ? currentlyRenderingFiber.memoizedState : workInProgressHook.next;
  if (null !== nextWorkInProgressHook)
    workInProgressHook = nextWorkInProgressHook, currentHook = nextCurrentHook;
  else {
    if (null === nextCurrentHook) {
      if (null === currentlyRenderingFiber.alternate)
        throw Error(formatProdErrorMessage$2(467));
      throw Error(formatProdErrorMessage$2(310));
    }
    currentHook = nextCurrentHook;
    nextCurrentHook = {
      memoizedState: currentHook.memoizedState,
      baseState: currentHook.baseState,
      baseQueue: currentHook.baseQueue,
      queue: currentHook.queue,
      next: null
    };
    null === workInProgressHook ? currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook : workInProgressHook = workInProgressHook.next = nextCurrentHook;
  }
  return workInProgressHook;
}
function createFunctionComponentUpdateQueue() {
  return { lastEffect: null, events: null, stores: null, memoCache: null };
}
function useThenable(thenable) {
  var index2 = thenableIndexCounter$1;
  thenableIndexCounter$1 += 1;
  null === thenableState$1 && (thenableState$1 = []);
  thenable = trackUsedThenable(thenableState$1, thenable, index2);
  index2 = currentlyRenderingFiber;
  null === (null === workInProgressHook ? index2.memoizedState : workInProgressHook.next) && (index2 = index2.alternate, ReactSharedInternals.H = null === index2 || null === index2.memoizedState ? HooksDispatcherOnMount : HooksDispatcherOnUpdate);
  return thenable;
}
function use(usable) {
  if (null !== usable && "object" === typeof usable) {
    if ("function" === typeof usable.then) return useThenable(usable);
    if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable);
  }
  throw Error(formatProdErrorMessage$2(438, String(usable)));
}
function useMemoCache(size) {
  var memoCache = null, updateQueue = currentlyRenderingFiber.updateQueue;
  null !== updateQueue && (memoCache = updateQueue.memoCache);
  if (null == memoCache) {
    var current2 = currentlyRenderingFiber.alternate;
    null !== current2 && (current2 = current2.updateQueue, null !== current2 && (current2 = current2.memoCache, null != current2 && (memoCache = {
      data: current2.data.map(function(array) {
        return array.slice();
      }),
      index: 0
    })));
  }
  null == memoCache && (memoCache = { data: [], index: 0 });
  null === updateQueue && (updateQueue = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = updateQueue);
  updateQueue.memoCache = memoCache;
  updateQueue = memoCache.data[memoCache.index];
  if (void 0 === updateQueue)
    for (updateQueue = memoCache.data[memoCache.index] = Array(size), current2 = 0; current2 < size; current2++)
      updateQueue[current2] = REACT_MEMO_CACHE_SENTINEL;
  memoCache.index++;
  return updateQueue;
}
function basicStateReducer(state, action) {
  return "function" === typeof action ? action(state) : action;
}
function updateReducer(reducer) {
  var hook = updateWorkInProgressHook();
  return updateReducerImpl(hook, currentHook, reducer);
}
function updateReducerImpl(hook, current2, reducer) {
  var queue = hook.queue;
  if (null === queue) throw Error(formatProdErrorMessage$2(311));
  queue.lastRenderedReducer = reducer;
  var baseQueue = hook.baseQueue, pendingQueue = queue.pending;
  if (null !== pendingQueue) {
    if (null !== baseQueue) {
      var baseFirst = baseQueue.next;
      baseQueue.next = pendingQueue.next;
      pendingQueue.next = baseFirst;
    }
    current2.baseQueue = baseQueue = pendingQueue;
    queue.pending = null;
  }
  pendingQueue = hook.baseState;
  if (null === baseQueue) hook.memoizedState = pendingQueue;
  else {
    current2 = baseQueue.next;
    var newBaseQueueFirst = baseFirst = null, newBaseQueueLast = null, update = current2, didReadFromEntangledAsyncAction$32 = false;
    do {
      var updateLane = update.lane & -536870913;
      if (updateLane !== update.lane ? (workInProgressRootRenderLanes & updateLane) === updateLane : (renderLanes & updateLane) === updateLane) {
        var revertLane = update.revertLane;
        if (0 === revertLane)
          null !== newBaseQueueLast && (newBaseQueueLast = newBaseQueueLast.next = {
            lane: 0,
            revertLane: 0,
            action: update.action,
            hasEagerState: update.hasEagerState,
            eagerState: update.eagerState,
            next: null
          }), updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction$32 = true);
        else if ((renderLanes & revertLane) === revertLane) {
          update = update.next;
          revertLane === currentEntangledLane && (didReadFromEntangledAsyncAction$32 = true);
          continue;
        } else
          updateLane = {
            lane: 0,
            revertLane: update.revertLane,
            action: update.action,
            hasEagerState: update.hasEagerState,
            eagerState: update.eagerState,
            next: null
          }, null === newBaseQueueLast ? (newBaseQueueFirst = newBaseQueueLast = updateLane, baseFirst = pendingQueue) : newBaseQueueLast = newBaseQueueLast.next = updateLane, currentlyRenderingFiber.lanes |= revertLane, workInProgressRootSkippedLanes |= revertLane;
        updateLane = update.action;
        shouldDoubleInvokeUserFnsInHooksDEV && reducer(pendingQueue, updateLane);
        pendingQueue = update.hasEagerState ? update.eagerState : reducer(pendingQueue, updateLane);
      } else
        revertLane = {
          lane: updateLane,
          revertLane: update.revertLane,
          action: update.action,
          hasEagerState: update.hasEagerState,
          eagerState: update.eagerState,
          next: null
        }, null === newBaseQueueLast ? (newBaseQueueFirst = newBaseQueueLast = revertLane, baseFirst = pendingQueue) : newBaseQueueLast = newBaseQueueLast.next = revertLane, currentlyRenderingFiber.lanes |= updateLane, workInProgressRootSkippedLanes |= updateLane;
      update = update.next;
    } while (null !== update && update !== current2);
    null === newBaseQueueLast ? baseFirst = pendingQueue : newBaseQueueLast.next = newBaseQueueFirst;
    if (!objectIs$2(pendingQueue, hook.memoizedState) && (didReceiveUpdate = true, didReadFromEntangledAsyncAction$32 && (reducer = currentEntangledActionThenable, null !== reducer)))
      throw reducer;
    hook.memoizedState = pendingQueue;
    hook.baseState = baseFirst;
    hook.baseQueue = newBaseQueueLast;
    queue.lastRenderedState = pendingQueue;
  }
  null === baseQueue && (queue.lanes = 0);
  return [hook.memoizedState, queue.dispatch];
}
function rerenderReducer(reducer) {
  var hook = updateWorkInProgressHook(), queue = hook.queue;
  if (null === queue) throw Error(formatProdErrorMessage$2(311));
  queue.lastRenderedReducer = reducer;
  var dispatch = queue.dispatch, lastRenderPhaseUpdate = queue.pending, newState = hook.memoizedState;
  if (null !== lastRenderPhaseUpdate) {
    queue.pending = null;
    var update = lastRenderPhaseUpdate = lastRenderPhaseUpdate.next;
    do
      newState = reducer(newState, update.action), update = update.next;
    while (update !== lastRenderPhaseUpdate);
    objectIs$2(newState, hook.memoizedState) || (didReceiveUpdate = true);
    hook.memoizedState = newState;
    null === hook.baseQueue && (hook.baseState = newState);
    queue.lastRenderedState = newState;
  }
  return [newState, dispatch];
}
function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
  var fiber = currentlyRenderingFiber, hook = updateWorkInProgressHook(), isHydrating$jscomp$0 = isHydrating;
  if (isHydrating$jscomp$0) {
    if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage$2(407));
    getServerSnapshot = getServerSnapshot();
  } else getServerSnapshot = getSnapshot();
  var snapshotChanged = !objectIs$2(
    (currentHook || hook).memoizedState,
    getServerSnapshot
  );
  snapshotChanged && (hook.memoizedState = getServerSnapshot, didReceiveUpdate = true);
  hook = hook.queue;
  var create = subscribeToStore.bind(null, fiber, hook, subscribe);
  updateEffectImpl(2048, 8, create, [subscribe]);
  if (hook.getSnapshot !== getSnapshot || snapshotChanged || null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) {
    fiber.flags |= 2048;
    pushSimpleEffect(
      9,
      createEffectInstance(),
      updateStoreInstance.bind(
        null,
        fiber,
        hook,
        getServerSnapshot,
        getSnapshot
      ),
      null
    );
    if (null === workInProgressRoot) throw Error(formatProdErrorMessage$2(349));
    isHydrating$jscomp$0 || 0 !== (renderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
  }
  return getServerSnapshot;
}
function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
  fiber.flags |= 16384;
  fiber = { getSnapshot, value: renderedSnapshot };
  getSnapshot = currentlyRenderingFiber.updateQueue;
  null === getSnapshot ? (getSnapshot = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = getSnapshot, getSnapshot.stores = [fiber]) : (renderedSnapshot = getSnapshot.stores, null === renderedSnapshot ? getSnapshot.stores = [fiber] : renderedSnapshot.push(fiber));
}
function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
  inst.value = nextSnapshot;
  inst.getSnapshot = getSnapshot;
  checkIfSnapshotChanged$1(inst) && forceStoreRerender(fiber);
}
function subscribeToStore(fiber, inst, subscribe) {
  return subscribe(function() {
    checkIfSnapshotChanged$1(inst) && forceStoreRerender(fiber);
  });
}
function checkIfSnapshotChanged$1(inst) {
  var latestGetSnapshot = inst.getSnapshot;
  inst = inst.value;
  try {
    var nextValue = latestGetSnapshot();
    return !objectIs$2(inst, nextValue);
  } catch (error) {
    return true;
  }
}
function forceStoreRerender(fiber) {
  var root2 = enqueueConcurrentRenderForLane(fiber, 2);
  null !== root2 && scheduleUpdateOnFiber(root2, fiber, 2);
}
function mountStateImpl(initialState2) {
  var hook = mountWorkInProgressHook();
  if ("function" === typeof initialState2) {
    var initialStateInitializer = initialState2;
    initialState2 = initialStateInitializer();
    if (shouldDoubleInvokeUserFnsInHooksDEV) {
      setIsStrictModeForDevtools(true);
      try {
        initialStateInitializer();
      } finally {
        setIsStrictModeForDevtools(false);
      }
    }
  }
  hook.memoizedState = hook.baseState = initialState2;
  hook.queue = {
    pending: null,
    lanes: 0,
    dispatch: null,
    lastRenderedReducer: basicStateReducer,
    lastRenderedState: initialState2
  };
  return hook;
}
function updateOptimisticImpl(hook, current2, passthrough, reducer) {
  hook.baseState = passthrough;
  return updateReducerImpl(
    hook,
    currentHook,
    "function" === typeof reducer ? reducer : basicStateReducer
  );
}
function dispatchActionState(fiber, actionQueue, setPendingState, setState, payload) {
  if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage$2(485));
  fiber = actionQueue.action;
  if (null !== fiber) {
    var actionNode = {
      payload,
      action: fiber,
      next: null,
      isTransition: true,
      status: "pending",
      value: null,
      reason: null,
      listeners: [],
      then: function(listener) {
        actionNode.listeners.push(listener);
      }
    };
    null !== ReactSharedInternals.T ? setPendingState(true) : actionNode.isTransition = false;
    setState(actionNode);
    setPendingState = actionQueue.pending;
    null === setPendingState ? (actionNode.next = actionQueue.pending = actionNode, runActionStateAction(actionQueue, actionNode)) : (actionNode.next = setPendingState.next, actionQueue.pending = setPendingState.next = actionNode);
  }
}
function runActionStateAction(actionQueue, node) {
  var action = node.action, payload = node.payload, prevState = actionQueue.state;
  if (node.isTransition) {
    var prevTransition = ReactSharedInternals.T, currentTransition = {};
    ReactSharedInternals.T = currentTransition;
    try {
      var returnValue = action(prevState, payload), onStartTransitionFinish = ReactSharedInternals.S;
      null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
      handleActionReturnValue(actionQueue, node, returnValue);
    } catch (error) {
      onActionError(actionQueue, node, error);
    } finally {
      ReactSharedInternals.T = prevTransition;
    }
  } else
    try {
      prevTransition = action(prevState, payload), handleActionReturnValue(actionQueue, node, prevTransition);
    } catch (error$38) {
      onActionError(actionQueue, node, error$38);
    }
}
function handleActionReturnValue(actionQueue, node, returnValue) {
  null !== returnValue && "object" === typeof returnValue && "function" === typeof returnValue.then ? returnValue.then(
    function(nextState) {
      onActionSuccess(actionQueue, node, nextState);
    },
    function(error) {
      return onActionError(actionQueue, node, error);
    }
  ) : onActionSuccess(actionQueue, node, returnValue);
}
function onActionSuccess(actionQueue, actionNode, nextState) {
  actionNode.status = "fulfilled";
  actionNode.value = nextState;
  notifyActionListeners(actionNode);
  actionQueue.state = nextState;
  actionNode = actionQueue.pending;
  null !== actionNode && (nextState = actionNode.next, nextState === actionNode ? actionQueue.pending = null : (nextState = nextState.next, actionNode.next = nextState, runActionStateAction(actionQueue, nextState)));
}
function onActionError(actionQueue, actionNode, error) {
  var last = actionQueue.pending;
  actionQueue.pending = null;
  if (null !== last) {
    last = last.next;
    do
      actionNode.status = "rejected", actionNode.reason = error, notifyActionListeners(actionNode), actionNode = actionNode.next;
    while (actionNode !== last);
  }
  actionQueue.action = null;
}
function notifyActionListeners(actionNode) {
  actionNode = actionNode.listeners;
  for (var i2 = 0; i2 < actionNode.length; i2++) (0, actionNode[i2])();
}
function actionStateReducer(oldState, newState) {
  return newState;
}
function mountActionState(action, initialStateProp) {
  if (isHydrating) {
    var ssrFormState = workInProgressRoot.formState;
    if (null !== ssrFormState) {
      a: {
        var JSCompiler_inline_result = currentlyRenderingFiber;
        if (isHydrating) {
          if (nextHydratableInstance) {
            b: {
              var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance;
              for (var inRootOrSingleton = rootOrSingletonContext; 8 !== JSCompiler_inline_result$jscomp$0.nodeType; ) {
                if (!inRootOrSingleton) {
                  JSCompiler_inline_result$jscomp$0 = null;
                  break b;
                }
                JSCompiler_inline_result$jscomp$0 = getNextHydratable(
                  JSCompiler_inline_result$jscomp$0.nextSibling
                );
                if (null === JSCompiler_inline_result$jscomp$0) {
                  JSCompiler_inline_result$jscomp$0 = null;
                  break b;
                }
              }
              inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data;
              JSCompiler_inline_result$jscomp$0 = "F!" === inRootOrSingleton || "F" === inRootOrSingleton ? JSCompiler_inline_result$jscomp$0 : null;
            }
            if (JSCompiler_inline_result$jscomp$0) {
              nextHydratableInstance = getNextHydratable(
                JSCompiler_inline_result$jscomp$0.nextSibling
              );
              JSCompiler_inline_result = "F!" === JSCompiler_inline_result$jscomp$0.data;
              break a;
            }
          }
          throwOnHydrationMismatch(JSCompiler_inline_result);
        }
        JSCompiler_inline_result = false;
      }
      JSCompiler_inline_result && (initialStateProp = ssrFormState[0]);
    }
  }
  ssrFormState = mountWorkInProgressHook();
  ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp;
  JSCompiler_inline_result = {
    pending: null,
    lanes: 0,
    dispatch: null,
    lastRenderedReducer: actionStateReducer,
    lastRenderedState: initialStateProp
  };
  ssrFormState.queue = JSCompiler_inline_result;
  ssrFormState = dispatchSetState.bind(
    null,
    currentlyRenderingFiber,
    JSCompiler_inline_result
  );
  JSCompiler_inline_result.dispatch = ssrFormState;
  JSCompiler_inline_result = mountStateImpl(false);
  inRootOrSingleton = dispatchOptimisticSetState.bind(
    null,
    currentlyRenderingFiber,
    false,
    JSCompiler_inline_result.queue
  );
  JSCompiler_inline_result = mountWorkInProgressHook();
  JSCompiler_inline_result$jscomp$0 = {
    state: initialStateProp,
    dispatch: null,
    action,
    pending: null
  };
  JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0;
  ssrFormState = dispatchActionState.bind(
    null,
    currentlyRenderingFiber,
    JSCompiler_inline_result$jscomp$0,
    inRootOrSingleton,
    ssrFormState
  );
  JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState;
  JSCompiler_inline_result.memoizedState = action;
  return [initialStateProp, ssrFormState, false];
}
function updateActionState(action) {
  var stateHook = updateWorkInProgressHook();
  return updateActionStateImpl(stateHook, currentHook, action);
}
function updateActionStateImpl(stateHook, currentStateHook, action) {
  currentStateHook = updateReducerImpl(
    stateHook,
    currentStateHook,
    actionStateReducer
  )[0];
  stateHook = updateReducer(basicStateReducer)[0];
  if ("object" === typeof currentStateHook && null !== currentStateHook && "function" === typeof currentStateHook.then)
    try {
      var state = useThenable(currentStateHook);
    } catch (x) {
      if (x === SuspenseException) throw SuspenseActionException;
      throw x;
    }
  else state = currentStateHook;
  currentStateHook = updateWorkInProgressHook();
  var actionQueue = currentStateHook.queue, dispatch = actionQueue.dispatch;
  action !== currentStateHook.memoizedState && (currentlyRenderingFiber.flags |= 2048, pushSimpleEffect(
    9,
    createEffectInstance(),
    actionStateActionEffect.bind(null, actionQueue, action),
    null
  ));
  return [state, dispatch, stateHook];
}
function actionStateActionEffect(actionQueue, action) {
  actionQueue.action = action;
}
function rerenderActionState(action) {
  var stateHook = updateWorkInProgressHook(), currentStateHook = currentHook;
  if (null !== currentStateHook)
    return updateActionStateImpl(stateHook, currentStateHook, action);
  updateWorkInProgressHook();
  stateHook = stateHook.memoizedState;
  currentStateHook = updateWorkInProgressHook();
  var dispatch = currentStateHook.queue.dispatch;
  currentStateHook.memoizedState = action;
  return [stateHook, dispatch, false];
}
function pushSimpleEffect(tag, inst, create, createDeps) {
  tag = { tag, create, deps: createDeps, inst, next: null };
  inst = currentlyRenderingFiber.updateQueue;
  null === inst && (inst = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = inst);
  create = inst.lastEffect;
  null === create ? inst.lastEffect = tag.next = tag : (createDeps = create.next, create.next = tag, tag.next = createDeps, inst.lastEffect = tag);
  return tag;
}
function createEffectInstance() {
  return { destroy: void 0, resource: void 0 };
}
function updateRef() {
  return updateWorkInProgressHook().memoizedState;
}
function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) {
  var hook = mountWorkInProgressHook();
  createDeps = void 0 === createDeps ? null : createDeps;
  currentlyRenderingFiber.flags |= fiberFlags;
  hook.memoizedState = pushSimpleEffect(
    1 | hookFlags,
    createEffectInstance(),
    create,
    createDeps
  );
}
function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
  var hook = updateWorkInProgressHook();
  deps = void 0 === deps ? null : deps;
  var inst = hook.memoizedState.inst;
  null !== currentHook && null !== deps && areHookInputsEqual(deps, currentHook.memoizedState.deps) ? hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps) : (currentlyRenderingFiber.flags |= fiberFlags, hook.memoizedState = pushSimpleEffect(
    1 | hookFlags,
    inst,
    create,
    deps
  ));
}
function mountEffect(create, createDeps) {
  mountEffectImpl(8390656, 8, create, createDeps);
}
function updateEffect(create, createDeps) {
  updateEffectImpl(2048, 8, create, createDeps);
}
function updateInsertionEffect(create, deps) {
  return updateEffectImpl(4, 2, create, deps);
}
function updateLayoutEffect(create, deps) {
  return updateEffectImpl(4, 4, create, deps);
}
function imperativeHandleEffect(create, ref) {
  if ("function" === typeof ref) {
    create = create();
    var refCleanup = ref(create);
    return function() {
      "function" === typeof refCleanup ? refCleanup() : ref(null);
    };
  }
  if (null !== ref && void 0 !== ref)
    return create = create(), ref.current = create, function() {
      ref.current = null;
    };
}
function updateImperativeHandle(ref, create, deps) {
  deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
  updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps);
}
function mountDebugValue() {
}
function updateCallback(callback, deps) {
  var hook = updateWorkInProgressHook();
  deps = void 0 === deps ? null : deps;
  var prevState = hook.memoizedState;
  if (null !== deps && areHookInputsEqual(deps, prevState[1]))
    return prevState[0];
  hook.memoizedState = [callback, deps];
  return callback;
}
function updateMemo(nextCreate, deps) {
  var hook = updateWorkInProgressHook();
  deps = void 0 === deps ? null : deps;
  var prevState = hook.memoizedState;
  if (null !== deps && areHookInputsEqual(deps, prevState[1]))
    return prevState[0];
  prevState = nextCreate();
  if (shouldDoubleInvokeUserFnsInHooksDEV) {
    setIsStrictModeForDevtools(true);
    try {
      nextCreate();
    } finally {
      setIsStrictModeForDevtools(false);
    }
  }
  hook.memoizedState = [prevState, deps];
  return prevState;
}
function mountDeferredValueImpl(hook, value, initialValue) {
  if (void 0 === initialValue || 0 !== (renderLanes & 1073741824))
    return hook.memoizedState = value;
  hook.memoizedState = initialValue;
  hook = requestDeferredLane();
  currentlyRenderingFiber.lanes |= hook;
  workInProgressRootSkippedLanes |= hook;
  return initialValue;
}
function updateDeferredValueImpl(hook, prevValue, value, initialValue) {
  if (objectIs$2(value, prevValue)) return value;
  if (null !== currentTreeHiddenStackCursor.current)
    return hook = mountDeferredValueImpl(hook, value, initialValue), objectIs$2(hook, prevValue) || (didReceiveUpdate = true), hook;
  if (0 === (renderLanes & 42))
    return didReceiveUpdate = true, hook.memoizedState = value;
  hook = requestDeferredLane();
  currentlyRenderingFiber.lanes |= hook;
  workInProgressRootSkippedLanes |= hook;
  return prevValue;
}
function startTransition(fiber, queue, pendingState, finishedState, callback) {
  var previousPriority = ReactDOMSharedInternals.p;
  ReactDOMSharedInternals.p = 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8;
  var prevTransition = ReactSharedInternals.T, currentTransition = {};
  ReactSharedInternals.T = currentTransition;
  dispatchOptimisticSetState(fiber, false, queue, pendingState);
  try {
    var returnValue = callback(), onStartTransitionFinish = ReactSharedInternals.S;
    null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
    if (null !== returnValue && "object" === typeof returnValue && "function" === typeof returnValue.then) {
      var thenableForFinishedState = chainThenableValue(
        returnValue,
        finishedState
      );
      dispatchSetStateInternal(
        fiber,
        queue,
        thenableForFinishedState,
        requestUpdateLane(fiber)
      );
    } else
      dispatchSetStateInternal(
        fiber,
        queue,
        finishedState,
        requestUpdateLane(fiber)
      );
  } catch (error) {
    dispatchSetStateInternal(
      fiber,
      queue,
      { then: function() {
      }, status: "rejected", reason: error },
      requestUpdateLane()
    );
  } finally {
    ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = prevTransition;
  }
}
function noop$2$1() {
}
function startHostTransition(formFiber, pendingState, action, formData) {
  if (5 !== formFiber.tag) throw Error(formatProdErrorMessage$2(476));
  var queue = ensureFormComponentIsStateful(formFiber).queue;
  startTransition(
    formFiber,
    queue,
    pendingState,
    sharedNotPendingObject,
    null === action ? noop$2$1 : function() {
      requestFormReset$1(formFiber);
      return action(formData);
    }
  );
}
function ensureFormComponentIsStateful(formFiber) {
  var existingStateHook = formFiber.memoizedState;
  if (null !== existingStateHook) return existingStateHook;
  existingStateHook = {
    memoizedState: sharedNotPendingObject,
    baseState: sharedNotPendingObject,
    baseQueue: null,
    queue: {
      pending: null,
      lanes: 0,
      dispatch: null,
      lastRenderedReducer: basicStateReducer,
      lastRenderedState: sharedNotPendingObject
    },
    next: null
  };
  var initialResetState = {};
  existingStateHook.next = {
    memoizedState: initialResetState,
    baseState: initialResetState,
    baseQueue: null,
    queue: {
      pending: null,
      lanes: 0,
      dispatch: null,
      lastRenderedReducer: basicStateReducer,
      lastRenderedState: initialResetState
    },
    next: null
  };
  formFiber.memoizedState = existingStateHook;
  formFiber = formFiber.alternate;
  null !== formFiber && (formFiber.memoizedState = existingStateHook);
  return existingStateHook;
}
function requestFormReset$1(formFiber) {
  var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue;
  dispatchSetStateInternal(formFiber, resetStateQueue, {}, requestUpdateLane());
}
function useHostTransitionStatus() {
  return readContext(HostTransitionContext);
}
function updateId() {
  return updateWorkInProgressHook().memoizedState;
}
function updateRefresh() {
  return updateWorkInProgressHook().memoizedState;
}
function refreshCache(fiber) {
  for (var provider = fiber.return; null !== provider; ) {
    switch (provider.tag) {
      case 24:
      case 3:
        var lane = requestUpdateLane();
        fiber = createUpdate(lane);
        var root$41 = enqueueUpdate(provider, fiber, lane);
        null !== root$41 && (scheduleUpdateOnFiber(root$41, provider, lane), entangleTransitions(root$41, provider, lane));
        provider = { cache: createCache() };
        fiber.payload = provider;
        return;
    }
    provider = provider.return;
  }
}
function dispatchReducerAction(fiber, queue, action) {
  var lane = requestUpdateLane();
  action = {
    lane,
    revertLane: 0,
    action,
    hasEagerState: false,
    eagerState: null,
    next: null
  };
  isRenderPhaseUpdate(fiber) ? enqueueRenderPhaseUpdate(queue, action) : (action = enqueueConcurrentHookUpdate(fiber, queue, action, lane), null !== action && (scheduleUpdateOnFiber(action, fiber, lane), entangleTransitionUpdate(action, queue, lane)));
}
function dispatchSetState(fiber, queue, action) {
  var lane = requestUpdateLane();
  dispatchSetStateInternal(fiber, queue, action, lane);
}
function dispatchSetStateInternal(fiber, queue, action, lane) {
  var update = {
    lane,
    revertLane: 0,
    action,
    hasEagerState: false,
    eagerState: null,
    next: null
  };
  if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update);
  else {
    var alternate = fiber.alternate;
    if (0 === fiber.lanes && (null === alternate || 0 === alternate.lanes) && (alternate = queue.lastRenderedReducer, null !== alternate))
      try {
        var currentState = queue.lastRenderedState, eagerState = alternate(currentState, action);
        update.hasEagerState = true;
        update.eagerState = eagerState;
        if (objectIs$2(eagerState, currentState))
          return enqueueUpdate$1(fiber, queue, update, 0), null === workInProgressRoot && finishQueueingConcurrentUpdates(), false;
      } catch (error) {
      } finally {
      }
    action = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
    if (null !== action)
      return scheduleUpdateOnFiber(action, fiber, lane), entangleTransitionUpdate(action, queue, lane), true;
  }
  return false;
}
function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) {
  action = {
    lane: 2,
    revertLane: requestTransitionLane(),
    action,
    hasEagerState: false,
    eagerState: null,
    next: null
  };
  if (isRenderPhaseUpdate(fiber)) {
    if (throwIfDuringRender) throw Error(formatProdErrorMessage$2(479));
  } else
    throwIfDuringRender = enqueueConcurrentHookUpdate(
      fiber,
      queue,
      action,
      2
    ), null !== throwIfDuringRender && scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2);
}
function isRenderPhaseUpdate(fiber) {
  var alternate = fiber.alternate;
  return fiber === currentlyRenderingFiber || null !== alternate && alternate === currentlyRenderingFiber;
}
function enqueueRenderPhaseUpdate(queue, update) {
  didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
  var pending = queue.pending;
  null === pending ? update.next = update : (update.next = pending.next, pending.next = update);
  queue.pending = update;
}
function entangleTransitionUpdate(root2, queue, lane) {
  if (0 !== (lane & 4194048)) {
    var queueLanes = queue.lanes;
    queueLanes &= root2.pendingLanes;
    lane |= queueLanes;
    queue.lanes = lane;
    markRootEntangled(root2, lane);
  }
}
var ContextOnlyDispatcher = {
  readContext,
  use,
  useCallback: throwInvalidHookError,
  useContext: throwInvalidHookError,
  useEffect: throwInvalidHookError,
  useImperativeHandle: throwInvalidHookError,
  useLayoutEffect: throwInvalidHookError,
  useInsertionEffect: throwInvalidHookError,
  useMemo: throwInvalidHookError,
  useReducer: throwInvalidHookError,
  useRef: throwInvalidHookError,
  useState: throwInvalidHookError,
  useDebugValue: throwInvalidHookError,
  useDeferredValue: throwInvalidHookError,
  useTransition: throwInvalidHookError,
  useSyncExternalStore: throwInvalidHookError,
  useId: throwInvalidHookError,
  useHostTransitionStatus: throwInvalidHookError,
  useFormState: throwInvalidHookError,
  useActionState: throwInvalidHookError,
  useOptimistic: throwInvalidHookError,
  useMemoCache: throwInvalidHookError,
  useCacheRefresh: throwInvalidHookError
}, HooksDispatcherOnMount = {
  readContext,
  use,
  useCallback: function(callback, deps) {
    mountWorkInProgressHook().memoizedState = [
      callback,
      void 0 === deps ? null : deps
    ];
    return callback;
  },
  useContext: readContext,
  useEffect: mountEffect,
  useImperativeHandle: function(ref, create, deps) {
    deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
    mountEffectImpl(
      4194308,
      4,
      imperativeHandleEffect.bind(null, create, ref),
      deps
    );
  },
  useLayoutEffect: function(create, deps) {
    return mountEffectImpl(4194308, 4, create, deps);
  },
  useInsertionEffect: function(create, deps) {
    mountEffectImpl(4, 2, create, deps);
  },
  useMemo: function(nextCreate, deps) {
    var hook = mountWorkInProgressHook();
    deps = void 0 === deps ? null : deps;
    var nextValue = nextCreate();
    if (shouldDoubleInvokeUserFnsInHooksDEV) {
      setIsStrictModeForDevtools(true);
      try {
        nextCreate();
      } finally {
        setIsStrictModeForDevtools(false);
      }
    }
    hook.memoizedState = [nextValue, deps];
    return nextValue;
  },
  useReducer: function(reducer, initialArg, init) {
    var hook = mountWorkInProgressHook();
    if (void 0 !== init) {
      var initialState2 = init(initialArg);
      if (shouldDoubleInvokeUserFnsInHooksDEV) {
        setIsStrictModeForDevtools(true);
        try {
          init(initialArg);
        } finally {
          setIsStrictModeForDevtools(false);
        }
      }
    } else initialState2 = initialArg;
    hook.memoizedState = hook.baseState = initialState2;
    reducer = {
      pending: null,
      lanes: 0,
      dispatch: null,
      lastRenderedReducer: reducer,
      lastRenderedState: initialState2
    };
    hook.queue = reducer;
    reducer = reducer.dispatch = dispatchReducerAction.bind(
      null,
      currentlyRenderingFiber,
      reducer
    );
    return [hook.memoizedState, reducer];
  },
  useRef: function(initialValue) {
    var hook = mountWorkInProgressHook();
    initialValue = { current: initialValue };
    return hook.memoizedState = initialValue;
  },
  useState: function(initialState2) {
    initialState2 = mountStateImpl(initialState2);
    var queue = initialState2.queue, dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue);
    queue.dispatch = dispatch;
    return [initialState2.memoizedState, dispatch];
  },
  useDebugValue: mountDebugValue,
  useDeferredValue: function(value, initialValue) {
    var hook = mountWorkInProgressHook();
    return mountDeferredValueImpl(hook, value, initialValue);
  },
  useTransition: function() {
    var stateHook = mountStateImpl(false);
    stateHook = startTransition.bind(
      null,
      currentlyRenderingFiber,
      stateHook.queue,
      true,
      false
    );
    mountWorkInProgressHook().memoizedState = stateHook;
    return [false, stateHook];
  },
  useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
    var fiber = currentlyRenderingFiber, hook = mountWorkInProgressHook();
    if (isHydrating) {
      if (void 0 === getServerSnapshot)
        throw Error(formatProdErrorMessage$2(407));
      getServerSnapshot = getServerSnapshot();
    } else {
      getServerSnapshot = getSnapshot();
      if (null === workInProgressRoot)
        throw Error(formatProdErrorMessage$2(349));
      0 !== (workInProgressRootRenderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
    }
    hook.memoizedState = getServerSnapshot;
    var inst = { value: getServerSnapshot, getSnapshot };
    hook.queue = inst;
    mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [
      subscribe
    ]);
    fiber.flags |= 2048;
    pushSimpleEffect(
      9,
      createEffectInstance(),
      updateStoreInstance.bind(
        null,
        fiber,
        inst,
        getServerSnapshot,
        getSnapshot
      ),
      null
    );
    return getServerSnapshot;
  },
  useId: function() {
    var hook = mountWorkInProgressHook(), identifierPrefix = workInProgressRoot.identifierPrefix;
    if (isHydrating) {
      var JSCompiler_inline_result = treeContextOverflow;
      var idWithLeadingBit = treeContextId;
      JSCompiler_inline_result = (idWithLeadingBit & ~(1 << 32 - clz32(idWithLeadingBit) - 1)).toString(32) + JSCompiler_inline_result;
      identifierPrefix = "«" + identifierPrefix + "R" + JSCompiler_inline_result;
      JSCompiler_inline_result = localIdCounter++;
      0 < JSCompiler_inline_result && (identifierPrefix += "H" + JSCompiler_inline_result.toString(32));
      identifierPrefix += "»";
    } else
      JSCompiler_inline_result = globalClientIdCounter++, identifierPrefix = "«" + identifierPrefix + "r" + JSCompiler_inline_result.toString(32) + "»";
    return hook.memoizedState = identifierPrefix;
  },
  useHostTransitionStatus,
  useFormState: mountActionState,
  useActionState: mountActionState,
  useOptimistic: function(passthrough) {
    var hook = mountWorkInProgressHook();
    hook.memoizedState = hook.baseState = passthrough;
    var queue = {
      pending: null,
      lanes: 0,
      dispatch: null,
      lastRenderedReducer: null,
      lastRenderedState: null
    };
    hook.queue = queue;
    hook = dispatchOptimisticSetState.bind(
      null,
      currentlyRenderingFiber,
      true,
      queue
    );
    queue.dispatch = hook;
    return [passthrough, hook];
  },
  useMemoCache,
  useCacheRefresh: function() {
    return mountWorkInProgressHook().memoizedState = refreshCache.bind(
      null,
      currentlyRenderingFiber
    );
  }
}, HooksDispatcherOnUpdate = {
  readContext,
  use,
  useCallback: updateCallback,
  useContext: readContext,
  useEffect: updateEffect,
  useImperativeHandle: updateImperativeHandle,
  useInsertionEffect: updateInsertionEffect,
  useLayoutEffect: updateLayoutEffect,
  useMemo: updateMemo,
  useReducer: updateReducer,
  useRef: updateRef,
  useState: function() {
    return updateReducer(basicStateReducer);
  },
  useDebugValue: mountDebugValue,
  useDeferredValue: function(value, initialValue) {
    var hook = updateWorkInProgressHook();
    return updateDeferredValueImpl(
      hook,
      currentHook.memoizedState,
      value,
      initialValue
    );
  },
  useTransition: function() {
    var booleanOrThenable = updateReducer(basicStateReducer)[0], start = updateWorkInProgressHook().memoizedState;
    return [
      "boolean" === typeof booleanOrThenable ? booleanOrThenable : useThenable(booleanOrThenable),
      start
    ];
  },
  useSyncExternalStore: updateSyncExternalStore,
  useId: updateId,
  useHostTransitionStatus,
  useFormState: updateActionState,
  useActionState: updateActionState,
  useOptimistic: function(passthrough, reducer) {
    var hook = updateWorkInProgressHook();
    return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
  },
  useMemoCache,
  useCacheRefresh: updateRefresh
}, HooksDispatcherOnRerender = {
  readContext,
  use,
  useCallback: updateCallback,
  useContext: readContext,
  useEffect: updateEffect,
  useImperativeHandle: updateImperativeHandle,
  useInsertionEffect: updateInsertionEffect,
  useLayoutEffect: updateLayoutEffect,
  useMemo: updateMemo,
  useReducer: rerenderReducer,
  useRef: updateRef,
  useState: function() {
    return rerenderReducer(basicStateReducer);
  },
  useDebugValue: mountDebugValue,
  useDeferredValue: function(value, initialValue) {
    var hook = updateWorkInProgressHook();
    return null === currentHook ? mountDeferredValueImpl(hook, value, initialValue) : updateDeferredValueImpl(
      hook,
      currentHook.memoizedState,
      value,
      initialValue
    );
  },
  useTransition: function() {
    var booleanOrThenable = rerenderReducer(basicStateReducer)[0], start = updateWorkInProgressHook().memoizedState;
    return [
      "boolean" === typeof booleanOrThenable ? booleanOrThenable : useThenable(booleanOrThenable),
      start
    ];
  },
  useSyncExternalStore: updateSyncExternalStore,
  useId: updateId,
  useHostTransitionStatus,
  useFormState: rerenderActionState,
  useActionState: rerenderActionState,
  useOptimistic: function(passthrough, reducer) {
    var hook = updateWorkInProgressHook();
    if (null !== currentHook)
      return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
    hook.baseState = passthrough;
    return [passthrough, hook.queue.dispatch];
  },
  useMemoCache,
  useCacheRefresh: updateRefresh
}, thenableState = null, thenableIndexCounter = 0;
function unwrapThenable(thenable) {
  var index2 = thenableIndexCounter;
  thenableIndexCounter += 1;
  null === thenableState && (thenableState = []);
  return trackUsedThenable(thenableState, thenable, index2);
}
function coerceRef(workInProgress2, element) {
  element = element.props.ref;
  workInProgress2.ref = void 0 !== element ? element : null;
}
function throwOnInvalidObjectType(returnFiber, newChild) {
  if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE)
    throw Error(formatProdErrorMessage$2(525));
  returnFiber = Object.prototype.toString.call(newChild);
  throw Error(
    formatProdErrorMessage$2(
      31,
      "[object Object]" === returnFiber ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : returnFiber
    )
  );
}
function resolveLazy(lazyType) {
  var init = lazyType._init;
  return init(lazyType._payload);
}
function createChildReconciler(shouldTrackSideEffects) {
  function deleteChild(returnFiber, childToDelete) {
    if (shouldTrackSideEffects) {
      var deletions = returnFiber.deletions;
      null === deletions ? (returnFiber.deletions = [childToDelete], returnFiber.flags |= 16) : deletions.push(childToDelete);
    }
  }
  function deleteRemainingChildren(returnFiber, currentFirstChild) {
    if (!shouldTrackSideEffects) return null;
    for (; null !== currentFirstChild; )
      deleteChild(returnFiber, currentFirstChild), currentFirstChild = currentFirstChild.sibling;
    return null;
  }
  function mapRemainingChildren(currentFirstChild) {
    for (var existingChildren = /* @__PURE__ */ new Map(); null !== currentFirstChild; )
      null !== currentFirstChild.key ? existingChildren.set(currentFirstChild.key, currentFirstChild) : existingChildren.set(currentFirstChild.index, currentFirstChild), currentFirstChild = currentFirstChild.sibling;
    return existingChildren;
  }
  function useFiber(fiber, pendingProps) {
    fiber = createWorkInProgress(fiber, pendingProps);
    fiber.index = 0;
    fiber.sibling = null;
    return fiber;
  }
  function placeChild(newFiber, lastPlacedIndex, newIndex) {
    newFiber.index = newIndex;
    if (!shouldTrackSideEffects)
      return newFiber.flags |= 1048576, lastPlacedIndex;
    newIndex = newFiber.alternate;
    if (null !== newIndex)
      return newIndex = newIndex.index, newIndex < lastPlacedIndex ? (newFiber.flags |= 67108866, lastPlacedIndex) : newIndex;
    newFiber.flags |= 67108866;
    return lastPlacedIndex;
  }
  function placeSingleChild(newFiber) {
    shouldTrackSideEffects && null === newFiber.alternate && (newFiber.flags |= 67108866);
    return newFiber;
  }
  function updateTextNode(returnFiber, current2, textContent, lanes) {
    if (null === current2 || 6 !== current2.tag)
      return current2 = createFiberFromText(textContent, returnFiber.mode, lanes), current2.return = returnFiber, current2;
    current2 = useFiber(current2, textContent);
    current2.return = returnFiber;
    return current2;
  }
  function updateElement(returnFiber, current2, element, lanes) {
    var elementType = element.type;
    if (elementType === REACT_FRAGMENT_TYPE)
      return updateFragment(
        returnFiber,
        current2,
        element.props.children,
        lanes,
        element.key
      );
    if (null !== current2 && (current2.elementType === elementType || "object" === typeof elementType && null !== elementType && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === current2.type))
      return current2 = useFiber(current2, element.props), coerceRef(current2, element), current2.return = returnFiber, current2;
    current2 = createFiberFromTypeAndProps(
      element.type,
      element.key,
      element.props,
      null,
      returnFiber.mode,
      lanes
    );
    coerceRef(current2, element);
    current2.return = returnFiber;
    return current2;
  }
  function updatePortal(returnFiber, current2, portal, lanes) {
    if (null === current2 || 4 !== current2.tag || current2.stateNode.containerInfo !== portal.containerInfo || current2.stateNode.implementation !== portal.implementation)
      return current2 = createFiberFromPortal(portal, returnFiber.mode, lanes), current2.return = returnFiber, current2;
    current2 = useFiber(current2, portal.children || []);
    current2.return = returnFiber;
    return current2;
  }
  function updateFragment(returnFiber, current2, fragment, lanes, key) {
    if (null === current2 || 7 !== current2.tag)
      return current2 = createFiberFromFragment(
        fragment,
        returnFiber.mode,
        lanes,
        key
      ), current2.return = returnFiber, current2;
    current2 = useFiber(current2, fragment);
    current2.return = returnFiber;
    return current2;
  }
  function createChild(returnFiber, newChild, lanes) {
    if ("string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild)
      return newChild = createFiberFromText(
        "" + newChild,
        returnFiber.mode,
        lanes
      ), newChild.return = returnFiber, newChild;
    if ("object" === typeof newChild && null !== newChild) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          return lanes = createFiberFromTypeAndProps(
            newChild.type,
            newChild.key,
            newChild.props,
            null,
            returnFiber.mode,
            lanes
          ), coerceRef(lanes, newChild), lanes.return = returnFiber, lanes;
        case REACT_PORTAL_TYPE:
          return newChild = createFiberFromPortal(
            newChild,
            returnFiber.mode,
            lanes
          ), newChild.return = returnFiber, newChild;
        case REACT_LAZY_TYPE:
          var init = newChild._init;
          newChild = init(newChild._payload);
          return createChild(returnFiber, newChild, lanes);
      }
      if (isArrayImpl(newChild) || getIteratorFn(newChild))
        return newChild = createFiberFromFragment(
          newChild,
          returnFiber.mode,
          lanes,
          null
        ), newChild.return = returnFiber, newChild;
      if ("function" === typeof newChild.then)
        return createChild(returnFiber, unwrapThenable(newChild), lanes);
      if (newChild.$$typeof === REACT_CONTEXT_TYPE)
        return createChild(
          returnFiber,
          readContextDuringReconciliation(returnFiber, newChild),
          lanes
        );
      throwOnInvalidObjectType(returnFiber, newChild);
    }
    return null;
  }
  function updateSlot(returnFiber, oldFiber, newChild, lanes) {
    var key = null !== oldFiber ? oldFiber.key : null;
    if ("string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild)
      return null !== key ? null : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
    if ("object" === typeof newChild && null !== newChild) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          return newChild.key === key ? updateElement(returnFiber, oldFiber, newChild, lanes) : null;
        case REACT_PORTAL_TYPE:
          return newChild.key === key ? updatePortal(returnFiber, oldFiber, newChild, lanes) : null;
        case REACT_LAZY_TYPE:
          return key = newChild._init, newChild = key(newChild._payload), updateSlot(returnFiber, oldFiber, newChild, lanes);
      }
      if (isArrayImpl(newChild) || getIteratorFn(newChild))
        return null !== key ? null : updateFragment(returnFiber, oldFiber, newChild, lanes, null);
      if ("function" === typeof newChild.then)
        return updateSlot(
          returnFiber,
          oldFiber,
          unwrapThenable(newChild),
          lanes
        );
      if (newChild.$$typeof === REACT_CONTEXT_TYPE)
        return updateSlot(
          returnFiber,
          oldFiber,
          readContextDuringReconciliation(returnFiber, newChild),
          lanes
        );
      throwOnInvalidObjectType(returnFiber, newChild);
    }
    return null;
  }
  function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) {
    if ("string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild)
      return existingChildren = existingChildren.get(newIdx) || null, updateTextNode(returnFiber, existingChildren, "" + newChild, lanes);
    if ("object" === typeof newChild && null !== newChild) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          return existingChildren = existingChildren.get(
            null === newChild.key ? newIdx : newChild.key
          ) || null, updateElement(returnFiber, existingChildren, newChild, lanes);
        case REACT_PORTAL_TYPE:
          return existingChildren = existingChildren.get(
            null === newChild.key ? newIdx : newChild.key
          ) || null, updatePortal(returnFiber, existingChildren, newChild, lanes);
        case REACT_LAZY_TYPE:
          var init = newChild._init;
          newChild = init(newChild._payload);
          return updateFromMap(
            existingChildren,
            returnFiber,
            newIdx,
            newChild,
            lanes
          );
      }
      if (isArrayImpl(newChild) || getIteratorFn(newChild))
        return existingChildren = existingChildren.get(newIdx) || null, updateFragment(returnFiber, existingChildren, newChild, lanes, null);
      if ("function" === typeof newChild.then)
        return updateFromMap(
          existingChildren,
          returnFiber,
          newIdx,
          unwrapThenable(newChild),
          lanes
        );
      if (newChild.$$typeof === REACT_CONTEXT_TYPE)
        return updateFromMap(
          existingChildren,
          returnFiber,
          newIdx,
          readContextDuringReconciliation(returnFiber, newChild),
          lanes
        );
      throwOnInvalidObjectType(returnFiber, newChild);
    }
    return null;
  }
  function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {
    for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, newIdx = currentFirstChild = 0, nextOldFiber = null; null !== oldFiber && newIdx < newChildren.length; newIdx++) {
      oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling;
      var newFiber = updateSlot(
        returnFiber,
        oldFiber,
        newChildren[newIdx],
        lanes
      );
      if (null === newFiber) {
        null === oldFiber && (oldFiber = nextOldFiber);
        break;
      }
      shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber);
      currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
      null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber;
      previousNewFiber = newFiber;
      oldFiber = nextOldFiber;
    }
    if (newIdx === newChildren.length)
      return deleteRemainingChildren(returnFiber, oldFiber), isHydrating && pushTreeFork(returnFiber, newIdx), resultingFirstChild;
    if (null === oldFiber) {
      for (; newIdx < newChildren.length; newIdx++)
        oldFiber = createChild(returnFiber, newChildren[newIdx], lanes), null !== oldFiber && (currentFirstChild = placeChild(
          oldFiber,
          currentFirstChild,
          newIdx
        ), null === previousNewFiber ? resultingFirstChild = oldFiber : previousNewFiber.sibling = oldFiber, previousNewFiber = oldFiber);
      isHydrating && pushTreeFork(returnFiber, newIdx);
      return resultingFirstChild;
    }
    for (oldFiber = mapRemainingChildren(oldFiber); newIdx < newChildren.length; newIdx++)
      nextOldFiber = updateFromMap(
        oldFiber,
        returnFiber,
        newIdx,
        newChildren[newIdx],
        lanes
      ), null !== nextOldFiber && (shouldTrackSideEffects && null !== nextOldFiber.alternate && oldFiber.delete(
        null === nextOldFiber.key ? newIdx : nextOldFiber.key
      ), currentFirstChild = placeChild(
        nextOldFiber,
        currentFirstChild,
        newIdx
      ), null === previousNewFiber ? resultingFirstChild = nextOldFiber : previousNewFiber.sibling = nextOldFiber, previousNewFiber = nextOldFiber);
    shouldTrackSideEffects && oldFiber.forEach(function(child) {
      return deleteChild(returnFiber, child);
    });
    isHydrating && pushTreeFork(returnFiber, newIdx);
    return resultingFirstChild;
  }
  function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildren, lanes) {
    if (null == newChildren) throw Error(formatProdErrorMessage$2(151));
    for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, newIdx = currentFirstChild = 0, nextOldFiber = null, step = newChildren.next(); null !== oldFiber && !step.done; newIdx++, step = newChildren.next()) {
      oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling;
      var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
      if (null === newFiber) {
        null === oldFiber && (oldFiber = nextOldFiber);
        break;
      }
      shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber);
      currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
      null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber;
      previousNewFiber = newFiber;
      oldFiber = nextOldFiber;
    }
    if (step.done)
      return deleteRemainingChildren(returnFiber, oldFiber), isHydrating && pushTreeFork(returnFiber, newIdx), resultingFirstChild;
    if (null === oldFiber) {
      for (; !step.done; newIdx++, step = newChildren.next())
        step = createChild(returnFiber, step.value, lanes), null !== step && (currentFirstChild = placeChild(step, currentFirstChild, newIdx), null === previousNewFiber ? resultingFirstChild = step : previousNewFiber.sibling = step, previousNewFiber = step);
      isHydrating && pushTreeFork(returnFiber, newIdx);
      return resultingFirstChild;
    }
    for (oldFiber = mapRemainingChildren(oldFiber); !step.done; newIdx++, step = newChildren.next())
      step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes), null !== step && (shouldTrackSideEffects && null !== step.alternate && oldFiber.delete(null === step.key ? newIdx : step.key), currentFirstChild = placeChild(step, currentFirstChild, newIdx), null === previousNewFiber ? resultingFirstChild = step : previousNewFiber.sibling = step, previousNewFiber = step);
    shouldTrackSideEffects && oldFiber.forEach(function(child) {
      return deleteChild(returnFiber, child);
    });
    isHydrating && pushTreeFork(returnFiber, newIdx);
    return resultingFirstChild;
  }
  function reconcileChildFibersImpl(returnFiber, currentFirstChild, newChild, lanes) {
    "object" === typeof newChild && null !== newChild && newChild.type === REACT_FRAGMENT_TYPE && null === newChild.key && (newChild = newChild.props.children);
    if ("object" === typeof newChild && null !== newChild) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          a: {
            for (var key = newChild.key; null !== currentFirstChild; ) {
              if (currentFirstChild.key === key) {
                key = newChild.type;
                if (key === REACT_FRAGMENT_TYPE) {
                  if (7 === currentFirstChild.tag) {
                    deleteRemainingChildren(
                      returnFiber,
                      currentFirstChild.sibling
                    );
                    lanes = useFiber(
                      currentFirstChild,
                      newChild.props.children
                    );
                    lanes.return = returnFiber;
                    returnFiber = lanes;
                    break a;
                  }
                } else if (currentFirstChild.elementType === key || "object" === typeof key && null !== key && key.$$typeof === REACT_LAZY_TYPE && resolveLazy(key) === currentFirstChild.type) {
                  deleteRemainingChildren(
                    returnFiber,
                    currentFirstChild.sibling
                  );
                  lanes = useFiber(currentFirstChild, newChild.props);
                  coerceRef(lanes, newChild);
                  lanes.return = returnFiber;
                  returnFiber = lanes;
                  break a;
                }
                deleteRemainingChildren(returnFiber, currentFirstChild);
                break;
              } else deleteChild(returnFiber, currentFirstChild);
              currentFirstChild = currentFirstChild.sibling;
            }
            newChild.type === REACT_FRAGMENT_TYPE ? (lanes = createFiberFromFragment(
              newChild.props.children,
              returnFiber.mode,
              lanes,
              newChild.key
            ), lanes.return = returnFiber, returnFiber = lanes) : (lanes = createFiberFromTypeAndProps(
              newChild.type,
              newChild.key,
              newChild.props,
              null,
              returnFiber.mode,
              lanes
            ), coerceRef(lanes, newChild), lanes.return = returnFiber, returnFiber = lanes);
          }
          return placeSingleChild(returnFiber);
        case REACT_PORTAL_TYPE:
          a: {
            for (key = newChild.key; null !== currentFirstChild; ) {
              if (currentFirstChild.key === key)
                if (4 === currentFirstChild.tag && currentFirstChild.stateNode.containerInfo === newChild.containerInfo && currentFirstChild.stateNode.implementation === newChild.implementation) {
                  deleteRemainingChildren(
                    returnFiber,
                    currentFirstChild.sibling
                  );
                  lanes = useFiber(currentFirstChild, newChild.children || []);
                  lanes.return = returnFiber;
                  returnFiber = lanes;
                  break a;
                } else {
                  deleteRemainingChildren(returnFiber, currentFirstChild);
                  break;
                }
              else deleteChild(returnFiber, currentFirstChild);
              currentFirstChild = currentFirstChild.sibling;
            }
            lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes);
            lanes.return = returnFiber;
            returnFiber = lanes;
          }
          return placeSingleChild(returnFiber);
        case REACT_LAZY_TYPE:
          return key = newChild._init, newChild = key(newChild._payload), reconcileChildFibersImpl(
            returnFiber,
            currentFirstChild,
            newChild,
            lanes
          );
      }
      if (isArrayImpl(newChild))
        return reconcileChildrenArray(
          returnFiber,
          currentFirstChild,
          newChild,
          lanes
        );
      if (getIteratorFn(newChild)) {
        key = getIteratorFn(newChild);
        if ("function" !== typeof key) throw Error(formatProdErrorMessage$2(150));
        newChild = key.call(newChild);
        return reconcileChildrenIterator(
          returnFiber,
          currentFirstChild,
          newChild,
          lanes
        );
      }
      if ("function" === typeof newChild.then)
        return reconcileChildFibersImpl(
          returnFiber,
          currentFirstChild,
          unwrapThenable(newChild),
          lanes
        );
      if (newChild.$$typeof === REACT_CONTEXT_TYPE)
        return reconcileChildFibersImpl(
          returnFiber,
          currentFirstChild,
          readContextDuringReconciliation(returnFiber, newChild),
          lanes
        );
      throwOnInvalidObjectType(returnFiber, newChild);
    }
    return "string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild ? (newChild = "" + newChild, null !== currentFirstChild && 6 === currentFirstChild.tag ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), lanes = useFiber(currentFirstChild, newChild), lanes.return = returnFiber, returnFiber = lanes) : (deleteRemainingChildren(returnFiber, currentFirstChild), lanes = createFiberFromText(newChild, returnFiber.mode, lanes), lanes.return = returnFiber, returnFiber = lanes), placeSingleChild(returnFiber)) : deleteRemainingChildren(returnFiber, currentFirstChild);
  }
  return function(returnFiber, currentFirstChild, newChild, lanes) {
    try {
      thenableIndexCounter = 0;
      var firstChildFiber = reconcileChildFibersImpl(
        returnFiber,
        currentFirstChild,
        newChild,
        lanes
      );
      thenableState = null;
      return firstChildFiber;
    } catch (x) {
      if (x === SuspenseException || x === SuspenseActionException) throw x;
      var fiber = createFiberImplClass(29, x, null, returnFiber.mode);
      fiber.lanes = lanes;
      fiber.return = returnFiber;
      return fiber;
    } finally {
    }
  };
}
var reconcileChildFibers = createChildReconciler(true), mountChildFibers = createChildReconciler(false), suspenseHandlerStackCursor = createCursor(null), shellBoundary = null;
function pushPrimaryTreeSuspenseHandler(handler) {
  var current2 = handler.alternate;
  push(suspenseStackCursor, suspenseStackCursor.current & 1);
  push(suspenseHandlerStackCursor, handler);
  null === shellBoundary && (null === current2 || null !== currentTreeHiddenStackCursor.current ? shellBoundary = handler : null !== current2.memoizedState && (shellBoundary = handler));
}
function pushOffscreenSuspenseHandler(fiber) {
  if (22 === fiber.tag) {
    if (push(suspenseStackCursor, suspenseStackCursor.current), push(suspenseHandlerStackCursor, fiber), null === shellBoundary) {
      var current2 = fiber.alternate;
      null !== current2 && null !== current2.memoizedState && (shellBoundary = fiber);
    }
  } else reuseSuspenseHandlerOnStack();
}
function reuseSuspenseHandlerOnStack() {
  push(suspenseStackCursor, suspenseStackCursor.current);
  push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current);
}
function popSuspenseHandler(fiber) {
  pop(suspenseHandlerStackCursor);
  shellBoundary === fiber && (shellBoundary = null);
  pop(suspenseStackCursor);
}
var suspenseStackCursor = createCursor(0);
function findFirstSuspended(row) {
  for (var node = row; null !== node; ) {
    if (13 === node.tag) {
      var state = node.memoizedState;
      if (null !== state && (state = state.dehydrated, null === state || "$?" === state.data || isSuspenseInstanceFallback(state)))
        return node;
    } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) {
      if (0 !== (node.flags & 128)) return node;
    } else if (null !== node.child) {
      node.child.return = node;
      node = node.child;
      continue;
    }
    if (node === row) break;
    for (; null === node.sibling; ) {
      if (null === node.return || node.return === row) return null;
      node = node.return;
    }
    node.sibling.return = node.return;
    node = node.sibling;
  }
  return null;
}
function applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, nextProps) {
  ctor = workInProgress2.memoizedState;
  getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor);
  getDerivedStateFromProps = null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps ? ctor : assign({}, ctor, getDerivedStateFromProps);
  workInProgress2.memoizedState = getDerivedStateFromProps;
  0 === workInProgress2.lanes && (workInProgress2.updateQueue.baseState = getDerivedStateFromProps);
}
var classComponentUpdater = {
  enqueueSetState: function(inst, payload, callback) {
    inst = inst._reactInternals;
    var lane = requestUpdateLane(), update = createUpdate(lane);
    update.payload = payload;
    void 0 !== callback && null !== callback && (update.callback = callback);
    payload = enqueueUpdate(inst, update, lane);
    null !== payload && (scheduleUpdateOnFiber(payload, inst, lane), entangleTransitions(payload, inst, lane));
  },
  enqueueReplaceState: function(inst, payload, callback) {
    inst = inst._reactInternals;
    var lane = requestUpdateLane(), update = createUpdate(lane);
    update.tag = 1;
    update.payload = payload;
    void 0 !== callback && null !== callback && (update.callback = callback);
    payload = enqueueUpdate(inst, update, lane);
    null !== payload && (scheduleUpdateOnFiber(payload, inst, lane), entangleTransitions(payload, inst, lane));
  },
  enqueueForceUpdate: function(inst, callback) {
    inst = inst._reactInternals;
    var lane = requestUpdateLane(), update = createUpdate(lane);
    update.tag = 2;
    void 0 !== callback && null !== callback && (update.callback = callback);
    callback = enqueueUpdate(inst, update, lane);
    null !== callback && (scheduleUpdateOnFiber(callback, inst, lane), entangleTransitions(callback, inst, lane));
  }
};
function checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) {
  workInProgress2 = workInProgress2.stateNode;
  return "function" === typeof workInProgress2.shouldComponentUpdate ? workInProgress2.shouldComponentUpdate(newProps, newState, nextContext) : ctor.prototype && ctor.prototype.isPureReactComponent ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) : true;
}
function callComponentWillReceiveProps(workInProgress2, instance2, newProps, nextContext) {
  workInProgress2 = instance2.state;
  "function" === typeof instance2.componentWillReceiveProps && instance2.componentWillReceiveProps(newProps, nextContext);
  "function" === typeof instance2.UNSAFE_componentWillReceiveProps && instance2.UNSAFE_componentWillReceiveProps(newProps, nextContext);
  instance2.state !== workInProgress2 && classComponentUpdater.enqueueReplaceState(instance2, instance2.state, null);
}
function resolveClassComponentProps(Component2, baseProps) {
  var newProps = baseProps;
  if ("ref" in baseProps) {
    newProps = {};
    for (var propName in baseProps)
      "ref" !== propName && (newProps[propName] = baseProps[propName]);
  }
  if (Component2 = Component2.defaultProps) {
    newProps === baseProps && (newProps = assign({}, newProps));
    for (var propName$73 in Component2)
      void 0 === newProps[propName$73] && (newProps[propName$73] = Component2[propName$73]);
  }
  return newProps;
}
var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
  if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
    var event = new window.ErrorEvent("error", {
      bubbles: true,
      cancelable: true,
      message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
      error
    });
    if (!window.dispatchEvent(event)) return;
  } else if ("object" === typeof process && "function" === typeof process.emit) {
    process.emit("uncaughtException", error);
    return;
  }
  console.error(error);
};
function defaultOnUncaughtError(error) {
  reportGlobalError(error);
}
function defaultOnCaughtError(error) {
  console.error(error);
}
function defaultOnRecoverableError(error) {
  reportGlobalError(error);
}
function logUncaughtError(root2, errorInfo) {
  try {
    var onUncaughtError = root2.onUncaughtError;
    onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack });
  } catch (e$74) {
    setTimeout(function() {
      throw e$74;
    });
  }
}
function logCaughtError(root2, boundary, errorInfo) {
  try {
    var onCaughtError = root2.onCaughtError;
    onCaughtError(errorInfo.value, {
      componentStack: errorInfo.stack,
      errorBoundary: 1 === boundary.tag ? boundary.stateNode : null
    });
  } catch (e$75) {
    setTimeout(function() {
      throw e$75;
    });
  }
}
function createRootErrorUpdate(root2, errorInfo, lane) {
  lane = createUpdate(lane);
  lane.tag = 3;
  lane.payload = { element: null };
  lane.callback = function() {
    logUncaughtError(root2, errorInfo);
  };
  return lane;
}
function createClassErrorUpdate(lane) {
  lane = createUpdate(lane);
  lane.tag = 3;
  return lane;
}
function initializeClassErrorUpdate(update, root2, fiber, errorInfo) {
  var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
  if ("function" === typeof getDerivedStateFromError) {
    var error = errorInfo.value;
    update.payload = function() {
      return getDerivedStateFromError(error);
    };
    update.callback = function() {
      logCaughtError(root2, fiber, errorInfo);
    };
  }
  var inst = fiber.stateNode;
  null !== inst && "function" === typeof inst.componentDidCatch && (update.callback = function() {
    logCaughtError(root2, fiber, errorInfo);
    "function" !== typeof getDerivedStateFromError && (null === legacyErrorBoundariesThatAlreadyFailed ? legacyErrorBoundariesThatAlreadyFailed = /* @__PURE__ */ new Set([this]) : legacyErrorBoundariesThatAlreadyFailed.add(this));
    var stack = errorInfo.stack;
    this.componentDidCatch(errorInfo.value, {
      componentStack: null !== stack ? stack : ""
    });
  });
}
function throwException(root2, returnFiber, sourceFiber, value, rootRenderLanes) {
  sourceFiber.flags |= 32768;
  if (null !== value && "object" === typeof value && "function" === typeof value.then) {
    returnFiber = sourceFiber.alternate;
    null !== returnFiber && propagateParentContextChanges(
      returnFiber,
      sourceFiber,
      rootRenderLanes,
      true
    );
    sourceFiber = suspenseHandlerStackCursor.current;
    if (null !== sourceFiber) {
      switch (sourceFiber.tag) {
        case 13:
          return null === shellBoundary ? renderDidSuspendDelayIfPossible() : null === sourceFiber.alternate && 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 3), sourceFiber.flags &= -257, sourceFiber.flags |= 65536, sourceFiber.lanes = rootRenderLanes, value === noopSuspenseyCommitThenable ? sourceFiber.flags |= 16384 : (returnFiber = sourceFiber.updateQueue, null === returnFiber ? sourceFiber.updateQueue = /* @__PURE__ */ new Set([value]) : returnFiber.add(value), attachPingListener(root2, value, rootRenderLanes)), false;
        case 22:
          return sourceFiber.flags |= 65536, value === noopSuspenseyCommitThenable ? sourceFiber.flags |= 16384 : (returnFiber = sourceFiber.updateQueue, null === returnFiber ? (returnFiber = {
            transitions: null,
            markerInstances: null,
            retryQueue: /* @__PURE__ */ new Set([value])
          }, sourceFiber.updateQueue = returnFiber) : (sourceFiber = returnFiber.retryQueue, null === sourceFiber ? returnFiber.retryQueue = /* @__PURE__ */ new Set([value]) : sourceFiber.add(value)), attachPingListener(root2, value, rootRenderLanes)), false;
      }
      throw Error(formatProdErrorMessage$2(435, sourceFiber.tag));
    }
    attachPingListener(root2, value, rootRenderLanes);
    renderDidSuspendDelayIfPossible();
    return false;
  }
  if (isHydrating)
    return returnFiber = suspenseHandlerStackCursor.current, null !== returnFiber ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256), returnFiber.flags |= 65536, returnFiber.lanes = rootRenderLanes, value !== HydrationMismatchException && (root2 = Error(formatProdErrorMessage$2(422), { cause: value }), queueHydrationError(createCapturedValueAtFiber(root2, sourceFiber)))) : (value !== HydrationMismatchException && (returnFiber = Error(formatProdErrorMessage$2(423), {
      cause: value
    }), queueHydrationError(
      createCapturedValueAtFiber(returnFiber, sourceFiber)
    )), root2 = root2.current.alternate, root2.flags |= 65536, rootRenderLanes &= -rootRenderLanes, root2.lanes |= rootRenderLanes, value = createCapturedValueAtFiber(value, sourceFiber), rootRenderLanes = createRootErrorUpdate(
      root2.stateNode,
      value,
      rootRenderLanes
    ), enqueueCapturedUpdate(root2, rootRenderLanes), 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2)), false;
  var wrapperError = Error(formatProdErrorMessage$2(520), { cause: value });
  wrapperError = createCapturedValueAtFiber(wrapperError, sourceFiber);
  null === workInProgressRootConcurrentErrors ? workInProgressRootConcurrentErrors = [wrapperError] : workInProgressRootConcurrentErrors.push(wrapperError);
  4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2);
  if (null === returnFiber) return true;
  value = createCapturedValueAtFiber(value, sourceFiber);
  sourceFiber = returnFiber;
  do {
    switch (sourceFiber.tag) {
      case 3:
        return sourceFiber.flags |= 65536, root2 = rootRenderLanes & -rootRenderLanes, sourceFiber.lanes |= root2, root2 = createRootErrorUpdate(sourceFiber.stateNode, value, root2), enqueueCapturedUpdate(sourceFiber, root2), false;
      case 1:
        if (returnFiber = sourceFiber.type, wrapperError = sourceFiber.stateNode, 0 === (sourceFiber.flags & 128) && ("function" === typeof returnFiber.getDerivedStateFromError || null !== wrapperError && "function" === typeof wrapperError.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(wrapperError))))
          return sourceFiber.flags |= 65536, rootRenderLanes &= -rootRenderLanes, sourceFiber.lanes |= rootRenderLanes, rootRenderLanes = createClassErrorUpdate(rootRenderLanes), initializeClassErrorUpdate(
            rootRenderLanes,
            root2,
            sourceFiber,
            value
          ), enqueueCapturedUpdate(sourceFiber, rootRenderLanes), false;
    }
    sourceFiber = sourceFiber.return;
  } while (null !== sourceFiber);
  return false;
}
var SelectiveHydrationException = Error(formatProdErrorMessage$2(461)), didReceiveUpdate = false;
function reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2) {
  workInProgress2.child = null === current2 ? mountChildFibers(workInProgress2, null, nextChildren, renderLanes2) : reconcileChildFibers(
    workInProgress2,
    current2.child,
    nextChildren,
    renderLanes2
  );
}
function updateForwardRef(current2, workInProgress2, Component2, nextProps, renderLanes2) {
  Component2 = Component2.render;
  var ref = workInProgress2.ref;
  if ("ref" in nextProps) {
    var propsWithoutRef = {};
    for (var key in nextProps)
      "ref" !== key && (propsWithoutRef[key] = nextProps[key]);
  } else propsWithoutRef = nextProps;
  prepareToReadContext(workInProgress2);
  nextProps = renderWithHooks(
    current2,
    workInProgress2,
    Component2,
    propsWithoutRef,
    ref,
    renderLanes2
  );
  key = checkDidRenderIdHook();
  if (null !== current2 && !didReceiveUpdate)
    return bailoutHooks(current2, workInProgress2, renderLanes2), bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
  isHydrating && key && pushMaterializedTreeId(workInProgress2);
  workInProgress2.flags |= 1;
  reconcileChildren(current2, workInProgress2, nextProps, renderLanes2);
  return workInProgress2.child;
}
function updateMemoComponent(current2, workInProgress2, Component2, nextProps, renderLanes2) {
  if (null === current2) {
    var type = Component2.type;
    if ("function" === typeof type && !shouldConstruct(type) && void 0 === type.defaultProps && null === Component2.compare)
      return workInProgress2.tag = 15, workInProgress2.type = type, updateSimpleMemoComponent(
        current2,
        workInProgress2,
        type,
        nextProps,
        renderLanes2
      );
    current2 = createFiberFromTypeAndProps(
      Component2.type,
      null,
      nextProps,
      workInProgress2,
      workInProgress2.mode,
      renderLanes2
    );
    current2.ref = workInProgress2.ref;
    current2.return = workInProgress2;
    return workInProgress2.child = current2;
  }
  type = current2.child;
  if (!checkScheduledUpdateOrContext(current2, renderLanes2)) {
    var prevProps = type.memoizedProps;
    Component2 = Component2.compare;
    Component2 = null !== Component2 ? Component2 : shallowEqual;
    if (Component2(prevProps, nextProps) && current2.ref === workInProgress2.ref)
      return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
  }
  workInProgress2.flags |= 1;
  current2 = createWorkInProgress(type, nextProps);
  current2.ref = workInProgress2.ref;
  current2.return = workInProgress2;
  return workInProgress2.child = current2;
}
function updateSimpleMemoComponent(current2, workInProgress2, Component2, nextProps, renderLanes2) {
  if (null !== current2) {
    var prevProps = current2.memoizedProps;
    if (shallowEqual(prevProps, nextProps) && current2.ref === workInProgress2.ref)
      if (didReceiveUpdate = false, workInProgress2.pendingProps = nextProps = prevProps, checkScheduledUpdateOrContext(current2, renderLanes2))
        0 !== (current2.flags & 131072) && (didReceiveUpdate = true);
      else
        return workInProgress2.lanes = current2.lanes, bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
  }
  return updateFunctionComponent(
    current2,
    workInProgress2,
    Component2,
    nextProps,
    renderLanes2
  );
}
function updateOffscreenComponent(current2, workInProgress2, renderLanes2) {
  var nextProps = workInProgress2.pendingProps, nextChildren = nextProps.children, prevState = null !== current2 ? current2.memoizedState : null;
  if ("hidden" === nextProps.mode) {
    if (0 !== (workInProgress2.flags & 128)) {
      nextProps = null !== prevState ? prevState.baseLanes | renderLanes2 : renderLanes2;
      if (null !== current2) {
        nextChildren = workInProgress2.child = current2.child;
        for (prevState = 0; null !== nextChildren; )
          prevState = prevState | nextChildren.lanes | nextChildren.childLanes, nextChildren = nextChildren.sibling;
        workInProgress2.childLanes = prevState & ~nextProps;
      } else workInProgress2.childLanes = 0, workInProgress2.child = null;
      return deferHiddenOffscreenComponent(
        current2,
        workInProgress2,
        nextProps,
        renderLanes2
      );
    }
    if (0 !== (renderLanes2 & 536870912))
      workInProgress2.memoizedState = { baseLanes: 0, cachePool: null }, null !== current2 && pushTransition(
        workInProgress2,
        null !== prevState ? prevState.cachePool : null
      ), null !== prevState ? pushHiddenContext(workInProgress2, prevState) : reuseHiddenContextOnStack(), pushOffscreenSuspenseHandler(workInProgress2);
    else
      return workInProgress2.lanes = workInProgress2.childLanes = 536870912, deferHiddenOffscreenComponent(
        current2,
        workInProgress2,
        null !== prevState ? prevState.baseLanes | renderLanes2 : renderLanes2,
        renderLanes2
      );
  } else
    null !== prevState ? (pushTransition(workInProgress2, prevState.cachePool), pushHiddenContext(workInProgress2, prevState), reuseSuspenseHandlerOnStack(), workInProgress2.memoizedState = null) : (null !== current2 && pushTransition(workInProgress2, null), reuseHiddenContextOnStack(), reuseSuspenseHandlerOnStack());
  reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
  return workInProgress2.child;
}
function deferHiddenOffscreenComponent(current2, workInProgress2, nextBaseLanes, renderLanes2) {
  var JSCompiler_inline_result = peekCacheFromPool();
  JSCompiler_inline_result = null === JSCompiler_inline_result ? null : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result };
  workInProgress2.memoizedState = {
    baseLanes: nextBaseLanes,
    cachePool: JSCompiler_inline_result
  };
  null !== current2 && pushTransition(workInProgress2, null);
  reuseHiddenContextOnStack();
  pushOffscreenSuspenseHandler(workInProgress2);
  null !== current2 && propagateParentContextChanges(current2, workInProgress2, renderLanes2, true);
  return null;
}
function markRef(current2, workInProgress2) {
  var ref = workInProgress2.ref;
  if (null === ref)
    null !== current2 && null !== current2.ref && (workInProgress2.flags |= 4194816);
  else {
    if ("function" !== typeof ref && "object" !== typeof ref)
      throw Error(formatProdErrorMessage$2(284));
    if (null === current2 || current2.ref !== ref)
      workInProgress2.flags |= 4194816;
  }
}
function updateFunctionComponent(current2, workInProgress2, Component2, nextProps, renderLanes2) {
  prepareToReadContext(workInProgress2);
  Component2 = renderWithHooks(
    current2,
    workInProgress2,
    Component2,
    nextProps,
    void 0,
    renderLanes2
  );
  nextProps = checkDidRenderIdHook();
  if (null !== current2 && !didReceiveUpdate)
    return bailoutHooks(current2, workInProgress2, renderLanes2), bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
  isHydrating && nextProps && pushMaterializedTreeId(workInProgress2);
  workInProgress2.flags |= 1;
  reconcileChildren(current2, workInProgress2, Component2, renderLanes2);
  return workInProgress2.child;
}
function replayFunctionComponent(current2, workInProgress2, nextProps, Component2, secondArg, renderLanes2) {
  prepareToReadContext(workInProgress2);
  workInProgress2.updateQueue = null;
  nextProps = renderWithHooksAgain(
    workInProgress2,
    Component2,
    nextProps,
    secondArg
  );
  finishRenderingHooks(current2);
  Component2 = checkDidRenderIdHook();
  if (null !== current2 && !didReceiveUpdate)
    return bailoutHooks(current2, workInProgress2, renderLanes2), bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
  isHydrating && Component2 && pushMaterializedTreeId(workInProgress2);
  workInProgress2.flags |= 1;
  reconcileChildren(current2, workInProgress2, nextProps, renderLanes2);
  return workInProgress2.child;
}
function updateClassComponent(current2, workInProgress2, Component2, nextProps, renderLanes2) {
  prepareToReadContext(workInProgress2);
  if (null === workInProgress2.stateNode) {
    var context = emptyContextObject, contextType = Component2.contextType;
    "object" === typeof contextType && null !== contextType && (context = readContext(contextType));
    context = new Component2(nextProps, context);
    workInProgress2.memoizedState = null !== context.state && void 0 !== context.state ? context.state : null;
    context.updater = classComponentUpdater;
    workInProgress2.stateNode = context;
    context._reactInternals = workInProgress2;
    context = workInProgress2.stateNode;
    context.props = nextProps;
    context.state = workInProgress2.memoizedState;
    context.refs = {};
    initializeUpdateQueue(workInProgress2);
    contextType = Component2.contextType;
    context.context = "object" === typeof contextType && null !== contextType ? readContext(contextType) : emptyContextObject;
    context.state = workInProgress2.memoizedState;
    contextType = Component2.getDerivedStateFromProps;
    "function" === typeof contextType && (applyDerivedStateFromProps(
      workInProgress2,
      Component2,
      contextType,
      nextProps
    ), context.state = workInProgress2.memoizedState);
    "function" === typeof Component2.getDerivedStateFromProps || "function" === typeof context.getSnapshotBeforeUpdate || "function" !== typeof context.UNSAFE_componentWillMount && "function" !== typeof context.componentWillMount || (contextType = context.state, "function" === typeof context.componentWillMount && context.componentWillMount(), "function" === typeof context.UNSAFE_componentWillMount && context.UNSAFE_componentWillMount(), contextType !== context.state && classComponentUpdater.enqueueReplaceState(context, context.state, null), processUpdateQueue(workInProgress2, nextProps, context, renderLanes2), suspendIfUpdateReadFromEntangledAsyncAction(), context.state = workInProgress2.memoizedState);
    "function" === typeof context.componentDidMount && (workInProgress2.flags |= 4194308);
    nextProps = true;
  } else if (null === current2) {
    context = workInProgress2.stateNode;
    var unresolvedOldProps = workInProgress2.memoizedProps, oldProps = resolveClassComponentProps(Component2, unresolvedOldProps);
    context.props = oldProps;
    var oldContext = context.context, contextType$jscomp$0 = Component2.contextType;
    contextType = emptyContextObject;
    "object" === typeof contextType$jscomp$0 && null !== contextType$jscomp$0 && (contextType = readContext(contextType$jscomp$0));
    var getDerivedStateFromProps = Component2.getDerivedStateFromProps;
    contextType$jscomp$0 = "function" === typeof getDerivedStateFromProps || "function" === typeof context.getSnapshotBeforeUpdate;
    unresolvedOldProps = workInProgress2.pendingProps !== unresolvedOldProps;
    contextType$jscomp$0 || "function" !== typeof context.UNSAFE_componentWillReceiveProps && "function" !== typeof context.componentWillReceiveProps || (unresolvedOldProps || oldContext !== contextType) && callComponentWillReceiveProps(
      workInProgress2,
      context,
      nextProps,
      contextType
    );
    hasForceUpdate = false;
    var oldState = workInProgress2.memoizedState;
    context.state = oldState;
    processUpdateQueue(workInProgress2, nextProps, context, renderLanes2);
    suspendIfUpdateReadFromEntangledAsyncAction();
    oldContext = workInProgress2.memoizedState;
    unresolvedOldProps || oldState !== oldContext || hasForceUpdate ? ("function" === typeof getDerivedStateFromProps && (applyDerivedStateFromProps(
      workInProgress2,
      Component2,
      getDerivedStateFromProps,
      nextProps
    ), oldContext = workInProgress2.memoizedState), (oldProps = hasForceUpdate || checkShouldComponentUpdate(
      workInProgress2,
      Component2,
      oldProps,
      nextProps,
      oldState,
      oldContext,
      contextType
    )) ? (contextType$jscomp$0 || "function" !== typeof context.UNSAFE_componentWillMount && "function" !== typeof context.componentWillMount || ("function" === typeof context.componentWillMount && context.componentWillMount(), "function" === typeof context.UNSAFE_componentWillMount && context.UNSAFE_componentWillMount()), "function" === typeof context.componentDidMount && (workInProgress2.flags |= 4194308)) : ("function" === typeof context.componentDidMount && (workInProgress2.flags |= 4194308), workInProgress2.memoizedProps = nextProps, workInProgress2.memoizedState = oldContext), context.props = nextProps, context.state = oldContext, context.context = contextType, nextProps = oldProps) : ("function" === typeof context.componentDidMount && (workInProgress2.flags |= 4194308), nextProps = false);
  } else {
    context = workInProgress2.stateNode;
    cloneUpdateQueue(current2, workInProgress2);
    contextType = workInProgress2.memoizedProps;
    contextType$jscomp$0 = resolveClassComponentProps(Component2, contextType);
    context.props = contextType$jscomp$0;
    getDerivedStateFromProps = workInProgress2.pendingProps;
    oldState = context.context;
    oldContext = Component2.contextType;
    oldProps = emptyContextObject;
    "object" === typeof oldContext && null !== oldContext && (oldProps = readContext(oldContext));
    unresolvedOldProps = Component2.getDerivedStateFromProps;
    (oldContext = "function" === typeof unresolvedOldProps || "function" === typeof context.getSnapshotBeforeUpdate) || "function" !== typeof context.UNSAFE_componentWillReceiveProps && "function" !== typeof context.componentWillReceiveProps || (contextType !== getDerivedStateFromProps || oldState !== oldProps) && callComponentWillReceiveProps(
      workInProgress2,
      context,
      nextProps,
      oldProps
    );
    hasForceUpdate = false;
    oldState = workInProgress2.memoizedState;
    context.state = oldState;
    processUpdateQueue(workInProgress2, nextProps, context, renderLanes2);
    suspendIfUpdateReadFromEntangledAsyncAction();
    var newState = workInProgress2.memoizedState;
    contextType !== getDerivedStateFromProps || oldState !== newState || hasForceUpdate || null !== current2 && null !== current2.dependencies && checkIfContextChanged(current2.dependencies) ? ("function" === typeof unresolvedOldProps && (applyDerivedStateFromProps(
      workInProgress2,
      Component2,
      unresolvedOldProps,
      nextProps
    ), newState = workInProgress2.memoizedState), (contextType$jscomp$0 = hasForceUpdate || checkShouldComponentUpdate(
      workInProgress2,
      Component2,
      contextType$jscomp$0,
      nextProps,
      oldState,
      newState,
      oldProps
    ) || null !== current2 && null !== current2.dependencies && checkIfContextChanged(current2.dependencies)) ? (oldContext || "function" !== typeof context.UNSAFE_componentWillUpdate && "function" !== typeof context.componentWillUpdate || ("function" === typeof context.componentWillUpdate && context.componentWillUpdate(nextProps, newState, oldProps), "function" === typeof context.UNSAFE_componentWillUpdate && context.UNSAFE_componentWillUpdate(
      nextProps,
      newState,
      oldProps
    )), "function" === typeof context.componentDidUpdate && (workInProgress2.flags |= 4), "function" === typeof context.getSnapshotBeforeUpdate && (workInProgress2.flags |= 1024)) : ("function" !== typeof context.componentDidUpdate || contextType === current2.memoizedProps && oldState === current2.memoizedState || (workInProgress2.flags |= 4), "function" !== typeof context.getSnapshotBeforeUpdate || contextType === current2.memoizedProps && oldState === current2.memoizedState || (workInProgress2.flags |= 1024), workInProgress2.memoizedProps = nextProps, workInProgress2.memoizedState = newState), context.props = nextProps, context.state = newState, context.context = oldProps, nextProps = contextType$jscomp$0) : ("function" !== typeof context.componentDidUpdate || contextType === current2.memoizedProps && oldState === current2.memoizedState || (workInProgress2.flags |= 4), "function" !== typeof context.getSnapshotBeforeUpdate || contextType === current2.memoizedProps && oldState === current2.memoizedState || (workInProgress2.flags |= 1024), nextProps = false);
  }
  context = nextProps;
  markRef(current2, workInProgress2);
  nextProps = 0 !== (workInProgress2.flags & 128);
  context || nextProps ? (context = workInProgress2.stateNode, Component2 = nextProps && "function" !== typeof Component2.getDerivedStateFromError ? null : context.render(), workInProgress2.flags |= 1, null !== current2 && nextProps ? (workInProgress2.child = reconcileChildFibers(
    workInProgress2,
    current2.child,
    null,
    renderLanes2
  ), workInProgress2.child = reconcileChildFibers(
    workInProgress2,
    null,
    Component2,
    renderLanes2
  )) : reconcileChildren(current2, workInProgress2, Component2, renderLanes2), workInProgress2.memoizedState = context.state, current2 = workInProgress2.child) : current2 = bailoutOnAlreadyFinishedWork(
    current2,
    workInProgress2,
    renderLanes2
  );
  return current2;
}
function mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2) {
  resetHydrationState();
  workInProgress2.flags |= 256;
  reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
  return workInProgress2.child;
}
var SUSPENDED_MARKER = {
  dehydrated: null,
  treeContext: null,
  retryLane: 0,
  hydrationErrors: null
};
function mountSuspenseOffscreenState(renderLanes2) {
  return { baseLanes: renderLanes2, cachePool: getSuspendedCache() };
}
function getRemainingWorkInPrimaryTree(current2, primaryTreeDidDefer, renderLanes2) {
  current2 = null !== current2 ? current2.childLanes & ~renderLanes2 : 0;
  primaryTreeDidDefer && (current2 |= workInProgressDeferredLane);
  return current2;
}
function updateSuspenseComponent(current2, workInProgress2, renderLanes2) {
  var nextProps = workInProgress2.pendingProps, showFallback = false, didSuspend = 0 !== (workInProgress2.flags & 128), JSCompiler_temp;
  (JSCompiler_temp = didSuspend) || (JSCompiler_temp = null !== current2 && null === current2.memoizedState ? false : 0 !== (suspenseStackCursor.current & 2));
  JSCompiler_temp && (showFallback = true, workInProgress2.flags &= -129);
  JSCompiler_temp = 0 !== (workInProgress2.flags & 32);
  workInProgress2.flags &= -33;
  if (null === current2) {
    if (isHydrating) {
      showFallback ? pushPrimaryTreeSuspenseHandler(workInProgress2) : reuseSuspenseHandlerOnStack();
      if (isHydrating) {
        var nextInstance = nextHydratableInstance, JSCompiler_temp$jscomp$0;
        if (JSCompiler_temp$jscomp$0 = nextInstance) {
          c: {
            JSCompiler_temp$jscomp$0 = nextInstance;
            for (nextInstance = rootOrSingletonContext; 8 !== JSCompiler_temp$jscomp$0.nodeType; ) {
              if (!nextInstance) {
                nextInstance = null;
                break c;
              }
              JSCompiler_temp$jscomp$0 = getNextHydratable(
                JSCompiler_temp$jscomp$0.nextSibling
              );
              if (null === JSCompiler_temp$jscomp$0) {
                nextInstance = null;
                break c;
              }
            }
            nextInstance = JSCompiler_temp$jscomp$0;
          }
          null !== nextInstance ? (workInProgress2.memoizedState = {
            dehydrated: nextInstance,
            treeContext: null !== treeContextProvider ? { id: treeContextId, overflow: treeContextOverflow } : null,
            retryLane: 536870912,
            hydrationErrors: null
          }, JSCompiler_temp$jscomp$0 = createFiberImplClass(
            18,
            null,
            null,
            0
          ), JSCompiler_temp$jscomp$0.stateNode = nextInstance, JSCompiler_temp$jscomp$0.return = workInProgress2, workInProgress2.child = JSCompiler_temp$jscomp$0, hydrationParentFiber = workInProgress2, nextHydratableInstance = null, JSCompiler_temp$jscomp$0 = true) : JSCompiler_temp$jscomp$0 = false;
        }
        JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress2);
      }
      nextInstance = workInProgress2.memoizedState;
      if (null !== nextInstance && (nextInstance = nextInstance.dehydrated, null !== nextInstance))
        return isSuspenseInstanceFallback(nextInstance) ? workInProgress2.lanes = 32 : workInProgress2.lanes = 536870912, null;
      popSuspenseHandler(workInProgress2);
    }
    nextInstance = nextProps.children;
    nextProps = nextProps.fallback;
    if (showFallback)
      return reuseSuspenseHandlerOnStack(), showFallback = workInProgress2.mode, nextInstance = mountWorkInProgressOffscreenFiber(
        { mode: "hidden", children: nextInstance },
        showFallback
      ), nextProps = createFiberFromFragment(
        nextProps,
        showFallback,
        renderLanes2,
        null
      ), nextInstance.return = workInProgress2, nextProps.return = workInProgress2, nextInstance.sibling = nextProps, workInProgress2.child = nextInstance, showFallback = workInProgress2.child, showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes2), showFallback.childLanes = getRemainingWorkInPrimaryTree(
        current2,
        JSCompiler_temp,
        renderLanes2
      ), workInProgress2.memoizedState = SUSPENDED_MARKER, nextProps;
    pushPrimaryTreeSuspenseHandler(workInProgress2);
    return mountSuspensePrimaryChildren(workInProgress2, nextInstance);
  }
  JSCompiler_temp$jscomp$0 = current2.memoizedState;
  if (null !== JSCompiler_temp$jscomp$0 && (nextInstance = JSCompiler_temp$jscomp$0.dehydrated, null !== nextInstance)) {
    if (didSuspend)
      workInProgress2.flags & 256 ? (pushPrimaryTreeSuspenseHandler(workInProgress2), workInProgress2.flags &= -257, workInProgress2 = retrySuspenseComponentWithoutHydrating(
        current2,
        workInProgress2,
        renderLanes2
      )) : null !== workInProgress2.memoizedState ? (reuseSuspenseHandlerOnStack(), workInProgress2.child = current2.child, workInProgress2.flags |= 128, workInProgress2 = null) : (reuseSuspenseHandlerOnStack(), showFallback = nextProps.fallback, nextInstance = workInProgress2.mode, nextProps = mountWorkInProgressOffscreenFiber(
        { mode: "visible", children: nextProps.children },
        nextInstance
      ), showFallback = createFiberFromFragment(
        showFallback,
        nextInstance,
        renderLanes2,
        null
      ), showFallback.flags |= 2, nextProps.return = workInProgress2, showFallback.return = workInProgress2, nextProps.sibling = showFallback, workInProgress2.child = nextProps, reconcileChildFibers(
        workInProgress2,
        current2.child,
        null,
        renderLanes2
      ), nextProps = workInProgress2.child, nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes2), nextProps.childLanes = getRemainingWorkInPrimaryTree(
        current2,
        JSCompiler_temp,
        renderLanes2
      ), workInProgress2.memoizedState = SUSPENDED_MARKER, workInProgress2 = showFallback);
    else if (pushPrimaryTreeSuspenseHandler(workInProgress2), isSuspenseInstanceFallback(nextInstance)) {
      JSCompiler_temp = nextInstance.nextSibling && nextInstance.nextSibling.dataset;
      if (JSCompiler_temp) var digest = JSCompiler_temp.dgst;
      JSCompiler_temp = digest;
      nextProps = Error(formatProdErrorMessage$2(419));
      nextProps.stack = "";
      nextProps.digest = JSCompiler_temp;
      queueHydrationError({ value: nextProps, source: null, stack: null });
      workInProgress2 = retrySuspenseComponentWithoutHydrating(
        current2,
        workInProgress2,
        renderLanes2
      );
    } else if (didReceiveUpdate || propagateParentContextChanges(current2, workInProgress2, renderLanes2, false), JSCompiler_temp = 0 !== (renderLanes2 & current2.childLanes), didReceiveUpdate || JSCompiler_temp) {
      JSCompiler_temp = workInProgressRoot;
      if (null !== JSCompiler_temp && (nextProps = renderLanes2 & -renderLanes2, nextProps = 0 !== (nextProps & 42) ? 1 : getBumpedLaneForHydrationByLane(nextProps), nextProps = 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes2)) ? 0 : nextProps, 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane))
        throw JSCompiler_temp$jscomp$0.retryLane = nextProps, enqueueConcurrentRenderForLane(current2, nextProps), scheduleUpdateOnFiber(JSCompiler_temp, current2, nextProps), SelectiveHydrationException;
      "$?" === nextInstance.data || renderDidSuspendDelayIfPossible();
      workInProgress2 = retrySuspenseComponentWithoutHydrating(
        current2,
        workInProgress2,
        renderLanes2
      );
    } else
      "$?" === nextInstance.data ? (workInProgress2.flags |= 192, workInProgress2.child = current2.child, workInProgress2 = null) : (current2 = JSCompiler_temp$jscomp$0.treeContext, nextHydratableInstance = getNextHydratable(
        nextInstance.nextSibling
      ), hydrationParentFiber = workInProgress2, isHydrating = true, hydrationErrors = null, rootOrSingletonContext = false, null !== current2 && (idStack[idStackIndex++] = treeContextId, idStack[idStackIndex++] = treeContextOverflow, idStack[idStackIndex++] = treeContextProvider, treeContextId = current2.id, treeContextOverflow = current2.overflow, treeContextProvider = workInProgress2), workInProgress2 = mountSuspensePrimaryChildren(
        workInProgress2,
        nextProps.children
      ), workInProgress2.flags |= 4096);
    return workInProgress2;
  }
  if (showFallback)
    return reuseSuspenseHandlerOnStack(), showFallback = nextProps.fallback, nextInstance = workInProgress2.mode, JSCompiler_temp$jscomp$0 = current2.child, digest = JSCompiler_temp$jscomp$0.sibling, nextProps = createWorkInProgress(JSCompiler_temp$jscomp$0, {
      mode: "hidden",
      children: nextProps.children
    }), nextProps.subtreeFlags = JSCompiler_temp$jscomp$0.subtreeFlags & 65011712, null !== digest ? showFallback = createWorkInProgress(digest, showFallback) : (showFallback = createFiberFromFragment(
      showFallback,
      nextInstance,
      renderLanes2,
      null
    ), showFallback.flags |= 2), showFallback.return = workInProgress2, nextProps.return = workInProgress2, nextProps.sibling = showFallback, workInProgress2.child = nextProps, nextProps = showFallback, showFallback = workInProgress2.child, nextInstance = current2.child.memoizedState, null === nextInstance ? nextInstance = mountSuspenseOffscreenState(renderLanes2) : (JSCompiler_temp$jscomp$0 = nextInstance.cachePool, null !== JSCompiler_temp$jscomp$0 ? (digest = CacheContext._currentValue, JSCompiler_temp$jscomp$0 = JSCompiler_temp$jscomp$0.parent !== digest ? { parent: digest, pool: digest } : JSCompiler_temp$jscomp$0) : JSCompiler_temp$jscomp$0 = getSuspendedCache(), nextInstance = {
      baseLanes: nextInstance.baseLanes | renderLanes2,
      cachePool: JSCompiler_temp$jscomp$0
    }), showFallback.memoizedState = nextInstance, showFallback.childLanes = getRemainingWorkInPrimaryTree(
      current2,
      JSCompiler_temp,
      renderLanes2
    ), workInProgress2.memoizedState = SUSPENDED_MARKER, nextProps;
  pushPrimaryTreeSuspenseHandler(workInProgress2);
  renderLanes2 = current2.child;
  current2 = renderLanes2.sibling;
  renderLanes2 = createWorkInProgress(renderLanes2, {
    mode: "visible",
    children: nextProps.children
  });
  renderLanes2.return = workInProgress2;
  renderLanes2.sibling = null;
  null !== current2 && (JSCompiler_temp = workInProgress2.deletions, null === JSCompiler_temp ? (workInProgress2.deletions = [current2], workInProgress2.flags |= 16) : JSCompiler_temp.push(current2));
  workInProgress2.child = renderLanes2;
  workInProgress2.memoizedState = null;
  return renderLanes2;
}
function mountSuspensePrimaryChildren(workInProgress2, primaryChildren) {
  primaryChildren = mountWorkInProgressOffscreenFiber(
    { mode: "visible", children: primaryChildren },
    workInProgress2.mode
  );
  primaryChildren.return = workInProgress2;
  return workInProgress2.child = primaryChildren;
}
function mountWorkInProgressOffscreenFiber(offscreenProps, mode) {
  offscreenProps = createFiberImplClass(22, offscreenProps, null, mode);
  offscreenProps.lanes = 0;
  offscreenProps.stateNode = {
    _visibility: 1,
    _pendingMarkers: null,
    _retryCache: null,
    _transitions: null
  };
  return offscreenProps;
}
function retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2) {
  reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
  current2 = mountSuspensePrimaryChildren(
    workInProgress2,
    workInProgress2.pendingProps.children
  );
  current2.flags |= 2;
  workInProgress2.memoizedState = null;
  return current2;
}
function scheduleSuspenseWorkOnFiber(fiber, renderLanes2, propagationRoot) {
  fiber.lanes |= renderLanes2;
  var alternate = fiber.alternate;
  null !== alternate && (alternate.lanes |= renderLanes2);
  scheduleContextWorkOnParentPath(fiber.return, renderLanes2, propagationRoot);
}
function initSuspenseListRenderState(workInProgress2, isBackwards, tail, lastContentRow, tailMode) {
  var renderState = workInProgress2.memoizedState;
  null === renderState ? workInProgress2.memoizedState = {
    isBackwards,
    rendering: null,
    renderingStartTime: 0,
    last: lastContentRow,
    tail,
    tailMode
  } : (renderState.isBackwards = isBackwards, renderState.rendering = null, renderState.renderingStartTime = 0, renderState.last = lastContentRow, renderState.tail = tail, renderState.tailMode = tailMode);
}
function updateSuspenseListComponent(current2, workInProgress2, renderLanes2) {
  var nextProps = workInProgress2.pendingProps, revealOrder = nextProps.revealOrder, tailMode = nextProps.tail;
  reconcileChildren(current2, workInProgress2, nextProps.children, renderLanes2);
  nextProps = suspenseStackCursor.current;
  if (0 !== (nextProps & 2))
    nextProps = nextProps & 1 | 2, workInProgress2.flags |= 128;
  else {
    if (null !== current2 && 0 !== (current2.flags & 128))
      a: for (current2 = workInProgress2.child; null !== current2; ) {
        if (13 === current2.tag)
          null !== current2.memoizedState && scheduleSuspenseWorkOnFiber(current2, renderLanes2, workInProgress2);
        else if (19 === current2.tag)
          scheduleSuspenseWorkOnFiber(current2, renderLanes2, workInProgress2);
        else if (null !== current2.child) {
          current2.child.return = current2;
          current2 = current2.child;
          continue;
        }
        if (current2 === workInProgress2) break a;
        for (; null === current2.sibling; ) {
          if (null === current2.return || current2.return === workInProgress2)
            break a;
          current2 = current2.return;
        }
        current2.sibling.return = current2.return;
        current2 = current2.sibling;
      }
    nextProps &= 1;
  }
  push(suspenseStackCursor, nextProps);
  switch (revealOrder) {
    case "forwards":
      renderLanes2 = workInProgress2.child;
      for (revealOrder = null; null !== renderLanes2; )
        current2 = renderLanes2.alternate, null !== current2 && null === findFirstSuspended(current2) && (revealOrder = renderLanes2), renderLanes2 = renderLanes2.sibling;
      renderLanes2 = revealOrder;
      null === renderLanes2 ? (revealOrder = workInProgress2.child, workInProgress2.child = null) : (revealOrder = renderLanes2.sibling, renderLanes2.sibling = null);
      initSuspenseListRenderState(
        workInProgress2,
        false,
        revealOrder,
        renderLanes2,
        tailMode
      );
      break;
    case "backwards":
      renderLanes2 = null;
      revealOrder = workInProgress2.child;
      for (workInProgress2.child = null; null !== revealOrder; ) {
        current2 = revealOrder.alternate;
        if (null !== current2 && null === findFirstSuspended(current2)) {
          workInProgress2.child = revealOrder;
          break;
        }
        current2 = revealOrder.sibling;
        revealOrder.sibling = renderLanes2;
        renderLanes2 = revealOrder;
        revealOrder = current2;
      }
      initSuspenseListRenderState(
        workInProgress2,
        true,
        renderLanes2,
        null,
        tailMode
      );
      break;
    case "together":
      initSuspenseListRenderState(workInProgress2, false, null, null, void 0);
      break;
    default:
      workInProgress2.memoizedState = null;
  }
  return workInProgress2.child;
}
function bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2) {
  null !== current2 && (workInProgress2.dependencies = current2.dependencies);
  workInProgressRootSkippedLanes |= workInProgress2.lanes;
  if (0 === (renderLanes2 & workInProgress2.childLanes))
    if (null !== current2) {
      if (propagateParentContextChanges(
        current2,
        workInProgress2,
        renderLanes2,
        false
      ), 0 === (renderLanes2 & workInProgress2.childLanes))
        return null;
    } else return null;
  if (null !== current2 && workInProgress2.child !== current2.child)
    throw Error(formatProdErrorMessage$2(153));
  if (null !== workInProgress2.child) {
    current2 = workInProgress2.child;
    renderLanes2 = createWorkInProgress(current2, current2.pendingProps);
    workInProgress2.child = renderLanes2;
    for (renderLanes2.return = workInProgress2; null !== current2.sibling; )
      current2 = current2.sibling, renderLanes2 = renderLanes2.sibling = createWorkInProgress(current2, current2.pendingProps), renderLanes2.return = workInProgress2;
    renderLanes2.sibling = null;
  }
  return workInProgress2.child;
}
function checkScheduledUpdateOrContext(current2, renderLanes2) {
  if (0 !== (current2.lanes & renderLanes2)) return true;
  current2 = current2.dependencies;
  return null !== current2 && checkIfContextChanged(current2) ? true : false;
}
function attemptEarlyBailoutIfNoScheduledUpdate(current2, workInProgress2, renderLanes2) {
  switch (workInProgress2.tag) {
    case 3:
      pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
      pushProvider(workInProgress2, CacheContext, current2.memoizedState.cache);
      resetHydrationState();
      break;
    case 27:
    case 5:
      pushHostContext(workInProgress2);
      break;
    case 4:
      pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
      break;
    case 10:
      pushProvider(
        workInProgress2,
        workInProgress2.type,
        workInProgress2.memoizedProps.value
      );
      break;
    case 13:
      var state = workInProgress2.memoizedState;
      if (null !== state) {
        if (null !== state.dehydrated)
          return pushPrimaryTreeSuspenseHandler(workInProgress2), workInProgress2.flags |= 128, null;
        if (0 !== (renderLanes2 & workInProgress2.child.childLanes))
          return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
        pushPrimaryTreeSuspenseHandler(workInProgress2);
        current2 = bailoutOnAlreadyFinishedWork(
          current2,
          workInProgress2,
          renderLanes2
        );
        return null !== current2 ? current2.sibling : null;
      }
      pushPrimaryTreeSuspenseHandler(workInProgress2);
      break;
    case 19:
      var didSuspendBefore = 0 !== (current2.flags & 128);
      state = 0 !== (renderLanes2 & workInProgress2.childLanes);
      state || (propagateParentContextChanges(
        current2,
        workInProgress2,
        renderLanes2,
        false
      ), state = 0 !== (renderLanes2 & workInProgress2.childLanes));
      if (didSuspendBefore) {
        if (state)
          return updateSuspenseListComponent(
            current2,
            workInProgress2,
            renderLanes2
          );
        workInProgress2.flags |= 128;
      }
      didSuspendBefore = workInProgress2.memoizedState;
      null !== didSuspendBefore && (didSuspendBefore.rendering = null, didSuspendBefore.tail = null, didSuspendBefore.lastEffect = null);
      push(suspenseStackCursor, suspenseStackCursor.current);
      if (state) break;
      else return null;
    case 22:
    case 23:
      return workInProgress2.lanes = 0, updateOffscreenComponent(current2, workInProgress2, renderLanes2);
    case 24:
      pushProvider(workInProgress2, CacheContext, current2.memoizedState.cache);
  }
  return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
}
function beginWork(current2, workInProgress2, renderLanes2) {
  if (null !== current2)
    if (current2.memoizedProps !== workInProgress2.pendingProps)
      didReceiveUpdate = true;
    else {
      if (!checkScheduledUpdateOrContext(current2, renderLanes2) && 0 === (workInProgress2.flags & 128))
        return didReceiveUpdate = false, attemptEarlyBailoutIfNoScheduledUpdate(
          current2,
          workInProgress2,
          renderLanes2
        );
      didReceiveUpdate = 0 !== (current2.flags & 131072) ? true : false;
    }
  else
    didReceiveUpdate = false, isHydrating && 0 !== (workInProgress2.flags & 1048576) && pushTreeId(workInProgress2, treeForkCount, workInProgress2.index);
  workInProgress2.lanes = 0;
  switch (workInProgress2.tag) {
    case 16:
      a: {
        current2 = workInProgress2.pendingProps;
        var lazyComponent = workInProgress2.elementType, init = lazyComponent._init;
        lazyComponent = init(lazyComponent._payload);
        workInProgress2.type = lazyComponent;
        if ("function" === typeof lazyComponent)
          shouldConstruct(lazyComponent) ? (current2 = resolveClassComponentProps(lazyComponent, current2), workInProgress2.tag = 1, workInProgress2 = updateClassComponent(
            null,
            workInProgress2,
            lazyComponent,
            current2,
            renderLanes2
          )) : (workInProgress2.tag = 0, workInProgress2 = updateFunctionComponent(
            null,
            workInProgress2,
            lazyComponent,
            current2,
            renderLanes2
          ));
        else {
          if (void 0 !== lazyComponent && null !== lazyComponent) {
            if (init = lazyComponent.$$typeof, init === REACT_FORWARD_REF_TYPE) {
              workInProgress2.tag = 11;
              workInProgress2 = updateForwardRef(
                null,
                workInProgress2,
                lazyComponent,
                current2,
                renderLanes2
              );
              break a;
            } else if (init === REACT_MEMO_TYPE) {
              workInProgress2.tag = 14;
              workInProgress2 = updateMemoComponent(
                null,
                workInProgress2,
                lazyComponent,
                current2,
                renderLanes2
              );
              break a;
            }
          }
          workInProgress2 = getComponentNameFromType(lazyComponent) || lazyComponent;
          throw Error(formatProdErrorMessage$2(306, workInProgress2, ""));
        }
      }
      return workInProgress2;
    case 0:
      return updateFunctionComponent(
        current2,
        workInProgress2,
        workInProgress2.type,
        workInProgress2.pendingProps,
        renderLanes2
      );
    case 1:
      return lazyComponent = workInProgress2.type, init = resolveClassComponentProps(
        lazyComponent,
        workInProgress2.pendingProps
      ), updateClassComponent(
        current2,
        workInProgress2,
        lazyComponent,
        init,
        renderLanes2
      );
    case 3:
      a: {
        pushHostContainer(
          workInProgress2,
          workInProgress2.stateNode.containerInfo
        );
        if (null === current2) throw Error(formatProdErrorMessage$2(387));
        lazyComponent = workInProgress2.pendingProps;
        var prevState = workInProgress2.memoizedState;
        init = prevState.element;
        cloneUpdateQueue(current2, workInProgress2);
        processUpdateQueue(workInProgress2, lazyComponent, null, renderLanes2);
        var nextState = workInProgress2.memoizedState;
        lazyComponent = nextState.cache;
        pushProvider(workInProgress2, CacheContext, lazyComponent);
        lazyComponent !== prevState.cache && propagateContextChanges(
          workInProgress2,
          [CacheContext],
          renderLanes2,
          true
        );
        suspendIfUpdateReadFromEntangledAsyncAction();
        lazyComponent = nextState.element;
        if (prevState.isDehydrated)
          if (prevState = {
            element: lazyComponent,
            isDehydrated: false,
            cache: nextState.cache
          }, workInProgress2.updateQueue.baseState = prevState, workInProgress2.memoizedState = prevState, workInProgress2.flags & 256) {
            workInProgress2 = mountHostRootWithoutHydrating(
              current2,
              workInProgress2,
              lazyComponent,
              renderLanes2
            );
            break a;
          } else if (lazyComponent !== init) {
            init = createCapturedValueAtFiber(
              Error(formatProdErrorMessage$2(424)),
              workInProgress2
            );
            queueHydrationError(init);
            workInProgress2 = mountHostRootWithoutHydrating(
              current2,
              workInProgress2,
              lazyComponent,
              renderLanes2
            );
            break a;
          } else {
            current2 = workInProgress2.stateNode.containerInfo;
            switch (current2.nodeType) {
              case 9:
                current2 = current2.body;
                break;
              default:
                current2 = "HTML" === current2.nodeName ? current2.ownerDocument.body : current2;
            }
            nextHydratableInstance = getNextHydratable(current2.firstChild);
            hydrationParentFiber = workInProgress2;
            isHydrating = true;
            hydrationErrors = null;
            rootOrSingletonContext = true;
            renderLanes2 = mountChildFibers(
              workInProgress2,
              null,
              lazyComponent,
              renderLanes2
            );
            for (workInProgress2.child = renderLanes2; renderLanes2; )
              renderLanes2.flags = renderLanes2.flags & -3 | 4096, renderLanes2 = renderLanes2.sibling;
          }
        else {
          resetHydrationState();
          if (lazyComponent === init) {
            workInProgress2 = bailoutOnAlreadyFinishedWork(
              current2,
              workInProgress2,
              renderLanes2
            );
            break a;
          }
          reconcileChildren(
            current2,
            workInProgress2,
            lazyComponent,
            renderLanes2
          );
        }
        workInProgress2 = workInProgress2.child;
      }
      return workInProgress2;
    case 26:
      return markRef(current2, workInProgress2), null === current2 ? (renderLanes2 = getResource(
        workInProgress2.type,
        null,
        workInProgress2.pendingProps,
        null
      )) ? workInProgress2.memoizedState = renderLanes2 : isHydrating || (renderLanes2 = workInProgress2.type, current2 = workInProgress2.pendingProps, lazyComponent = getOwnerDocumentFromRootContainer(
        rootInstanceStackCursor.current
      ).createElement(renderLanes2), lazyComponent[internalInstanceKey] = workInProgress2, lazyComponent[internalPropsKey] = current2, setInitialProperties(lazyComponent, renderLanes2, current2), markNodeAsHoistable(lazyComponent), workInProgress2.stateNode = lazyComponent) : workInProgress2.memoizedState = getResource(
        workInProgress2.type,
        current2.memoizedProps,
        workInProgress2.pendingProps,
        current2.memoizedState
      ), null;
    case 27:
      return pushHostContext(workInProgress2), null === current2 && isHydrating && (lazyComponent = workInProgress2.stateNode = resolveSingletonInstance(
        workInProgress2.type,
        workInProgress2.pendingProps,
        rootInstanceStackCursor.current
      ), hydrationParentFiber = workInProgress2, rootOrSingletonContext = true, init = nextHydratableInstance, isSingletonScope(workInProgress2.type) ? (previousHydratableOnEnteringScopedSingleton = init, nextHydratableInstance = getNextHydratable(
        lazyComponent.firstChild
      )) : nextHydratableInstance = init), reconcileChildren(
        current2,
        workInProgress2,
        workInProgress2.pendingProps.children,
        renderLanes2
      ), markRef(current2, workInProgress2), null === current2 && (workInProgress2.flags |= 4194304), workInProgress2.child;
    case 5:
      if (null === current2 && isHydrating) {
        if (init = lazyComponent = nextHydratableInstance)
          lazyComponent = canHydrateInstance(
            lazyComponent,
            workInProgress2.type,
            workInProgress2.pendingProps,
            rootOrSingletonContext
          ), null !== lazyComponent ? (workInProgress2.stateNode = lazyComponent, hydrationParentFiber = workInProgress2, nextHydratableInstance = getNextHydratable(
            lazyComponent.firstChild
          ), rootOrSingletonContext = false, init = true) : init = false;
        init || throwOnHydrationMismatch(workInProgress2);
      }
      pushHostContext(workInProgress2);
      init = workInProgress2.type;
      prevState = workInProgress2.pendingProps;
      nextState = null !== current2 ? current2.memoizedProps : null;
      lazyComponent = prevState.children;
      shouldSetTextContent(init, prevState) ? lazyComponent = null : null !== nextState && shouldSetTextContent(init, nextState) && (workInProgress2.flags |= 32);
      null !== workInProgress2.memoizedState && (init = renderWithHooks(
        current2,
        workInProgress2,
        TransitionAwareHostComponent,
        null,
        null,
        renderLanes2
      ), HostTransitionContext._currentValue = init);
      markRef(current2, workInProgress2);
      reconcileChildren(current2, workInProgress2, lazyComponent, renderLanes2);
      return workInProgress2.child;
    case 6:
      if (null === current2 && isHydrating) {
        if (current2 = renderLanes2 = nextHydratableInstance)
          renderLanes2 = canHydrateTextInstance(
            renderLanes2,
            workInProgress2.pendingProps,
            rootOrSingletonContext
          ), null !== renderLanes2 ? (workInProgress2.stateNode = renderLanes2, hydrationParentFiber = workInProgress2, nextHydratableInstance = null, current2 = true) : current2 = false;
        current2 || throwOnHydrationMismatch(workInProgress2);
      }
      return null;
    case 13:
      return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
    case 4:
      return pushHostContainer(
        workInProgress2,
        workInProgress2.stateNode.containerInfo
      ), lazyComponent = workInProgress2.pendingProps, null === current2 ? workInProgress2.child = reconcileChildFibers(
        workInProgress2,
        null,
        lazyComponent,
        renderLanes2
      ) : reconcileChildren(
        current2,
        workInProgress2,
        lazyComponent,
        renderLanes2
      ), workInProgress2.child;
    case 11:
      return updateForwardRef(
        current2,
        workInProgress2,
        workInProgress2.type,
        workInProgress2.pendingProps,
        renderLanes2
      );
    case 7:
      return reconcileChildren(
        current2,
        workInProgress2,
        workInProgress2.pendingProps,
        renderLanes2
      ), workInProgress2.child;
    case 8:
      return reconcileChildren(
        current2,
        workInProgress2,
        workInProgress2.pendingProps.children,
        renderLanes2
      ), workInProgress2.child;
    case 12:
      return reconcileChildren(
        current2,
        workInProgress2,
        workInProgress2.pendingProps.children,
        renderLanes2
      ), workInProgress2.child;
    case 10:
      return lazyComponent = workInProgress2.pendingProps, pushProvider(workInProgress2, workInProgress2.type, lazyComponent.value), reconcileChildren(
        current2,
        workInProgress2,
        lazyComponent.children,
        renderLanes2
      ), workInProgress2.child;
    case 9:
      return init = workInProgress2.type._context, lazyComponent = workInProgress2.pendingProps.children, prepareToReadContext(workInProgress2), init = readContext(init), lazyComponent = lazyComponent(init), workInProgress2.flags |= 1, reconcileChildren(current2, workInProgress2, lazyComponent, renderLanes2), workInProgress2.child;
    case 14:
      return updateMemoComponent(
        current2,
        workInProgress2,
        workInProgress2.type,
        workInProgress2.pendingProps,
        renderLanes2
      );
    case 15:
      return updateSimpleMemoComponent(
        current2,
        workInProgress2,
        workInProgress2.type,
        workInProgress2.pendingProps,
        renderLanes2
      );
    case 19:
      return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
    case 31:
      return lazyComponent = workInProgress2.pendingProps, renderLanes2 = workInProgress2.mode, lazyComponent = {
        mode: lazyComponent.mode,
        children: lazyComponent.children
      }, null === current2 ? (renderLanes2 = mountWorkInProgressOffscreenFiber(
        lazyComponent,
        renderLanes2
      ), renderLanes2.ref = workInProgress2.ref, workInProgress2.child = renderLanes2, renderLanes2.return = workInProgress2, workInProgress2 = renderLanes2) : (renderLanes2 = createWorkInProgress(current2.child, lazyComponent), renderLanes2.ref = workInProgress2.ref, workInProgress2.child = renderLanes2, renderLanes2.return = workInProgress2, workInProgress2 = renderLanes2), workInProgress2;
    case 22:
      return updateOffscreenComponent(current2, workInProgress2, renderLanes2);
    case 24:
      return prepareToReadContext(workInProgress2), lazyComponent = readContext(CacheContext), null === current2 ? (init = peekCacheFromPool(), null === init && (init = workInProgressRoot, prevState = createCache(), init.pooledCache = prevState, prevState.refCount++, null !== prevState && (init.pooledCacheLanes |= renderLanes2), init = prevState), workInProgress2.memoizedState = {
        parent: lazyComponent,
        cache: init
      }, initializeUpdateQueue(workInProgress2), pushProvider(workInProgress2, CacheContext, init)) : (0 !== (current2.lanes & renderLanes2) && (cloneUpdateQueue(current2, workInProgress2), processUpdateQueue(workInProgress2, null, null, renderLanes2), suspendIfUpdateReadFromEntangledAsyncAction()), init = current2.memoizedState, prevState = workInProgress2.memoizedState, init.parent !== lazyComponent ? (init = { parent: lazyComponent, cache: lazyComponent }, workInProgress2.memoizedState = init, 0 === workInProgress2.lanes && (workInProgress2.memoizedState = workInProgress2.updateQueue.baseState = init), pushProvider(workInProgress2, CacheContext, lazyComponent)) : (lazyComponent = prevState.cache, pushProvider(workInProgress2, CacheContext, lazyComponent), lazyComponent !== init.cache && propagateContextChanges(
        workInProgress2,
        [CacheContext],
        renderLanes2,
        true
      ))), reconcileChildren(
        current2,
        workInProgress2,
        workInProgress2.pendingProps.children,
        renderLanes2
      ), workInProgress2.child;
    case 29:
      throw workInProgress2.pendingProps;
  }
  throw Error(formatProdErrorMessage$2(156, workInProgress2.tag));
}
function markUpdate(workInProgress2) {
  workInProgress2.flags |= 4;
}
function preloadResourceAndSuspendIfNeeded(workInProgress2, resource) {
  if ("stylesheet" !== resource.type || 0 !== (resource.state.loading & 4))
    workInProgress2.flags &= -16777217;
  else if (workInProgress2.flags |= 16777216, !preloadResource(resource)) {
    resource = suspenseHandlerStackCursor.current;
    if (null !== resource && ((workInProgressRootRenderLanes & 4194048) === workInProgressRootRenderLanes ? null !== shellBoundary : (workInProgressRootRenderLanes & 62914560) !== workInProgressRootRenderLanes && 0 === (workInProgressRootRenderLanes & 536870912) || resource !== shellBoundary))
      throw suspendedThenable = noopSuspenseyCommitThenable, SuspenseyCommitException;
    workInProgress2.flags |= 8192;
  }
}
function scheduleRetryEffect(workInProgress2, retryQueue) {
  null !== retryQueue && (workInProgress2.flags |= 4);
  workInProgress2.flags & 16384 && (retryQueue = 22 !== workInProgress2.tag ? claimNextRetryLane() : 536870912, workInProgress2.lanes |= retryQueue, workInProgressSuspendedRetryLanes |= retryQueue);
}
function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
  if (!isHydrating)
    switch (renderState.tailMode) {
      case "hidden":
        hasRenderedATailFallback = renderState.tail;
        for (var lastTailNode = null; null !== hasRenderedATailFallback; )
          null !== hasRenderedATailFallback.alternate && (lastTailNode = hasRenderedATailFallback), hasRenderedATailFallback = hasRenderedATailFallback.sibling;
        null === lastTailNode ? renderState.tail = null : lastTailNode.sibling = null;
        break;
      case "collapsed":
        lastTailNode = renderState.tail;
        for (var lastTailNode$113 = null; null !== lastTailNode; )
          null !== lastTailNode.alternate && (lastTailNode$113 = lastTailNode), lastTailNode = lastTailNode.sibling;
        null === lastTailNode$113 ? hasRenderedATailFallback || null === renderState.tail ? renderState.tail = null : renderState.tail.sibling = null : lastTailNode$113.sibling = null;
    }
}
function bubbleProperties(completedWork) {
  var didBailout = null !== completedWork.alternate && completedWork.alternate.child === completedWork.child, newChildLanes = 0, subtreeFlags = 0;
  if (didBailout)
    for (var child$114 = completedWork.child; null !== child$114; )
      newChildLanes |= child$114.lanes | child$114.childLanes, subtreeFlags |= child$114.subtreeFlags & 65011712, subtreeFlags |= child$114.flags & 65011712, child$114.return = completedWork, child$114 = child$114.sibling;
  else
    for (child$114 = completedWork.child; null !== child$114; )
      newChildLanes |= child$114.lanes | child$114.childLanes, subtreeFlags |= child$114.subtreeFlags, subtreeFlags |= child$114.flags, child$114.return = completedWork, child$114 = child$114.sibling;
  completedWork.subtreeFlags |= subtreeFlags;
  completedWork.childLanes = newChildLanes;
  return didBailout;
}
function completeWork(current2, workInProgress2, renderLanes2) {
  var newProps = workInProgress2.pendingProps;
  popTreeContext(workInProgress2);
  switch (workInProgress2.tag) {
    case 31:
    case 16:
    case 15:
    case 0:
    case 11:
    case 7:
    case 8:
    case 12:
    case 9:
    case 14:
      return bubbleProperties(workInProgress2), null;
    case 1:
      return bubbleProperties(workInProgress2), null;
    case 3:
      renderLanes2 = workInProgress2.stateNode;
      newProps = null;
      null !== current2 && (newProps = current2.memoizedState.cache);
      workInProgress2.memoizedState.cache !== newProps && (workInProgress2.flags |= 2048);
      popProvider(CacheContext);
      popHostContainer();
      renderLanes2.pendingContext && (renderLanes2.context = renderLanes2.pendingContext, renderLanes2.pendingContext = null);
      if (null === current2 || null === current2.child)
        popHydrationState(workInProgress2) ? markUpdate(workInProgress2) : null === current2 || current2.memoizedState.isDehydrated && 0 === (workInProgress2.flags & 256) || (workInProgress2.flags |= 1024, upgradeHydrationErrorsToRecoverable());
      bubbleProperties(workInProgress2);
      return null;
    case 26:
      return renderLanes2 = workInProgress2.memoizedState, null === current2 ? (markUpdate(workInProgress2), null !== renderLanes2 ? (bubbleProperties(workInProgress2), preloadResourceAndSuspendIfNeeded(workInProgress2, renderLanes2)) : (bubbleProperties(workInProgress2), workInProgress2.flags &= -16777217)) : renderLanes2 ? renderLanes2 !== current2.memoizedState ? (markUpdate(workInProgress2), bubbleProperties(workInProgress2), preloadResourceAndSuspendIfNeeded(workInProgress2, renderLanes2)) : (bubbleProperties(workInProgress2), workInProgress2.flags &= -16777217) : (current2.memoizedProps !== newProps && markUpdate(workInProgress2), bubbleProperties(workInProgress2), workInProgress2.flags &= -16777217), null;
    case 27:
      popHostContext(workInProgress2);
      renderLanes2 = rootInstanceStackCursor.current;
      var type = workInProgress2.type;
      if (null !== current2 && null != workInProgress2.stateNode)
        current2.memoizedProps !== newProps && markUpdate(workInProgress2);
      else {
        if (!newProps) {
          if (null === workInProgress2.stateNode)
            throw Error(formatProdErrorMessage$2(166));
          bubbleProperties(workInProgress2);
          return null;
        }
        current2 = contextStackCursor.current;
        popHydrationState(workInProgress2) ? prepareToHydrateHostInstance(workInProgress2) : (current2 = resolveSingletonInstance(type, newProps, renderLanes2), workInProgress2.stateNode = current2, markUpdate(workInProgress2));
      }
      bubbleProperties(workInProgress2);
      return null;
    case 5:
      popHostContext(workInProgress2);
      renderLanes2 = workInProgress2.type;
      if (null !== current2 && null != workInProgress2.stateNode)
        current2.memoizedProps !== newProps && markUpdate(workInProgress2);
      else {
        if (!newProps) {
          if (null === workInProgress2.stateNode)
            throw Error(formatProdErrorMessage$2(166));
          bubbleProperties(workInProgress2);
          return null;
        }
        current2 = contextStackCursor.current;
        if (popHydrationState(workInProgress2))
          prepareToHydrateHostInstance(workInProgress2);
        else {
          type = getOwnerDocumentFromRootContainer(
            rootInstanceStackCursor.current
          );
          switch (current2) {
            case 1:
              current2 = type.createElementNS(
                "http://www.w3.org/2000/svg",
                renderLanes2
              );
              break;
            case 2:
              current2 = type.createElementNS(
                "http://www.w3.org/1998/Math/MathML",
                renderLanes2
              );
              break;
            default:
              switch (renderLanes2) {
                case "svg":
                  current2 = type.createElementNS(
                    "http://www.w3.org/2000/svg",
                    renderLanes2
                  );
                  break;
                case "math":
                  current2 = type.createElementNS(
                    "http://www.w3.org/1998/Math/MathML",
                    renderLanes2
                  );
                  break;
                case "script":
                  current2 = type.createElement("div");
                  current2.innerHTML = "<script><\/script>";
                  current2 = current2.removeChild(current2.firstChild);
                  break;
                case "select":
                  current2 = "string" === typeof newProps.is ? type.createElement("select", { is: newProps.is }) : type.createElement("select");
                  newProps.multiple ? current2.multiple = true : newProps.size && (current2.size = newProps.size);
                  break;
                default:
                  current2 = "string" === typeof newProps.is ? type.createElement(renderLanes2, { is: newProps.is }) : type.createElement(renderLanes2);
              }
          }
          current2[internalInstanceKey] = workInProgress2;
          current2[internalPropsKey] = newProps;
          a: for (type = workInProgress2.child; null !== type; ) {
            if (5 === type.tag || 6 === type.tag)
              current2.appendChild(type.stateNode);
            else if (4 !== type.tag && 27 !== type.tag && null !== type.child) {
              type.child.return = type;
              type = type.child;
              continue;
            }
            if (type === workInProgress2) break a;
            for (; null === type.sibling; ) {
              if (null === type.return || type.return === workInProgress2)
                break a;
              type = type.return;
            }
            type.sibling.return = type.return;
            type = type.sibling;
          }
          workInProgress2.stateNode = current2;
          a: switch (setInitialProperties(current2, renderLanes2, newProps), renderLanes2) {
            case "button":
            case "input":
            case "select":
            case "textarea":
              current2 = !!newProps.autoFocus;
              break a;
            case "img":
              current2 = true;
              break a;
            default:
              current2 = false;
          }
          current2 && markUpdate(workInProgress2);
        }
      }
      bubbleProperties(workInProgress2);
      workInProgress2.flags &= -16777217;
      return null;
    case 6:
      if (current2 && null != workInProgress2.stateNode)
        current2.memoizedProps !== newProps && markUpdate(workInProgress2);
      else {
        if ("string" !== typeof newProps && null === workInProgress2.stateNode)
          throw Error(formatProdErrorMessage$2(166));
        current2 = rootInstanceStackCursor.current;
        if (popHydrationState(workInProgress2)) {
          current2 = workInProgress2.stateNode;
          renderLanes2 = workInProgress2.memoizedProps;
          newProps = null;
          type = hydrationParentFiber;
          if (null !== type)
            switch (type.tag) {
              case 27:
              case 5:
                newProps = type.memoizedProps;
            }
          current2[internalInstanceKey] = workInProgress2;
          current2 = current2.nodeValue === renderLanes2 || null !== newProps && true === newProps.suppressHydrationWarning || checkForUnmatchedText(current2.nodeValue, renderLanes2) ? true : false;
          current2 || throwOnHydrationMismatch(workInProgress2);
        } else
          current2 = getOwnerDocumentFromRootContainer(current2).createTextNode(
            newProps
          ), current2[internalInstanceKey] = workInProgress2, workInProgress2.stateNode = current2;
      }
      bubbleProperties(workInProgress2);
      return null;
    case 13:
      newProps = workInProgress2.memoizedState;
      if (null === current2 || null !== current2.memoizedState && null !== current2.memoizedState.dehydrated) {
        type = popHydrationState(workInProgress2);
        if (null !== newProps && null !== newProps.dehydrated) {
          if (null === current2) {
            if (!type) throw Error(formatProdErrorMessage$2(318));
            type = workInProgress2.memoizedState;
            type = null !== type ? type.dehydrated : null;
            if (!type) throw Error(formatProdErrorMessage$2(317));
            type[internalInstanceKey] = workInProgress2;
          } else
            resetHydrationState(), 0 === (workInProgress2.flags & 128) && (workInProgress2.memoizedState = null), workInProgress2.flags |= 4;
          bubbleProperties(workInProgress2);
          type = false;
        } else
          type = upgradeHydrationErrorsToRecoverable(), null !== current2 && null !== current2.memoizedState && (current2.memoizedState.hydrationErrors = type), type = true;
        if (!type) {
          if (workInProgress2.flags & 256)
            return popSuspenseHandler(workInProgress2), workInProgress2;
          popSuspenseHandler(workInProgress2);
          return null;
        }
      }
      popSuspenseHandler(workInProgress2);
      if (0 !== (workInProgress2.flags & 128))
        return workInProgress2.lanes = renderLanes2, workInProgress2;
      renderLanes2 = null !== newProps;
      current2 = null !== current2 && null !== current2.memoizedState;
      if (renderLanes2) {
        newProps = workInProgress2.child;
        type = null;
        null !== newProps.alternate && null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool);
        var cache$127 = null;
        null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && (cache$127 = newProps.memoizedState.cachePool.pool);
        cache$127 !== type && (newProps.flags |= 2048);
      }
      renderLanes2 !== current2 && renderLanes2 && (workInProgress2.child.flags |= 8192);
      scheduleRetryEffect(workInProgress2, workInProgress2.updateQueue);
      bubbleProperties(workInProgress2);
      return null;
    case 4:
      return popHostContainer(), null === current2 && listenToAllSupportedEvents(workInProgress2.stateNode.containerInfo), bubbleProperties(workInProgress2), null;
    case 10:
      return popProvider(workInProgress2.type), bubbleProperties(workInProgress2), null;
    case 19:
      pop(suspenseStackCursor);
      type = workInProgress2.memoizedState;
      if (null === type) return bubbleProperties(workInProgress2), null;
      newProps = 0 !== (workInProgress2.flags & 128);
      cache$127 = type.rendering;
      if (null === cache$127)
        if (newProps) cutOffTailIfNeeded(type, false);
        else {
          if (0 !== workInProgressRootExitStatus || null !== current2 && 0 !== (current2.flags & 128))
            for (current2 = workInProgress2.child; null !== current2; ) {
              cache$127 = findFirstSuspended(current2);
              if (null !== cache$127) {
                workInProgress2.flags |= 128;
                cutOffTailIfNeeded(type, false);
                current2 = cache$127.updateQueue;
                workInProgress2.updateQueue = current2;
                scheduleRetryEffect(workInProgress2, current2);
                workInProgress2.subtreeFlags = 0;
                current2 = renderLanes2;
                for (renderLanes2 = workInProgress2.child; null !== renderLanes2; )
                  resetWorkInProgress(renderLanes2, current2), renderLanes2 = renderLanes2.sibling;
                push(
                  suspenseStackCursor,
                  suspenseStackCursor.current & 1 | 2
                );
                return workInProgress2.child;
              }
              current2 = current2.sibling;
            }
          null !== type.tail && now() > workInProgressRootRenderTargetTime && (workInProgress2.flags |= 128, newProps = true, cutOffTailIfNeeded(type, false), workInProgress2.lanes = 4194304);
        }
      else {
        if (!newProps)
          if (current2 = findFirstSuspended(cache$127), null !== current2) {
            if (workInProgress2.flags |= 128, newProps = true, current2 = current2.updateQueue, workInProgress2.updateQueue = current2, scheduleRetryEffect(workInProgress2, current2), cutOffTailIfNeeded(type, true), null === type.tail && "hidden" === type.tailMode && !cache$127.alternate && !isHydrating)
              return bubbleProperties(workInProgress2), null;
          } else
            2 * now() - type.renderingStartTime > workInProgressRootRenderTargetTime && 536870912 !== renderLanes2 && (workInProgress2.flags |= 128, newProps = true, cutOffTailIfNeeded(type, false), workInProgress2.lanes = 4194304);
        type.isBackwards ? (cache$127.sibling = workInProgress2.child, workInProgress2.child = cache$127) : (current2 = type.last, null !== current2 ? current2.sibling = cache$127 : workInProgress2.child = cache$127, type.last = cache$127);
      }
      if (null !== type.tail)
        return workInProgress2 = type.tail, type.rendering = workInProgress2, type.tail = workInProgress2.sibling, type.renderingStartTime = now(), workInProgress2.sibling = null, current2 = suspenseStackCursor.current, push(suspenseStackCursor, newProps ? current2 & 1 | 2 : current2 & 1), workInProgress2;
      bubbleProperties(workInProgress2);
      return null;
    case 22:
    case 23:
      return popSuspenseHandler(workInProgress2), popHiddenContext(), newProps = null !== workInProgress2.memoizedState, null !== current2 ? null !== current2.memoizedState !== newProps && (workInProgress2.flags |= 8192) : newProps && (workInProgress2.flags |= 8192), newProps ? 0 !== (renderLanes2 & 536870912) && 0 === (workInProgress2.flags & 128) && (bubbleProperties(workInProgress2), workInProgress2.subtreeFlags & 6 && (workInProgress2.flags |= 8192)) : bubbleProperties(workInProgress2), renderLanes2 = workInProgress2.updateQueue, null !== renderLanes2 && scheduleRetryEffect(workInProgress2, renderLanes2.retryQueue), renderLanes2 = null, null !== current2 && null !== current2.memoizedState && null !== current2.memoizedState.cachePool && (renderLanes2 = current2.memoizedState.cachePool.pool), newProps = null, null !== workInProgress2.memoizedState && null !== workInProgress2.memoizedState.cachePool && (newProps = workInProgress2.memoizedState.cachePool.pool), newProps !== renderLanes2 && (workInProgress2.flags |= 2048), null !== current2 && pop(resumedCache), null;
    case 24:
      return renderLanes2 = null, null !== current2 && (renderLanes2 = current2.memoizedState.cache), workInProgress2.memoizedState.cache !== renderLanes2 && (workInProgress2.flags |= 2048), popProvider(CacheContext), bubbleProperties(workInProgress2), null;
    case 25:
      return null;
    case 30:
      return null;
  }
  throw Error(formatProdErrorMessage$2(156, workInProgress2.tag));
}
function unwindWork(current2, workInProgress2) {
  popTreeContext(workInProgress2);
  switch (workInProgress2.tag) {
    case 1:
      return current2 = workInProgress2.flags, current2 & 65536 ? (workInProgress2.flags = current2 & -65537 | 128, workInProgress2) : null;
    case 3:
      return popProvider(CacheContext), popHostContainer(), current2 = workInProgress2.flags, 0 !== (current2 & 65536) && 0 === (current2 & 128) ? (workInProgress2.flags = current2 & -65537 | 128, workInProgress2) : null;
    case 26:
    case 27:
    case 5:
      return popHostContext(workInProgress2), null;
    case 13:
      popSuspenseHandler(workInProgress2);
      current2 = workInProgress2.memoizedState;
      if (null !== current2 && null !== current2.dehydrated) {
        if (null === workInProgress2.alternate)
          throw Error(formatProdErrorMessage$2(340));
        resetHydrationState();
      }
      current2 = workInProgress2.flags;
      return current2 & 65536 ? (workInProgress2.flags = current2 & -65537 | 128, workInProgress2) : null;
    case 19:
      return pop(suspenseStackCursor), null;
    case 4:
      return popHostContainer(), null;
    case 10:
      return popProvider(workInProgress2.type), null;
    case 22:
    case 23:
      return popSuspenseHandler(workInProgress2), popHiddenContext(), null !== current2 && pop(resumedCache), current2 = workInProgress2.flags, current2 & 65536 ? (workInProgress2.flags = current2 & -65537 | 128, workInProgress2) : null;
    case 24:
      return popProvider(CacheContext), null;
    case 25:
      return null;
    default:
      return null;
  }
}
function unwindInterruptedWork(current2, interruptedWork) {
  popTreeContext(interruptedWork);
  switch (interruptedWork.tag) {
    case 3:
      popProvider(CacheContext);
      popHostContainer();
      break;
    case 26:
    case 27:
    case 5:
      popHostContext(interruptedWork);
      break;
    case 4:
      popHostContainer();
      break;
    case 13:
      popSuspenseHandler(interruptedWork);
      break;
    case 19:
      pop(suspenseStackCursor);
      break;
    case 10:
      popProvider(interruptedWork.type);
      break;
    case 22:
    case 23:
      popSuspenseHandler(interruptedWork);
      popHiddenContext();
      null !== current2 && pop(resumedCache);
      break;
    case 24:
      popProvider(CacheContext);
  }
}
function commitHookEffectListMount(flags, finishedWork) {
  try {
    var updateQueue = finishedWork.updateQueue, lastEffect = null !== updateQueue ? updateQueue.lastEffect : null;
    if (null !== lastEffect) {
      var firstEffect = lastEffect.next;
      updateQueue = firstEffect;
      do {
        if ((updateQueue.tag & flags) === flags) {
          lastEffect = void 0;
          var create = updateQueue.create, inst = updateQueue.inst;
          lastEffect = create();
          inst.destroy = lastEffect;
        }
        updateQueue = updateQueue.next;
      } while (updateQueue !== firstEffect);
    }
  } catch (error) {
    captureCommitPhaseError(finishedWork, finishedWork.return, error);
  }
}
function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor$jscomp$0) {
  try {
    var updateQueue = finishedWork.updateQueue, lastEffect = null !== updateQueue ? updateQueue.lastEffect : null;
    if (null !== lastEffect) {
      var firstEffect = lastEffect.next;
      updateQueue = firstEffect;
      do {
        if ((updateQueue.tag & flags) === flags) {
          var inst = updateQueue.inst, destroy = inst.destroy;
          if (void 0 !== destroy) {
            inst.destroy = void 0;
            lastEffect = finishedWork;
            var nearestMountedAncestor = nearestMountedAncestor$jscomp$0, destroy_ = destroy;
            try {
              destroy_();
            } catch (error) {
              captureCommitPhaseError(
                lastEffect,
                nearestMountedAncestor,
                error
              );
            }
          }
        }
        updateQueue = updateQueue.next;
      } while (updateQueue !== firstEffect);
    }
  } catch (error) {
    captureCommitPhaseError(finishedWork, finishedWork.return, error);
  }
}
function commitClassCallbacks(finishedWork) {
  var updateQueue = finishedWork.updateQueue;
  if (null !== updateQueue) {
    var instance2 = finishedWork.stateNode;
    try {
      commitCallbacks(updateQueue, instance2);
    } catch (error) {
      captureCommitPhaseError(finishedWork, finishedWork.return, error);
    }
  }
}
function safelyCallComponentWillUnmount(current2, nearestMountedAncestor, instance2) {
  instance2.props = resolveClassComponentProps(
    current2.type,
    current2.memoizedProps
  );
  instance2.state = current2.memoizedState;
  try {
    instance2.componentWillUnmount();
  } catch (error) {
    captureCommitPhaseError(current2, nearestMountedAncestor, error);
  }
}
function safelyAttachRef(current2, nearestMountedAncestor) {
  try {
    var ref = current2.ref;
    if (null !== ref) {
      switch (current2.tag) {
        case 26:
        case 27:
        case 5:
          var instanceToUse = current2.stateNode;
          break;
        case 30:
          instanceToUse = current2.stateNode;
          break;
        default:
          instanceToUse = current2.stateNode;
      }
      "function" === typeof ref ? current2.refCleanup = ref(instanceToUse) : ref.current = instanceToUse;
    }
  } catch (error) {
    captureCommitPhaseError(current2, nearestMountedAncestor, error);
  }
}
function safelyDetachRef(current2, nearestMountedAncestor) {
  var ref = current2.ref, refCleanup = current2.refCleanup;
  if (null !== ref)
    if ("function" === typeof refCleanup)
      try {
        refCleanup();
      } catch (error) {
        captureCommitPhaseError(current2, nearestMountedAncestor, error);
      } finally {
        current2.refCleanup = null, current2 = current2.alternate, null != current2 && (current2.refCleanup = null);
      }
    else if ("function" === typeof ref)
      try {
        ref(null);
      } catch (error$143) {
        captureCommitPhaseError(current2, nearestMountedAncestor, error$143);
      }
    else ref.current = null;
}
function commitHostMount(finishedWork) {
  var type = finishedWork.type, props = finishedWork.memoizedProps, instance2 = finishedWork.stateNode;
  try {
    a: switch (type) {
      case "button":
      case "input":
      case "select":
      case "textarea":
        props.autoFocus && instance2.focus();
        break a;
      case "img":
        props.src ? instance2.src = props.src : props.srcSet && (instance2.srcset = props.srcSet);
    }
  } catch (error) {
    captureCommitPhaseError(finishedWork, finishedWork.return, error);
  }
}
function commitHostUpdate(finishedWork, newProps, oldProps) {
  try {
    var domElement = finishedWork.stateNode;
    updateProperties(domElement, finishedWork.type, oldProps, newProps);
    domElement[internalPropsKey] = newProps;
  } catch (error) {
    captureCommitPhaseError(finishedWork, finishedWork.return, error);
  }
}
function isHostParent(fiber) {
  return 5 === fiber.tag || 3 === fiber.tag || 26 === fiber.tag || 27 === fiber.tag && isSingletonScope(fiber.type) || 4 === fiber.tag;
}
function getHostSibling(fiber) {
  a: for (; ; ) {
    for (; null === fiber.sibling; ) {
      if (null === fiber.return || isHostParent(fiber.return)) return null;
      fiber = fiber.return;
    }
    fiber.sibling.return = fiber.return;
    for (fiber = fiber.sibling; 5 !== fiber.tag && 6 !== fiber.tag && 18 !== fiber.tag; ) {
      if (27 === fiber.tag && isSingletonScope(fiber.type)) continue a;
      if (fiber.flags & 2) continue a;
      if (null === fiber.child || 4 === fiber.tag) continue a;
      else fiber.child.return = fiber, fiber = fiber.child;
    }
    if (!(fiber.flags & 2)) return fiber.stateNode;
  }
}
function insertOrAppendPlacementNodeIntoContainer(node, before, parent) {
  var tag = node.tag;
  if (5 === tag || 6 === tag)
    node = node.stateNode, before ? (9 === parent.nodeType ? parent.body : "HTML" === parent.nodeName ? parent.ownerDocument.body : parent).insertBefore(node, before) : (before = 9 === parent.nodeType ? parent.body : "HTML" === parent.nodeName ? parent.ownerDocument.body : parent, before.appendChild(node), parent = parent._reactRootContainer, null !== parent && void 0 !== parent || null !== before.onclick || (before.onclick = noop$1$1));
  else if (4 !== tag && (27 === tag && isSingletonScope(node.type) && (parent = node.stateNode, before = null), node = node.child, null !== node))
    for (insertOrAppendPlacementNodeIntoContainer(node, before, parent), node = node.sibling; null !== node; )
      insertOrAppendPlacementNodeIntoContainer(node, before, parent), node = node.sibling;
}
function insertOrAppendPlacementNode(node, before, parent) {
  var tag = node.tag;
  if (5 === tag || 6 === tag)
    node = node.stateNode, before ? parent.insertBefore(node, before) : parent.appendChild(node);
  else if (4 !== tag && (27 === tag && isSingletonScope(node.type) && (parent = node.stateNode), node = node.child, null !== node))
    for (insertOrAppendPlacementNode(node, before, parent), node = node.sibling; null !== node; )
      insertOrAppendPlacementNode(node, before, parent), node = node.sibling;
}
function commitHostSingletonAcquisition(finishedWork) {
  var singleton = finishedWork.stateNode, props = finishedWork.memoizedProps;
  try {
    for (var type = finishedWork.type, attributes = singleton.attributes; attributes.length; )
      singleton.removeAttributeNode(attributes[0]);
    setInitialProperties(singleton, type, props);
    singleton[internalInstanceKey] = finishedWork;
    singleton[internalPropsKey] = props;
  } catch (error) {
    captureCommitPhaseError(finishedWork, finishedWork.return, error);
  }
}
var offscreenSubtreeIsHidden = false, offscreenSubtreeWasHidden = false, needsFormReset = false, PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, nextEffect = null;
function commitBeforeMutationEffects(root2, firstChild) {
  root2 = root2.containerInfo;
  eventsEnabled = _enabled;
  root2 = getActiveElementDeep(root2);
  if (hasSelectionCapabilities(root2)) {
    if ("selectionStart" in root2)
      var JSCompiler_temp = {
        start: root2.selectionStart,
        end: root2.selectionEnd
      };
    else
      a: {
        JSCompiler_temp = (JSCompiler_temp = root2.ownerDocument) && JSCompiler_temp.defaultView || window;
        var selection = JSCompiler_temp.getSelection && JSCompiler_temp.getSelection();
        if (selection && 0 !== selection.rangeCount) {
          JSCompiler_temp = selection.anchorNode;
          var anchorOffset = selection.anchorOffset, focusNode = selection.focusNode;
          selection = selection.focusOffset;
          try {
            JSCompiler_temp.nodeType, focusNode.nodeType;
          } catch (e$20) {
            JSCompiler_temp = null;
            break a;
          }
          var length = 0, start = -1, end = -1, indexWithinAnchor = 0, indexWithinFocus = 0, node = root2, parentNode = null;
          b: for (; ; ) {
            for (var next; ; ) {
              node !== JSCompiler_temp || 0 !== anchorOffset && 3 !== node.nodeType || (start = length + anchorOffset);
              node !== focusNode || 0 !== selection && 3 !== node.nodeType || (end = length + selection);
              3 === node.nodeType && (length += node.nodeValue.length);
              if (null === (next = node.firstChild)) break;
              parentNode = node;
              node = next;
            }
            for (; ; ) {
              if (node === root2) break b;
              parentNode === JSCompiler_temp && ++indexWithinAnchor === anchorOffset && (start = length);
              parentNode === focusNode && ++indexWithinFocus === selection && (end = length);
              if (null !== (next = node.nextSibling)) break;
              node = parentNode;
              parentNode = node.parentNode;
            }
            node = next;
          }
          JSCompiler_temp = -1 === start || -1 === end ? null : { start, end };
        } else JSCompiler_temp = null;
      }
    JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 };
  } else JSCompiler_temp = null;
  selectionInformation = { focusedElem: root2, selectionRange: JSCompiler_temp };
  _enabled = false;
  for (nextEffect = firstChild; null !== nextEffect; )
    if (firstChild = nextEffect, root2 = firstChild.child, 0 !== (firstChild.subtreeFlags & 1024) && null !== root2)
      root2.return = firstChild, nextEffect = root2;
    else
      for (; null !== nextEffect; ) {
        firstChild = nextEffect;
        focusNode = firstChild.alternate;
        root2 = firstChild.flags;
        switch (firstChild.tag) {
          case 0:
            break;
          case 11:
          case 15:
            break;
          case 1:
            if (0 !== (root2 & 1024) && null !== focusNode) {
              root2 = void 0;
              JSCompiler_temp = firstChild;
              anchorOffset = focusNode.memoizedProps;
              focusNode = focusNode.memoizedState;
              selection = JSCompiler_temp.stateNode;
              try {
                var resolvedPrevProps = resolveClassComponentProps(
                  JSCompiler_temp.type,
                  anchorOffset,
                  JSCompiler_temp.elementType === JSCompiler_temp.type
                );
                root2 = selection.getSnapshotBeforeUpdate(
                  resolvedPrevProps,
                  focusNode
                );
                selection.__reactInternalSnapshotBeforeUpdate = root2;
              } catch (error) {
                captureCommitPhaseError(
                  JSCompiler_temp,
                  JSCompiler_temp.return,
                  error
                );
              }
            }
            break;
          case 3:
            if (0 !== (root2 & 1024)) {
              if (root2 = firstChild.stateNode.containerInfo, JSCompiler_temp = root2.nodeType, 9 === JSCompiler_temp)
                clearContainerSparingly(root2);
              else if (1 === JSCompiler_temp)
                switch (root2.nodeName) {
                  case "HEAD":
                  case "HTML":
                  case "BODY":
                    clearContainerSparingly(root2);
                    break;
                  default:
                    root2.textContent = "";
                }
            }
            break;
          case 5:
          case 26:
          case 27:
          case 6:
          case 4:
          case 17:
            break;
          default:
            if (0 !== (root2 & 1024)) throw Error(formatProdErrorMessage$2(163));
        }
        root2 = firstChild.sibling;
        if (null !== root2) {
          root2.return = firstChild.return;
          nextEffect = root2;
          break;
        }
        nextEffect = firstChild.return;
      }
}
function commitLayoutEffectOnFiber(finishedRoot, current2, finishedWork) {
  var flags = finishedWork.flags;
  switch (finishedWork.tag) {
    case 0:
    case 11:
    case 15:
      recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
      flags & 4 && commitHookEffectListMount(5, finishedWork);
      break;
    case 1:
      recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
      if (flags & 4)
        if (finishedRoot = finishedWork.stateNode, null === current2)
          try {
            finishedRoot.componentDidMount();
          } catch (error) {
            captureCommitPhaseError(finishedWork, finishedWork.return, error);
          }
        else {
          var prevProps = resolveClassComponentProps(
            finishedWork.type,
            current2.memoizedProps
          );
          current2 = current2.memoizedState;
          try {
            finishedRoot.componentDidUpdate(
              prevProps,
              current2,
              finishedRoot.__reactInternalSnapshotBeforeUpdate
            );
          } catch (error$142) {
            captureCommitPhaseError(
              finishedWork,
              finishedWork.return,
              error$142
            );
          }
        }
      flags & 64 && commitClassCallbacks(finishedWork);
      flags & 512 && safelyAttachRef(finishedWork, finishedWork.return);
      break;
    case 3:
      recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
      if (flags & 64 && (finishedRoot = finishedWork.updateQueue, null !== finishedRoot)) {
        current2 = null;
        if (null !== finishedWork.child)
          switch (finishedWork.child.tag) {
            case 27:
            case 5:
              current2 = finishedWork.child.stateNode;
              break;
            case 1:
              current2 = finishedWork.child.stateNode;
          }
        try {
          commitCallbacks(finishedRoot, current2);
        } catch (error) {
          captureCommitPhaseError(finishedWork, finishedWork.return, error);
        }
      }
      break;
    case 27:
      null === current2 && flags & 4 && commitHostSingletonAcquisition(finishedWork);
    case 26:
    case 5:
      recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
      null === current2 && flags & 4 && commitHostMount(finishedWork);
      flags & 512 && safelyAttachRef(finishedWork, finishedWork.return);
      break;
    case 12:
      recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
      break;
    case 13:
      recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
      flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
      flags & 64 && (finishedRoot = finishedWork.memoizedState, null !== finishedRoot && (finishedRoot = finishedRoot.dehydrated, null !== finishedRoot && (finishedWork = retryDehydratedSuspenseBoundary.bind(
        null,
        finishedWork
      ), registerSuspenseInstanceRetry(finishedRoot, finishedWork))));
      break;
    case 22:
      flags = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden;
      if (!flags) {
        current2 = null !== current2 && null !== current2.memoizedState || offscreenSubtreeWasHidden;
        prevProps = offscreenSubtreeIsHidden;
        var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
        offscreenSubtreeIsHidden = flags;
        (offscreenSubtreeWasHidden = current2) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects(
          finishedRoot,
          finishedWork,
          0 !== (finishedWork.subtreeFlags & 8772)
        ) : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
        offscreenSubtreeIsHidden = prevProps;
        offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
      }
      break;
    case 30:
      break;
    default:
      recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
  }
}
function detachFiberAfterEffects(fiber) {
  var alternate = fiber.alternate;
  null !== alternate && (fiber.alternate = null, detachFiberAfterEffects(alternate));
  fiber.child = null;
  fiber.deletions = null;
  fiber.sibling = null;
  5 === fiber.tag && (alternate = fiber.stateNode, null !== alternate && detachDeletedInstance(alternate));
  fiber.stateNode = null;
  fiber.return = null;
  fiber.dependencies = null;
  fiber.memoizedProps = null;
  fiber.memoizedState = null;
  fiber.pendingProps = null;
  fiber.stateNode = null;
  fiber.updateQueue = null;
}
var hostParent = null, hostParentIsContainer = false;
function recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, parent) {
  for (parent = parent.child; null !== parent; )
    commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, parent), parent = parent.sibling;
}
function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, deletedFiber) {
  if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount)
    try {
      injectedHook.onCommitFiberUnmount(rendererID, deletedFiber);
    } catch (err) {
    }
  switch (deletedFiber.tag) {
    case 26:
      offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor);
      recursivelyTraverseDeletionEffects(
        finishedRoot,
        nearestMountedAncestor,
        deletedFiber
      );
      deletedFiber.memoizedState ? deletedFiber.memoizedState.count-- : deletedFiber.stateNode && (deletedFiber = deletedFiber.stateNode, deletedFiber.parentNode.removeChild(deletedFiber));
      break;
    case 27:
      offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor);
      var prevHostParent = hostParent, prevHostParentIsContainer = hostParentIsContainer;
      isSingletonScope(deletedFiber.type) && (hostParent = deletedFiber.stateNode, hostParentIsContainer = false);
      recursivelyTraverseDeletionEffects(
        finishedRoot,
        nearestMountedAncestor,
        deletedFiber
      );
      releaseSingletonInstance(deletedFiber.stateNode);
      hostParent = prevHostParent;
      hostParentIsContainer = prevHostParentIsContainer;
      break;
    case 5:
      offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor);
    case 6:
      prevHostParent = hostParent;
      prevHostParentIsContainer = hostParentIsContainer;
      hostParent = null;
      recursivelyTraverseDeletionEffects(
        finishedRoot,
        nearestMountedAncestor,
        deletedFiber
      );
      hostParent = prevHostParent;
      hostParentIsContainer = prevHostParentIsContainer;
      if (null !== hostParent)
        if (hostParentIsContainer)
          try {
            (9 === hostParent.nodeType ? hostParent.body : "HTML" === hostParent.nodeName ? hostParent.ownerDocument.body : hostParent).removeChild(deletedFiber.stateNode);
          } catch (error) {
            captureCommitPhaseError(
              deletedFiber,
              nearestMountedAncestor,
              error
            );
          }
        else
          try {
            hostParent.removeChild(deletedFiber.stateNode);
          } catch (error) {
            captureCommitPhaseError(
              deletedFiber,
              nearestMountedAncestor,
              error
            );
          }
      break;
    case 18:
      null !== hostParent && (hostParentIsContainer ? (finishedRoot = hostParent, clearSuspenseBoundary(
        9 === finishedRoot.nodeType ? finishedRoot.body : "HTML" === finishedRoot.nodeName ? finishedRoot.ownerDocument.body : finishedRoot,
        deletedFiber.stateNode
      ), retryIfBlockedOn(finishedRoot)) : clearSuspenseBoundary(hostParent, deletedFiber.stateNode));
      break;
    case 4:
      prevHostParent = hostParent;
      prevHostParentIsContainer = hostParentIsContainer;
      hostParent = deletedFiber.stateNode.containerInfo;
      hostParentIsContainer = true;
      recursivelyTraverseDeletionEffects(
        finishedRoot,
        nearestMountedAncestor,
        deletedFiber
      );
      hostParent = prevHostParent;
      hostParentIsContainer = prevHostParentIsContainer;
      break;
    case 0:
    case 11:
    case 14:
    case 15:
      offscreenSubtreeWasHidden || commitHookEffectListUnmount(2, deletedFiber, nearestMountedAncestor);
      offscreenSubtreeWasHidden || commitHookEffectListUnmount(4, deletedFiber, nearestMountedAncestor);
      recursivelyTraverseDeletionEffects(
        finishedRoot,
        nearestMountedAncestor,
        deletedFiber
      );
      break;
    case 1:
      offscreenSubtreeWasHidden || (safelyDetachRef(deletedFiber, nearestMountedAncestor), prevHostParent = deletedFiber.stateNode, "function" === typeof prevHostParent.componentWillUnmount && safelyCallComponentWillUnmount(
        deletedFiber,
        nearestMountedAncestor,
        prevHostParent
      ));
      recursivelyTraverseDeletionEffects(
        finishedRoot,
        nearestMountedAncestor,
        deletedFiber
      );
      break;
    case 21:
      recursivelyTraverseDeletionEffects(
        finishedRoot,
        nearestMountedAncestor,
        deletedFiber
      );
      break;
    case 22:
      offscreenSubtreeWasHidden = (prevHostParent = offscreenSubtreeWasHidden) || null !== deletedFiber.memoizedState;
      recursivelyTraverseDeletionEffects(
        finishedRoot,
        nearestMountedAncestor,
        deletedFiber
      );
      offscreenSubtreeWasHidden = prevHostParent;
      break;
    default:
      recursivelyTraverseDeletionEffects(
        finishedRoot,
        nearestMountedAncestor,
        deletedFiber
      );
  }
}
function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
  if (null === finishedWork.memoizedState && (finishedRoot = finishedWork.alternate, null !== finishedRoot && (finishedRoot = finishedRoot.memoizedState, null !== finishedRoot && (finishedRoot = finishedRoot.dehydrated, null !== finishedRoot))))
    try {
      retryIfBlockedOn(finishedRoot);
    } catch (error) {
      captureCommitPhaseError(finishedWork, finishedWork.return, error);
    }
}
function getRetryCache(finishedWork) {
  switch (finishedWork.tag) {
    case 13:
    case 19:
      var retryCache = finishedWork.stateNode;
      null === retryCache && (retryCache = finishedWork.stateNode = new PossiblyWeakSet());
      return retryCache;
    case 22:
      return finishedWork = finishedWork.stateNode, retryCache = finishedWork._retryCache, null === retryCache && (retryCache = finishedWork._retryCache = new PossiblyWeakSet()), retryCache;
    default:
      throw Error(formatProdErrorMessage$2(435, finishedWork.tag));
  }
}
function attachSuspenseRetryListeners(finishedWork, wakeables) {
  var retryCache = getRetryCache(finishedWork);
  wakeables.forEach(function(wakeable) {
    var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
    retryCache.has(wakeable) || (retryCache.add(wakeable), wakeable.then(retry, retry));
  });
}
function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
  var deletions = parentFiber.deletions;
  if (null !== deletions)
    for (var i2 = 0; i2 < deletions.length; i2++) {
      var childToDelete = deletions[i2], root2 = root$jscomp$0, returnFiber = parentFiber, parent = returnFiber;
      a: for (; null !== parent; ) {
        switch (parent.tag) {
          case 27:
            if (isSingletonScope(parent.type)) {
              hostParent = parent.stateNode;
              hostParentIsContainer = false;
              break a;
            }
            break;
          case 5:
            hostParent = parent.stateNode;
            hostParentIsContainer = false;
            break a;
          case 3:
          case 4:
            hostParent = parent.stateNode.containerInfo;
            hostParentIsContainer = true;
            break a;
        }
        parent = parent.return;
      }
      if (null === hostParent) throw Error(formatProdErrorMessage$2(160));
      commitDeletionEffectsOnFiber(root2, returnFiber, childToDelete);
      hostParent = null;
      hostParentIsContainer = false;
      root2 = childToDelete.alternate;
      null !== root2 && (root2.return = null);
      childToDelete.return = null;
    }
  if (parentFiber.subtreeFlags & 13878)
    for (parentFiber = parentFiber.child; null !== parentFiber; )
      commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), parentFiber = parentFiber.sibling;
}
var currentHoistableRoot = null;
function commitMutationEffectsOnFiber(finishedWork, root2) {
  var current2 = finishedWork.alternate, flags = finishedWork.flags;
  switch (finishedWork.tag) {
    case 0:
    case 11:
    case 14:
    case 15:
      recursivelyTraverseMutationEffects(root2, finishedWork);
      commitReconciliationEffects(finishedWork);
      flags & 4 && (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), commitHookEffectListMount(3, finishedWork), commitHookEffectListUnmount(5, finishedWork, finishedWork.return));
      break;
    case 1:
      recursivelyTraverseMutationEffects(root2, finishedWork);
      commitReconciliationEffects(finishedWork);
      flags & 512 && (offscreenSubtreeWasHidden || null === current2 || safelyDetachRef(current2, current2.return));
      flags & 64 && offscreenSubtreeIsHidden && (finishedWork = finishedWork.updateQueue, null !== finishedWork && (flags = finishedWork.callbacks, null !== flags && (current2 = finishedWork.shared.hiddenCallbacks, finishedWork.shared.hiddenCallbacks = null === current2 ? flags : current2.concat(flags))));
      break;
    case 26:
      var hoistableRoot = currentHoistableRoot;
      recursivelyTraverseMutationEffects(root2, finishedWork);
      commitReconciliationEffects(finishedWork);
      flags & 512 && (offscreenSubtreeWasHidden || null === current2 || safelyDetachRef(current2, current2.return));
      if (flags & 4) {
        var currentResource = null !== current2 ? current2.memoizedState : null;
        flags = finishedWork.memoizedState;
        if (null === current2)
          if (null === flags)
            if (null === finishedWork.stateNode) {
              a: {
                flags = finishedWork.type;
                current2 = finishedWork.memoizedProps;
                hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
                b: switch (flags) {
                  case "title":
                    currentResource = hoistableRoot.getElementsByTagName("title")[0];
                    if (!currentResource || currentResource[internalHoistableMarker] || currentResource[internalInstanceKey] || "http://www.w3.org/2000/svg" === currentResource.namespaceURI || currentResource.hasAttribute("itemprop"))
                      currentResource = hoistableRoot.createElement(flags), hoistableRoot.head.insertBefore(
                        currentResource,
                        hoistableRoot.querySelector("head > title")
                      );
                    setInitialProperties(currentResource, flags, current2);
                    currentResource[internalInstanceKey] = finishedWork;
                    markNodeAsHoistable(currentResource);
                    flags = currentResource;
                    break a;
                  case "link":
                    var maybeNodes = getHydratableHoistableCache(
                      "link",
                      "href",
                      hoistableRoot
                    ).get(flags + (current2.href || ""));
                    if (maybeNodes) {
                      for (var i2 = 0; i2 < maybeNodes.length; i2++)
                        if (currentResource = maybeNodes[i2], currentResource.getAttribute("href") === (null == current2.href || "" === current2.href ? null : current2.href) && currentResource.getAttribute("rel") === (null == current2.rel ? null : current2.rel) && currentResource.getAttribute("title") === (null == current2.title ? null : current2.title) && currentResource.getAttribute("crossorigin") === (null == current2.crossOrigin ? null : current2.crossOrigin)) {
                          maybeNodes.splice(i2, 1);
                          break b;
                        }
                    }
                    currentResource = hoistableRoot.createElement(flags);
                    setInitialProperties(currentResource, flags, current2);
                    hoistableRoot.head.appendChild(currentResource);
                    break;
                  case "meta":
                    if (maybeNodes = getHydratableHoistableCache(
                      "meta",
                      "content",
                      hoistableRoot
                    ).get(flags + (current2.content || ""))) {
                      for (i2 = 0; i2 < maybeNodes.length; i2++)
                        if (currentResource = maybeNodes[i2], currentResource.getAttribute("content") === (null == current2.content ? null : "" + current2.content) && currentResource.getAttribute("name") === (null == current2.name ? null : current2.name) && currentResource.getAttribute("property") === (null == current2.property ? null : current2.property) && currentResource.getAttribute("http-equiv") === (null == current2.httpEquiv ? null : current2.httpEquiv) && currentResource.getAttribute("charset") === (null == current2.charSet ? null : current2.charSet)) {
                          maybeNodes.splice(i2, 1);
                          break b;
                        }
                    }
                    currentResource = hoistableRoot.createElement(flags);
                    setInitialProperties(currentResource, flags, current2);
                    hoistableRoot.head.appendChild(currentResource);
                    break;
                  default:
                    throw Error(formatProdErrorMessage$2(468, flags));
                }
                currentResource[internalInstanceKey] = finishedWork;
                markNodeAsHoistable(currentResource);
                flags = currentResource;
              }
              finishedWork.stateNode = flags;
            } else
              mountHoistable(
                hoistableRoot,
                finishedWork.type,
                finishedWork.stateNode
              );
          else
            finishedWork.stateNode = acquireResource(
              hoistableRoot,
              flags,
              finishedWork.memoizedProps
            );
        else
          currentResource !== flags ? (null === currentResource ? null !== current2.stateNode && (current2 = current2.stateNode, current2.parentNode.removeChild(current2)) : currentResource.count--, null === flags ? mountHoistable(
            hoistableRoot,
            finishedWork.type,
            finishedWork.stateNode
          ) : acquireResource(
            hoistableRoot,
            flags,
            finishedWork.memoizedProps
          )) : null === flags && null !== finishedWork.stateNode && commitHostUpdate(
            finishedWork,
            finishedWork.memoizedProps,
            current2.memoizedProps
          );
      }
      break;
    case 27:
      recursivelyTraverseMutationEffects(root2, finishedWork);
      commitReconciliationEffects(finishedWork);
      flags & 512 && (offscreenSubtreeWasHidden || null === current2 || safelyDetachRef(current2, current2.return));
      null !== current2 && flags & 4 && commitHostUpdate(
        finishedWork,
        finishedWork.memoizedProps,
        current2.memoizedProps
      );
      break;
    case 5:
      recursivelyTraverseMutationEffects(root2, finishedWork);
      commitReconciliationEffects(finishedWork);
      flags & 512 && (offscreenSubtreeWasHidden || null === current2 || safelyDetachRef(current2, current2.return));
      if (finishedWork.flags & 32) {
        hoistableRoot = finishedWork.stateNode;
        try {
          setTextContent(hoistableRoot, "");
        } catch (error) {
          captureCommitPhaseError(finishedWork, finishedWork.return, error);
        }
      }
      flags & 4 && null != finishedWork.stateNode && (hoistableRoot = finishedWork.memoizedProps, commitHostUpdate(
        finishedWork,
        hoistableRoot,
        null !== current2 ? current2.memoizedProps : hoistableRoot
      ));
      flags & 1024 && (needsFormReset = true);
      break;
    case 6:
      recursivelyTraverseMutationEffects(root2, finishedWork);
      commitReconciliationEffects(finishedWork);
      if (flags & 4) {
        if (null === finishedWork.stateNode)
          throw Error(formatProdErrorMessage$2(162));
        flags = finishedWork.memoizedProps;
        current2 = finishedWork.stateNode;
        try {
          current2.nodeValue = flags;
        } catch (error) {
          captureCommitPhaseError(finishedWork, finishedWork.return, error);
        }
      }
      break;
    case 3:
      tagCaches = null;
      hoistableRoot = currentHoistableRoot;
      currentHoistableRoot = getHoistableRoot(root2.containerInfo);
      recursivelyTraverseMutationEffects(root2, finishedWork);
      currentHoistableRoot = hoistableRoot;
      commitReconciliationEffects(finishedWork);
      if (flags & 4 && null !== current2 && current2.memoizedState.isDehydrated)
        try {
          retryIfBlockedOn(root2.containerInfo);
        } catch (error) {
          captureCommitPhaseError(finishedWork, finishedWork.return, error);
        }
      needsFormReset && (needsFormReset = false, recursivelyResetForms(finishedWork));
      break;
    case 4:
      flags = currentHoistableRoot;
      currentHoistableRoot = getHoistableRoot(
        finishedWork.stateNode.containerInfo
      );
      recursivelyTraverseMutationEffects(root2, finishedWork);
      commitReconciliationEffects(finishedWork);
      currentHoistableRoot = flags;
      break;
    case 12:
      recursivelyTraverseMutationEffects(root2, finishedWork);
      commitReconciliationEffects(finishedWork);
      break;
    case 13:
      recursivelyTraverseMutationEffects(root2, finishedWork);
      commitReconciliationEffects(finishedWork);
      finishedWork.child.flags & 8192 && null !== finishedWork.memoizedState !== (null !== current2 && null !== current2.memoizedState) && (globalMostRecentFallbackTime = now());
      flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (finishedWork.updateQueue = null, attachSuspenseRetryListeners(finishedWork, flags)));
      break;
    case 22:
      hoistableRoot = null !== finishedWork.memoizedState;
      var wasHidden = null !== current2 && null !== current2.memoizedState, prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
      offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || hoistableRoot;
      offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || wasHidden;
      recursivelyTraverseMutationEffects(root2, finishedWork);
      offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
      offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden;
      commitReconciliationEffects(finishedWork);
      if (flags & 8192)
        a: for (root2 = finishedWork.stateNode, root2._visibility = hoistableRoot ? root2._visibility & -2 : root2._visibility | 1, hoistableRoot && (null === current2 || wasHidden || offscreenSubtreeIsHidden || offscreenSubtreeWasHidden || recursivelyTraverseDisappearLayoutEffects(finishedWork)), current2 = null, root2 = finishedWork; ; ) {
          if (5 === root2.tag || 26 === root2.tag) {
            if (null === current2) {
              wasHidden = current2 = root2;
              try {
                if (currentResource = wasHidden.stateNode, hoistableRoot)
                  maybeNodes = currentResource.style, "function" === typeof maybeNodes.setProperty ? maybeNodes.setProperty("display", "none", "important") : maybeNodes.display = "none";
                else {
                  i2 = wasHidden.stateNode;
                  var styleProp = wasHidden.memoizedProps.style, display = void 0 !== styleProp && null !== styleProp && styleProp.hasOwnProperty("display") ? styleProp.display : null;
                  i2.style.display = null == display || "boolean" === typeof display ? "" : ("" + display).trim();
                }
              } catch (error) {
                captureCommitPhaseError(wasHidden, wasHidden.return, error);
              }
            }
          } else if (6 === root2.tag) {
            if (null === current2) {
              wasHidden = root2;
              try {
                wasHidden.stateNode.nodeValue = hoistableRoot ? "" : wasHidden.memoizedProps;
              } catch (error) {
                captureCommitPhaseError(wasHidden, wasHidden.return, error);
              }
            }
          } else if ((22 !== root2.tag && 23 !== root2.tag || null === root2.memoizedState || root2 === finishedWork) && null !== root2.child) {
            root2.child.return = root2;
            root2 = root2.child;
            continue;
          }
          if (root2 === finishedWork) break a;
          for (; null === root2.sibling; ) {
            if (null === root2.return || root2.return === finishedWork) break a;
            current2 === root2 && (current2 = null);
            root2 = root2.return;
          }
          current2 === root2 && (current2 = null);
          root2.sibling.return = root2.return;
          root2 = root2.sibling;
        }
      flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (current2 = flags.retryQueue, null !== current2 && (flags.retryQueue = null, attachSuspenseRetryListeners(finishedWork, current2))));
      break;
    case 19:
      recursivelyTraverseMutationEffects(root2, finishedWork);
      commitReconciliationEffects(finishedWork);
      flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (finishedWork.updateQueue = null, attachSuspenseRetryListeners(finishedWork, flags)));
      break;
    case 30:
      break;
    case 21:
      break;
    default:
      recursivelyTraverseMutationEffects(root2, finishedWork), commitReconciliationEffects(finishedWork);
  }
}
function commitReconciliationEffects(finishedWork) {
  var flags = finishedWork.flags;
  if (flags & 2) {
    try {
      for (var hostParentFiber, parentFiber = finishedWork.return; null !== parentFiber; ) {
        if (isHostParent(parentFiber)) {
          hostParentFiber = parentFiber;
          break;
        }
        parentFiber = parentFiber.return;
      }
      if (null == hostParentFiber) throw Error(formatProdErrorMessage$2(160));
      switch (hostParentFiber.tag) {
        case 27:
          var parent = hostParentFiber.stateNode, before = getHostSibling(finishedWork);
          insertOrAppendPlacementNode(finishedWork, before, parent);
          break;
        case 5:
          var parent$144 = hostParentFiber.stateNode;
          hostParentFiber.flags & 32 && (setTextContent(parent$144, ""), hostParentFiber.flags &= -33);
          var before$145 = getHostSibling(finishedWork);
          insertOrAppendPlacementNode(finishedWork, before$145, parent$144);
          break;
        case 3:
        case 4:
          var parent$146 = hostParentFiber.stateNode.containerInfo, before$147 = getHostSibling(finishedWork);
          insertOrAppendPlacementNodeIntoContainer(
            finishedWork,
            before$147,
            parent$146
          );
          break;
        default:
          throw Error(formatProdErrorMessage$2(161));
      }
    } catch (error) {
      captureCommitPhaseError(finishedWork, finishedWork.return, error);
    }
    finishedWork.flags &= -3;
  }
  flags & 4096 && (finishedWork.flags &= -4097);
}
function recursivelyResetForms(parentFiber) {
  if (parentFiber.subtreeFlags & 1024)
    for (parentFiber = parentFiber.child; null !== parentFiber; ) {
      var fiber = parentFiber;
      recursivelyResetForms(fiber);
      5 === fiber.tag && fiber.flags & 1024 && fiber.stateNode.reset();
      parentFiber = parentFiber.sibling;
    }
}
function recursivelyTraverseLayoutEffects(root2, parentFiber) {
  if (parentFiber.subtreeFlags & 8772)
    for (parentFiber = parentFiber.child; null !== parentFiber; )
      commitLayoutEffectOnFiber(root2, parentFiber.alternate, parentFiber), parentFiber = parentFiber.sibling;
}
function recursivelyTraverseDisappearLayoutEffects(parentFiber) {
  for (parentFiber = parentFiber.child; null !== parentFiber; ) {
    var finishedWork = parentFiber;
    switch (finishedWork.tag) {
      case 0:
      case 11:
      case 14:
      case 15:
        commitHookEffectListUnmount(4, finishedWork, finishedWork.return);
        recursivelyTraverseDisappearLayoutEffects(finishedWork);
        break;
      case 1:
        safelyDetachRef(finishedWork, finishedWork.return);
        var instance2 = finishedWork.stateNode;
        "function" === typeof instance2.componentWillUnmount && safelyCallComponentWillUnmount(
          finishedWork,
          finishedWork.return,
          instance2
        );
        recursivelyTraverseDisappearLayoutEffects(finishedWork);
        break;
      case 27:
        releaseSingletonInstance(finishedWork.stateNode);
      case 26:
      case 5:
        safelyDetachRef(finishedWork, finishedWork.return);
        recursivelyTraverseDisappearLayoutEffects(finishedWork);
        break;
      case 22:
        null === finishedWork.memoizedState && recursivelyTraverseDisappearLayoutEffects(finishedWork);
        break;
      case 30:
        recursivelyTraverseDisappearLayoutEffects(finishedWork);
        break;
      default:
        recursivelyTraverseDisappearLayoutEffects(finishedWork);
    }
    parentFiber = parentFiber.sibling;
  }
}
function recursivelyTraverseReappearLayoutEffects(finishedRoot$jscomp$0, parentFiber, includeWorkInProgressEffects) {
  includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772);
  for (parentFiber = parentFiber.child; null !== parentFiber; ) {
    var current2 = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags;
    switch (finishedWork.tag) {
      case 0:
      case 11:
      case 15:
        recursivelyTraverseReappearLayoutEffects(
          finishedRoot,
          finishedWork,
          includeWorkInProgressEffects
        );
        commitHookEffectListMount(4, finishedWork);
        break;
      case 1:
        recursivelyTraverseReappearLayoutEffects(
          finishedRoot,
          finishedWork,
          includeWorkInProgressEffects
        );
        current2 = finishedWork;
        finishedRoot = current2.stateNode;
        if ("function" === typeof finishedRoot.componentDidMount)
          try {
            finishedRoot.componentDidMount();
          } catch (error) {
            captureCommitPhaseError(current2, current2.return, error);
          }
        current2 = finishedWork;
        finishedRoot = current2.updateQueue;
        if (null !== finishedRoot) {
          var instance2 = current2.stateNode;
          try {
            var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks;
            if (null !== hiddenCallbacks)
              for (finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; finishedRoot < hiddenCallbacks.length; finishedRoot++)
                callCallback(hiddenCallbacks[finishedRoot], instance2);
          } catch (error) {
            captureCommitPhaseError(current2, current2.return, error);
          }
        }
        includeWorkInProgressEffects && flags & 64 && commitClassCallbacks(finishedWork);
        safelyAttachRef(finishedWork, finishedWork.return);
        break;
      case 27:
        commitHostSingletonAcquisition(finishedWork);
      case 26:
      case 5:
        recursivelyTraverseReappearLayoutEffects(
          finishedRoot,
          finishedWork,
          includeWorkInProgressEffects
        );
        includeWorkInProgressEffects && null === current2 && flags & 4 && commitHostMount(finishedWork);
        safelyAttachRef(finishedWork, finishedWork.return);
        break;
      case 12:
        recursivelyTraverseReappearLayoutEffects(
          finishedRoot,
          finishedWork,
          includeWorkInProgressEffects
        );
        break;
      case 13:
        recursivelyTraverseReappearLayoutEffects(
          finishedRoot,
          finishedWork,
          includeWorkInProgressEffects
        );
        includeWorkInProgressEffects && flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
        break;
      case 22:
        null === finishedWork.memoizedState && recursivelyTraverseReappearLayoutEffects(
          finishedRoot,
          finishedWork,
          includeWorkInProgressEffects
        );
        safelyAttachRef(finishedWork, finishedWork.return);
        break;
      case 30:
        break;
      default:
        recursivelyTraverseReappearLayoutEffects(
          finishedRoot,
          finishedWork,
          includeWorkInProgressEffects
        );
    }
    parentFiber = parentFiber.sibling;
  }
}
function commitOffscreenPassiveMountEffects(current2, finishedWork) {
  var previousCache = null;
  null !== current2 && null !== current2.memoizedState && null !== current2.memoizedState.cachePool && (previousCache = current2.memoizedState.cachePool.pool);
  current2 = null;
  null !== finishedWork.memoizedState && null !== finishedWork.memoizedState.cachePool && (current2 = finishedWork.memoizedState.cachePool.pool);
  current2 !== previousCache && (null != current2 && current2.refCount++, null != previousCache && releaseCache(previousCache));
}
function commitCachePassiveMountEffect(current2, finishedWork) {
  current2 = null;
  null !== finishedWork.alternate && (current2 = finishedWork.alternate.memoizedState.cache);
  finishedWork = finishedWork.memoizedState.cache;
  finishedWork !== current2 && (finishedWork.refCount++, null != current2 && releaseCache(current2));
}
function recursivelyTraversePassiveMountEffects(root2, parentFiber, committedLanes, committedTransitions) {
  if (parentFiber.subtreeFlags & 10256)
    for (parentFiber = parentFiber.child; null !== parentFiber; )
      commitPassiveMountOnFiber(
        root2,
        parentFiber,
        committedLanes,
        committedTransitions
      ), parentFiber = parentFiber.sibling;
}
function commitPassiveMountOnFiber(finishedRoot, finishedWork, committedLanes, committedTransitions) {
  var flags = finishedWork.flags;
  switch (finishedWork.tag) {
    case 0:
    case 11:
    case 15:
      recursivelyTraversePassiveMountEffects(
        finishedRoot,
        finishedWork,
        committedLanes,
        committedTransitions
      );
      flags & 2048 && commitHookEffectListMount(9, finishedWork);
      break;
    case 1:
      recursivelyTraversePassiveMountEffects(
        finishedRoot,
        finishedWork,
        committedLanes,
        committedTransitions
      );
      break;
    case 3:
      recursivelyTraversePassiveMountEffects(
        finishedRoot,
        finishedWork,
        committedLanes,
        committedTransitions
      );
      flags & 2048 && (finishedRoot = null, null !== finishedWork.alternate && (finishedRoot = finishedWork.alternate.memoizedState.cache), finishedWork = finishedWork.memoizedState.cache, finishedWork !== finishedRoot && (finishedWork.refCount++, null != finishedRoot && releaseCache(finishedRoot)));
      break;
    case 12:
      if (flags & 2048) {
        recursivelyTraversePassiveMountEffects(
          finishedRoot,
          finishedWork,
          committedLanes,
          committedTransitions
        );
        finishedRoot = finishedWork.stateNode;
        try {
          var _finishedWork$memoize2 = finishedWork.memoizedProps, id = _finishedWork$memoize2.id, onPostCommit = _finishedWork$memoize2.onPostCommit;
          "function" === typeof onPostCommit && onPostCommit(
            id,
            null === finishedWork.alternate ? "mount" : "update",
            finishedRoot.passiveEffectDuration,
            -0
          );
        } catch (error) {
          captureCommitPhaseError(finishedWork, finishedWork.return, error);
        }
      } else
        recursivelyTraversePassiveMountEffects(
          finishedRoot,
          finishedWork,
          committedLanes,
          committedTransitions
        );
      break;
    case 13:
      recursivelyTraversePassiveMountEffects(
        finishedRoot,
        finishedWork,
        committedLanes,
        committedTransitions
      );
      break;
    case 23:
      break;
    case 22:
      _finishedWork$memoize2 = finishedWork.stateNode;
      id = finishedWork.alternate;
      null !== finishedWork.memoizedState ? _finishedWork$memoize2._visibility & 2 ? recursivelyTraversePassiveMountEffects(
        finishedRoot,
        finishedWork,
        committedLanes,
        committedTransitions
      ) : recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) : _finishedWork$memoize2._visibility & 2 ? recursivelyTraversePassiveMountEffects(
        finishedRoot,
        finishedWork,
        committedLanes,
        committedTransitions
      ) : (_finishedWork$memoize2._visibility |= 2, recursivelyTraverseReconnectPassiveEffects(
        finishedRoot,
        finishedWork,
        committedLanes,
        committedTransitions,
        0 !== (finishedWork.subtreeFlags & 10256)
      ));
      flags & 2048 && commitOffscreenPassiveMountEffects(id, finishedWork);
      break;
    case 24:
      recursivelyTraversePassiveMountEffects(
        finishedRoot,
        finishedWork,
        committedLanes,
        committedTransitions
      );
      flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
      break;
    default:
      recursivelyTraversePassiveMountEffects(
        finishedRoot,
        finishedWork,
        committedLanes,
        committedTransitions
      );
  }
}
function recursivelyTraverseReconnectPassiveEffects(finishedRoot$jscomp$0, parentFiber, committedLanes$jscomp$0, committedTransitions$jscomp$0, includeWorkInProgressEffects) {
  includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256);
  for (parentFiber = parentFiber.child; null !== parentFiber; ) {
    var finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, committedLanes = committedLanes$jscomp$0, committedTransitions = committedTransitions$jscomp$0, flags = finishedWork.flags;
    switch (finishedWork.tag) {
      case 0:
      case 11:
      case 15:
        recursivelyTraverseReconnectPassiveEffects(
          finishedRoot,
          finishedWork,
          committedLanes,
          committedTransitions,
          includeWorkInProgressEffects
        );
        commitHookEffectListMount(8, finishedWork);
        break;
      case 23:
        break;
      case 22:
        var instance2 = finishedWork.stateNode;
        null !== finishedWork.memoizedState ? instance2._visibility & 2 ? recursivelyTraverseReconnectPassiveEffects(
          finishedRoot,
          finishedWork,
          committedLanes,
          committedTransitions,
          includeWorkInProgressEffects
        ) : recursivelyTraverseAtomicPassiveEffects(
          finishedRoot,
          finishedWork
        ) : (instance2._visibility |= 2, recursivelyTraverseReconnectPassiveEffects(
          finishedRoot,
          finishedWork,
          committedLanes,
          committedTransitions,
          includeWorkInProgressEffects
        ));
        includeWorkInProgressEffects && flags & 2048 && commitOffscreenPassiveMountEffects(
          finishedWork.alternate,
          finishedWork
        );
        break;
      case 24:
        recursivelyTraverseReconnectPassiveEffects(
          finishedRoot,
          finishedWork,
          committedLanes,
          committedTransitions,
          includeWorkInProgressEffects
        );
        includeWorkInProgressEffects && flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
        break;
      default:
        recursivelyTraverseReconnectPassiveEffects(
          finishedRoot,
          finishedWork,
          committedLanes,
          committedTransitions,
          includeWorkInProgressEffects
        );
    }
    parentFiber = parentFiber.sibling;
  }
}
function recursivelyTraverseAtomicPassiveEffects(finishedRoot$jscomp$0, parentFiber) {
  if (parentFiber.subtreeFlags & 10256)
    for (parentFiber = parentFiber.child; null !== parentFiber; ) {
      var finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags;
      switch (finishedWork.tag) {
        case 22:
          recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork);
          flags & 2048 && commitOffscreenPassiveMountEffects(
            finishedWork.alternate,
            finishedWork
          );
          break;
        case 24:
          recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork);
          flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
          break;
        default:
          recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork);
      }
      parentFiber = parentFiber.sibling;
    }
}
var suspenseyCommitFlag = 8192;
function recursivelyAccumulateSuspenseyCommit(parentFiber) {
  if (parentFiber.subtreeFlags & suspenseyCommitFlag)
    for (parentFiber = parentFiber.child; null !== parentFiber; )
      accumulateSuspenseyCommitOnFiber(parentFiber), parentFiber = parentFiber.sibling;
}
function accumulateSuspenseyCommitOnFiber(fiber) {
  switch (fiber.tag) {
    case 26:
      recursivelyAccumulateSuspenseyCommit(fiber);
      fiber.flags & suspenseyCommitFlag && null !== fiber.memoizedState && suspendResource(
        currentHoistableRoot,
        fiber.memoizedState,
        fiber.memoizedProps
      );
      break;
    case 5:
      recursivelyAccumulateSuspenseyCommit(fiber);
      break;
    case 3:
    case 4:
      var previousHoistableRoot = currentHoistableRoot;
      currentHoistableRoot = getHoistableRoot(fiber.stateNode.containerInfo);
      recursivelyAccumulateSuspenseyCommit(fiber);
      currentHoistableRoot = previousHoistableRoot;
      break;
    case 22:
      null === fiber.memoizedState && (previousHoistableRoot = fiber.alternate, null !== previousHoistableRoot && null !== previousHoistableRoot.memoizedState ? (previousHoistableRoot = suspenseyCommitFlag, suspenseyCommitFlag = 16777216, recursivelyAccumulateSuspenseyCommit(fiber), suspenseyCommitFlag = previousHoistableRoot) : recursivelyAccumulateSuspenseyCommit(fiber));
      break;
    default:
      recursivelyAccumulateSuspenseyCommit(fiber);
  }
}
function detachAlternateSiblings(parentFiber) {
  var previousFiber = parentFiber.alternate;
  if (null !== previousFiber && (parentFiber = previousFiber.child, null !== parentFiber)) {
    previousFiber.child = null;
    do
      previousFiber = parentFiber.sibling, parentFiber.sibling = null, parentFiber = previousFiber;
    while (null !== parentFiber);
  }
}
function recursivelyTraversePassiveUnmountEffects(parentFiber) {
  var deletions = parentFiber.deletions;
  if (0 !== (parentFiber.flags & 16)) {
    if (null !== deletions)
      for (var i2 = 0; i2 < deletions.length; i2++) {
        var childToDelete = deletions[i2];
        nextEffect = childToDelete;
        commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
          childToDelete,
          parentFiber
        );
      }
    detachAlternateSiblings(parentFiber);
  }
  if (parentFiber.subtreeFlags & 10256)
    for (parentFiber = parentFiber.child; null !== parentFiber; )
      commitPassiveUnmountOnFiber(parentFiber), parentFiber = parentFiber.sibling;
}
function commitPassiveUnmountOnFiber(finishedWork) {
  switch (finishedWork.tag) {
    case 0:
    case 11:
    case 15:
      recursivelyTraversePassiveUnmountEffects(finishedWork);
      finishedWork.flags & 2048 && commitHookEffectListUnmount(9, finishedWork, finishedWork.return);
      break;
    case 3:
      recursivelyTraversePassiveUnmountEffects(finishedWork);
      break;
    case 12:
      recursivelyTraversePassiveUnmountEffects(finishedWork);
      break;
    case 22:
      var instance2 = finishedWork.stateNode;
      null !== finishedWork.memoizedState && instance2._visibility & 2 && (null === finishedWork.return || 13 !== finishedWork.return.tag) ? (instance2._visibility &= -3, recursivelyTraverseDisconnectPassiveEffects(finishedWork)) : recursivelyTraversePassiveUnmountEffects(finishedWork);
      break;
    default:
      recursivelyTraversePassiveUnmountEffects(finishedWork);
  }
}
function recursivelyTraverseDisconnectPassiveEffects(parentFiber) {
  var deletions = parentFiber.deletions;
  if (0 !== (parentFiber.flags & 16)) {
    if (null !== deletions)
      for (var i2 = 0; i2 < deletions.length; i2++) {
        var childToDelete = deletions[i2];
        nextEffect = childToDelete;
        commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
          childToDelete,
          parentFiber
        );
      }
    detachAlternateSiblings(parentFiber);
  }
  for (parentFiber = parentFiber.child; null !== parentFiber; ) {
    deletions = parentFiber;
    switch (deletions.tag) {
      case 0:
      case 11:
      case 15:
        commitHookEffectListUnmount(8, deletions, deletions.return);
        recursivelyTraverseDisconnectPassiveEffects(deletions);
        break;
      case 22:
        i2 = deletions.stateNode;
        i2._visibility & 2 && (i2._visibility &= -3, recursivelyTraverseDisconnectPassiveEffects(deletions));
        break;
      default:
        recursivelyTraverseDisconnectPassiveEffects(deletions);
    }
    parentFiber = parentFiber.sibling;
  }
}
function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(deletedSubtreeRoot, nearestMountedAncestor) {
  for (; null !== nextEffect; ) {
    var fiber = nextEffect;
    switch (fiber.tag) {
      case 0:
      case 11:
      case 15:
        commitHookEffectListUnmount(8, fiber, nearestMountedAncestor);
        break;
      case 23:
      case 22:
        if (null !== fiber.memoizedState && null !== fiber.memoizedState.cachePool) {
          var cache = fiber.memoizedState.cachePool.pool;
          null != cache && cache.refCount++;
        }
        break;
      case 24:
        releaseCache(fiber.memoizedState.cache);
    }
    cache = fiber.child;
    if (null !== cache) cache.return = fiber, nextEffect = cache;
    else
      a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) {
        cache = nextEffect;
        var sibling = cache.sibling, returnFiber = cache.return;
        detachFiberAfterEffects(cache);
        if (cache === fiber) {
          nextEffect = null;
          break a;
        }
        if (null !== sibling) {
          sibling.return = returnFiber;
          nextEffect = sibling;
          break a;
        }
        nextEffect = returnFiber;
      }
  }
}
var DefaultAsyncDispatcher = {
  getCacheForType: function(resourceType) {
    var cache = readContext(CacheContext), cacheForType = cache.data.get(resourceType);
    void 0 === cacheForType && (cacheForType = resourceType(), cache.data.set(resourceType, cacheForType));
    return cacheForType;
  }
}, PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, executionContext = 0, workInProgressRoot = null, workInProgress = null, workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, workInProgressRootDidSkipSuspendedSiblings = false, workInProgressRootIsPrerendering = false, workInProgressRootDidAttachPingListener = false, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, workInProgressRootSkippedLanes = 0, workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = false, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, pendingEffectsStatus = 0, pendingEffectsRoot = null, pendingFinishedWork = null, pendingEffectsLanes = 0, pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, pendingRecoverableErrors = null, nestedUpdateCount = 0, rootWithNestedUpdates = null;
function requestUpdateLane() {
  if (0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes)
    return workInProgressRootRenderLanes & -workInProgressRootRenderLanes;
  if (null !== ReactSharedInternals.T) {
    var actionScopeLane = currentEntangledLane;
    return 0 !== actionScopeLane ? actionScopeLane : requestTransitionLane();
  }
  return resolveUpdatePriority();
}
function requestDeferredLane() {
  0 === workInProgressDeferredLane && (workInProgressDeferredLane = 0 === (workInProgressRootRenderLanes & 536870912) || isHydrating ? claimNextTransitionLane() : 536870912);
  var suspenseHandler = suspenseHandlerStackCursor.current;
  null !== suspenseHandler && (suspenseHandler.flags |= 32);
  return workInProgressDeferredLane;
}
function scheduleUpdateOnFiber(root2, fiber, lane) {
  if (root2 === workInProgressRoot && (2 === workInProgressSuspendedReason || 9 === workInProgressSuspendedReason) || null !== root2.cancelPendingCommit)
    prepareFreshStack(root2, 0), markRootSuspended(
      root2,
      workInProgressRootRenderLanes,
      workInProgressDeferredLane,
      false
    );
  markRootUpdated$1(root2, lane);
  if (0 === (executionContext & 2) || root2 !== workInProgressRoot)
    root2 === workInProgressRoot && (0 === (executionContext & 2) && (workInProgressRootInterleavedUpdatedLanes |= lane), 4 === workInProgressRootExitStatus && markRootSuspended(
      root2,
      workInProgressRootRenderLanes,
      workInProgressDeferredLane,
      false
    )), ensureRootIsScheduled(root2);
}
function performWorkOnRoot(root$jscomp$0, lanes, forceSync) {
  if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage$2(327));
  var shouldTimeSlice = !forceSync && 0 === (lanes & 124) && 0 === (lanes & root$jscomp$0.expiredLanes) || checkIfRootIsPrerendering(root$jscomp$0, lanes), exitStatus = shouldTimeSlice ? renderRootConcurrent(root$jscomp$0, lanes) : renderRootSync(root$jscomp$0, lanes, true), renderWasConcurrent = shouldTimeSlice;
  do {
    if (0 === exitStatus) {
      workInProgressRootIsPrerendering && !shouldTimeSlice && markRootSuspended(root$jscomp$0, lanes, 0, false);
      break;
    } else {
      forceSync = root$jscomp$0.current.alternate;
      if (renderWasConcurrent && !isRenderConsistentWithExternalStores(forceSync)) {
        exitStatus = renderRootSync(root$jscomp$0, lanes, false);
        renderWasConcurrent = false;
        continue;
      }
      if (2 === exitStatus) {
        renderWasConcurrent = lanes;
        if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent)
          var JSCompiler_inline_result = 0;
        else
          JSCompiler_inline_result = root$jscomp$0.pendingLanes & -536870913, JSCompiler_inline_result = 0 !== JSCompiler_inline_result ? JSCompiler_inline_result : JSCompiler_inline_result & 536870912 ? 536870912 : 0;
        if (0 !== JSCompiler_inline_result) {
          lanes = JSCompiler_inline_result;
          a: {
            var root2 = root$jscomp$0;
            exitStatus = workInProgressRootConcurrentErrors;
            var wasRootDehydrated = root2.current.memoizedState.isDehydrated;
            wasRootDehydrated && (prepareFreshStack(root2, JSCompiler_inline_result).flags |= 256);
            JSCompiler_inline_result = renderRootSync(
              root2,
              JSCompiler_inline_result,
              false
            );
            if (2 !== JSCompiler_inline_result) {
              if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) {
                root2.errorRecoveryDisabledLanes |= renderWasConcurrent;
                workInProgressRootInterleavedUpdatedLanes |= renderWasConcurrent;
                exitStatus = 4;
                break a;
              }
              renderWasConcurrent = workInProgressRootRecoverableErrors;
              workInProgressRootRecoverableErrors = exitStatus;
              null !== renderWasConcurrent && (null === workInProgressRootRecoverableErrors ? workInProgressRootRecoverableErrors = renderWasConcurrent : workInProgressRootRecoverableErrors.push.apply(
                workInProgressRootRecoverableErrors,
                renderWasConcurrent
              ));
            }
            exitStatus = JSCompiler_inline_result;
          }
          renderWasConcurrent = false;
          if (2 !== exitStatus) continue;
        }
      }
      if (1 === exitStatus) {
        prepareFreshStack(root$jscomp$0, 0);
        markRootSuspended(root$jscomp$0, lanes, 0, true);
        break;
      }
      a: {
        shouldTimeSlice = root$jscomp$0;
        renderWasConcurrent = exitStatus;
        switch (renderWasConcurrent) {
          case 0:
          case 1:
            throw Error(formatProdErrorMessage$2(345));
          case 4:
            if ((lanes & 4194048) !== lanes) break;
          case 6:
            markRootSuspended(
              shouldTimeSlice,
              lanes,
              workInProgressDeferredLane,
              !workInProgressRootDidSkipSuspendedSiblings
            );
            break a;
          case 2:
            workInProgressRootRecoverableErrors = null;
            break;
          case 3:
          case 5:
            break;
          default:
            throw Error(formatProdErrorMessage$2(329));
        }
        if ((lanes & 62914560) === lanes && (exitStatus = globalMostRecentFallbackTime + 300 - now(), 10 < exitStatus)) {
          markRootSuspended(
            shouldTimeSlice,
            lanes,
            workInProgressDeferredLane,
            !workInProgressRootDidSkipSuspendedSiblings
          );
          if (0 !== getNextLanes(shouldTimeSlice, 0, true)) break a;
          shouldTimeSlice.timeoutHandle = scheduleTimeout(
            commitRootWhenReady.bind(
              null,
              shouldTimeSlice,
              forceSync,
              workInProgressRootRecoverableErrors,
              workInProgressTransitions,
              workInProgressRootDidIncludeRecursiveRenderUpdate,
              lanes,
              workInProgressDeferredLane,
              workInProgressRootInterleavedUpdatedLanes,
              workInProgressSuspendedRetryLanes,
              workInProgressRootDidSkipSuspendedSiblings,
              renderWasConcurrent,
              2,
              -0,
              0
            ),
            exitStatus
          );
          break a;
        }
        commitRootWhenReady(
          shouldTimeSlice,
          forceSync,
          workInProgressRootRecoverableErrors,
          workInProgressTransitions,
          workInProgressRootDidIncludeRecursiveRenderUpdate,
          lanes,
          workInProgressDeferredLane,
          workInProgressRootInterleavedUpdatedLanes,
          workInProgressSuspendedRetryLanes,
          workInProgressRootDidSkipSuspendedSiblings,
          renderWasConcurrent,
          0,
          -0,
          0
        );
      }
    }
    break;
  } while (1);
  ensureRootIsScheduled(root$jscomp$0);
}
function commitRootWhenReady(root2, finishedWork, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, lanes, spawnedLane, updatedLanes, suspendedRetryLanes, didSkipSuspendedSiblings, exitStatus, suspendedCommitReason, completedRenderStartTime, completedRenderEndTime) {
  root2.timeoutHandle = -1;
  suspendedCommitReason = finishedWork.subtreeFlags;
  if (suspendedCommitReason & 8192 || 16785408 === (suspendedCommitReason & 16785408)) {
    if (suspendedState = { stylesheets: null, count: 0, unsuspend: noop$4 }, accumulateSuspenseyCommitOnFiber(finishedWork), suspendedCommitReason = waitForCommitToBeReady(), null !== suspendedCommitReason) {
      root2.cancelPendingCommit = suspendedCommitReason(
        commitRoot.bind(
          null,
          root2,
          finishedWork,
          lanes,
          recoverableErrors,
          transitions,
          didIncludeRenderPhaseUpdate,
          spawnedLane,
          updatedLanes,
          suspendedRetryLanes,
          exitStatus,
          1,
          completedRenderStartTime,
          completedRenderEndTime
        )
      );
      markRootSuspended(root2, lanes, spawnedLane, !didSkipSuspendedSiblings);
      return;
    }
  }
  commitRoot(
    root2,
    finishedWork,
    lanes,
    recoverableErrors,
    transitions,
    didIncludeRenderPhaseUpdate,
    spawnedLane,
    updatedLanes,
    suspendedRetryLanes
  );
}
function isRenderConsistentWithExternalStores(finishedWork) {
  for (var node = finishedWork; ; ) {
    var tag = node.tag;
    if ((0 === tag || 11 === tag || 15 === tag) && node.flags & 16384 && (tag = node.updateQueue, null !== tag && (tag = tag.stores, null !== tag)))
      for (var i2 = 0; i2 < tag.length; i2++) {
        var check = tag[i2], getSnapshot = check.getSnapshot;
        check = check.value;
        try {
          if (!objectIs$2(getSnapshot(), check)) return false;
        } catch (error) {
          return false;
        }
      }
    tag = node.child;
    if (node.subtreeFlags & 16384 && null !== tag)
      tag.return = node, node = tag;
    else {
      if (node === finishedWork) break;
      for (; null === node.sibling; ) {
        if (null === node.return || node.return === finishedWork) return true;
        node = node.return;
      }
      node.sibling.return = node.return;
      node = node.sibling;
    }
  }
  return true;
}
function markRootSuspended(root2, suspendedLanes, spawnedLane, didAttemptEntireTree) {
  suspendedLanes &= ~workInProgressRootPingedLanes;
  suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes;
  root2.suspendedLanes |= suspendedLanes;
  root2.pingedLanes &= ~suspendedLanes;
  didAttemptEntireTree && (root2.warmLanes |= suspendedLanes);
  didAttemptEntireTree = root2.expirationTimes;
  for (var lanes = suspendedLanes; 0 < lanes; ) {
    var index$4 = 31 - clz32(lanes), lane = 1 << index$4;
    didAttemptEntireTree[index$4] = -1;
    lanes &= ~lane;
  }
  0 !== spawnedLane && markSpawnedDeferredLane(root2, spawnedLane, suspendedLanes);
}
function flushSyncWork$1() {
  return 0 === (executionContext & 6) ? (flushSyncWorkAcrossRoots_impl(0), false) : true;
}
function resetWorkInProgressStack() {
  if (null !== workInProgress) {
    if (0 === workInProgressSuspendedReason)
      var interruptedWork = workInProgress.return;
    else
      interruptedWork = workInProgress, lastContextDependency = currentlyRenderingFiber$1 = null, resetHooksOnUnwind(interruptedWork), thenableState = null, thenableIndexCounter = 0, interruptedWork = workInProgress;
    for (; null !== interruptedWork; )
      unwindInterruptedWork(interruptedWork.alternate, interruptedWork), interruptedWork = interruptedWork.return;
    workInProgress = null;
  }
}
function prepareFreshStack(root2, lanes) {
  var timeoutHandle = root2.timeoutHandle;
  -1 !== timeoutHandle && (root2.timeoutHandle = -1, cancelTimeout(timeoutHandle));
  timeoutHandle = root2.cancelPendingCommit;
  null !== timeoutHandle && (root2.cancelPendingCommit = null, timeoutHandle());
  resetWorkInProgressStack();
  workInProgressRoot = root2;
  workInProgress = timeoutHandle = createWorkInProgress(root2.current, null);
  workInProgressRootRenderLanes = lanes;
  workInProgressSuspendedReason = 0;
  workInProgressThrownValue = null;
  workInProgressRootDidSkipSuspendedSiblings = false;
  workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root2, lanes);
  workInProgressRootDidAttachPingListener = false;
  workInProgressSuspendedRetryLanes = workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = workInProgressRootExitStatus = 0;
  workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null;
  workInProgressRootDidIncludeRecursiveRenderUpdate = false;
  0 !== (lanes & 8) && (lanes |= lanes & 32);
  var allEntangledLanes = root2.entangledLanes;
  if (0 !== allEntangledLanes)
    for (root2 = root2.entanglements, allEntangledLanes &= lanes; 0 < allEntangledLanes; ) {
      var index$2 = 31 - clz32(allEntangledLanes), lane = 1 << index$2;
      lanes |= root2[index$2];
      allEntangledLanes &= ~lane;
    }
  entangledRenderLanes = lanes;
  finishQueueingConcurrentUpdates();
  return timeoutHandle;
}
function handleThrow(root2, thrownValue) {
  currentlyRenderingFiber = null;
  ReactSharedInternals.H = ContextOnlyDispatcher;
  thrownValue === SuspenseException || thrownValue === SuspenseActionException ? (thrownValue = getSuspendedThenable(), workInProgressSuspendedReason = 3) : thrownValue === SuspenseyCommitException ? (thrownValue = getSuspendedThenable(), workInProgressSuspendedReason = 4) : workInProgressSuspendedReason = thrownValue === SelectiveHydrationException ? 8 : null !== thrownValue && "object" === typeof thrownValue && "function" === typeof thrownValue.then ? 6 : 1;
  workInProgressThrownValue = thrownValue;
  null === workInProgress && (workInProgressRootExitStatus = 1, logUncaughtError(
    root2,
    createCapturedValueAtFiber(thrownValue, root2.current)
  ));
}
function pushDispatcher() {
  var prevDispatcher = ReactSharedInternals.H;
  ReactSharedInternals.H = ContextOnlyDispatcher;
  return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher;
}
function pushAsyncDispatcher() {
  var prevAsyncDispatcher = ReactSharedInternals.A;
  ReactSharedInternals.A = DefaultAsyncDispatcher;
  return prevAsyncDispatcher;
}
function renderDidSuspendDelayIfPossible() {
  workInProgressRootExitStatus = 4;
  workInProgressRootDidSkipSuspendedSiblings || (workInProgressRootRenderLanes & 4194048) !== workInProgressRootRenderLanes && null !== suspenseHandlerStackCursor.current || (workInProgressRootIsPrerendering = true);
  0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) || null === workInProgressRoot || markRootSuspended(
    workInProgressRoot,
    workInProgressRootRenderLanes,
    workInProgressDeferredLane,
    false
  );
}
function renderRootSync(root2, lanes, shouldYieldForPrerendering) {
  var prevExecutionContext = executionContext;
  executionContext |= 2;
  var prevDispatcher = pushDispatcher(), prevAsyncDispatcher = pushAsyncDispatcher();
  if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes)
    workInProgressTransitions = null, prepareFreshStack(root2, lanes);
  lanes = false;
  var exitStatus = workInProgressRootExitStatus;
  a: do
    try {
      if (0 !== workInProgressSuspendedReason && null !== workInProgress) {
        var unitOfWork = workInProgress, thrownValue = workInProgressThrownValue;
        switch (workInProgressSuspendedReason) {
          case 8:
            resetWorkInProgressStack();
            exitStatus = 6;
            break a;
          case 3:
          case 2:
          case 9:
          case 6:
            null === suspenseHandlerStackCursor.current && (lanes = true);
            var reason = workInProgressSuspendedReason;
            workInProgressSuspendedReason = 0;
            workInProgressThrownValue = null;
            throwAndUnwindWorkLoop(root2, unitOfWork, thrownValue, reason);
            if (shouldYieldForPrerendering && workInProgressRootIsPrerendering) {
              exitStatus = 0;
              break a;
            }
            break;
          default:
            reason = workInProgressSuspendedReason, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, throwAndUnwindWorkLoop(root2, unitOfWork, thrownValue, reason);
        }
      }
      workLoopSync();
      exitStatus = workInProgressRootExitStatus;
      break;
    } catch (thrownValue$167) {
      handleThrow(root2, thrownValue$167);
    }
  while (1);
  lanes && root2.shellSuspendCounter++;
  lastContextDependency = currentlyRenderingFiber$1 = null;
  executionContext = prevExecutionContext;
  ReactSharedInternals.H = prevDispatcher;
  ReactSharedInternals.A = prevAsyncDispatcher;
  null === workInProgress && (workInProgressRoot = null, workInProgressRootRenderLanes = 0, finishQueueingConcurrentUpdates());
  return exitStatus;
}
function workLoopSync() {
  for (; null !== workInProgress; ) performUnitOfWork(workInProgress);
}
function renderRootConcurrent(root2, lanes) {
  var prevExecutionContext = executionContext;
  executionContext |= 2;
  var prevDispatcher = pushDispatcher(), prevAsyncDispatcher = pushAsyncDispatcher();
  workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes ? (workInProgressTransitions = null, workInProgressRootRenderTargetTime = now() + 500, prepareFreshStack(root2, lanes)) : workInProgressRootIsPrerendering = checkIfRootIsPrerendering(
    root2,
    lanes
  );
  a: do
    try {
      if (0 !== workInProgressSuspendedReason && null !== workInProgress) {
        lanes = workInProgress;
        var thrownValue = workInProgressThrownValue;
        b: switch (workInProgressSuspendedReason) {
          case 1:
            workInProgressSuspendedReason = 0;
            workInProgressThrownValue = null;
            throwAndUnwindWorkLoop(root2, lanes, thrownValue, 1);
            break;
          case 2:
          case 9:
            if (isThenableResolved(thrownValue)) {
              workInProgressSuspendedReason = 0;
              workInProgressThrownValue = null;
              replaySuspendedUnitOfWork(lanes);
              break;
            }
            lanes = function() {
              2 !== workInProgressSuspendedReason && 9 !== workInProgressSuspendedReason || workInProgressRoot !== root2 || (workInProgressSuspendedReason = 7);
              ensureRootIsScheduled(root2);
            };
            thrownValue.then(lanes, lanes);
            break a;
          case 3:
            workInProgressSuspendedReason = 7;
            break a;
          case 4:
            workInProgressSuspendedReason = 5;
            break a;
          case 7:
            isThenableResolved(thrownValue) ? (workInProgressSuspendedReason = 0, workInProgressThrownValue = null, replaySuspendedUnitOfWork(lanes)) : (workInProgressSuspendedReason = 0, workInProgressThrownValue = null, throwAndUnwindWorkLoop(root2, lanes, thrownValue, 7));
            break;
          case 5:
            var resource = null;
            switch (workInProgress.tag) {
              case 26:
                resource = workInProgress.memoizedState;
              case 5:
              case 27:
                var hostFiber = workInProgress;
                if (resource ? preloadResource(resource) : 1) {
                  workInProgressSuspendedReason = 0;
                  workInProgressThrownValue = null;
                  var sibling = hostFiber.sibling;
                  if (null !== sibling) workInProgress = sibling;
                  else {
                    var returnFiber = hostFiber.return;
                    null !== returnFiber ? (workInProgress = returnFiber, completeUnitOfWork(returnFiber)) : workInProgress = null;
                  }
                  break b;
                }
            }
            workInProgressSuspendedReason = 0;
            workInProgressThrownValue = null;
            throwAndUnwindWorkLoop(root2, lanes, thrownValue, 5);
            break;
          case 6:
            workInProgressSuspendedReason = 0;
            workInProgressThrownValue = null;
            throwAndUnwindWorkLoop(root2, lanes, thrownValue, 6);
            break;
          case 8:
            resetWorkInProgressStack();
            workInProgressRootExitStatus = 6;
            break a;
          default:
            throw Error(formatProdErrorMessage$2(462));
        }
      }
      workLoopConcurrentByScheduler();
      break;
    } catch (thrownValue$169) {
      handleThrow(root2, thrownValue$169);
    }
  while (1);
  lastContextDependency = currentlyRenderingFiber$1 = null;
  ReactSharedInternals.H = prevDispatcher;
  ReactSharedInternals.A = prevAsyncDispatcher;
  executionContext = prevExecutionContext;
  if (null !== workInProgress) return 0;
  workInProgressRoot = null;
  workInProgressRootRenderLanes = 0;
  finishQueueingConcurrentUpdates();
  return workInProgressRootExitStatus;
}
function workLoopConcurrentByScheduler() {
  for (; null !== workInProgress && !shouldYield(); )
    performUnitOfWork(workInProgress);
}
function performUnitOfWork(unitOfWork) {
  var next = beginWork(unitOfWork.alternate, unitOfWork, entangledRenderLanes);
  unitOfWork.memoizedProps = unitOfWork.pendingProps;
  null === next ? completeUnitOfWork(unitOfWork) : workInProgress = next;
}
function replaySuspendedUnitOfWork(unitOfWork) {
  var next = unitOfWork;
  var current2 = next.alternate;
  switch (next.tag) {
    case 15:
    case 0:
      next = replayFunctionComponent(
        current2,
        next,
        next.pendingProps,
        next.type,
        void 0,
        workInProgressRootRenderLanes
      );
      break;
    case 11:
      next = replayFunctionComponent(
        current2,
        next,
        next.pendingProps,
        next.type.render,
        next.ref,
        workInProgressRootRenderLanes
      );
      break;
    case 5:
      resetHooksOnUnwind(next);
    default:
      unwindInterruptedWork(current2, next), next = workInProgress = resetWorkInProgress(next, entangledRenderLanes), next = beginWork(current2, next, entangledRenderLanes);
  }
  unitOfWork.memoizedProps = unitOfWork.pendingProps;
  null === next ? completeUnitOfWork(unitOfWork) : workInProgress = next;
}
function throwAndUnwindWorkLoop(root2, unitOfWork, thrownValue, suspendedReason) {
  lastContextDependency = currentlyRenderingFiber$1 = null;
  resetHooksOnUnwind(unitOfWork);
  thenableState = null;
  thenableIndexCounter = 0;
  var returnFiber = unitOfWork.return;
  try {
    if (throwException(
      root2,
      returnFiber,
      unitOfWork,
      thrownValue,
      workInProgressRootRenderLanes
    )) {
      workInProgressRootExitStatus = 1;
      logUncaughtError(
        root2,
        createCapturedValueAtFiber(thrownValue, root2.current)
      );
      workInProgress = null;
      return;
    }
  } catch (error) {
    if (null !== returnFiber) throw workInProgress = returnFiber, error;
    workInProgressRootExitStatus = 1;
    logUncaughtError(
      root2,
      createCapturedValueAtFiber(thrownValue, root2.current)
    );
    workInProgress = null;
    return;
  }
  if (unitOfWork.flags & 32768) {
    if (isHydrating || 1 === suspendedReason) root2 = true;
    else if (workInProgressRootIsPrerendering || 0 !== (workInProgressRootRenderLanes & 536870912))
      root2 = false;
    else if (workInProgressRootDidSkipSuspendedSiblings = root2 = true, 2 === suspendedReason || 9 === suspendedReason || 3 === suspendedReason || 6 === suspendedReason)
      suspendedReason = suspenseHandlerStackCursor.current, null !== suspendedReason && 13 === suspendedReason.tag && (suspendedReason.flags |= 16384);
    unwindUnitOfWork(unitOfWork, root2);
  } else completeUnitOfWork(unitOfWork);
}
function completeUnitOfWork(unitOfWork) {
  var completedWork = unitOfWork;
  do {
    if (0 !== (completedWork.flags & 32768)) {
      unwindUnitOfWork(
        completedWork,
        workInProgressRootDidSkipSuspendedSiblings
      );
      return;
    }
    unitOfWork = completedWork.return;
    var next = completeWork(
      completedWork.alternate,
      completedWork,
      entangledRenderLanes
    );
    if (null !== next) {
      workInProgress = next;
      return;
    }
    completedWork = completedWork.sibling;
    if (null !== completedWork) {
      workInProgress = completedWork;
      return;
    }
    workInProgress = completedWork = unitOfWork;
  } while (null !== completedWork);
  0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5);
}
function unwindUnitOfWork(unitOfWork, skipSiblings) {
  do {
    var next = unwindWork(unitOfWork.alternate, unitOfWork);
    if (null !== next) {
      next.flags &= 32767;
      workInProgress = next;
      return;
    }
    next = unitOfWork.return;
    null !== next && (next.flags |= 32768, next.subtreeFlags = 0, next.deletions = null);
    if (!skipSiblings && (unitOfWork = unitOfWork.sibling, null !== unitOfWork)) {
      workInProgress = unitOfWork;
      return;
    }
    workInProgress = unitOfWork = next;
  } while (null !== unitOfWork);
  workInProgressRootExitStatus = 6;
  workInProgress = null;
}
function commitRoot(root2, finishedWork, lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, suspendedRetryLanes) {
  root2.cancelPendingCommit = null;
  do
    flushPendingEffects();
  while (0 !== pendingEffectsStatus);
  if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage$2(327));
  if (null !== finishedWork) {
    if (finishedWork === root2.current) throw Error(formatProdErrorMessage$2(177));
    didIncludeRenderPhaseUpdate = finishedWork.lanes | finishedWork.childLanes;
    didIncludeRenderPhaseUpdate |= concurrentlyUpdatedLanes;
    markRootFinished(
      root2,
      lanes,
      didIncludeRenderPhaseUpdate,
      spawnedLane,
      updatedLanes,
      suspendedRetryLanes
    );
    root2 === workInProgressRoot && (workInProgress = workInProgressRoot = null, workInProgressRootRenderLanes = 0);
    pendingFinishedWork = finishedWork;
    pendingEffectsRoot = root2;
    pendingEffectsLanes = lanes;
    pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate;
    pendingPassiveTransitions = transitions;
    pendingRecoverableErrors = recoverableErrors;
    0 !== (finishedWork.subtreeFlags & 10256) || 0 !== (finishedWork.flags & 10256) ? (root2.callbackNode = null, root2.callbackPriority = 0, scheduleCallback$1(NormalPriority$1, function() {
      flushPassiveEffects();
      return null;
    })) : (root2.callbackNode = null, root2.callbackPriority = 0);
    recoverableErrors = 0 !== (finishedWork.flags & 13878);
    if (0 !== (finishedWork.subtreeFlags & 13878) || recoverableErrors) {
      recoverableErrors = ReactSharedInternals.T;
      ReactSharedInternals.T = null;
      transitions = ReactDOMSharedInternals.p;
      ReactDOMSharedInternals.p = 2;
      spawnedLane = executionContext;
      executionContext |= 4;
      try {
        commitBeforeMutationEffects(root2, finishedWork, lanes);
      } finally {
        executionContext = spawnedLane, ReactDOMSharedInternals.p = transitions, ReactSharedInternals.T = recoverableErrors;
      }
    }
    pendingEffectsStatus = 1;
    flushMutationEffects();
    flushLayoutEffects();
    flushSpawnedWork();
  }
}
function flushMutationEffects() {
  if (1 === pendingEffectsStatus) {
    pendingEffectsStatus = 0;
    var root2 = pendingEffectsRoot, finishedWork = pendingFinishedWork, rootMutationHasEffect = 0 !== (finishedWork.flags & 13878);
    if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) {
      rootMutationHasEffect = ReactSharedInternals.T;
      ReactSharedInternals.T = null;
      var previousPriority = ReactDOMSharedInternals.p;
      ReactDOMSharedInternals.p = 2;
      var prevExecutionContext = executionContext;
      executionContext |= 4;
      try {
        commitMutationEffectsOnFiber(finishedWork, root2);
        var priorSelectionInformation = selectionInformation, curFocusedElem = getActiveElementDeep(root2.containerInfo), priorFocusedElem = priorSelectionInformation.focusedElem, priorSelectionRange = priorSelectionInformation.selectionRange;
        if (curFocusedElem !== priorFocusedElem && priorFocusedElem && priorFocusedElem.ownerDocument && containsNode(
          priorFocusedElem.ownerDocument.documentElement,
          priorFocusedElem
        )) {
          if (null !== priorSelectionRange && hasSelectionCapabilities(priorFocusedElem)) {
            var start = priorSelectionRange.start, end = priorSelectionRange.end;
            void 0 === end && (end = start);
            if ("selectionStart" in priorFocusedElem)
              priorFocusedElem.selectionStart = start, priorFocusedElem.selectionEnd = Math.min(
                end,
                priorFocusedElem.value.length
              );
            else {
              var doc = priorFocusedElem.ownerDocument || document, win = doc && doc.defaultView || window;
              if (win.getSelection) {
                var selection = win.getSelection(), length = priorFocusedElem.textContent.length, start$jscomp$0 = Math.min(priorSelectionRange.start, length), end$jscomp$0 = void 0 === priorSelectionRange.end ? start$jscomp$0 : Math.min(priorSelectionRange.end, length);
                !selection.extend && start$jscomp$0 > end$jscomp$0 && (curFocusedElem = end$jscomp$0, end$jscomp$0 = start$jscomp$0, start$jscomp$0 = curFocusedElem);
                var startMarker = getNodeForCharacterOffset(
                  priorFocusedElem,
                  start$jscomp$0
                ), endMarker = getNodeForCharacterOffset(
                  priorFocusedElem,
                  end$jscomp$0
                );
                if (startMarker && endMarker && (1 !== selection.rangeCount || selection.anchorNode !== startMarker.node || selection.anchorOffset !== startMarker.offset || selection.focusNode !== endMarker.node || selection.focusOffset !== endMarker.offset)) {
                  var range = doc.createRange();
                  range.setStart(startMarker.node, startMarker.offset);
                  selection.removeAllRanges();
                  start$jscomp$0 > end$jscomp$0 ? (selection.addRange(range), selection.extend(endMarker.node, endMarker.offset)) : (range.setEnd(endMarker.node, endMarker.offset), selection.addRange(range));
                }
              }
            }
          }
          doc = [];
          for (selection = priorFocusedElem; selection = selection.parentNode; )
            1 === selection.nodeType && doc.push({
              element: selection,
              left: selection.scrollLeft,
              top: selection.scrollTop
            });
          "function" === typeof priorFocusedElem.focus && priorFocusedElem.focus();
          for (priorFocusedElem = 0; priorFocusedElem < doc.length; priorFocusedElem++) {
            var info = doc[priorFocusedElem];
            info.element.scrollLeft = info.left;
            info.element.scrollTop = info.top;
          }
        }
        _enabled = !!eventsEnabled;
        selectionInformation = eventsEnabled = null;
      } finally {
        executionContext = prevExecutionContext, ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = rootMutationHasEffect;
      }
    }
    root2.current = finishedWork;
    pendingEffectsStatus = 2;
  }
}
function flushLayoutEffects() {
  if (2 === pendingEffectsStatus) {
    pendingEffectsStatus = 0;
    var root2 = pendingEffectsRoot, finishedWork = pendingFinishedWork, rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772);
    if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) {
      rootHasLayoutEffect = ReactSharedInternals.T;
      ReactSharedInternals.T = null;
      var previousPriority = ReactDOMSharedInternals.p;
      ReactDOMSharedInternals.p = 2;
      var prevExecutionContext = executionContext;
      executionContext |= 4;
      try {
        commitLayoutEffectOnFiber(root2, finishedWork.alternate, finishedWork);
      } finally {
        executionContext = prevExecutionContext, ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = rootHasLayoutEffect;
      }
    }
    pendingEffectsStatus = 3;
  }
}
function flushSpawnedWork() {
  if (4 === pendingEffectsStatus || 3 === pendingEffectsStatus) {
    pendingEffectsStatus = 0;
    requestPaint();
    var root2 = pendingEffectsRoot, finishedWork = pendingFinishedWork, lanes = pendingEffectsLanes, recoverableErrors = pendingRecoverableErrors;
    0 !== (finishedWork.subtreeFlags & 10256) || 0 !== (finishedWork.flags & 10256) ? pendingEffectsStatus = 5 : (pendingEffectsStatus = 0, pendingFinishedWork = pendingEffectsRoot = null, releaseRootPooledCache(root2, root2.pendingLanes));
    var remainingLanes = root2.pendingLanes;
    0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null);
    lanesToEventPriority(lanes);
    finishedWork = finishedWork.stateNode;
    if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot)
      try {
        injectedHook.onCommitFiberRoot(
          rendererID,
          finishedWork,
          void 0,
          128 === (finishedWork.current.flags & 128)
        );
      } catch (err) {
      }
    if (null !== recoverableErrors) {
      finishedWork = ReactSharedInternals.T;
      remainingLanes = ReactDOMSharedInternals.p;
      ReactDOMSharedInternals.p = 2;
      ReactSharedInternals.T = null;
      try {
        for (var onRecoverableError = root2.onRecoverableError, i2 = 0; i2 < recoverableErrors.length; i2++) {
          var recoverableError = recoverableErrors[i2];
          onRecoverableError(recoverableError.value, {
            componentStack: recoverableError.stack
          });
        }
      } finally {
        ReactSharedInternals.T = finishedWork, ReactDOMSharedInternals.p = remainingLanes;
      }
    }
    0 !== (pendingEffectsLanes & 3) && flushPendingEffects();
    ensureRootIsScheduled(root2);
    remainingLanes = root2.pendingLanes;
    0 !== (lanes & 4194090) && 0 !== (remainingLanes & 42) ? root2 === rootWithNestedUpdates ? nestedUpdateCount++ : (nestedUpdateCount = 0, rootWithNestedUpdates = root2) : nestedUpdateCount = 0;
    flushSyncWorkAcrossRoots_impl(0);
  }
}
function releaseRootPooledCache(root2, remainingLanes) {
  0 === (root2.pooledCacheLanes &= remainingLanes) && (remainingLanes = root2.pooledCache, null != remainingLanes && (root2.pooledCache = null, releaseCache(remainingLanes)));
}
function flushPendingEffects(wasDelayedCommit) {
  flushMutationEffects();
  flushLayoutEffects();
  flushSpawnedWork();
  return flushPassiveEffects();
}
function flushPassiveEffects() {
  if (5 !== pendingEffectsStatus) return false;
  var root2 = pendingEffectsRoot, remainingLanes = pendingEffectsRemainingLanes;
  pendingEffectsRemainingLanes = 0;
  var renderPriority = lanesToEventPriority(pendingEffectsLanes), prevTransition = ReactSharedInternals.T, previousPriority = ReactDOMSharedInternals.p;
  try {
    ReactDOMSharedInternals.p = 32 > renderPriority ? 32 : renderPriority;
    ReactSharedInternals.T = null;
    renderPriority = pendingPassiveTransitions;
    pendingPassiveTransitions = null;
    var root$jscomp$0 = pendingEffectsRoot, lanes = pendingEffectsLanes;
    pendingEffectsStatus = 0;
    pendingFinishedWork = pendingEffectsRoot = null;
    pendingEffectsLanes = 0;
    if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage$2(331));
    var prevExecutionContext = executionContext;
    executionContext |= 4;
    commitPassiveUnmountOnFiber(root$jscomp$0.current);
    commitPassiveMountOnFiber(
      root$jscomp$0,
      root$jscomp$0.current,
      lanes,
      renderPriority
    );
    executionContext = prevExecutionContext;
    flushSyncWorkAcrossRoots_impl(0, false);
    if (injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot)
      try {
        injectedHook.onPostCommitFiberRoot(rendererID, root$jscomp$0);
      } catch (err) {
      }
    return true;
  } finally {
    ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = prevTransition, releaseRootPooledCache(root2, remainingLanes);
  }
}
function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {
  sourceFiber = createCapturedValueAtFiber(error, sourceFiber);
  sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2);
  rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2);
  null !== rootFiber && (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber));
}
function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) {
  if (3 === sourceFiber.tag)
    captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);
  else
    for (; null !== nearestMountedAncestor; ) {
      if (3 === nearestMountedAncestor.tag) {
        captureCommitPhaseErrorOnRoot(
          nearestMountedAncestor,
          sourceFiber,
          error
        );
        break;
      } else if (1 === nearestMountedAncestor.tag) {
        var instance2 = nearestMountedAncestor.stateNode;
        if ("function" === typeof nearestMountedAncestor.type.getDerivedStateFromError || "function" === typeof instance2.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(instance2))) {
          sourceFiber = createCapturedValueAtFiber(error, sourceFiber);
          error = createClassErrorUpdate(2);
          instance2 = enqueueUpdate(nearestMountedAncestor, error, 2);
          null !== instance2 && (initializeClassErrorUpdate(
            error,
            instance2,
            nearestMountedAncestor,
            sourceFiber
          ), markRootUpdated$1(instance2, 2), ensureRootIsScheduled(instance2));
          break;
        }
      }
      nearestMountedAncestor = nearestMountedAncestor.return;
    }
}
function attachPingListener(root2, wakeable, lanes) {
  var pingCache = root2.pingCache;
  if (null === pingCache) {
    pingCache = root2.pingCache = new PossiblyWeakMap();
    var threadIDs = /* @__PURE__ */ new Set();
    pingCache.set(wakeable, threadIDs);
  } else
    threadIDs = pingCache.get(wakeable), void 0 === threadIDs && (threadIDs = /* @__PURE__ */ new Set(), pingCache.set(wakeable, threadIDs));
  threadIDs.has(lanes) || (workInProgressRootDidAttachPingListener = true, threadIDs.add(lanes), root2 = pingSuspendedRoot.bind(null, root2, wakeable, lanes), wakeable.then(root2, root2));
}
function pingSuspendedRoot(root2, wakeable, pingedLanes) {
  var pingCache = root2.pingCache;
  null !== pingCache && pingCache.delete(wakeable);
  root2.pingedLanes |= root2.suspendedLanes & pingedLanes;
  root2.warmLanes &= ~pingedLanes;
  workInProgressRoot === root2 && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || 3 === workInProgressRootExitStatus && (workInProgressRootRenderLanes & 62914560) === workInProgressRootRenderLanes && 300 > now() - globalMostRecentFallbackTime ? 0 === (executionContext & 2) && prepareFreshStack(root2, 0) : workInProgressRootPingedLanes |= pingedLanes, workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && (workInProgressSuspendedRetryLanes = 0));
  ensureRootIsScheduled(root2);
}
function retryTimedOutBoundary(boundaryFiber, retryLane) {
  0 === retryLane && (retryLane = claimNextRetryLane());
  boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane);
  null !== boundaryFiber && (markRootUpdated$1(boundaryFiber, retryLane), ensureRootIsScheduled(boundaryFiber));
}
function retryDehydratedSuspenseBoundary(boundaryFiber) {
  var suspenseState = boundaryFiber.memoizedState, retryLane = 0;
  null !== suspenseState && (retryLane = suspenseState.retryLane);
  retryTimedOutBoundary(boundaryFiber, retryLane);
}
function resolveRetryWakeable(boundaryFiber, wakeable) {
  var retryLane = 0;
  switch (boundaryFiber.tag) {
    case 13:
      var retryCache = boundaryFiber.stateNode;
      var suspenseState = boundaryFiber.memoizedState;
      null !== suspenseState && (retryLane = suspenseState.retryLane);
      break;
    case 19:
      retryCache = boundaryFiber.stateNode;
      break;
    case 22:
      retryCache = boundaryFiber.stateNode._retryCache;
      break;
    default:
      throw Error(formatProdErrorMessage$2(314));
  }
  null !== retryCache && retryCache.delete(wakeable);
  retryTimedOutBoundary(boundaryFiber, retryLane);
}
function scheduleCallback$1(priorityLevel, callback) {
  return scheduleCallback$3(priorityLevel, callback);
}
var firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = false, mightHavePendingSyncWork = false, isFlushingWork = false, currentEventTransitionLane = 0;
function ensureRootIsScheduled(root2) {
  root2 !== lastScheduledRoot && null === root2.next && (null === lastScheduledRoot ? firstScheduledRoot = lastScheduledRoot = root2 : lastScheduledRoot = lastScheduledRoot.next = root2);
  mightHavePendingSyncWork = true;
  didScheduleMicrotask || (didScheduleMicrotask = true, scheduleImmediateRootScheduleTask());
}
function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) {
  if (!isFlushingWork && mightHavePendingSyncWork) {
    isFlushingWork = true;
    do {
      var didPerformSomeWork = false;
      for (var root$174 = firstScheduledRoot; null !== root$174; ) {
        if (0 !== syncTransitionLanes) {
          var pendingLanes = root$174.pendingLanes;
          if (0 === pendingLanes) var JSCompiler_inline_result = 0;
          else {
            var suspendedLanes = root$174.suspendedLanes, pingedLanes = root$174.pingedLanes;
            JSCompiler_inline_result = (1 << 31 - clz32(42 | syncTransitionLanes) + 1) - 1;
            JSCompiler_inline_result &= pendingLanes & ~(suspendedLanes & ~pingedLanes);
            JSCompiler_inline_result = JSCompiler_inline_result & 201326741 ? JSCompiler_inline_result & 201326741 | 1 : JSCompiler_inline_result ? JSCompiler_inline_result | 2 : 0;
          }
          0 !== JSCompiler_inline_result && (didPerformSomeWork = true, performSyncWorkOnRoot(root$174, JSCompiler_inline_result));
        } else
          JSCompiler_inline_result = workInProgressRootRenderLanes, JSCompiler_inline_result = getNextLanes(
            root$174,
            root$174 === workInProgressRoot ? JSCompiler_inline_result : 0,
            null !== root$174.cancelPendingCommit || -1 !== root$174.timeoutHandle
          ), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root$174, JSCompiler_inline_result) || (didPerformSomeWork = true, performSyncWorkOnRoot(root$174, JSCompiler_inline_result));
        root$174 = root$174.next;
      }
    } while (didPerformSomeWork);
    isFlushingWork = false;
  }
}
function processRootScheduleInImmediateTask() {
  processRootScheduleInMicrotask();
}
function processRootScheduleInMicrotask() {
  mightHavePendingSyncWork = didScheduleMicrotask = false;
  var syncTransitionLanes = 0;
  0 !== currentEventTransitionLane && (shouldAttemptEagerTransition() && (syncTransitionLanes = currentEventTransitionLane), currentEventTransitionLane = 0);
  for (var currentTime = now(), prev = null, root2 = firstScheduledRoot; null !== root2; ) {
    var next = root2.next, nextLanes = scheduleTaskForRootDuringMicrotask(root2, currentTime);
    if (0 === nextLanes)
      root2.next = null, null === prev ? firstScheduledRoot = next : prev.next = next, null === next && (lastScheduledRoot = prev);
    else if (prev = root2, 0 !== syncTransitionLanes || 0 !== (nextLanes & 3))
      mightHavePendingSyncWork = true;
    root2 = next;
  }
  flushSyncWorkAcrossRoots_impl(syncTransitionLanes);
}
function scheduleTaskForRootDuringMicrotask(root2, currentTime) {
  for (var suspendedLanes = root2.suspendedLanes, pingedLanes = root2.pingedLanes, expirationTimes = root2.expirationTimes, lanes = root2.pendingLanes & -62914561; 0 < lanes; ) {
    var index$3 = 31 - clz32(lanes), lane = 1 << index$3, expirationTime = expirationTimes[index$3];
    if (-1 === expirationTime) {
      if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes))
        expirationTimes[index$3] = computeExpirationTime(lane, currentTime);
    } else expirationTime <= currentTime && (root2.expiredLanes |= lane);
    lanes &= ~lane;
  }
  currentTime = workInProgressRoot;
  suspendedLanes = workInProgressRootRenderLanes;
  suspendedLanes = getNextLanes(
    root2,
    root2 === currentTime ? suspendedLanes : 0,
    null !== root2.cancelPendingCommit || -1 !== root2.timeoutHandle
  );
  pingedLanes = root2.callbackNode;
  if (0 === suspendedLanes || root2 === currentTime && (2 === workInProgressSuspendedReason || 9 === workInProgressSuspendedReason) || null !== root2.cancelPendingCommit)
    return null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes), root2.callbackNode = null, root2.callbackPriority = 0;
  if (0 === (suspendedLanes & 3) || checkIfRootIsPrerendering(root2, suspendedLanes)) {
    currentTime = suspendedLanes & -suspendedLanes;
    if (currentTime === root2.callbackPriority) return currentTime;
    null !== pingedLanes && cancelCallback$1(pingedLanes);
    switch (lanesToEventPriority(suspendedLanes)) {
      case 2:
      case 8:
        suspendedLanes = UserBlockingPriority;
        break;
      case 32:
        suspendedLanes = NormalPriority$1;
        break;
      case 268435456:
        suspendedLanes = IdlePriority;
        break;
      default:
        suspendedLanes = NormalPriority$1;
    }
    pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root2);
    suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes);
    root2.callbackPriority = currentTime;
    root2.callbackNode = suspendedLanes;
    return currentTime;
  }
  null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes);
  root2.callbackPriority = 2;
  root2.callbackNode = null;
  return 2;
}
function performWorkOnRootViaSchedulerTask(root2, didTimeout) {
  if (0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus)
    return root2.callbackNode = null, root2.callbackPriority = 0, null;
  var originalCallbackNode = root2.callbackNode;
  if (flushPendingEffects() && root2.callbackNode !== originalCallbackNode)
    return null;
  var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes;
  workInProgressRootRenderLanes$jscomp$0 = getNextLanes(
    root2,
    root2 === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0,
    null !== root2.cancelPendingCommit || -1 !== root2.timeoutHandle
  );
  if (0 === workInProgressRootRenderLanes$jscomp$0) return null;
  performWorkOnRoot(root2, workInProgressRootRenderLanes$jscomp$0, didTimeout);
  scheduleTaskForRootDuringMicrotask(root2, now());
  return null != root2.callbackNode && root2.callbackNode === originalCallbackNode ? performWorkOnRootViaSchedulerTask.bind(null, root2) : null;
}
function performSyncWorkOnRoot(root2, lanes) {
  if (flushPendingEffects()) return null;
  performWorkOnRoot(root2, lanes, true);
}
function scheduleImmediateRootScheduleTask() {
  scheduleMicrotask(function() {
    0 !== (executionContext & 6) ? scheduleCallback$3(
      ImmediatePriority,
      processRootScheduleInImmediateTask
    ) : processRootScheduleInMicrotask();
  });
}
function requestTransitionLane() {
  0 === currentEventTransitionLane && (currentEventTransitionLane = claimNextTransitionLane());
  return currentEventTransitionLane;
}
function coerceFormActionProp(actionProp) {
  return null == actionProp || "symbol" === typeof actionProp || "boolean" === typeof actionProp ? null : "function" === typeof actionProp ? actionProp : sanitizeURL("" + actionProp);
}
function createFormDataWithSubmitter(form, submitter) {
  var temp = submitter.ownerDocument.createElement("input");
  temp.name = submitter.name;
  temp.value = submitter.value;
  form.id && temp.setAttribute("form", form.id);
  submitter.parentNode.insertBefore(temp, submitter);
  form = new FormData(form);
  temp.parentNode.removeChild(temp);
  return form;
}
function extractEvents$1(dispatchQueue, domEventName, maybeTargetInst, nativeEvent, nativeEventTarget) {
  if ("submit" === domEventName && maybeTargetInst && maybeTargetInst.stateNode === nativeEventTarget) {
    var action = coerceFormActionProp(
      (nativeEventTarget[internalPropsKey] || null).action
    ), submitter = nativeEvent.submitter;
    submitter && (domEventName = (domEventName = submitter[internalPropsKey] || null) ? coerceFormActionProp(domEventName.formAction) : submitter.getAttribute("formAction"), null !== domEventName && (action = domEventName, submitter = null));
    var event = new SyntheticEvent(
      "action",
      "action",
      null,
      nativeEvent,
      nativeEventTarget
    );
    dispatchQueue.push({
      event,
      listeners: [
        {
          instance: null,
          listener: function() {
            if (nativeEvent.defaultPrevented) {
              if (0 !== currentEventTransitionLane) {
                var formData = submitter ? createFormDataWithSubmitter(nativeEventTarget, submitter) : new FormData(nativeEventTarget);
                startHostTransition(
                  maybeTargetInst,
                  {
                    pending: true,
                    data: formData,
                    method: nativeEventTarget.method,
                    action
                  },
                  null,
                  formData
                );
              }
            } else
              "function" === typeof action && (event.preventDefault(), formData = submitter ? createFormDataWithSubmitter(nativeEventTarget, submitter) : new FormData(nativeEventTarget), startHostTransition(
                maybeTargetInst,
                {
                  pending: true,
                  data: formData,
                  method: nativeEventTarget.method,
                  action
                },
                action,
                formData
              ));
          },
          currentTarget: nativeEventTarget
        }
      ]
    });
  }
}
for (var i$jscomp$inline_1528 = 0; i$jscomp$inline_1528 < simpleEventPluginEvents.length; i$jscomp$inline_1528++) {
  var eventName$jscomp$inline_1529 = simpleEventPluginEvents[i$jscomp$inline_1528], domEventName$jscomp$inline_1530 = eventName$jscomp$inline_1529.toLowerCase(), capitalizedEvent$jscomp$inline_1531 = eventName$jscomp$inline_1529[0].toUpperCase() + eventName$jscomp$inline_1529.slice(1);
  registerSimpleEvent(
    domEventName$jscomp$inline_1530,
    "on" + capitalizedEvent$jscomp$inline_1531
  );
}
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
registerSimpleEvent(ANIMATION_ITERATION, "onAnimationIteration");
registerSimpleEvent(ANIMATION_START, "onAnimationStart");
registerSimpleEvent("dblclick", "onDoubleClick");
registerSimpleEvent("focusin", "onFocus");
registerSimpleEvent("focusout", "onBlur");
registerSimpleEvent(TRANSITION_RUN, "onTransitionRun");
registerSimpleEvent(TRANSITION_START, "onTransitionStart");
registerSimpleEvent(TRANSITION_CANCEL, "onTransitionCancel");
registerSimpleEvent(TRANSITION_END, "onTransitionEnd");
registerDirectEvent("onMouseEnter", ["mouseout", "mouseover"]);
registerDirectEvent("onMouseLeave", ["mouseout", "mouseover"]);
registerDirectEvent("onPointerEnter", ["pointerout", "pointerover"]);
registerDirectEvent("onPointerLeave", ["pointerout", "pointerover"]);
registerTwoPhaseEvent(
  "onChange",
  "change click focusin focusout input keydown keyup selectionchange".split(" ")
);
registerTwoPhaseEvent(
  "onSelect",
  "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(
    " "
  )
);
registerTwoPhaseEvent("onBeforeInput", [
  "compositionend",
  "keypress",
  "textInput",
  "paste"
]);
registerTwoPhaseEvent(
  "onCompositionEnd",
  "compositionend focusout keydown keypress keyup mousedown".split(" ")
);
registerTwoPhaseEvent(
  "onCompositionStart",
  "compositionstart focusout keydown keypress keyup mousedown".split(" ")
);
registerTwoPhaseEvent(
  "onCompositionUpdate",
  "compositionupdate focusout keydown keypress keyup mousedown".split(" ")
);
var mediaEventTypes = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(
  " "
), nonDelegatedEvents = new Set(
  "beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(mediaEventTypes)
);
function processDispatchQueue(dispatchQueue, eventSystemFlags) {
  eventSystemFlags = 0 !== (eventSystemFlags & 4);
  for (var i2 = 0; i2 < dispatchQueue.length; i2++) {
    var _dispatchQueue$i = dispatchQueue[i2], event = _dispatchQueue$i.event;
    _dispatchQueue$i = _dispatchQueue$i.listeners;
    a: {
      var previousInstance = void 0;
      if (eventSystemFlags)
        for (var i$jscomp$0 = _dispatchQueue$i.length - 1; 0 <= i$jscomp$0; i$jscomp$0--) {
          var _dispatchListeners$i = _dispatchQueue$i[i$jscomp$0], instance2 = _dispatchListeners$i.instance, currentTarget = _dispatchListeners$i.currentTarget;
          _dispatchListeners$i = _dispatchListeners$i.listener;
          if (instance2 !== previousInstance && event.isPropagationStopped())
            break a;
          previousInstance = _dispatchListeners$i;
          event.currentTarget = currentTarget;
          try {
            previousInstance(event);
          } catch (error) {
            reportGlobalError(error);
          }
          event.currentTarget = null;
          previousInstance = instance2;
        }
      else
        for (i$jscomp$0 = 0; i$jscomp$0 < _dispatchQueue$i.length; i$jscomp$0++) {
          _dispatchListeners$i = _dispatchQueue$i[i$jscomp$0];
          instance2 = _dispatchListeners$i.instance;
          currentTarget = _dispatchListeners$i.currentTarget;
          _dispatchListeners$i = _dispatchListeners$i.listener;
          if (instance2 !== previousInstance && event.isPropagationStopped())
            break a;
          previousInstance = _dispatchListeners$i;
          event.currentTarget = currentTarget;
          try {
            previousInstance(event);
          } catch (error) {
            reportGlobalError(error);
          }
          event.currentTarget = null;
          previousInstance = instance2;
        }
    }
  }
}
function listenToNonDelegatedEvent(domEventName, targetElement) {
  var JSCompiler_inline_result = targetElement[internalEventHandlersKey];
  void 0 === JSCompiler_inline_result && (JSCompiler_inline_result = targetElement[internalEventHandlersKey] = /* @__PURE__ */ new Set());
  var listenerSetKey = domEventName + "__bubble";
  JSCompiler_inline_result.has(listenerSetKey) || (addTrappedEventListener(targetElement, domEventName, 2, false), JSCompiler_inline_result.add(listenerSetKey));
}
function listenToNativeEvent(domEventName, isCapturePhaseListener, target) {
  var eventSystemFlags = 0;
  isCapturePhaseListener && (eventSystemFlags |= 4);
  addTrappedEventListener(
    target,
    domEventName,
    eventSystemFlags,
    isCapturePhaseListener
  );
}
var listeningMarker = "_reactListening" + Math.random().toString(36).slice(2);
function listenToAllSupportedEvents(rootContainerElement) {
  if (!rootContainerElement[listeningMarker]) {
    rootContainerElement[listeningMarker] = true;
    allNativeEvents.forEach(function(domEventName) {
      "selectionchange" !== domEventName && (nonDelegatedEvents.has(domEventName) || listenToNativeEvent(domEventName, false, rootContainerElement), listenToNativeEvent(domEventName, true, rootContainerElement));
    });
    var ownerDocument = 9 === rootContainerElement.nodeType ? rootContainerElement : rootContainerElement.ownerDocument;
    null === ownerDocument || ownerDocument[listeningMarker] || (ownerDocument[listeningMarker] = true, listenToNativeEvent("selectionchange", false, ownerDocument));
  }
}
function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener) {
  switch (getEventPriority(domEventName)) {
    case 2:
      var listenerWrapper = dispatchDiscreteEvent;
      break;
    case 8:
      listenerWrapper = dispatchContinuousEvent;
      break;
    default:
      listenerWrapper = dispatchEvent;
  }
  eventSystemFlags = listenerWrapper.bind(
    null,
    domEventName,
    eventSystemFlags,
    targetContainer
  );
  listenerWrapper = void 0;
  !passiveBrowserEventsSupported || "touchstart" !== domEventName && "touchmove" !== domEventName && "wheel" !== domEventName || (listenerWrapper = true);
  isCapturePhaseListener ? void 0 !== listenerWrapper ? targetContainer.addEventListener(domEventName, eventSystemFlags, {
    capture: true,
    passive: listenerWrapper
  }) : targetContainer.addEventListener(domEventName, eventSystemFlags, true) : void 0 !== listenerWrapper ? targetContainer.addEventListener(domEventName, eventSystemFlags, {
    passive: listenerWrapper
  }) : targetContainer.addEventListener(domEventName, eventSystemFlags, false);
}
function dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst$jscomp$0, targetContainer) {
  var ancestorInst = targetInst$jscomp$0;
  if (0 === (eventSystemFlags & 1) && 0 === (eventSystemFlags & 2) && null !== targetInst$jscomp$0)
    a: for (; ; ) {
      if (null === targetInst$jscomp$0) return;
      var nodeTag = targetInst$jscomp$0.tag;
      if (3 === nodeTag || 4 === nodeTag) {
        var container = targetInst$jscomp$0.stateNode.containerInfo;
        if (container === targetContainer) break;
        if (4 === nodeTag)
          for (nodeTag = targetInst$jscomp$0.return; null !== nodeTag; ) {
            var grandTag = nodeTag.tag;
            if ((3 === grandTag || 4 === grandTag) && nodeTag.stateNode.containerInfo === targetContainer)
              return;
            nodeTag = nodeTag.return;
          }
        for (; null !== container; ) {
          nodeTag = getClosestInstanceFromNode(container);
          if (null === nodeTag) return;
          grandTag = nodeTag.tag;
          if (5 === grandTag || 6 === grandTag || 26 === grandTag || 27 === grandTag) {
            targetInst$jscomp$0 = ancestorInst = nodeTag;
            continue a;
          }
          container = container.parentNode;
        }
      }
      targetInst$jscomp$0 = targetInst$jscomp$0.return;
    }
  batchedUpdates$1(function() {
    var targetInst = ancestorInst, nativeEventTarget = getEventTarget(nativeEvent), dispatchQueue = [];
    a: {
      var reactName = topLevelEventsToReactNames.get(domEventName);
      if (void 0 !== reactName) {
        var SyntheticEventCtor = SyntheticEvent, reactEventType = domEventName;
        switch (domEventName) {
          case "keypress":
            if (0 === getEventCharCode(nativeEvent)) break a;
          case "keydown":
          case "keyup":
            SyntheticEventCtor = SyntheticKeyboardEvent;
            break;
          case "focusin":
            reactEventType = "focus";
            SyntheticEventCtor = SyntheticFocusEvent;
            break;
          case "focusout":
            reactEventType = "blur";
            SyntheticEventCtor = SyntheticFocusEvent;
            break;
          case "beforeblur":
          case "afterblur":
            SyntheticEventCtor = SyntheticFocusEvent;
            break;
          case "click":
            if (2 === nativeEvent.button) break a;
          case "auxclick":
          case "dblclick":
          case "mousedown":
          case "mousemove":
          case "mouseup":
          case "mouseout":
          case "mouseover":
          case "contextmenu":
            SyntheticEventCtor = SyntheticMouseEvent;
            break;
          case "drag":
          case "dragend":
          case "dragenter":
          case "dragexit":
          case "dragleave":
          case "dragover":
          case "dragstart":
          case "drop":
            SyntheticEventCtor = SyntheticDragEvent;
            break;
          case "touchcancel":
          case "touchend":
          case "touchmove":
          case "touchstart":
            SyntheticEventCtor = SyntheticTouchEvent;
            break;
          case ANIMATION_END:
          case ANIMATION_ITERATION:
          case ANIMATION_START:
            SyntheticEventCtor = SyntheticAnimationEvent;
            break;
          case TRANSITION_END:
            SyntheticEventCtor = SyntheticTransitionEvent;
            break;
          case "scroll":
          case "scrollend":
            SyntheticEventCtor = SyntheticUIEvent;
            break;
          case "wheel":
            SyntheticEventCtor = SyntheticWheelEvent;
            break;
          case "copy":
          case "cut":
          case "paste":
            SyntheticEventCtor = SyntheticClipboardEvent;
            break;
          case "gotpointercapture":
          case "lostpointercapture":
          case "pointercancel":
          case "pointerdown":
          case "pointermove":
          case "pointerout":
          case "pointerover":
          case "pointerup":
            SyntheticEventCtor = SyntheticPointerEvent;
            break;
          case "toggle":
          case "beforetoggle":
            SyntheticEventCtor = SyntheticToggleEvent;
        }
        var inCapturePhase = 0 !== (eventSystemFlags & 4), accumulateTargetOnly = !inCapturePhase && ("scroll" === domEventName || "scrollend" === domEventName), reactEventName = inCapturePhase ? null !== reactName ? reactName + "Capture" : null : reactName;
        inCapturePhase = [];
        for (var instance2 = targetInst, lastHostComponent; null !== instance2; ) {
          var _instance = instance2;
          lastHostComponent = _instance.stateNode;
          _instance = _instance.tag;
          5 !== _instance && 26 !== _instance && 27 !== _instance || null === lastHostComponent || null === reactEventName || (_instance = getListener(instance2, reactEventName), null != _instance && inCapturePhase.push(
            createDispatchListener(instance2, _instance, lastHostComponent)
          ));
          if (accumulateTargetOnly) break;
          instance2 = instance2.return;
        }
        0 < inCapturePhase.length && (reactName = new SyntheticEventCtor(
          reactName,
          reactEventType,
          null,
          nativeEvent,
          nativeEventTarget
        ), dispatchQueue.push({ event: reactName, listeners: inCapturePhase }));
      }
    }
    if (0 === (eventSystemFlags & 7)) {
      a: {
        reactName = "mouseover" === domEventName || "pointerover" === domEventName;
        SyntheticEventCtor = "mouseout" === domEventName || "pointerout" === domEventName;
        if (reactName && nativeEvent !== currentReplayingEvent && (reactEventType = nativeEvent.relatedTarget || nativeEvent.fromElement) && (getClosestInstanceFromNode(reactEventType) || reactEventType[internalContainerInstanceKey]))
          break a;
        if (SyntheticEventCtor || reactName) {
          reactName = nativeEventTarget.window === nativeEventTarget ? nativeEventTarget : (reactName = nativeEventTarget.ownerDocument) ? reactName.defaultView || reactName.parentWindow : window;
          if (SyntheticEventCtor) {
            if (reactEventType = nativeEvent.relatedTarget || nativeEvent.toElement, SyntheticEventCtor = targetInst, reactEventType = reactEventType ? getClosestInstanceFromNode(reactEventType) : null, null !== reactEventType && (accumulateTargetOnly = getNearestMountedFiber(reactEventType), inCapturePhase = reactEventType.tag, reactEventType !== accumulateTargetOnly || 5 !== inCapturePhase && 27 !== inCapturePhase && 6 !== inCapturePhase))
              reactEventType = null;
          } else SyntheticEventCtor = null, reactEventType = targetInst;
          if (SyntheticEventCtor !== reactEventType) {
            inCapturePhase = SyntheticMouseEvent;
            _instance = "onMouseLeave";
            reactEventName = "onMouseEnter";
            instance2 = "mouse";
            if ("pointerout" === domEventName || "pointerover" === domEventName)
              inCapturePhase = SyntheticPointerEvent, _instance = "onPointerLeave", reactEventName = "onPointerEnter", instance2 = "pointer";
            accumulateTargetOnly = null == SyntheticEventCtor ? reactName : getNodeFromInstance(SyntheticEventCtor);
            lastHostComponent = null == reactEventType ? reactName : getNodeFromInstance(reactEventType);
            reactName = new inCapturePhase(
              _instance,
              instance2 + "leave",
              SyntheticEventCtor,
              nativeEvent,
              nativeEventTarget
            );
            reactName.target = accumulateTargetOnly;
            reactName.relatedTarget = lastHostComponent;
            _instance = null;
            getClosestInstanceFromNode(nativeEventTarget) === targetInst && (inCapturePhase = new inCapturePhase(
              reactEventName,
              instance2 + "enter",
              reactEventType,
              nativeEvent,
              nativeEventTarget
            ), inCapturePhase.target = lastHostComponent, inCapturePhase.relatedTarget = accumulateTargetOnly, _instance = inCapturePhase);
            accumulateTargetOnly = _instance;
            if (SyntheticEventCtor && reactEventType)
              b: {
                inCapturePhase = SyntheticEventCtor;
                reactEventName = reactEventType;
                instance2 = 0;
                for (lastHostComponent = inCapturePhase; lastHostComponent; lastHostComponent = getParent(lastHostComponent))
                  instance2++;
                lastHostComponent = 0;
                for (_instance = reactEventName; _instance; _instance = getParent(_instance))
                  lastHostComponent++;
                for (; 0 < instance2 - lastHostComponent; )
                  inCapturePhase = getParent(inCapturePhase), instance2--;
                for (; 0 < lastHostComponent - instance2; )
                  reactEventName = getParent(reactEventName), lastHostComponent--;
                for (; instance2--; ) {
                  if (inCapturePhase === reactEventName || null !== reactEventName && inCapturePhase === reactEventName.alternate)
                    break b;
                  inCapturePhase = getParent(inCapturePhase);
                  reactEventName = getParent(reactEventName);
                }
                inCapturePhase = null;
              }
            else inCapturePhase = null;
            null !== SyntheticEventCtor && accumulateEnterLeaveListenersForEvent(
              dispatchQueue,
              reactName,
              SyntheticEventCtor,
              inCapturePhase,
              false
            );
            null !== reactEventType && null !== accumulateTargetOnly && accumulateEnterLeaveListenersForEvent(
              dispatchQueue,
              accumulateTargetOnly,
              reactEventType,
              inCapturePhase,
              true
            );
          }
        }
      }
      a: {
        reactName = targetInst ? getNodeFromInstance(targetInst) : window;
        SyntheticEventCtor = reactName.nodeName && reactName.nodeName.toLowerCase();
        if ("select" === SyntheticEventCtor || "input" === SyntheticEventCtor && "file" === reactName.type)
          var getTargetInstFunc = getTargetInstForChangeEvent;
        else if (isTextInputElement(reactName))
          if (isInputEventSupported)
            getTargetInstFunc = getTargetInstForInputOrChangeEvent;
          else {
            getTargetInstFunc = getTargetInstForInputEventPolyfill;
            var handleEventFunc = handleEventsForInputEventPolyfill;
          }
        else
          SyntheticEventCtor = reactName.nodeName, !SyntheticEventCtor || "input" !== SyntheticEventCtor.toLowerCase() || "checkbox" !== reactName.type && "radio" !== reactName.type ? targetInst && isCustomElement(targetInst.elementType) && (getTargetInstFunc = getTargetInstForChangeEvent) : getTargetInstFunc = getTargetInstForClickEvent;
        if (getTargetInstFunc && (getTargetInstFunc = getTargetInstFunc(domEventName, targetInst))) {
          createAndAccumulateChangeEvent(
            dispatchQueue,
            getTargetInstFunc,
            nativeEvent,
            nativeEventTarget
          );
          break a;
        }
        handleEventFunc && handleEventFunc(domEventName, reactName, targetInst);
        "focusout" === domEventName && targetInst && "number" === reactName.type && null != targetInst.memoizedProps.value && setDefaultValue(reactName, "number", reactName.value);
      }
      handleEventFunc = targetInst ? getNodeFromInstance(targetInst) : window;
      switch (domEventName) {
        case "focusin":
          if (isTextInputElement(handleEventFunc) || "true" === handleEventFunc.contentEditable)
            activeElement = handleEventFunc, activeElementInst = targetInst, lastSelection = null;
          break;
        case "focusout":
          lastSelection = activeElementInst = activeElement = null;
          break;
        case "mousedown":
          mouseDown = true;
          break;
        case "contextmenu":
        case "mouseup":
        case "dragend":
          mouseDown = false;
          constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
          break;
        case "selectionchange":
          if (skipSelectionChangeEvent) break;
        case "keydown":
        case "keyup":
          constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
      }
      var fallbackData;
      if (canUseCompositionEvent)
        b: {
          switch (domEventName) {
            case "compositionstart":
              var eventType = "onCompositionStart";
              break b;
            case "compositionend":
              eventType = "onCompositionEnd";
              break b;
            case "compositionupdate":
              eventType = "onCompositionUpdate";
              break b;
          }
          eventType = void 0;
        }
      else
        isComposing ? isFallbackCompositionEnd(domEventName, nativeEvent) && (eventType = "onCompositionEnd") : "keydown" === domEventName && 229 === nativeEvent.keyCode && (eventType = "onCompositionStart");
      eventType && (useFallbackCompositionData && "ko" !== nativeEvent.locale && (isComposing || "onCompositionStart" !== eventType ? "onCompositionEnd" === eventType && isComposing && (fallbackData = getData()) : (root$1 = nativeEventTarget, startText = "value" in root$1 ? root$1.value : root$1.textContent, isComposing = true)), handleEventFunc = accumulateTwoPhaseListeners(targetInst, eventType), 0 < handleEventFunc.length && (eventType = new SyntheticCompositionEvent(
        eventType,
        domEventName,
        null,
        nativeEvent,
        nativeEventTarget
      ), dispatchQueue.push({ event: eventType, listeners: handleEventFunc }), fallbackData ? eventType.data = fallbackData : (fallbackData = getDataFromCustomEvent(nativeEvent), null !== fallbackData && (eventType.data = fallbackData))));
      if (fallbackData = canUseTextInputEvent ? getNativeBeforeInputChars(domEventName, nativeEvent) : getFallbackBeforeInputChars(domEventName, nativeEvent))
        eventType = accumulateTwoPhaseListeners(targetInst, "onBeforeInput"), 0 < eventType.length && (handleEventFunc = new SyntheticCompositionEvent(
          "onBeforeInput",
          "beforeinput",
          null,
          nativeEvent,
          nativeEventTarget
        ), dispatchQueue.push({
          event: handleEventFunc,
          listeners: eventType
        }), handleEventFunc.data = fallbackData);
      extractEvents$1(
        dispatchQueue,
        domEventName,
        targetInst,
        nativeEvent,
        nativeEventTarget
      );
    }
    processDispatchQueue(dispatchQueue, eventSystemFlags);
  });
}
function createDispatchListener(instance2, listener, currentTarget) {
  return {
    instance: instance2,
    listener,
    currentTarget
  };
}
function accumulateTwoPhaseListeners(targetFiber, reactName) {
  for (var captureName = reactName + "Capture", listeners = []; null !== targetFiber; ) {
    var _instance2 = targetFiber, stateNode = _instance2.stateNode;
    _instance2 = _instance2.tag;
    5 !== _instance2 && 26 !== _instance2 && 27 !== _instance2 || null === stateNode || (_instance2 = getListener(targetFiber, captureName), null != _instance2 && listeners.unshift(
      createDispatchListener(targetFiber, _instance2, stateNode)
    ), _instance2 = getListener(targetFiber, reactName), null != _instance2 && listeners.push(
      createDispatchListener(targetFiber, _instance2, stateNode)
    ));
    if (3 === targetFiber.tag) return listeners;
    targetFiber = targetFiber.return;
  }
  return [];
}
function getParent(inst) {
  if (null === inst) return null;
  do
    inst = inst.return;
  while (inst && 5 !== inst.tag && 27 !== inst.tag);
  return inst ? inst : null;
}
function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common2, inCapturePhase) {
  for (var registrationName = event._reactName, listeners = []; null !== target && target !== common2; ) {
    var _instance3 = target, alternate = _instance3.alternate, stateNode = _instance3.stateNode;
    _instance3 = _instance3.tag;
    if (null !== alternate && alternate === common2) break;
    5 !== _instance3 && 26 !== _instance3 && 27 !== _instance3 || null === stateNode || (alternate = stateNode, inCapturePhase ? (stateNode = getListener(target, registrationName), null != stateNode && listeners.unshift(
      createDispatchListener(target, stateNode, alternate)
    )) : inCapturePhase || (stateNode = getListener(target, registrationName), null != stateNode && listeners.push(
      createDispatchListener(target, stateNode, alternate)
    )));
    target = target.return;
  }
  0 !== listeners.length && dispatchQueue.push({ event, listeners });
}
var NORMALIZE_NEWLINES_REGEX = /\r\n?/g, NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
function normalizeMarkupForTextOrAttribute(markup) {
  return ("string" === typeof markup ? markup : "" + markup).replace(NORMALIZE_NEWLINES_REGEX, "\n").replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
}
function checkForUnmatchedText(serverText, clientText) {
  clientText = normalizeMarkupForTextOrAttribute(clientText);
  return normalizeMarkupForTextOrAttribute(serverText) === clientText ? true : false;
}
function noop$1$1() {
}
function setProp(domElement, tag, key, value, props, prevValue) {
  switch (key) {
    case "children":
      "string" === typeof value ? "body" === tag || "textarea" === tag && "" === value || setTextContent(domElement, value) : ("number" === typeof value || "bigint" === typeof value) && "body" !== tag && setTextContent(domElement, "" + value);
      break;
    case "className":
      setValueForKnownAttribute(domElement, "class", value);
      break;
    case "tabIndex":
      setValueForKnownAttribute(domElement, "tabindex", value);
      break;
    case "dir":
    case "role":
    case "viewBox":
    case "width":
    case "height":
      setValueForKnownAttribute(domElement, key, value);
      break;
    case "style":
      setValueForStyles(domElement, value, prevValue);
      break;
    case "data":
      if ("object" !== tag) {
        setValueForKnownAttribute(domElement, "data", value);
        break;
      }
    case "src":
    case "href":
      if ("" === value && ("a" !== tag || "href" !== key)) {
        domElement.removeAttribute(key);
        break;
      }
      if (null == value || "function" === typeof value || "symbol" === typeof value || "boolean" === typeof value) {
        domElement.removeAttribute(key);
        break;
      }
      value = sanitizeURL("" + value);
      domElement.setAttribute(key, value);
      break;
    case "action":
    case "formAction":
      if ("function" === typeof value) {
        domElement.setAttribute(
          key,
          "javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')"
        );
        break;
      } else
        "function" === typeof prevValue && ("formAction" === key ? ("input" !== tag && setProp(domElement, tag, "name", props.name, props, null), setProp(
          domElement,
          tag,
          "formEncType",
          props.formEncType,
          props,
          null
        ), setProp(
          domElement,
          tag,
          "formMethod",
          props.formMethod,
          props,
          null
        ), setProp(
          domElement,
          tag,
          "formTarget",
          props.formTarget,
          props,
          null
        )) : (setProp(domElement, tag, "encType", props.encType, props, null), setProp(domElement, tag, "method", props.method, props, null), setProp(domElement, tag, "target", props.target, props, null)));
      if (null == value || "symbol" === typeof value || "boolean" === typeof value) {
        domElement.removeAttribute(key);
        break;
      }
      value = sanitizeURL("" + value);
      domElement.setAttribute(key, value);
      break;
    case "onClick":
      null != value && (domElement.onclick = noop$1$1);
      break;
    case "onScroll":
      null != value && listenToNonDelegatedEvent("scroll", domElement);
      break;
    case "onScrollEnd":
      null != value && listenToNonDelegatedEvent("scrollend", domElement);
      break;
    case "dangerouslySetInnerHTML":
      if (null != value) {
        if ("object" !== typeof value || !("__html" in value))
          throw Error(formatProdErrorMessage$2(61));
        key = value.__html;
        if (null != key) {
          if (null != props.children) throw Error(formatProdErrorMessage$2(60));
          domElement.innerHTML = key;
        }
      }
      break;
    case "multiple":
      domElement.multiple = value && "function" !== typeof value && "symbol" !== typeof value;
      break;
    case "muted":
      domElement.muted = value && "function" !== typeof value && "symbol" !== typeof value;
      break;
    case "suppressContentEditableWarning":
    case "suppressHydrationWarning":
    case "defaultValue":
    case "defaultChecked":
    case "innerHTML":
    case "ref":
      break;
    case "autoFocus":
      break;
    case "xlinkHref":
      if (null == value || "function" === typeof value || "boolean" === typeof value || "symbol" === typeof value) {
        domElement.removeAttribute("xlink:href");
        break;
      }
      key = sanitizeURL("" + value);
      domElement.setAttributeNS(
        "http://www.w3.org/1999/xlink",
        "xlink:href",
        key
      );
      break;
    case "contentEditable":
    case "spellCheck":
    case "draggable":
    case "value":
    case "autoReverse":
    case "externalResourcesRequired":
    case "focusable":
    case "preserveAlpha":
      null != value && "function" !== typeof value && "symbol" !== typeof value ? domElement.setAttribute(key, "" + value) : domElement.removeAttribute(key);
      break;
    case "inert":
    case "allowFullScreen":
    case "async":
    case "autoPlay":
    case "controls":
    case "default":
    case "defer":
    case "disabled":
    case "disablePictureInPicture":
    case "disableRemotePlayback":
    case "formNoValidate":
    case "hidden":
    case "loop":
    case "noModule":
    case "noValidate":
    case "open":
    case "playsInline":
    case "readOnly":
    case "required":
    case "reversed":
    case "scoped":
    case "seamless":
    case "itemScope":
      value && "function" !== typeof value && "symbol" !== typeof value ? domElement.setAttribute(key, "") : domElement.removeAttribute(key);
      break;
    case "capture":
    case "download":
      true === value ? domElement.setAttribute(key, "") : false !== value && null != value && "function" !== typeof value && "symbol" !== typeof value ? domElement.setAttribute(key, value) : domElement.removeAttribute(key);
      break;
    case "cols":
    case "rows":
    case "size":
    case "span":
      null != value && "function" !== typeof value && "symbol" !== typeof value && !isNaN(value) && 1 <= value ? domElement.setAttribute(key, value) : domElement.removeAttribute(key);
      break;
    case "rowSpan":
    case "start":
      null == value || "function" === typeof value || "symbol" === typeof value || isNaN(value) ? domElement.removeAttribute(key) : domElement.setAttribute(key, value);
      break;
    case "popover":
      listenToNonDelegatedEvent("beforetoggle", domElement);
      listenToNonDelegatedEvent("toggle", domElement);
      setValueForAttribute(domElement, "popover", value);
      break;
    case "xlinkActuate":
      setValueForNamespacedAttribute(
        domElement,
        "http://www.w3.org/1999/xlink",
        "xlink:actuate",
        value
      );
      break;
    case "xlinkArcrole":
      setValueForNamespacedAttribute(
        domElement,
        "http://www.w3.org/1999/xlink",
        "xlink:arcrole",
        value
      );
      break;
    case "xlinkRole":
      setValueForNamespacedAttribute(
        domElement,
        "http://www.w3.org/1999/xlink",
        "xlink:role",
        value
      );
      break;
    case "xlinkShow":
      setValueForNamespacedAttribute(
        domElement,
        "http://www.w3.org/1999/xlink",
        "xlink:show",
        value
      );
      break;
    case "xlinkTitle":
      setValueForNamespacedAttribute(
        domElement,
        "http://www.w3.org/1999/xlink",
        "xlink:title",
        value
      );
      break;
    case "xlinkType":
      setValueForNamespacedAttribute(
        domElement,
        "http://www.w3.org/1999/xlink",
        "xlink:type",
        value
      );
      break;
    case "xmlBase":
      setValueForNamespacedAttribute(
        domElement,
        "http://www.w3.org/XML/1998/namespace",
        "xml:base",
        value
      );
      break;
    case "xmlLang":
      setValueForNamespacedAttribute(
        domElement,
        "http://www.w3.org/XML/1998/namespace",
        "xml:lang",
        value
      );
      break;
    case "xmlSpace":
      setValueForNamespacedAttribute(
        domElement,
        "http://www.w3.org/XML/1998/namespace",
        "xml:space",
        value
      );
      break;
    case "is":
      setValueForAttribute(domElement, "is", value);
      break;
    case "innerText":
    case "textContent":
      break;
    default:
      if (!(2 < key.length) || "o" !== key[0] && "O" !== key[0] || "n" !== key[1] && "N" !== key[1])
        key = aliases.get(key) || key, setValueForAttribute(domElement, key, value);
  }
}
function setPropOnCustomElement(domElement, tag, key, value, props, prevValue) {
  switch (key) {
    case "style":
      setValueForStyles(domElement, value, prevValue);
      break;
    case "dangerouslySetInnerHTML":
      if (null != value) {
        if ("object" !== typeof value || !("__html" in value))
          throw Error(formatProdErrorMessage$2(61));
        key = value.__html;
        if (null != key) {
          if (null != props.children) throw Error(formatProdErrorMessage$2(60));
          domElement.innerHTML = key;
        }
      }
      break;
    case "children":
      "string" === typeof value ? setTextContent(domElement, value) : ("number" === typeof value || "bigint" === typeof value) && setTextContent(domElement, "" + value);
      break;
    case "onScroll":
      null != value && listenToNonDelegatedEvent("scroll", domElement);
      break;
    case "onScrollEnd":
      null != value && listenToNonDelegatedEvent("scrollend", domElement);
      break;
    case "onClick":
      null != value && (domElement.onclick = noop$1$1);
      break;
    case "suppressContentEditableWarning":
    case "suppressHydrationWarning":
    case "innerHTML":
    case "ref":
      break;
    case "innerText":
    case "textContent":
      break;
    default:
      if (!registrationNameDependencies.hasOwnProperty(key))
        a: {
          if ("o" === key[0] && "n" === key[1] && (props = key.endsWith("Capture"), tag = key.slice(2, props ? key.length - 7 : void 0), prevValue = domElement[internalPropsKey] || null, prevValue = null != prevValue ? prevValue[key] : null, "function" === typeof prevValue && domElement.removeEventListener(tag, prevValue, props), "function" === typeof value)) {
            "function" !== typeof prevValue && null !== prevValue && (key in domElement ? domElement[key] = null : domElement.hasAttribute(key) && domElement.removeAttribute(key));
            domElement.addEventListener(tag, value, props);
            break a;
          }
          key in domElement ? domElement[key] = value : true === value ? domElement.setAttribute(key, "") : setValueForAttribute(domElement, key, value);
        }
  }
}
function setInitialProperties(domElement, tag, props) {
  switch (tag) {
    case "div":
    case "span":
    case "svg":
    case "path":
    case "a":
    case "g":
    case "p":
    case "li":
      break;
    case "img":
      listenToNonDelegatedEvent("error", domElement);
      listenToNonDelegatedEvent("load", domElement);
      var hasSrc = false, hasSrcSet = false, propKey;
      for (propKey in props)
        if (props.hasOwnProperty(propKey)) {
          var propValue = props[propKey];
          if (null != propValue)
            switch (propKey) {
              case "src":
                hasSrc = true;
                break;
              case "srcSet":
                hasSrcSet = true;
                break;
              case "children":
              case "dangerouslySetInnerHTML":
                throw Error(formatProdErrorMessage$2(137, tag));
              default:
                setProp(domElement, tag, propKey, propValue, props, null);
            }
        }
      hasSrcSet && setProp(domElement, tag, "srcSet", props.srcSet, props, null);
      hasSrc && setProp(domElement, tag, "src", props.src, props, null);
      return;
    case "input":
      listenToNonDelegatedEvent("invalid", domElement);
      var defaultValue = propKey = propValue = hasSrcSet = null, checked = null, defaultChecked = null;
      for (hasSrc in props)
        if (props.hasOwnProperty(hasSrc)) {
          var propValue$188 = props[hasSrc];
          if (null != propValue$188)
            switch (hasSrc) {
              case "name":
                hasSrcSet = propValue$188;
                break;
              case "type":
                propValue = propValue$188;
                break;
              case "checked":
                checked = propValue$188;
                break;
              case "defaultChecked":
                defaultChecked = propValue$188;
                break;
              case "value":
                propKey = propValue$188;
                break;
              case "defaultValue":
                defaultValue = propValue$188;
                break;
              case "children":
              case "dangerouslySetInnerHTML":
                if (null != propValue$188)
                  throw Error(formatProdErrorMessage$2(137, tag));
                break;
              default:
                setProp(domElement, tag, hasSrc, propValue$188, props, null);
            }
        }
      initInput(
        domElement,
        propKey,
        defaultValue,
        checked,
        defaultChecked,
        propValue,
        hasSrcSet,
        false
      );
      track(domElement);
      return;
    case "select":
      listenToNonDelegatedEvent("invalid", domElement);
      hasSrc = propValue = propKey = null;
      for (hasSrcSet in props)
        if (props.hasOwnProperty(hasSrcSet) && (defaultValue = props[hasSrcSet], null != defaultValue))
          switch (hasSrcSet) {
            case "value":
              propKey = defaultValue;
              break;
            case "defaultValue":
              propValue = defaultValue;
              break;
            case "multiple":
              hasSrc = defaultValue;
            default:
              setProp(domElement, tag, hasSrcSet, defaultValue, props, null);
          }
      tag = propKey;
      props = propValue;
      domElement.multiple = !!hasSrc;
      null != tag ? updateOptions(domElement, !!hasSrc, tag, false) : null != props && updateOptions(domElement, !!hasSrc, props, true);
      return;
    case "textarea":
      listenToNonDelegatedEvent("invalid", domElement);
      propKey = hasSrcSet = hasSrc = null;
      for (propValue in props)
        if (props.hasOwnProperty(propValue) && (defaultValue = props[propValue], null != defaultValue))
          switch (propValue) {
            case "value":
              hasSrc = defaultValue;
              break;
            case "defaultValue":
              hasSrcSet = defaultValue;
              break;
            case "children":
              propKey = defaultValue;
              break;
            case "dangerouslySetInnerHTML":
              if (null != defaultValue) throw Error(formatProdErrorMessage$2(91));
              break;
            default:
              setProp(domElement, tag, propValue, defaultValue, props, null);
          }
      initTextarea(domElement, hasSrc, hasSrcSet, propKey);
      track(domElement);
      return;
    case "option":
      for (checked in props)
        if (props.hasOwnProperty(checked) && (hasSrc = props[checked], null != hasSrc))
          switch (checked) {
            case "selected":
              domElement.selected = hasSrc && "function" !== typeof hasSrc && "symbol" !== typeof hasSrc;
              break;
            default:
              setProp(domElement, tag, checked, hasSrc, props, null);
          }
      return;
    case "dialog":
      listenToNonDelegatedEvent("beforetoggle", domElement);
      listenToNonDelegatedEvent("toggle", domElement);
      listenToNonDelegatedEvent("cancel", domElement);
      listenToNonDelegatedEvent("close", domElement);
      break;
    case "iframe":
    case "object":
      listenToNonDelegatedEvent("load", domElement);
      break;
    case "video":
    case "audio":
      for (hasSrc = 0; hasSrc < mediaEventTypes.length; hasSrc++)
        listenToNonDelegatedEvent(mediaEventTypes[hasSrc], domElement);
      break;
    case "image":
      listenToNonDelegatedEvent("error", domElement);
      listenToNonDelegatedEvent("load", domElement);
      break;
    case "details":
      listenToNonDelegatedEvent("toggle", domElement);
      break;
    case "embed":
    case "source":
    case "link":
      listenToNonDelegatedEvent("error", domElement), listenToNonDelegatedEvent("load", domElement);
    case "area":
    case "base":
    case "br":
    case "col":
    case "hr":
    case "keygen":
    case "meta":
    case "param":
    case "track":
    case "wbr":
    case "menuitem":
      for (defaultChecked in props)
        if (props.hasOwnProperty(defaultChecked) && (hasSrc = props[defaultChecked], null != hasSrc))
          switch (defaultChecked) {
            case "children":
            case "dangerouslySetInnerHTML":
              throw Error(formatProdErrorMessage$2(137, tag));
            default:
              setProp(domElement, tag, defaultChecked, hasSrc, props, null);
          }
      return;
    default:
      if (isCustomElement(tag)) {
        for (propValue$188 in props)
          props.hasOwnProperty(propValue$188) && (hasSrc = props[propValue$188], void 0 !== hasSrc && setPropOnCustomElement(
            domElement,
            tag,
            propValue$188,
            hasSrc,
            props,
            void 0
          ));
        return;
      }
  }
  for (defaultValue in props)
    props.hasOwnProperty(defaultValue) && (hasSrc = props[defaultValue], null != hasSrc && setProp(domElement, tag, defaultValue, hasSrc, props, null));
}
function updateProperties(domElement, tag, lastProps, nextProps) {
  switch (tag) {
    case "div":
    case "span":
    case "svg":
    case "path":
    case "a":
    case "g":
    case "p":
    case "li":
      break;
    case "input":
      var name = null, type = null, value = null, defaultValue = null, lastDefaultValue = null, checked = null, defaultChecked = null;
      for (propKey in lastProps) {
        var lastProp = lastProps[propKey];
        if (lastProps.hasOwnProperty(propKey) && null != lastProp)
          switch (propKey) {
            case "checked":
              break;
            case "value":
              break;
            case "defaultValue":
              lastDefaultValue = lastProp;
            default:
              nextProps.hasOwnProperty(propKey) || setProp(domElement, tag, propKey, null, nextProps, lastProp);
          }
      }
      for (var propKey$205 in nextProps) {
        var propKey = nextProps[propKey$205];
        lastProp = lastProps[propKey$205];
        if (nextProps.hasOwnProperty(propKey$205) && (null != propKey || null != lastProp))
          switch (propKey$205) {
            case "type":
              type = propKey;
              break;
            case "name":
              name = propKey;
              break;
            case "checked":
              checked = propKey;
              break;
            case "defaultChecked":
              defaultChecked = propKey;
              break;
            case "value":
              value = propKey;
              break;
            case "defaultValue":
              defaultValue = propKey;
              break;
            case "children":
            case "dangerouslySetInnerHTML":
              if (null != propKey)
                throw Error(formatProdErrorMessage$2(137, tag));
              break;
            default:
              propKey !== lastProp && setProp(
                domElement,
                tag,
                propKey$205,
                propKey,
                nextProps,
                lastProp
              );
          }
      }
      updateInput(
        domElement,
        value,
        defaultValue,
        lastDefaultValue,
        checked,
        defaultChecked,
        type,
        name
      );
      return;
    case "select":
      propKey = value = defaultValue = propKey$205 = null;
      for (type in lastProps)
        if (lastDefaultValue = lastProps[type], lastProps.hasOwnProperty(type) && null != lastDefaultValue)
          switch (type) {
            case "value":
              break;
            case "multiple":
              propKey = lastDefaultValue;
            default:
              nextProps.hasOwnProperty(type) || setProp(
                domElement,
                tag,
                type,
                null,
                nextProps,
                lastDefaultValue
              );
          }
      for (name in nextProps)
        if (type = nextProps[name], lastDefaultValue = lastProps[name], nextProps.hasOwnProperty(name) && (null != type || null != lastDefaultValue))
          switch (name) {
            case "value":
              propKey$205 = type;
              break;
            case "defaultValue":
              defaultValue = type;
              break;
            case "multiple":
              value = type;
            default:
              type !== lastDefaultValue && setProp(
                domElement,
                tag,
                name,
                type,
                nextProps,
                lastDefaultValue
              );
          }
      tag = defaultValue;
      lastProps = value;
      nextProps = propKey;
      null != propKey$205 ? updateOptions(domElement, !!lastProps, propKey$205, false) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, true) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", false));
      return;
    case "textarea":
      propKey = propKey$205 = null;
      for (defaultValue in lastProps)
        if (name = lastProps[defaultValue], lastProps.hasOwnProperty(defaultValue) && null != name && !nextProps.hasOwnProperty(defaultValue))
          switch (defaultValue) {
            case "value":
              break;
            case "children":
              break;
            default:
              setProp(domElement, tag, defaultValue, null, nextProps, name);
          }
      for (value in nextProps)
        if (name = nextProps[value], type = lastProps[value], nextProps.hasOwnProperty(value) && (null != name || null != type))
          switch (value) {
            case "value":
              propKey$205 = name;
              break;
            case "defaultValue":
              propKey = name;
              break;
            case "children":
              break;
            case "dangerouslySetInnerHTML":
              if (null != name) throw Error(formatProdErrorMessage$2(91));
              break;
            default:
              name !== type && setProp(domElement, tag, value, name, nextProps, type);
          }
      updateTextarea(domElement, propKey$205, propKey);
      return;
    case "option":
      for (var propKey$221 in lastProps)
        if (propKey$205 = lastProps[propKey$221], lastProps.hasOwnProperty(propKey$221) && null != propKey$205 && !nextProps.hasOwnProperty(propKey$221))
          switch (propKey$221) {
            case "selected":
              domElement.selected = false;
              break;
            default:
              setProp(
                domElement,
                tag,
                propKey$221,
                null,
                nextProps,
                propKey$205
              );
          }
      for (lastDefaultValue in nextProps)
        if (propKey$205 = nextProps[lastDefaultValue], propKey = lastProps[lastDefaultValue], nextProps.hasOwnProperty(lastDefaultValue) && propKey$205 !== propKey && (null != propKey$205 || null != propKey))
          switch (lastDefaultValue) {
            case "selected":
              domElement.selected = propKey$205 && "function" !== typeof propKey$205 && "symbol" !== typeof propKey$205;
              break;
            default:
              setProp(
                domElement,
                tag,
                lastDefaultValue,
                propKey$205,
                nextProps,
                propKey
              );
          }
      return;
    case "img":
    case "link":
    case "area":
    case "base":
    case "br":
    case "col":
    case "embed":
    case "hr":
    case "keygen":
    case "meta":
    case "param":
    case "source":
    case "track":
    case "wbr":
    case "menuitem":
      for (var propKey$226 in lastProps)
        propKey$205 = lastProps[propKey$226], lastProps.hasOwnProperty(propKey$226) && null != propKey$205 && !nextProps.hasOwnProperty(propKey$226) && setProp(domElement, tag, propKey$226, null, nextProps, propKey$205);
      for (checked in nextProps)
        if (propKey$205 = nextProps[checked], propKey = lastProps[checked], nextProps.hasOwnProperty(checked) && propKey$205 !== propKey && (null != propKey$205 || null != propKey))
          switch (checked) {
            case "children":
            case "dangerouslySetInnerHTML":
              if (null != propKey$205)
                throw Error(formatProdErrorMessage$2(137, tag));
              break;
            default:
              setProp(
                domElement,
                tag,
                checked,
                propKey$205,
                nextProps,
                propKey
              );
          }
      return;
    default:
      if (isCustomElement(tag)) {
        for (var propKey$231 in lastProps)
          propKey$205 = lastProps[propKey$231], lastProps.hasOwnProperty(propKey$231) && void 0 !== propKey$205 && !nextProps.hasOwnProperty(propKey$231) && setPropOnCustomElement(
            domElement,
            tag,
            propKey$231,
            void 0,
            nextProps,
            propKey$205
          );
        for (defaultChecked in nextProps)
          propKey$205 = nextProps[defaultChecked], propKey = lastProps[defaultChecked], !nextProps.hasOwnProperty(defaultChecked) || propKey$205 === propKey || void 0 === propKey$205 && void 0 === propKey || setPropOnCustomElement(
            domElement,
            tag,
            defaultChecked,
            propKey$205,
            nextProps,
            propKey
          );
        return;
      }
  }
  for (var propKey$236 in lastProps)
    propKey$205 = lastProps[propKey$236], lastProps.hasOwnProperty(propKey$236) && null != propKey$205 && !nextProps.hasOwnProperty(propKey$236) && setProp(domElement, tag, propKey$236, null, nextProps, propKey$205);
  for (lastProp in nextProps)
    propKey$205 = nextProps[lastProp], propKey = lastProps[lastProp], !nextProps.hasOwnProperty(lastProp) || propKey$205 === propKey || null == propKey$205 && null == propKey || setProp(domElement, tag, lastProp, propKey$205, nextProps, propKey);
}
var eventsEnabled = null, selectionInformation = null;
function getOwnerDocumentFromRootContainer(rootContainerElement) {
  return 9 === rootContainerElement.nodeType ? rootContainerElement : rootContainerElement.ownerDocument;
}
function getOwnHostContext(namespaceURI) {
  switch (namespaceURI) {
    case "http://www.w3.org/2000/svg":
      return 1;
    case "http://www.w3.org/1998/Math/MathML":
      return 2;
    default:
      return 0;
  }
}
function getChildHostContextProd(parentNamespace, type) {
  if (0 === parentNamespace)
    switch (type) {
      case "svg":
        return 1;
      case "math":
        return 2;
      default:
        return 0;
    }
  return 1 === parentNamespace && "foreignObject" === type ? 0 : parentNamespace;
}
function shouldSetTextContent(type, props) {
  return "textarea" === type || "noscript" === type || "string" === typeof props.children || "number" === typeof props.children || "bigint" === typeof props.children || "object" === typeof props.dangerouslySetInnerHTML && null !== props.dangerouslySetInnerHTML && null != props.dangerouslySetInnerHTML.__html;
}
var currentPopstateTransitionEvent = null;
function shouldAttemptEagerTransition() {
  var event = window.event;
  if (event && "popstate" === event.type) {
    if (event === currentPopstateTransitionEvent) return false;
    currentPopstateTransitionEvent = event;
    return true;
  }
  currentPopstateTransitionEvent = null;
  return false;
}
var scheduleTimeout = "function" === typeof setTimeout ? setTimeout : void 0, cancelTimeout = "function" === typeof clearTimeout ? clearTimeout : void 0, localPromise = "function" === typeof Promise ? Promise : void 0, scheduleMicrotask = "function" === typeof queueMicrotask ? queueMicrotask : "undefined" !== typeof localPromise ? function(callback) {
  return localPromise.resolve(null).then(callback).catch(handleErrorInNextTick);
} : scheduleTimeout;
function handleErrorInNextTick(error) {
  setTimeout(function() {
    throw error;
  });
}
function isSingletonScope(type) {
  return "head" === type;
}
function clearSuspenseBoundary(parentInstance, suspenseInstance) {
  var node = suspenseInstance, possiblePreambleContribution = 0, depth = 0;
  do {
    var nextNode = node.nextSibling;
    parentInstance.removeChild(node);
    if (nextNode && 8 === nextNode.nodeType)
      if (node = nextNode.data, "/$" === node) {
        if (0 < possiblePreambleContribution && 8 > possiblePreambleContribution) {
          node = possiblePreambleContribution;
          var ownerDocument = parentInstance.ownerDocument;
          node & 1 && releaseSingletonInstance(ownerDocument.documentElement);
          node & 2 && releaseSingletonInstance(ownerDocument.body);
          if (node & 4)
            for (node = ownerDocument.head, releaseSingletonInstance(node), ownerDocument = node.firstChild; ownerDocument; ) {
              var nextNode$jscomp$0 = ownerDocument.nextSibling, nodeName = ownerDocument.nodeName;
              ownerDocument[internalHoistableMarker] || "SCRIPT" === nodeName || "STYLE" === nodeName || "LINK" === nodeName && "stylesheet" === ownerDocument.rel.toLowerCase() || node.removeChild(ownerDocument);
              ownerDocument = nextNode$jscomp$0;
            }
        }
        if (0 === depth) {
          parentInstance.removeChild(nextNode);
          retryIfBlockedOn(suspenseInstance);
          return;
        }
        depth--;
      } else
        "$" === node || "$?" === node || "$!" === node ? depth++ : possiblePreambleContribution = node.charCodeAt(0) - 48;
    else possiblePreambleContribution = 0;
    node = nextNode;
  } while (node);
  retryIfBlockedOn(suspenseInstance);
}
function clearContainerSparingly(container) {
  var nextNode = container.firstChild;
  nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling);
  for (; nextNode; ) {
    var node = nextNode;
    nextNode = nextNode.nextSibling;
    switch (node.nodeName) {
      case "HTML":
      case "HEAD":
      case "BODY":
        clearContainerSparingly(node);
        detachDeletedInstance(node);
        continue;
      case "SCRIPT":
      case "STYLE":
        continue;
      case "LINK":
        if ("stylesheet" === node.rel.toLowerCase()) continue;
    }
    container.removeChild(node);
  }
}
function canHydrateInstance(instance2, type, props, inRootOrSingleton) {
  for (; 1 === instance2.nodeType; ) {
    var anyProps = props;
    if (instance2.nodeName.toLowerCase() !== type.toLowerCase()) {
      if (!inRootOrSingleton && ("INPUT" !== instance2.nodeName || "hidden" !== instance2.type))
        break;
    } else if (!inRootOrSingleton)
      if ("input" === type && "hidden" === instance2.type) {
        var name = null == anyProps.name ? null : "" + anyProps.name;
        if ("hidden" === anyProps.type && instance2.getAttribute("name") === name)
          return instance2;
      } else return instance2;
    else if (!instance2[internalHoistableMarker])
      switch (type) {
        case "meta":
          if (!instance2.hasAttribute("itemprop")) break;
          return instance2;
        case "link":
          name = instance2.getAttribute("rel");
          if ("stylesheet" === name && instance2.hasAttribute("data-precedence"))
            break;
          else if (name !== anyProps.rel || instance2.getAttribute("href") !== (null == anyProps.href || "" === anyProps.href ? null : anyProps.href) || instance2.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null : anyProps.crossOrigin) || instance2.getAttribute("title") !== (null == anyProps.title ? null : anyProps.title))
            break;
          return instance2;
        case "style":
          if (instance2.hasAttribute("data-precedence")) break;
          return instance2;
        case "script":
          name = instance2.getAttribute("src");
          if ((name !== (null == anyProps.src ? null : anyProps.src) || instance2.getAttribute("type") !== (null == anyProps.type ? null : anyProps.type) || instance2.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null : anyProps.crossOrigin)) && name && instance2.hasAttribute("async") && !instance2.hasAttribute("itemprop"))
            break;
          return instance2;
        default:
          return instance2;
      }
    instance2 = getNextHydratable(instance2.nextSibling);
    if (null === instance2) break;
  }
  return null;
}
function canHydrateTextInstance(instance2, text, inRootOrSingleton) {
  if ("" === text) return null;
  for (; 3 !== instance2.nodeType; ) {
    if ((1 !== instance2.nodeType || "INPUT" !== instance2.nodeName || "hidden" !== instance2.type) && !inRootOrSingleton)
      return null;
    instance2 = getNextHydratable(instance2.nextSibling);
    if (null === instance2) return null;
  }
  return instance2;
}
function isSuspenseInstanceFallback(instance2) {
  return "$!" === instance2.data || "$?" === instance2.data && "complete" === instance2.ownerDocument.readyState;
}
function registerSuspenseInstanceRetry(instance2, callback) {
  var ownerDocument = instance2.ownerDocument;
  if ("$?" !== instance2.data || "complete" === ownerDocument.readyState)
    callback();
  else {
    var listener = function() {
      callback();
      ownerDocument.removeEventListener("DOMContentLoaded", listener);
    };
    ownerDocument.addEventListener("DOMContentLoaded", listener);
    instance2._reactRetry = listener;
  }
}
function getNextHydratable(node) {
  for (; null != node; node = node.nextSibling) {
    var nodeType = node.nodeType;
    if (1 === nodeType || 3 === nodeType) break;
    if (8 === nodeType) {
      nodeType = node.data;
      if ("$" === nodeType || "$!" === nodeType || "$?" === nodeType || "F!" === nodeType || "F" === nodeType)
        break;
      if ("/$" === nodeType) return null;
    }
  }
  return node;
}
var previousHydratableOnEnteringScopedSingleton = null;
function getParentSuspenseInstance(targetInstance) {
  targetInstance = targetInstance.previousSibling;
  for (var depth = 0; targetInstance; ) {
    if (8 === targetInstance.nodeType) {
      var data = targetInstance.data;
      if ("$" === data || "$!" === data || "$?" === data) {
        if (0 === depth) return targetInstance;
        depth--;
      } else "/$" === data && depth++;
    }
    targetInstance = targetInstance.previousSibling;
  }
  return null;
}
function resolveSingletonInstance(type, props, rootContainerInstance) {
  props = getOwnerDocumentFromRootContainer(rootContainerInstance);
  switch (type) {
    case "html":
      type = props.documentElement;
      if (!type) throw Error(formatProdErrorMessage$2(452));
      return type;
    case "head":
      type = props.head;
      if (!type) throw Error(formatProdErrorMessage$2(453));
      return type;
    case "body":
      type = props.body;
      if (!type) throw Error(formatProdErrorMessage$2(454));
      return type;
    default:
      throw Error(formatProdErrorMessage$2(451));
  }
}
function releaseSingletonInstance(instance2) {
  for (var attributes = instance2.attributes; attributes.length; )
    instance2.removeAttributeNode(attributes[0]);
  detachDeletedInstance(instance2);
}
var preloadPropsMap = /* @__PURE__ */ new Map(), preconnectsSet = /* @__PURE__ */ new Set();
function getHoistableRoot(container) {
  return "function" === typeof container.getRootNode ? container.getRootNode() : 9 === container.nodeType ? container : container.ownerDocument;
}
var previousDispatcher = ReactDOMSharedInternals.d;
ReactDOMSharedInternals.d = {
  f: flushSyncWork,
  r: requestFormReset,
  D: prefetchDNS,
  C: preconnect,
  L: preload,
  m: preloadModule,
  X: preinitScript,
  S: preinitStyle,
  M: preinitModuleScript
};
function flushSyncWork() {
  var previousWasRendering = previousDispatcher.f(), wasRendering = flushSyncWork$1();
  return previousWasRendering || wasRendering;
}
function requestFormReset(form) {
  var formInst = getInstanceFromNode(form);
  null !== formInst && 5 === formInst.tag && "form" === formInst.type ? requestFormReset$1(formInst) : previousDispatcher.r(form);
}
var globalDocument = "undefined" === typeof document ? null : document;
function preconnectAs(rel, href, crossOrigin) {
  var ownerDocument = globalDocument;
  if (ownerDocument && "string" === typeof href && href) {
    var limitedEscapedHref = escapeSelectorAttributeValueInsideDoubleQuotes(href);
    limitedEscapedHref = 'link[rel="' + rel + '"][href="' + limitedEscapedHref + '"]';
    "string" === typeof crossOrigin && (limitedEscapedHref += '[crossorigin="' + crossOrigin + '"]');
    preconnectsSet.has(limitedEscapedHref) || (preconnectsSet.add(limitedEscapedHref), rel = { rel, crossOrigin, href }, null === ownerDocument.querySelector(limitedEscapedHref) && (href = ownerDocument.createElement("link"), setInitialProperties(href, "link", rel), markNodeAsHoistable(href), ownerDocument.head.appendChild(href)));
  }
}
function prefetchDNS(href) {
  previousDispatcher.D(href);
  preconnectAs("dns-prefetch", href, null);
}
function preconnect(href, crossOrigin) {
  previousDispatcher.C(href, crossOrigin);
  preconnectAs("preconnect", href, crossOrigin);
}
function preload(href, as, options) {
  previousDispatcher.L(href, as, options);
  var ownerDocument = globalDocument;
  if (ownerDocument && href && as) {
    var preloadSelector = 'link[rel="preload"][as="' + escapeSelectorAttributeValueInsideDoubleQuotes(as) + '"]';
    "image" === as ? options && options.imageSrcSet ? (preloadSelector += '[imagesrcset="' + escapeSelectorAttributeValueInsideDoubleQuotes(
      options.imageSrcSet
    ) + '"]', "string" === typeof options.imageSizes && (preloadSelector += '[imagesizes="' + escapeSelectorAttributeValueInsideDoubleQuotes(
      options.imageSizes
    ) + '"]')) : preloadSelector += '[href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"]' : preloadSelector += '[href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"]';
    var key = preloadSelector;
    switch (as) {
      case "style":
        key = getStyleKey(href);
        break;
      case "script":
        key = getScriptKey(href);
    }
    preloadPropsMap.has(key) || (href = assign(
      {
        rel: "preload",
        href: "image" === as && options && options.imageSrcSet ? void 0 : href,
        as
      },
      options
    ), preloadPropsMap.set(key, href), null !== ownerDocument.querySelector(preloadSelector) || "style" === as && ownerDocument.querySelector(getStylesheetSelectorFromKey(key)) || "script" === as && ownerDocument.querySelector(getScriptSelectorFromKey(key)) || (as = ownerDocument.createElement("link"), setInitialProperties(as, "link", href), markNodeAsHoistable(as), ownerDocument.head.appendChild(as)));
  }
}
function preloadModule(href, options) {
  previousDispatcher.m(href, options);
  var ownerDocument = globalDocument;
  if (ownerDocument && href) {
    var as = options && "string" === typeof options.as ? options.as : "script", preloadSelector = 'link[rel="modulepreload"][as="' + escapeSelectorAttributeValueInsideDoubleQuotes(as) + '"][href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"]', key = preloadSelector;
    switch (as) {
      case "audioworklet":
      case "paintworklet":
      case "serviceworker":
      case "sharedworker":
      case "worker":
      case "script":
        key = getScriptKey(href);
    }
    if (!preloadPropsMap.has(key) && (href = assign({ rel: "modulepreload", href }, options), preloadPropsMap.set(key, href), null === ownerDocument.querySelector(preloadSelector))) {
      switch (as) {
        case "audioworklet":
        case "paintworklet":
        case "serviceworker":
        case "sharedworker":
        case "worker":
        case "script":
          if (ownerDocument.querySelector(getScriptSelectorFromKey(key)))
            return;
      }
      as = ownerDocument.createElement("link");
      setInitialProperties(as, "link", href);
      markNodeAsHoistable(as);
      ownerDocument.head.appendChild(as);
    }
  }
}
function preinitStyle(href, precedence, options) {
  previousDispatcher.S(href, precedence, options);
  var ownerDocument = globalDocument;
  if (ownerDocument && href) {
    var styles = getResourcesFromRoot(ownerDocument).hoistableStyles, key = getStyleKey(href);
    precedence = precedence || "default";
    var resource = styles.get(key);
    if (!resource) {
      var state = { loading: 0, preload: null };
      if (resource = ownerDocument.querySelector(
        getStylesheetSelectorFromKey(key)
      ))
        state.loading = 5;
      else {
        href = assign(
          { rel: "stylesheet", href, "data-precedence": precedence },
          options
        );
        (options = preloadPropsMap.get(key)) && adoptPreloadPropsForStylesheet(href, options);
        var link = resource = ownerDocument.createElement("link");
        markNodeAsHoistable(link);
        setInitialProperties(link, "link", href);
        link._p = new Promise(function(resolve, reject) {
          link.onload = resolve;
          link.onerror = reject;
        });
        link.addEventListener("load", function() {
          state.loading |= 1;
        });
        link.addEventListener("error", function() {
          state.loading |= 2;
        });
        state.loading |= 4;
        insertStylesheet(resource, precedence, ownerDocument);
      }
      resource = {
        type: "stylesheet",
        instance: resource,
        count: 1,
        state
      };
      styles.set(key, resource);
    }
  }
}
function preinitScript(src, options) {
  previousDispatcher.X(src, options);
  var ownerDocument = globalDocument;
  if (ownerDocument && src) {
    var scripts = getResourcesFromRoot(ownerDocument).hoistableScripts, key = getScriptKey(src), resource = scripts.get(key);
    resource || (resource = ownerDocument.querySelector(getScriptSelectorFromKey(key)), resource || (src = assign({ src, async: true }, options), (options = preloadPropsMap.get(key)) && adoptPreloadPropsForScript(src, options), resource = ownerDocument.createElement("script"), markNodeAsHoistable(resource), setInitialProperties(resource, "link", src), ownerDocument.head.appendChild(resource)), resource = {
      type: "script",
      instance: resource,
      count: 1,
      state: null
    }, scripts.set(key, resource));
  }
}
function preinitModuleScript(src, options) {
  previousDispatcher.M(src, options);
  var ownerDocument = globalDocument;
  if (ownerDocument && src) {
    var scripts = getResourcesFromRoot(ownerDocument).hoistableScripts, key = getScriptKey(src), resource = scripts.get(key);
    resource || (resource = ownerDocument.querySelector(getScriptSelectorFromKey(key)), resource || (src = assign({ src, async: true, type: "module" }, options), (options = preloadPropsMap.get(key)) && adoptPreloadPropsForScript(src, options), resource = ownerDocument.createElement("script"), markNodeAsHoistable(resource), setInitialProperties(resource, "link", src), ownerDocument.head.appendChild(resource)), resource = {
      type: "script",
      instance: resource,
      count: 1,
      state: null
    }, scripts.set(key, resource));
  }
}
function getResource(type, currentProps, pendingProps, currentResource) {
  var JSCompiler_inline_result = (JSCompiler_inline_result = rootInstanceStackCursor.current) ? getHoistableRoot(JSCompiler_inline_result) : null;
  if (!JSCompiler_inline_result) throw Error(formatProdErrorMessage$2(446));
  switch (type) {
    case "meta":
    case "title":
      return null;
    case "style":
      return "string" === typeof pendingProps.precedence && "string" === typeof pendingProps.href ? (currentProps = getStyleKey(pendingProps.href), pendingProps = getResourcesFromRoot(
        JSCompiler_inline_result
      ).hoistableStyles, currentResource = pendingProps.get(currentProps), currentResource || (currentResource = {
        type: "style",
        instance: null,
        count: 0,
        state: null
      }, pendingProps.set(currentProps, currentResource)), currentResource) : { type: "void", instance: null, count: 0, state: null };
    case "link":
      if ("stylesheet" === pendingProps.rel && "string" === typeof pendingProps.href && "string" === typeof pendingProps.precedence) {
        type = getStyleKey(pendingProps.href);
        var styles$244 = getResourcesFromRoot(
          JSCompiler_inline_result
        ).hoistableStyles, resource$245 = styles$244.get(type);
        resource$245 || (JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result, resource$245 = {
          type: "stylesheet",
          instance: null,
          count: 0,
          state: { loading: 0, preload: null }
        }, styles$244.set(type, resource$245), (styles$244 = JSCompiler_inline_result.querySelector(
          getStylesheetSelectorFromKey(type)
        )) && !styles$244._p && (resource$245.instance = styles$244, resource$245.state.loading = 5), preloadPropsMap.has(type) || (pendingProps = {
          rel: "preload",
          as: "style",
          href: pendingProps.href,
          crossOrigin: pendingProps.crossOrigin,
          integrity: pendingProps.integrity,
          media: pendingProps.media,
          hrefLang: pendingProps.hrefLang,
          referrerPolicy: pendingProps.referrerPolicy
        }, preloadPropsMap.set(type, pendingProps), styles$244 || preloadStylesheet(
          JSCompiler_inline_result,
          type,
          pendingProps,
          resource$245.state
        )));
        if (currentProps && null === currentResource)
          throw Error(formatProdErrorMessage$2(528, ""));
        return resource$245;
      }
      if (currentProps && null !== currentResource)
        throw Error(formatProdErrorMessage$2(529, ""));
      return null;
    case "script":
      return currentProps = pendingProps.async, pendingProps = pendingProps.src, "string" === typeof pendingProps && currentProps && "function" !== typeof currentProps && "symbol" !== typeof currentProps ? (currentProps = getScriptKey(pendingProps), pendingProps = getResourcesFromRoot(
        JSCompiler_inline_result
      ).hoistableScripts, currentResource = pendingProps.get(currentProps), currentResource || (currentResource = {
        type: "script",
        instance: null,
        count: 0,
        state: null
      }, pendingProps.set(currentProps, currentResource)), currentResource) : { type: "void", instance: null, count: 0, state: null };
    default:
      throw Error(formatProdErrorMessage$2(444, type));
  }
}
function getStyleKey(href) {
  return 'href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"';
}
function getStylesheetSelectorFromKey(key) {
  return 'link[rel="stylesheet"][' + key + "]";
}
function stylesheetPropsFromRawProps(rawProps) {
  return assign({}, rawProps, {
    "data-precedence": rawProps.precedence,
    precedence: null
  });
}
function preloadStylesheet(ownerDocument, key, preloadProps, state) {
  ownerDocument.querySelector('link[rel="preload"][as="style"][' + key + "]") ? state.loading = 1 : (key = ownerDocument.createElement("link"), state.preload = key, key.addEventListener("load", function() {
    return state.loading |= 1;
  }), key.addEventListener("error", function() {
    return state.loading |= 2;
  }), setInitialProperties(key, "link", preloadProps), markNodeAsHoistable(key), ownerDocument.head.appendChild(key));
}
function getScriptKey(src) {
  return '[src="' + escapeSelectorAttributeValueInsideDoubleQuotes(src) + '"]';
}
function getScriptSelectorFromKey(key) {
  return "script[async]" + key;
}
function acquireResource(hoistableRoot, resource, props) {
  resource.count++;
  if (null === resource.instance)
    switch (resource.type) {
      case "style":
        var instance2 = hoistableRoot.querySelector(
          'style[data-href~="' + escapeSelectorAttributeValueInsideDoubleQuotes(props.href) + '"]'
        );
        if (instance2)
          return resource.instance = instance2, markNodeAsHoistable(instance2), instance2;
        var styleProps = assign({}, props, {
          "data-href": props.href,
          "data-precedence": props.precedence,
          href: null,
          precedence: null
        });
        instance2 = (hoistableRoot.ownerDocument || hoistableRoot).createElement(
          "style"
        );
        markNodeAsHoistable(instance2);
        setInitialProperties(instance2, "style", styleProps);
        insertStylesheet(instance2, props.precedence, hoistableRoot);
        return resource.instance = instance2;
      case "stylesheet":
        styleProps = getStyleKey(props.href);
        var instance$250 = hoistableRoot.querySelector(
          getStylesheetSelectorFromKey(styleProps)
        );
        if (instance$250)
          return resource.state.loading |= 4, resource.instance = instance$250, markNodeAsHoistable(instance$250), instance$250;
        instance2 = stylesheetPropsFromRawProps(props);
        (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance2, styleProps);
        instance$250 = (hoistableRoot.ownerDocument || hoistableRoot).createElement("link");
        markNodeAsHoistable(instance$250);
        var linkInstance = instance$250;
        linkInstance._p = new Promise(function(resolve, reject) {
          linkInstance.onload = resolve;
          linkInstance.onerror = reject;
        });
        setInitialProperties(instance$250, "link", instance2);
        resource.state.loading |= 4;
        insertStylesheet(instance$250, props.precedence, hoistableRoot);
        return resource.instance = instance$250;
      case "script":
        instance$250 = getScriptKey(props.src);
        if (styleProps = hoistableRoot.querySelector(
          getScriptSelectorFromKey(instance$250)
        ))
          return resource.instance = styleProps, markNodeAsHoistable(styleProps), styleProps;
        instance2 = props;
        if (styleProps = preloadPropsMap.get(instance$250))
          instance2 = assign({}, props), adoptPreloadPropsForScript(instance2, styleProps);
        hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
        styleProps = hoistableRoot.createElement("script");
        markNodeAsHoistable(styleProps);
        setInitialProperties(styleProps, "link", instance2);
        hoistableRoot.head.appendChild(styleProps);
        return resource.instance = styleProps;
      case "void":
        return null;
      default:
        throw Error(formatProdErrorMessage$2(443, resource.type));
    }
  else
    "stylesheet" === resource.type && 0 === (resource.state.loading & 4) && (instance2 = resource.instance, resource.state.loading |= 4, insertStylesheet(instance2, props.precedence, hoistableRoot));
  return resource.instance;
}
function insertStylesheet(instance2, precedence, root2) {
  for (var nodes = root2.querySelectorAll(
    'link[rel="stylesheet"][data-precedence],style[data-precedence]'
  ), last = nodes.length ? nodes[nodes.length - 1] : null, prior = last, i2 = 0; i2 < nodes.length; i2++) {
    var node = nodes[i2];
    if (node.dataset.precedence === precedence) prior = node;
    else if (prior !== last) break;
  }
  prior ? prior.parentNode.insertBefore(instance2, prior.nextSibling) : (precedence = 9 === root2.nodeType ? root2.head : root2, precedence.insertBefore(instance2, precedence.firstChild));
}
function adoptPreloadPropsForStylesheet(stylesheetProps, preloadProps) {
  null == stylesheetProps.crossOrigin && (stylesheetProps.crossOrigin = preloadProps.crossOrigin);
  null == stylesheetProps.referrerPolicy && (stylesheetProps.referrerPolicy = preloadProps.referrerPolicy);
  null == stylesheetProps.title && (stylesheetProps.title = preloadProps.title);
}
function adoptPreloadPropsForScript(scriptProps, preloadProps) {
  null == scriptProps.crossOrigin && (scriptProps.crossOrigin = preloadProps.crossOrigin);
  null == scriptProps.referrerPolicy && (scriptProps.referrerPolicy = preloadProps.referrerPolicy);
  null == scriptProps.integrity && (scriptProps.integrity = preloadProps.integrity);
}
var tagCaches = null;
function getHydratableHoistableCache(type, keyAttribute, ownerDocument) {
  if (null === tagCaches) {
    var cache = /* @__PURE__ */ new Map();
    var caches = tagCaches = /* @__PURE__ */ new Map();
    caches.set(ownerDocument, cache);
  } else
    caches = tagCaches, cache = caches.get(ownerDocument), cache || (cache = /* @__PURE__ */ new Map(), caches.set(ownerDocument, cache));
  if (cache.has(type)) return cache;
  cache.set(type, null);
  ownerDocument = ownerDocument.getElementsByTagName(type);
  for (caches = 0; caches < ownerDocument.length; caches++) {
    var node = ownerDocument[caches];
    if (!(node[internalHoistableMarker] || node[internalInstanceKey] || "link" === type && "stylesheet" === node.getAttribute("rel")) && "http://www.w3.org/2000/svg" !== node.namespaceURI) {
      var nodeKey = node.getAttribute(keyAttribute) || "";
      nodeKey = type + nodeKey;
      var existing = cache.get(nodeKey);
      existing ? existing.push(node) : cache.set(nodeKey, [node]);
    }
  }
  return cache;
}
function mountHoistable(hoistableRoot, type, instance2) {
  hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
  hoistableRoot.head.insertBefore(
    instance2,
    "title" === type ? hoistableRoot.querySelector("head > title") : null
  );
}
function isHostHoistableType(type, props, hostContext) {
  if (1 === hostContext || null != props.itemProp) return false;
  switch (type) {
    case "meta":
    case "title":
      return true;
    case "style":
      if ("string" !== typeof props.precedence || "string" !== typeof props.href || "" === props.href)
        break;
      return true;
    case "link":
      if ("string" !== typeof props.rel || "string" !== typeof props.href || "" === props.href || props.onLoad || props.onError)
        break;
      switch (props.rel) {
        case "stylesheet":
          return type = props.disabled, "string" === typeof props.precedence && null == type;
        default:
          return true;
      }
    case "script":
      if (props.async && "function" !== typeof props.async && "symbol" !== typeof props.async && !props.onLoad && !props.onError && props.src && "string" === typeof props.src)
        return true;
  }
  return false;
}
function preloadResource(resource) {
  return "stylesheet" === resource.type && 0 === (resource.state.loading & 3) ? false : true;
}
var suspendedState = null;
function noop$4() {
}
function suspendResource(hoistableRoot, resource, props) {
  if (null === suspendedState) throw Error(formatProdErrorMessage$2(475));
  var state = suspendedState;
  if ("stylesheet" === resource.type && ("string" !== typeof props.media || false !== matchMedia(props.media).matches) && 0 === (resource.state.loading & 4)) {
    if (null === resource.instance) {
      var key = getStyleKey(props.href), instance2 = hoistableRoot.querySelector(
        getStylesheetSelectorFromKey(key)
      );
      if (instance2) {
        hoistableRoot = instance2._p;
        null !== hoistableRoot && "object" === typeof hoistableRoot && "function" === typeof hoistableRoot.then && (state.count++, state = onUnsuspend.bind(state), hoistableRoot.then(state, state));
        resource.state.loading |= 4;
        resource.instance = instance2;
        markNodeAsHoistable(instance2);
        return;
      }
      instance2 = hoistableRoot.ownerDocument || hoistableRoot;
      props = stylesheetPropsFromRawProps(props);
      (key = preloadPropsMap.get(key)) && adoptPreloadPropsForStylesheet(props, key);
      instance2 = instance2.createElement("link");
      markNodeAsHoistable(instance2);
      var linkInstance = instance2;
      linkInstance._p = new Promise(function(resolve, reject) {
        linkInstance.onload = resolve;
        linkInstance.onerror = reject;
      });
      setInitialProperties(instance2, "link", props);
      resource.instance = instance2;
    }
    null === state.stylesheets && (state.stylesheets = /* @__PURE__ */ new Map());
    state.stylesheets.set(resource, hoistableRoot);
    (hoistableRoot = resource.state.preload) && 0 === (resource.state.loading & 3) && (state.count++, resource = onUnsuspend.bind(state), hoistableRoot.addEventListener("load", resource), hoistableRoot.addEventListener("error", resource));
  }
}
function waitForCommitToBeReady() {
  if (null === suspendedState) throw Error(formatProdErrorMessage$2(475));
  var state = suspendedState;
  state.stylesheets && 0 === state.count && insertSuspendedStylesheets(state, state.stylesheets);
  return 0 < state.count ? function(commit) {
    var stylesheetTimer = setTimeout(function() {
      state.stylesheets && insertSuspendedStylesheets(state, state.stylesheets);
      if (state.unsuspend) {
        var unsuspend = state.unsuspend;
        state.unsuspend = null;
        unsuspend();
      }
    }, 6e4);
    state.unsuspend = commit;
    return function() {
      state.unsuspend = null;
      clearTimeout(stylesheetTimer);
    };
  } : null;
}
function onUnsuspend() {
  this.count--;
  if (0 === this.count) {
    if (this.stylesheets) insertSuspendedStylesheets(this, this.stylesheets);
    else if (this.unsuspend) {
      var unsuspend = this.unsuspend;
      this.unsuspend = null;
      unsuspend();
    }
  }
}
var precedencesByRoot = null;
function insertSuspendedStylesheets(state, resources2) {
  state.stylesheets = null;
  null !== state.unsuspend && (state.count++, precedencesByRoot = /* @__PURE__ */ new Map(), resources2.forEach(insertStylesheetIntoRoot, state), precedencesByRoot = null, onUnsuspend.call(state));
}
function insertStylesheetIntoRoot(root2, resource) {
  if (!(resource.state.loading & 4)) {
    var precedences = precedencesByRoot.get(root2);
    if (precedences) var last = precedences.get(null);
    else {
      precedences = /* @__PURE__ */ new Map();
      precedencesByRoot.set(root2, precedences);
      for (var nodes = root2.querySelectorAll(
        "link[data-precedence],style[data-precedence]"
      ), i2 = 0; i2 < nodes.length; i2++) {
        var node = nodes[i2];
        if ("LINK" === node.nodeName || "not all" !== node.getAttribute("media"))
          precedences.set(node.dataset.precedence, node), last = node;
      }
      last && precedences.set(null, last);
    }
    nodes = resource.instance;
    node = nodes.getAttribute("data-precedence");
    i2 = precedences.get(node) || last;
    i2 === last && precedences.set(null, nodes);
    precedences.set(node, nodes);
    this.count++;
    last = onUnsuspend.bind(this);
    nodes.addEventListener("load", last);
    nodes.addEventListener("error", last);
    i2 ? i2.parentNode.insertBefore(nodes, i2.nextSibling) : (root2 = 9 === root2.nodeType ? root2.head : root2, root2.insertBefore(nodes, root2.firstChild));
    resource.state.loading |= 4;
  }
}
var HostTransitionContext = {
  $$typeof: REACT_CONTEXT_TYPE,
  Provider: null,
  Consumer: null,
  _currentValue: sharedNotPendingObject,
  _currentValue2: sharedNotPendingObject,
  _threadCount: 0
};
function FiberRootNode(containerInfo, tag, hydrate, identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, formState) {
  this.tag = 1;
  this.containerInfo = containerInfo;
  this.pingCache = this.current = this.pendingChildren = null;
  this.timeoutHandle = -1;
  this.callbackNode = this.next = this.pendingContext = this.context = this.cancelPendingCommit = null;
  this.callbackPriority = 0;
  this.expirationTimes = createLaneMap(-1);
  this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0;
  this.entanglements = createLaneMap(0);
  this.hiddenUpdates = createLaneMap(null);
  this.identifierPrefix = identifierPrefix;
  this.onUncaughtError = onUncaughtError;
  this.onCaughtError = onCaughtError;
  this.onRecoverableError = onRecoverableError;
  this.pooledCache = null;
  this.pooledCacheLanes = 0;
  this.formState = formState;
  this.incompleteTransitions = /* @__PURE__ */ new Map();
}
function createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transitionCallbacks, formState) {
  containerInfo = new FiberRootNode(
    containerInfo,
    tag,
    hydrate,
    identifierPrefix,
    onUncaughtError,
    onCaughtError,
    onRecoverableError,
    formState
  );
  tag = 1;
  true === isStrictMode && (tag |= 24);
  isStrictMode = createFiberImplClass(3, null, null, tag);
  containerInfo.current = isStrictMode;
  isStrictMode.stateNode = containerInfo;
  tag = createCache();
  tag.refCount++;
  containerInfo.pooledCache = tag;
  tag.refCount++;
  isStrictMode.memoizedState = {
    element: initialChildren,
    isDehydrated: hydrate,
    cache: tag
  };
  initializeUpdateQueue(isStrictMode);
  return containerInfo;
}
function getContextForSubtree(parentComponent) {
  if (!parentComponent) return emptyContextObject;
  parentComponent = emptyContextObject;
  return parentComponent;
}
function updateContainerImpl(rootFiber, lane, element, container, parentComponent, callback) {
  parentComponent = getContextForSubtree(parentComponent);
  null === container.context ? container.context = parentComponent : container.pendingContext = parentComponent;
  container = createUpdate(lane);
  container.payload = { element };
  callback = void 0 === callback ? null : callback;
  null !== callback && (container.callback = callback);
  element = enqueueUpdate(rootFiber, container, lane);
  null !== element && (scheduleUpdateOnFiber(element, rootFiber, lane), entangleTransitions(element, rootFiber, lane));
}
function markRetryLaneImpl(fiber, retryLane) {
  fiber = fiber.memoizedState;
  if (null !== fiber && null !== fiber.dehydrated) {
    var a2 = fiber.retryLane;
    fiber.retryLane = 0 !== a2 && a2 < retryLane ? a2 : retryLane;
  }
}
function markRetryLaneIfNotHydrated(fiber, retryLane) {
  markRetryLaneImpl(fiber, retryLane);
  (fiber = fiber.alternate) && markRetryLaneImpl(fiber, retryLane);
}
function attemptContinuousHydration(fiber) {
  if (13 === fiber.tag) {
    var root2 = enqueueConcurrentRenderForLane(fiber, 67108864);
    null !== root2 && scheduleUpdateOnFiber(root2, fiber, 67108864);
    markRetryLaneIfNotHydrated(fiber, 67108864);
  }
}
var _enabled = true;
function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) {
  var prevTransition = ReactSharedInternals.T;
  ReactSharedInternals.T = null;
  var previousPriority = ReactDOMSharedInternals.p;
  try {
    ReactDOMSharedInternals.p = 2, dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
  } finally {
    ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = prevTransition;
  }
}
function dispatchContinuousEvent(domEventName, eventSystemFlags, container, nativeEvent) {
  var prevTransition = ReactSharedInternals.T;
  ReactSharedInternals.T = null;
  var previousPriority = ReactDOMSharedInternals.p;
  try {
    ReactDOMSharedInternals.p = 8, dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
  } finally {
    ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = prevTransition;
  }
}
function dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
  if (_enabled) {
    var blockedOn = findInstanceBlockingEvent(nativeEvent);
    if (null === blockedOn)
      dispatchEventForPluginEventSystem(
        domEventName,
        eventSystemFlags,
        nativeEvent,
        return_targetInst,
        targetContainer
      ), clearIfContinuousEvent(domEventName, nativeEvent);
    else if (queueIfContinuousEvent(
      blockedOn,
      domEventName,
      eventSystemFlags,
      targetContainer,
      nativeEvent
    ))
      nativeEvent.stopPropagation();
    else if (clearIfContinuousEvent(domEventName, nativeEvent), eventSystemFlags & 4 && -1 < discreteReplayableEvents.indexOf(domEventName)) {
      for (; null !== blockedOn; ) {
        var fiber = getInstanceFromNode(blockedOn);
        if (null !== fiber)
          switch (fiber.tag) {
            case 3:
              fiber = fiber.stateNode;
              if (fiber.current.memoizedState.isDehydrated) {
                var lanes = getHighestPriorityLanes(fiber.pendingLanes);
                if (0 !== lanes) {
                  var root2 = fiber;
                  root2.pendingLanes |= 2;
                  for (root2.entangledLanes |= 2; lanes; ) {
                    var lane = 1 << 31 - clz32(lanes);
                    root2.entanglements[1] |= lane;
                    lanes &= ~lane;
                  }
                  ensureRootIsScheduled(fiber);
                  0 === (executionContext & 6) && (workInProgressRootRenderTargetTime = now() + 500, flushSyncWorkAcrossRoots_impl(0));
                }
              }
              break;
            case 13:
              root2 = enqueueConcurrentRenderForLane(fiber, 2), null !== root2 && scheduleUpdateOnFiber(root2, fiber, 2), flushSyncWork$1(), markRetryLaneIfNotHydrated(fiber, 2);
          }
        fiber = findInstanceBlockingEvent(nativeEvent);
        null === fiber && dispatchEventForPluginEventSystem(
          domEventName,
          eventSystemFlags,
          nativeEvent,
          return_targetInst,
          targetContainer
        );
        if (fiber === blockedOn) break;
        blockedOn = fiber;
      }
      null !== blockedOn && nativeEvent.stopPropagation();
    } else
      dispatchEventForPluginEventSystem(
        domEventName,
        eventSystemFlags,
        nativeEvent,
        null,
        targetContainer
      );
  }
}
function findInstanceBlockingEvent(nativeEvent) {
  nativeEvent = getEventTarget(nativeEvent);
  return findInstanceBlockingTarget(nativeEvent);
}
var return_targetInst = null;
function findInstanceBlockingTarget(targetNode) {
  return_targetInst = null;
  targetNode = getClosestInstanceFromNode(targetNode);
  if (null !== targetNode) {
    var nearestMounted = getNearestMountedFiber(targetNode);
    if (null === nearestMounted) targetNode = null;
    else {
      var tag = nearestMounted.tag;
      if (13 === tag) {
        targetNode = getSuspenseInstanceFromFiber(nearestMounted);
        if (null !== targetNode) return targetNode;
        targetNode = null;
      } else if (3 === tag) {
        if (nearestMounted.stateNode.current.memoizedState.isDehydrated)
          return 3 === nearestMounted.tag ? nearestMounted.stateNode.containerInfo : null;
        targetNode = null;
      } else nearestMounted !== targetNode && (targetNode = null);
    }
  }
  return_targetInst = targetNode;
  return null;
}
function getEventPriority(domEventName) {
  switch (domEventName) {
    case "beforetoggle":
    case "cancel":
    case "click":
    case "close":
    case "contextmenu":
    case "copy":
    case "cut":
    case "auxclick":
    case "dblclick":
    case "dragend":
    case "dragstart":
    case "drop":
    case "focusin":
    case "focusout":
    case "input":
    case "invalid":
    case "keydown":
    case "keypress":
    case "keyup":
    case "mousedown":
    case "mouseup":
    case "paste":
    case "pause":
    case "play":
    case "pointercancel":
    case "pointerdown":
    case "pointerup":
    case "ratechange":
    case "reset":
    case "resize":
    case "seeked":
    case "submit":
    case "toggle":
    case "touchcancel":
    case "touchend":
    case "touchstart":
    case "volumechange":
    case "change":
    case "selectionchange":
    case "textInput":
    case "compositionstart":
    case "compositionend":
    case "compositionupdate":
    case "beforeblur":
    case "afterblur":
    case "beforeinput":
    case "blur":
    case "fullscreenchange":
    case "focus":
    case "hashchange":
    case "popstate":
    case "select":
    case "selectstart":
      return 2;
    case "drag":
    case "dragenter":
    case "dragexit":
    case "dragleave":
    case "dragover":
    case "mousemove":
    case "mouseout":
    case "mouseover":
    case "pointermove":
    case "pointerout":
    case "pointerover":
    case "scroll":
    case "touchmove":
    case "wheel":
    case "mouseenter":
    case "mouseleave":
    case "pointerenter":
    case "pointerleave":
      return 8;
    case "message":
      switch (getCurrentPriorityLevel()) {
        case ImmediatePriority:
          return 2;
        case UserBlockingPriority:
          return 8;
        case NormalPriority$1:
        case LowPriority:
          return 32;
        case IdlePriority:
          return 268435456;
        default:
          return 32;
      }
    default:
      return 32;
  }
}
var hasScheduledReplayAttempt = false, queuedFocus = null, queuedDrag = null, queuedMouse = null, queuedPointers = /* @__PURE__ */ new Map(), queuedPointerCaptures = /* @__PURE__ */ new Map(), queuedExplicitHydrationTargets = [], discreteReplayableEvents = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(
  " "
);
function clearIfContinuousEvent(domEventName, nativeEvent) {
  switch (domEventName) {
    case "focusin":
    case "focusout":
      queuedFocus = null;
      break;
    case "dragenter":
    case "dragleave":
      queuedDrag = null;
      break;
    case "mouseover":
    case "mouseout":
      queuedMouse = null;
      break;
    case "pointerover":
    case "pointerout":
      queuedPointers.delete(nativeEvent.pointerId);
      break;
    case "gotpointercapture":
    case "lostpointercapture":
      queuedPointerCaptures.delete(nativeEvent.pointerId);
  }
}
function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
  if (null === existingQueuedEvent || existingQueuedEvent.nativeEvent !== nativeEvent)
    return existingQueuedEvent = {
      blockedOn,
      domEventName,
      eventSystemFlags,
      nativeEvent,
      targetContainers: [targetContainer]
    }, null !== blockedOn && (blockedOn = getInstanceFromNode(blockedOn), null !== blockedOn && attemptContinuousHydration(blockedOn)), existingQueuedEvent;
  existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
  blockedOn = existingQueuedEvent.targetContainers;
  null !== targetContainer && -1 === blockedOn.indexOf(targetContainer) && blockedOn.push(targetContainer);
  return existingQueuedEvent;
}
function queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
  switch (domEventName) {
    case "focusin":
      return queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(
        queuedFocus,
        blockedOn,
        domEventName,
        eventSystemFlags,
        targetContainer,
        nativeEvent
      ), true;
    case "dragenter":
      return queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(
        queuedDrag,
        blockedOn,
        domEventName,
        eventSystemFlags,
        targetContainer,
        nativeEvent
      ), true;
    case "mouseover":
      return queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(
        queuedMouse,
        blockedOn,
        domEventName,
        eventSystemFlags,
        targetContainer,
        nativeEvent
      ), true;
    case "pointerover":
      var pointerId = nativeEvent.pointerId;
      queuedPointers.set(
        pointerId,
        accumulateOrCreateContinuousQueuedReplayableEvent(
          queuedPointers.get(pointerId) || null,
          blockedOn,
          domEventName,
          eventSystemFlags,
          targetContainer,
          nativeEvent
        )
      );
      return true;
    case "gotpointercapture":
      return pointerId = nativeEvent.pointerId, queuedPointerCaptures.set(
        pointerId,
        accumulateOrCreateContinuousQueuedReplayableEvent(
          queuedPointerCaptures.get(pointerId) || null,
          blockedOn,
          domEventName,
          eventSystemFlags,
          targetContainer,
          nativeEvent
        )
      ), true;
  }
  return false;
}
function attemptExplicitHydrationTarget(queuedTarget) {
  var targetInst = getClosestInstanceFromNode(queuedTarget.target);
  if (null !== targetInst) {
    var nearestMounted = getNearestMountedFiber(targetInst);
    if (null !== nearestMounted) {
      if (targetInst = nearestMounted.tag, 13 === targetInst) {
        if (targetInst = getSuspenseInstanceFromFiber(nearestMounted), null !== targetInst) {
          queuedTarget.blockedOn = targetInst;
          runWithPriority(queuedTarget.priority, function() {
            if (13 === nearestMounted.tag) {
              var lane = requestUpdateLane();
              lane = getBumpedLaneForHydrationByLane(lane);
              var root2 = enqueueConcurrentRenderForLane(nearestMounted, lane);
              null !== root2 && scheduleUpdateOnFiber(root2, nearestMounted, lane);
              markRetryLaneIfNotHydrated(nearestMounted, lane);
            }
          });
          return;
        }
      } else if (3 === targetInst && nearestMounted.stateNode.current.memoizedState.isDehydrated) {
        queuedTarget.blockedOn = 3 === nearestMounted.tag ? nearestMounted.stateNode.containerInfo : null;
        return;
      }
    }
  }
  queuedTarget.blockedOn = null;
}
function attemptReplayContinuousQueuedEvent(queuedEvent) {
  if (null !== queuedEvent.blockedOn) return false;
  for (var targetContainers = queuedEvent.targetContainers; 0 < targetContainers.length; ) {
    var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.nativeEvent);
    if (null === nextBlockedOn) {
      nextBlockedOn = queuedEvent.nativeEvent;
      var nativeEventClone = new nextBlockedOn.constructor(
        nextBlockedOn.type,
        nextBlockedOn
      );
      currentReplayingEvent = nativeEventClone;
      nextBlockedOn.target.dispatchEvent(nativeEventClone);
      currentReplayingEvent = null;
    } else
      return targetContainers = getInstanceFromNode(nextBlockedOn), null !== targetContainers && attemptContinuousHydration(targetContainers), queuedEvent.blockedOn = nextBlockedOn, false;
    targetContainers.shift();
  }
  return true;
}
function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {
  attemptReplayContinuousQueuedEvent(queuedEvent) && map.delete(key);
}
function replayUnblockedEvents() {
  hasScheduledReplayAttempt = false;
  null !== queuedFocus && attemptReplayContinuousQueuedEvent(queuedFocus) && (queuedFocus = null);
  null !== queuedDrag && attemptReplayContinuousQueuedEvent(queuedDrag) && (queuedDrag = null);
  null !== queuedMouse && attemptReplayContinuousQueuedEvent(queuedMouse) && (queuedMouse = null);
  queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
  queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
}
function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
  queuedEvent.blockedOn === unblocked && (queuedEvent.blockedOn = null, hasScheduledReplayAttempt || (hasScheduledReplayAttempt = true, Scheduler.unstable_scheduleCallback(
    Scheduler.unstable_NormalPriority,
    replayUnblockedEvents
  )));
}
var lastScheduledReplayQueue = null;
function scheduleReplayQueueIfNeeded(formReplayingQueue) {
  lastScheduledReplayQueue !== formReplayingQueue && (lastScheduledReplayQueue = formReplayingQueue, Scheduler.unstable_scheduleCallback(
    Scheduler.unstable_NormalPriority,
    function() {
      lastScheduledReplayQueue === formReplayingQueue && (lastScheduledReplayQueue = null);
      for (var i2 = 0; i2 < formReplayingQueue.length; i2 += 3) {
        var form = formReplayingQueue[i2], submitterOrAction = formReplayingQueue[i2 + 1], formData = formReplayingQueue[i2 + 2];
        if ("function" !== typeof submitterOrAction)
          if (null === findInstanceBlockingTarget(submitterOrAction || form))
            continue;
          else break;
        var formInst = getInstanceFromNode(form);
        null !== formInst && (formReplayingQueue.splice(i2, 3), i2 -= 3, startHostTransition(
          formInst,
          {
            pending: true,
            data: formData,
            method: form.method,
            action: submitterOrAction
          },
          submitterOrAction,
          formData
        ));
      }
    }
  ));
}
function retryIfBlockedOn(unblocked) {
  function unblock(queuedEvent) {
    return scheduleCallbackIfUnblocked(queuedEvent, unblocked);
  }
  null !== queuedFocus && scheduleCallbackIfUnblocked(queuedFocus, unblocked);
  null !== queuedDrag && scheduleCallbackIfUnblocked(queuedDrag, unblocked);
  null !== queuedMouse && scheduleCallbackIfUnblocked(queuedMouse, unblocked);
  queuedPointers.forEach(unblock);
  queuedPointerCaptures.forEach(unblock);
  for (var i2 = 0; i2 < queuedExplicitHydrationTargets.length; i2++) {
    var queuedTarget = queuedExplicitHydrationTargets[i2];
    queuedTarget.blockedOn === unblocked && (queuedTarget.blockedOn = null);
  }
  for (; 0 < queuedExplicitHydrationTargets.length && (i2 = queuedExplicitHydrationTargets[0], null === i2.blockedOn); )
    attemptExplicitHydrationTarget(i2), null === i2.blockedOn && queuedExplicitHydrationTargets.shift();
  i2 = (unblocked.ownerDocument || unblocked).$$reactFormReplay;
  if (null != i2)
    for (queuedTarget = 0; queuedTarget < i2.length; queuedTarget += 3) {
      var form = i2[queuedTarget], submitterOrAction = i2[queuedTarget + 1], formProps = form[internalPropsKey] || null;
      if ("function" === typeof submitterOrAction)
        formProps || scheduleReplayQueueIfNeeded(i2);
      else if (formProps) {
        var action = null;
        if (submitterOrAction && submitterOrAction.hasAttribute("formAction"))
          if (form = submitterOrAction, formProps = submitterOrAction[internalPropsKey] || null)
            action = formProps.formAction;
          else {
            if (null !== findInstanceBlockingTarget(form)) continue;
          }
        else action = formProps.action;
        "function" === typeof action ? i2[queuedTarget + 1] = action : (i2.splice(queuedTarget, 3), queuedTarget -= 3);
        scheduleReplayQueueIfNeeded(i2);
      }
    }
}
function ReactDOMRoot(internalRoot) {
  this._internalRoot = internalRoot;
}
ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function(children) {
  var root2 = this._internalRoot;
  if (null === root2) throw Error(formatProdErrorMessage$2(409));
  var current2 = root2.current, lane = requestUpdateLane();
  updateContainerImpl(current2, lane, children, root2, null, null);
};
ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function() {
  var root2 = this._internalRoot;
  if (null !== root2) {
    this._internalRoot = null;
    var container = root2.containerInfo;
    updateContainerImpl(root2.current, 2, null, root2, null, null);
    flushSyncWork$1();
    container[internalContainerInstanceKey] = null;
  }
};
function ReactDOMHydrationRoot(internalRoot) {
  this._internalRoot = internalRoot;
}
ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function(target) {
  if (target) {
    var updatePriority = resolveUpdatePriority();
    target = { blockedOn: null, target, priority: updatePriority };
    for (var i2 = 0; i2 < queuedExplicitHydrationTargets.length && 0 !== updatePriority && updatePriority < queuedExplicitHydrationTargets[i2].priority; i2++) ;
    queuedExplicitHydrationTargets.splice(i2, 0, target);
    0 === i2 && attemptExplicitHydrationTarget(target);
  }
};
var isomorphicReactPackageVersion$jscomp$inline_1785 = React$2.version;
if ("19.1.1" !== isomorphicReactPackageVersion$jscomp$inline_1785)
  throw Error(
    formatProdErrorMessage$2(
      527,
      isomorphicReactPackageVersion$jscomp$inline_1785,
      "19.1.1"
    )
  );
ReactDOMSharedInternals.findDOMNode = function(componentOrElement) {
  var fiber = componentOrElement._reactInternals;
  if (void 0 === fiber) {
    if ("function" === typeof componentOrElement.render)
      throw Error(formatProdErrorMessage$2(188));
    componentOrElement = Object.keys(componentOrElement).join(",");
    throw Error(formatProdErrorMessage$2(268, componentOrElement));
  }
  componentOrElement = findCurrentFiberUsingSlowPath(fiber);
  componentOrElement = null !== componentOrElement ? findCurrentHostFiberImpl(componentOrElement) : null;
  componentOrElement = null === componentOrElement ? null : componentOrElement.stateNode;
  return componentOrElement;
};
var internals$jscomp$inline_2256 = {
  bundleType: 0,
  version: "19.1.1",
  rendererPackageName: "react-dom",
  currentDispatcherRef: ReactSharedInternals,
  reconcilerVersion: "19.1.1"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
  var hook$jscomp$inline_2257 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
  if (!hook$jscomp$inline_2257.isDisabled && hook$jscomp$inline_2257.supportsFiber)
    try {
      rendererID = hook$jscomp$inline_2257.inject(
        internals$jscomp$inline_2256
      ), injectedHook = hook$jscomp$inline_2257;
    } catch (err) {
    }
}
reactDomClient_production.createRoot = function(container, options) {
  if (!isValidContainer(container)) throw Error(formatProdErrorMessage$2(299));
  var isStrictMode = false, identifierPrefix = "", onUncaughtError = defaultOnUncaughtError, onCaughtError = defaultOnCaughtError, onRecoverableError = defaultOnRecoverableError, transitionCallbacks = null;
  null !== options && void 0 !== options && (true === options.unstable_strictMode && (isStrictMode = true), void 0 !== options.identifierPrefix && (identifierPrefix = options.identifierPrefix), void 0 !== options.onUncaughtError && (onUncaughtError = options.onUncaughtError), void 0 !== options.onCaughtError && (onCaughtError = options.onCaughtError), void 0 !== options.onRecoverableError && (onRecoverableError = options.onRecoverableError), void 0 !== options.unstable_transitionCallbacks && (transitionCallbacks = options.unstable_transitionCallbacks));
  options = createFiberRoot(
    container,
    1,
    false,
    null,
    null,
    isStrictMode,
    identifierPrefix,
    onUncaughtError,
    onCaughtError,
    onRecoverableError,
    transitionCallbacks,
    null
  );
  container[internalContainerInstanceKey] = options.current;
  listenToAllSupportedEvents(container);
  return new ReactDOMRoot(options);
};
reactDomClient_production.hydrateRoot = function(container, initialChildren, options) {
  if (!isValidContainer(container)) throw Error(formatProdErrorMessage$2(299));
  var isStrictMode = false, identifierPrefix = "", onUncaughtError = defaultOnUncaughtError, onCaughtError = defaultOnCaughtError, onRecoverableError = defaultOnRecoverableError, transitionCallbacks = null, formState = null;
  null !== options && void 0 !== options && (true === options.unstable_strictMode && (isStrictMode = true), void 0 !== options.identifierPrefix && (identifierPrefix = options.identifierPrefix), void 0 !== options.onUncaughtError && (onUncaughtError = options.onUncaughtError), void 0 !== options.onCaughtError && (onCaughtError = options.onCaughtError), void 0 !== options.onRecoverableError && (onRecoverableError = options.onRecoverableError), void 0 !== options.unstable_transitionCallbacks && (transitionCallbacks = options.unstable_transitionCallbacks), void 0 !== options.formState && (formState = options.formState));
  initialChildren = createFiberRoot(
    container,
    1,
    true,
    initialChildren,
    null != options ? options : null,
    isStrictMode,
    identifierPrefix,
    onUncaughtError,
    onCaughtError,
    onRecoverableError,
    transitionCallbacks,
    formState
  );
  initialChildren.context = getContextForSubtree(null);
  options = initialChildren.current;
  isStrictMode = requestUpdateLane();
  isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode);
  identifierPrefix = createUpdate(isStrictMode);
  identifierPrefix.callback = null;
  enqueueUpdate(options, identifierPrefix, isStrictMode);
  options = isStrictMode;
  initialChildren.current.lanes = options;
  markRootUpdated$1(initialChildren, options);
  ensureRootIsScheduled(initialChildren);
  container[internalContainerInstanceKey] = initialChildren.current;
  listenToAllSupportedEvents(container);
  return new ReactDOMHydrationRoot(initialChildren);
};
reactDomClient_production.version = "19.1.1";
function checkDCE() {
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") {
    return;
  }
  try {
    __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
  } catch (err) {
    console.error(err);
  }
}
{
  checkDCE();
  client.exports = reactDomClient_production;
}
var clientExports = client.exports;
const ReactDOM = /* @__PURE__ */ getDefaultExportFromCjs(clientExports);
/**
 * react-router v7.12.0
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */
var PopStateEventType = "popstate";
function createBrowserHistory(options = {}) {
  function createBrowserLocation(window2, globalHistory) {
    let { pathname, search, hash } = window2.location;
    return createLocation(
      "",
      { pathname, search, hash },
      // state defaults to `null` because `window.history.state` does
      globalHistory.state && globalHistory.state.usr || null,
      globalHistory.state && globalHistory.state.key || "default"
    );
  }
  function createBrowserHref(window2, to) {
    return typeof to === "string" ? to : createPath(to);
  }
  return getUrlBasedHistory(
    createBrowserLocation,
    createBrowserHref,
    null,
    options
  );
}
function invariant(value, message) {
  if (value === false || value === null || typeof value === "undefined") {
    throw new Error(message);
  }
}
function warning(cond, message) {
  if (!cond) {
    if (typeof console !== "undefined") console.warn(message);
    try {
      throw new Error(message);
    } catch (e2) {
    }
  }
}
function createKey() {
  return Math.random().toString(36).substring(2, 10);
}
function getHistoryState(location, index2) {
  return {
    usr: location.state,
    key: location.key,
    idx: index2
  };
}
function createLocation(current2, to, state = null, key) {
  let location = {
    pathname: typeof current2 === "string" ? current2 : current2.pathname,
    search: "",
    hash: "",
    ...typeof to === "string" ? parsePath(to) : to,
    state,
    // TODO: This could be cleaned up.  push/replace should probably just take
    // full Locations now and avoid the need to run through this flow at all
    // But that's a pretty big refactor to the current test suite so going to
    // keep as is for the time being and just let any incoming keys take precedence
    key: to && to.key || key || createKey()
  };
  return location;
}
function createPath({
  pathname = "/",
  search = "",
  hash = ""
}) {
  if (search && search !== "?")
    pathname += search.charAt(0) === "?" ? search : "?" + search;
  if (hash && hash !== "#")
    pathname += hash.charAt(0) === "#" ? hash : "#" + hash;
  return pathname;
}
function parsePath(path) {
  let parsedPath = {};
  if (path) {
    let hashIndex = path.indexOf("#");
    if (hashIndex >= 0) {
      parsedPath.hash = path.substring(hashIndex);
      path = path.substring(0, hashIndex);
    }
    let searchIndex = path.indexOf("?");
    if (searchIndex >= 0) {
      parsedPath.search = path.substring(searchIndex);
      path = path.substring(0, searchIndex);
    }
    if (path) {
      parsedPath.pathname = path;
    }
  }
  return parsedPath;
}
function getUrlBasedHistory(getLocation, createHref2, validateLocation, options = {}) {
  let { window: window2 = document.defaultView, v5Compat = false } = options;
  let globalHistory = window2.history;
  let action = "POP";
  let listener = null;
  let index2 = getIndex();
  if (index2 == null) {
    index2 = 0;
    globalHistory.replaceState({ ...globalHistory.state, idx: index2 }, "");
  }
  function getIndex() {
    let state = globalHistory.state || { idx: null };
    return state.idx;
  }
  function handlePop() {
    action = "POP";
    let nextIndex = getIndex();
    let delta = nextIndex == null ? null : nextIndex - index2;
    index2 = nextIndex;
    if (listener) {
      listener({ action, location: history.location, delta });
    }
  }
  function push2(to, state) {
    action = "PUSH";
    let location = createLocation(history.location, to, state);
    index2 = getIndex() + 1;
    let historyState = getHistoryState(location, index2);
    let url = history.createHref(location);
    try {
      globalHistory.pushState(historyState, "", url);
    } catch (error) {
      if (error instanceof DOMException && error.name === "DataCloneError") {
        throw error;
      }
      window2.location.assign(url);
    }
    if (v5Compat && listener) {
      listener({ action, location: history.location, delta: 1 });
    }
  }
  function replace2(to, state) {
    action = "REPLACE";
    let location = createLocation(history.location, to, state);
    index2 = getIndex();
    let historyState = getHistoryState(location, index2);
    let url = history.createHref(location);
    globalHistory.replaceState(historyState, "", url);
    if (v5Compat && listener) {
      listener({ action, location: history.location, delta: 0 });
    }
  }
  function createURL(to) {
    return createBrowserURLImpl(to);
  }
  let history = {
    get action() {
      return action;
    },
    get location() {
      return getLocation(window2, globalHistory);
    },
    listen(fn) {
      if (listener) {
        throw new Error("A history only accepts one active listener");
      }
      window2.addEventListener(PopStateEventType, handlePop);
      listener = fn;
      return () => {
        window2.removeEventListener(PopStateEventType, handlePop);
        listener = null;
      };
    },
    createHref(to) {
      return createHref2(window2, to);
    },
    createURL,
    encodeLocation(to) {
      let url = createURL(to);
      return {
        pathname: url.pathname,
        search: url.search,
        hash: url.hash
      };
    },
    push: push2,
    replace: replace2,
    go(n2) {
      return globalHistory.go(n2);
    }
  };
  return history;
}
function createBrowserURLImpl(to, isAbsolute = false) {
  let base = "http://localhost";
  if (typeof window !== "undefined") {
    base = window.location.origin !== "null" ? window.location.origin : window.location.href;
  }
  invariant(base, "No window.location.(origin|href) available to create URL");
  let href = typeof to === "string" ? to : createPath(to);
  href = href.replace(/ $/, "%20");
  if (!isAbsolute && href.startsWith("//")) {
    href = base + href;
  }
  return new URL(href, base);
}
function matchRoutes(routes2, locationArg, basename = "/") {
  return matchRoutesImpl(routes2, locationArg, basename, false);
}
function matchRoutesImpl(routes2, locationArg, basename, allowPartial) {
  let location = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
  let pathname = stripBasename(location.pathname || "/", basename);
  if (pathname == null) {
    return null;
  }
  let branches = flattenRoutes(routes2);
  rankRouteBranches(branches);
  let matches2 = null;
  for (let i2 = 0; matches2 == null && i2 < branches.length; ++i2) {
    let decoded = decodePath(pathname);
    matches2 = matchRouteBranch(
      branches[i2],
      decoded,
      allowPartial
    );
  }
  return matches2;
}
function flattenRoutes(routes2, branches = [], parentsMeta = [], parentPath = "", _hasParentOptionalSegments = false) {
  let flattenRoute = (route, index2, hasParentOptionalSegments = _hasParentOptionalSegments, relativePath) => {
    let meta = {
      relativePath: relativePath === void 0 ? route.path || "" : relativePath,
      caseSensitive: route.caseSensitive === true,
      childrenIndex: index2,
      route
    };
    if (meta.relativePath.startsWith("/")) {
      if (!meta.relativePath.startsWith(parentPath) && hasParentOptionalSegments) {
        return;
      }
      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.`
      );
      meta.relativePath = meta.relativePath.slice(parentPath.length);
    }
    let path = joinPaths([parentPath, meta.relativePath]);
    let routesMeta = parentsMeta.concat(meta);
    if (route.children && route.children.length > 0) {
      invariant(
        // Our types know better, but runtime JS may not!
        // @ts-expect-error
        route.index !== true,
        `Index routes must not have child routes. Please remove all child routes from route path "${path}".`
      );
      flattenRoutes(
        route.children,
        branches,
        routesMeta,
        path,
        hasParentOptionalSegments
      );
    }
    if (route.path == null && !route.index) {
      return;
    }
    branches.push({
      path,
      score: computeScore(path, route.index),
      routesMeta
    });
  };
  routes2.forEach((route, index2) => {
    var _a;
    if (route.path === "" || !((_a = route.path) == null ? void 0 : _a.includes("?"))) {
      flattenRoute(route, index2);
    } else {
      for (let exploded of explodeOptionalSegments(route.path)) {
        flattenRoute(route, index2, true, exploded);
      }
    }
  });
  return branches;
}
function explodeOptionalSegments(path) {
  let segments = path.split("/");
  if (segments.length === 0) return [];
  let [first, ...rest] = segments;
  let isOptional = first.endsWith("?");
  let required = first.replace(/\?$/, "");
  if (rest.length === 0) {
    return isOptional ? [required, ""] : [required];
  }
  let restExploded = explodeOptionalSegments(rest.join("/"));
  let result = [];
  result.push(
    ...restExploded.map(
      (subpath) => subpath === "" ? required : [required, subpath].join("/")
    )
  );
  if (isOptional) {
    result.push(...restExploded);
  }
  return result.map(
    (exploded) => path.startsWith("/") && exploded === "" ? "/" : exploded
  );
}
function rankRouteBranches(branches) {
  branches.sort(
    (a2, b) => a2.score !== b.score ? b.score - a2.score : compareIndexes(
      a2.routesMeta.map((meta) => meta.childrenIndex),
      b.routesMeta.map((meta) => meta.childrenIndex)
    )
  );
}
var paramRe = /^:[\w-]+$/;
var dynamicSegmentValue = 3;
var indexRouteValue = 2;
var emptySegmentValue = 1;
var staticSegmentValue = 10;
var splatPenalty = -2;
var isSplat = (s2) => s2 === "*";
function computeScore(path, index2) {
  let segments = path.split("/");
  let initialScore = segments.length;
  if (segments.some(isSplat)) {
    initialScore += splatPenalty;
  }
  if (index2) {
    initialScore += indexRouteValue;
  }
  return segments.filter((s2) => !isSplat(s2)).reduce(
    (score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue),
    initialScore
  );
}
function compareIndexes(a2, b) {
  let siblings = a2.length === b.length && a2.slice(0, -1).every((n2, i2) => n2 === b[i2]);
  return siblings ? (
    // If two routes are siblings, we should try to match the earlier sibling
    // first. This allows people to have fine-grained control over the matching
    // behavior by simply putting routes with identical paths in the order they
    // want them tried.
    a2[a2.length - 1] - b[b.length - 1]
  ) : (
    // Otherwise, it doesn't really make sense to rank non-siblings by index,
    // so they sort equally.
    0
  );
}
function matchRouteBranch(branch, pathname, allowPartial = false) {
  let { routesMeta } = branch;
  let matchedParams = {};
  let matchedPathname = "/";
  let matches2 = [];
  for (let i2 = 0; i2 < routesMeta.length; ++i2) {
    let meta = routesMeta[i2];
    let end = i2 === routesMeta.length - 1;
    let remainingPathname = matchedPathname === "/" ? pathname : pathname.slice(matchedPathname.length) || "/";
    let match = matchPath(
      { path: meta.relativePath, caseSensitive: meta.caseSensitive, end },
      remainingPathname
    );
    let route = meta.route;
    if (!match && end && allowPartial && !routesMeta[routesMeta.length - 1].route.index) {
      match = matchPath(
        {
          path: meta.relativePath,
          caseSensitive: meta.caseSensitive,
          end: false
        },
        remainingPathname
      );
    }
    if (!match) {
      return null;
    }
    Object.assign(matchedParams, match.params);
    matches2.push({
      // TODO: Can this as be avoided?
      params: matchedParams,
      pathname: joinPaths([matchedPathname, match.pathname]),
      pathnameBase: normalizePathname(
        joinPaths([matchedPathname, match.pathnameBase])
      ),
      route
    });
    if (match.pathnameBase !== "/") {
      matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);
    }
  }
  return matches2;
}
function matchPath(pattern, pathname) {
  if (typeof pattern === "string") {
    pattern = { path: pattern, caseSensitive: false, end: true };
  }
  let [matcher, compiledParams] = compilePath(
    pattern.path,
    pattern.caseSensitive,
    pattern.end
  );
  let match = pathname.match(matcher);
  if (!match) return null;
  let matchedPathname = match[0];
  let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1");
  let captureGroups = match.slice(1);
  let params = compiledParams.reduce(
    (memo2, { paramName, isOptional }, index2) => {
      if (paramName === "*") {
        let splatValue = captureGroups[index2] || "";
        pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1");
      }
      const value = captureGroups[index2];
      if (isOptional && !value) {
        memo2[paramName] = void 0;
      } else {
        memo2[paramName] = (value || "").replace(/%2F/g, "/");
      }
      return memo2;
    },
    {}
  );
  return {
    params,
    pathname: matchedPathname,
    pathnameBase,
    pattern
  };
}
function compilePath(path, caseSensitive = false, end = true) {
  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(/\*$/, "/*")}".`
  );
  let params = [];
  let regexpSource = "^" + path.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
    /\/:([\w-]+)(\?)?/g,
    (_2, paramName, isOptional) => {
      params.push({ paramName, isOptional: isOptional != null });
      return isOptional ? "/?([^\\/]+)?" : "/([^\\/]+)";
    }
  ).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2");
  if (path.endsWith("*")) {
    params.push({ paramName: "*" });
    regexpSource += path === "*" || path === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$";
  } else if (end) {
    regexpSource += "\\/*$";
  } else if (path !== "" && path !== "/") {
    regexpSource += "(?:(?=\\/|$))";
  } else ;
  let matcher = new RegExp(regexpSource, caseSensitive ? void 0 : "i");
  return [matcher, params];
}
function decodePath(value) {
  try {
    return value.split("/").map((v2) => decodeURIComponent(v2).replace(/\//g, "%2F")).join("/");
  } catch (error) {
    warning(
      false,
      `The URL path "${value}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${error}).`
    );
    return value;
  }
}
function stripBasename(pathname, basename) {
  if (basename === "/") return pathname;
  if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {
    return null;
  }
  let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length;
  let nextChar = pathname.charAt(startIndex);
  if (nextChar && nextChar !== "/") {
    return null;
  }
  return pathname.slice(startIndex) || "/";
}
var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
function resolvePath(to, fromPathname = "/") {
  let {
    pathname: toPathname,
    search = "",
    hash = ""
  } = typeof to === "string" ? parsePath(to) : to;
  let pathname;
  if (toPathname) {
    if (isAbsoluteUrl(toPathname)) {
      pathname = toPathname;
    } else {
      if (toPathname.includes("//")) {
        let oldPathname = toPathname;
        toPathname = toPathname.replace(/\/\/+/g, "/");
        warning(
          false,
          `Pathnames cannot have embedded double slashes - normalizing ${oldPathname} -> ${toPathname}`
        );
      }
      if (toPathname.startsWith("/")) {
        pathname = resolvePathname(toPathname.substring(1), "/");
      } else {
        pathname = resolvePathname(toPathname, fromPathname);
      }
    }
  } else {
    pathname = fromPathname;
  }
  return {
    pathname,
    search: normalizeSearch(search),
    hash: normalizeHash(hash)
  };
}
function resolvePathname(relativePath, fromPathname) {
  let segments = fromPathname.replace(/\/+$/, "").split("/");
  let relativeSegments = relativePath.split("/");
  relativeSegments.forEach((segment) => {
    if (segment === "..") {
      if (segments.length > 1) segments.pop();
    } else if (segment !== ".") {
      segments.push(segment);
    }
  });
  return segments.length > 1 ? segments.join("/") : "/";
}
function getInvalidPathError(char, field, dest, path) {
  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.`;
}
function getPathContributingMatches(matches2) {
  return matches2.filter(
    (match, index2) => index2 === 0 || match.route.path && match.route.path.length > 0
  );
}
function getResolveToMatches(matches2) {
  let pathMatches = getPathContributingMatches(matches2);
  return pathMatches.map(
    (match, idx) => idx === pathMatches.length - 1 ? match.pathname : match.pathnameBase
  );
}
function resolveTo(toArg, routePathnames, locationPathname, isPathRelative = false) {
  let to;
  if (typeof toArg === "string") {
    to = parsePath(toArg);
  } else {
    to = { ...toArg };
    invariant(
      !to.pathname || !to.pathname.includes("?"),
      getInvalidPathError("?", "pathname", "search", to)
    );
    invariant(
      !to.pathname || !to.pathname.includes("#"),
      getInvalidPathError("#", "pathname", "hash", to)
    );
    invariant(
      !to.search || !to.search.includes("#"),
      getInvalidPathError("#", "search", "hash", to)
    );
  }
  let isEmptyPath = toArg === "" || to.pathname === "";
  let toPathname = isEmptyPath ? "/" : to.pathname;
  let from;
  if (toPathname == null) {
    from = locationPathname;
  } else {
    let routePathnameIndex = routePathnames.length - 1;
    if (!isPathRelative && toPathname.startsWith("..")) {
      let toSegments = toPathname.split("/");
      while (toSegments[0] === "..") {
        toSegments.shift();
        routePathnameIndex -= 1;
      }
      to.pathname = toSegments.join("/");
    }
    from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/";
  }
  let path = resolvePath(to, from);
  let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/");
  let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/");
  if (!path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) {
    path.pathname += "/";
  }
  return path;
}
var joinPaths = (paths) => paths.join("/").replace(/\/\/+/g, "/");
var normalizePathname = (pathname) => pathname.replace(/\/+$/, "").replace(/^\/*/, "/");
var normalizeSearch = (search) => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search;
var normalizeHash = (hash) => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash;
var ErrorResponseImpl = class {
  constructor(status, statusText, data2, internal = false) {
    this.status = status;
    this.statusText = statusText || "";
    this.internal = internal;
    if (data2 instanceof Error) {
      this.data = data2.toString();
      this.error = data2;
    } else {
      this.data = data2;
    }
  }
};
function isRouteErrorResponse(error) {
  return error != null && typeof error.status === "number" && typeof error.statusText === "string" && typeof error.internal === "boolean" && "data" in error;
}
function getRoutePattern(matches2) {
  return matches2.map((m2) => m2.route.path).filter(Boolean).join("/").replace(/\/\/*/g, "/") || "/";
}
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
function parseToInfo(_to, basename) {
  let to = _to;
  if (typeof to !== "string" || !ABSOLUTE_URL_REGEX.test(to)) {
    return {
      absoluteURL: void 0,
      isExternal: false,
      to
    };
  }
  let absoluteURL = to;
  let isExternal = false;
  if (isBrowser) {
    try {
      let currentUrl = new URL(window.location.href);
      let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to);
      let path = stripBasename(targetUrl.pathname, basename);
      if (targetUrl.origin === currentUrl.origin && path != null) {
        to = path + targetUrl.search + targetUrl.hash;
      } else {
        isExternal = true;
      }
    } catch (e2) {
      warning(
        false,
        `<Link to="${to}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
      );
    }
  }
  return {
    absoluteURL,
    isExternal,
    to
  };
}
Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
var validMutationMethodsArr = [
  "POST",
  "PUT",
  "PATCH",
  "DELETE"
];
new Set(
  validMutationMethodsArr
);
var validRequestMethodsArr = [
  "GET",
  ...validMutationMethodsArr
];
new Set(validRequestMethodsArr);
var DataRouterContext = reactExports.createContext(null);
DataRouterContext.displayName = "DataRouter";
var DataRouterStateContext = reactExports.createContext(null);
DataRouterStateContext.displayName = "DataRouterState";
var RSCRouterContext = reactExports.createContext(false);
var ViewTransitionContext = reactExports.createContext({
  isTransitioning: false
});
ViewTransitionContext.displayName = "ViewTransition";
var FetchersContext = reactExports.createContext(
  /* @__PURE__ */ new Map()
);
FetchersContext.displayName = "Fetchers";
var AwaitContext = reactExports.createContext(null);
AwaitContext.displayName = "Await";
var NavigationContext = reactExports.createContext(
  null
);
NavigationContext.displayName = "Navigation";
var LocationContext = reactExports.createContext(
  null
);
LocationContext.displayName = "Location";
var RouteContext = reactExports.createContext({
  outlet: null,
  matches: [],
  isDataRoute: false
});
RouteContext.displayName = "Route";
var RouteErrorContext = reactExports.createContext(null);
RouteErrorContext.displayName = "RouteError";
var ERROR_DIGEST_BASE = "REACT_ROUTER_ERROR";
var ERROR_DIGEST_REDIRECT = "REDIRECT";
var ERROR_DIGEST_ROUTE_ERROR_RESPONSE = "ROUTE_ERROR_RESPONSE";
function decodeRedirectErrorDigest(digest) {
  if (digest.startsWith(`${ERROR_DIGEST_BASE}:${ERROR_DIGEST_REDIRECT}:{`)) {
    try {
      let parsed = JSON.parse(digest.slice(28));
      if (typeof parsed === "object" && parsed && typeof parsed.status === "number" && typeof parsed.statusText === "string" && typeof parsed.location === "string" && typeof parsed.reloadDocument === "boolean" && typeof parsed.replace === "boolean") {
        return parsed;
      }
    } catch {
    }
  }
}
function decodeRouteErrorResponseDigest(digest) {
  if (digest.startsWith(
    `${ERROR_DIGEST_BASE}:${ERROR_DIGEST_ROUTE_ERROR_RESPONSE}:{`
  )) {
    try {
      let parsed = JSON.parse(digest.slice(40));
      if (typeof parsed === "object" && parsed && typeof parsed.status === "number" && typeof parsed.statusText === "string") {
        return new ErrorResponseImpl(
          parsed.status,
          parsed.statusText,
          parsed.data
        );
      }
    } catch {
    }
  }
}
function useHref(to, { relative } = {}) {
  invariant(
    useInRouterContext(),
    // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    `useHref() may be used only in the context of a <Router> component.`
  );
  let { basename, navigator: navigator2 } = reactExports.useContext(NavigationContext);
  let { hash, pathname, search } = useResolvedPath(to, { relative });
  let joinedPathname = pathname;
  if (basename !== "/") {
    joinedPathname = pathname === "/" ? basename : joinPaths([basename, pathname]);
  }
  return navigator2.createHref({ pathname: joinedPathname, search, hash });
}
function useInRouterContext() {
  return reactExports.useContext(LocationContext) != null;
}
function useLocation() {
  invariant(
    useInRouterContext(),
    // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    `useLocation() may be used only in the context of a <Router> component.`
  );
  return reactExports.useContext(LocationContext).location;
}
var navigateEffectWarning = `You should call navigate() in a React.useEffect(), not when your component is first rendered.`;
function useIsomorphicLayoutEffect$1(cb) {
  let isStatic = reactExports.useContext(NavigationContext).static;
  if (!isStatic) {
    reactExports.useLayoutEffect(cb);
  }
}
function useNavigate() {
  let { isDataRoute } = reactExports.useContext(RouteContext);
  return isDataRoute ? useNavigateStable() : useNavigateUnstable();
}
function useNavigateUnstable() {
  invariant(
    useInRouterContext(),
    // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    `useNavigate() may be used only in the context of a <Router> component.`
  );
  let dataRouterContext = reactExports.useContext(DataRouterContext);
  let { basename, navigator: navigator2 } = reactExports.useContext(NavigationContext);
  let { matches: matches2 } = reactExports.useContext(RouteContext);
  let { pathname: locationPathname } = useLocation();
  let routePathnamesJson = JSON.stringify(getResolveToMatches(matches2));
  let activeRef = reactExports.useRef(false);
  useIsomorphicLayoutEffect$1(() => {
    activeRef.current = true;
  });
  let navigate = reactExports.useCallback(
    (to, options = {}) => {
      warning(activeRef.current, navigateEffectWarning);
      if (!activeRef.current) return;
      if (typeof to === "number") {
        navigator2.go(to);
        return;
      }
      let path = resolveTo(
        to,
        JSON.parse(routePathnamesJson),
        locationPathname,
        options.relative === "path"
      );
      if (dataRouterContext == null && basename !== "/") {
        path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
      }
      (!!options.replace ? navigator2.replace : navigator2.push)(
        path,
        options.state,
        options
      );
    },
    [
      basename,
      navigator2,
      routePathnamesJson,
      locationPathname,
      dataRouterContext
    ]
  );
  return navigate;
}
reactExports.createContext(null);
function useParams() {
  let { matches: matches2 } = reactExports.useContext(RouteContext);
  let routeMatch = matches2[matches2.length - 1];
  return routeMatch ? routeMatch.params : {};
}
function useResolvedPath(to, { relative } = {}) {
  let { matches: matches2 } = reactExports.useContext(RouteContext);
  let { pathname: locationPathname } = useLocation();
  let routePathnamesJson = JSON.stringify(getResolveToMatches(matches2));
  return reactExports.useMemo(
    () => resolveTo(
      to,
      JSON.parse(routePathnamesJson),
      locationPathname,
      relative === "path"
    ),
    [to, routePathnamesJson, locationPathname, relative]
  );
}
function useRoutes(routes2, locationArg) {
  return useRoutesImpl(routes2, locationArg);
}
function useRoutesImpl(routes2, locationArg, dataRouterState, onError, future) {
  var _a;
  invariant(
    useInRouterContext(),
    // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    `useRoutes() may be used only in the context of a <Router> component.`
  );
  let { navigator: navigator2 } = reactExports.useContext(NavigationContext);
  let { matches: parentMatches } = reactExports.useContext(RouteContext);
  let routeMatch = parentMatches[parentMatches.length - 1];
  let parentParams = routeMatch ? routeMatch.params : {};
  let parentPathname = routeMatch ? routeMatch.pathname : "/";
  let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/";
  let parentRoute = routeMatch && routeMatch.route;
  {
    let parentPath = parentRoute && parentRoute.path || "";
    warningOnce(
      parentPathname,
      !parentRoute || parentPath.endsWith("*") || 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.

Please change the parent <Route path="${parentPath}"> to <Route path="${parentPath === "/" ? "*" : `${parentPath}/*`}">.`
    );
  }
  let locationFromContext = useLocation();
  let location;
  if (locationArg) {
    let parsedLocationArg = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
    invariant(
      parentPathnameBase === "/" || ((_a = parsedLocationArg.pathname) == null ? void 0 : _a.startsWith(parentPathnameBase)),
      `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.`
    );
    location = parsedLocationArg;
  } else {
    location = locationFromContext;
  }
  let pathname = location.pathname || "/";
  let remainingPathname = pathname;
  if (parentPathnameBase !== "/") {
    let parentSegments = parentPathnameBase.replace(/^\//, "").split("/");
    let segments = pathname.replace(/^\//, "").split("/");
    remainingPathname = "/" + segments.slice(parentSegments.length).join("/");
  }
  let matches2 = matchRoutes(routes2, { pathname: remainingPathname });
  {
    warning(
      parentRoute || matches2 != null,
      `No routes matched location "${location.pathname}${location.search}${location.hash}" `
    );
    warning(
      matches2 == null || matches2[matches2.length - 1].route.element !== void 0 || matches2[matches2.length - 1].route.Component !== void 0 || matches2[matches2.length - 1].route.lazy !== void 0,
      `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.`
    );
  }
  let renderedMatches = _renderMatches(
    matches2 && matches2.map(
      (match) => Object.assign({}, match, {
        params: Object.assign({}, parentParams, match.params),
        pathname: joinPaths([
          parentPathnameBase,
          // Re-encode pathnames that were decoded inside matchRoutes.
          // Pre-encode `?` and `#` ahead of `encodeLocation` because it uses
          // `new URL()` internally and we need to prevent it from treating
          // them as separators
          navigator2.encodeLocation ? navigator2.encodeLocation(
            match.pathname.replace(/\?/g, "%3F").replace(/#/g, "%23")
          ).pathname : match.pathname
        ]),
        pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : joinPaths([
          parentPathnameBase,
          // Re-encode pathnames that were decoded inside matchRoutes
          // Pre-encode `?` and `#` ahead of `encodeLocation` because it uses
          // `new URL()` internally and we need to prevent it from treating
          // them as separators
          navigator2.encodeLocation ? navigator2.encodeLocation(
            match.pathnameBase.replace(/\?/g, "%3F").replace(/#/g, "%23")
          ).pathname : match.pathnameBase
        ])
      })
    ),
    parentMatches,
    dataRouterState,
    onError,
    future
  );
  if (locationArg && renderedMatches) {
    return /* @__PURE__ */ reactExports.createElement(
      LocationContext.Provider,
      {
        value: {
          location: {
            pathname: "/",
            search: "",
            hash: "",
            state: null,
            key: "default",
            ...location
          },
          navigationType: "POP"
          /* Pop */
        }
      },
      renderedMatches
    );
  }
  return renderedMatches;
}
function DefaultErrorComponent() {
  let error = useRouteError();
  let message = isRouteErrorResponse(error) ? `${error.status} ${error.statusText}` : error instanceof Error ? error.message : JSON.stringify(error);
  let stack = error instanceof Error ? error.stack : null;
  let lightgrey = "rgba(200,200,200, 0.5)";
  let preStyles = { padding: "0.5rem", backgroundColor: lightgrey };
  let codeStyles = { padding: "2px 4px", backgroundColor: lightgrey };
  let devInfo = null;
  {
    console.error(
      "Error handled by React Router default ErrorBoundary:",
      error
    );
    devInfo = /* @__PURE__ */ reactExports.createElement(reactExports.Fragment, null, /* @__PURE__ */ reactExports.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ reactExports.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ reactExports.createElement("code", { style: codeStyles }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ reactExports.createElement("code", { style: codeStyles }, "errorElement"), " prop on your route."));
  }
  return /* @__PURE__ */ reactExports.createElement(reactExports.Fragment, null, /* @__PURE__ */ reactExports.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ reactExports.createElement("h3", { style: { fontStyle: "italic" } }, message), stack ? /* @__PURE__ */ reactExports.createElement("pre", { style: preStyles }, stack) : null, devInfo);
}
var defaultErrorElement = /* @__PURE__ */ reactExports.createElement(DefaultErrorComponent, null);
var RenderErrorBoundary = class extends reactExports.Component {
  constructor(props) {
    super(props);
    this.state = {
      location: props.location,
      revalidation: props.revalidation,
      error: props.error
    };
  }
  static getDerivedStateFromError(error) {
    return { error };
  }
  static getDerivedStateFromProps(props, state) {
    if (state.location !== props.location || state.revalidation !== "idle" && props.revalidation === "idle") {
      return {
        error: props.error,
        location: props.location,
        revalidation: props.revalidation
      };
    }
    return {
      error: props.error !== void 0 ? props.error : state.error,
      location: state.location,
      revalidation: props.revalidation || state.revalidation
    };
  }
  componentDidCatch(error, errorInfo) {
    if (this.props.onError) {
      this.props.onError(error, errorInfo);
    } else {
      console.error(
        "React Router caught the following error during render",
        error
      );
    }
  }
  render() {
    let error = this.state.error;
    if (this.context && typeof error === "object" && error && "digest" in error && typeof error.digest === "string") {
      const decoded = decodeRouteErrorResponseDigest(error.digest);
      if (decoded) error = decoded;
    }
    let result = error !== void 0 ? /* @__PURE__ */ reactExports.createElement(RouteContext.Provider, { value: this.props.routeContext }, /* @__PURE__ */ reactExports.createElement(
      RouteErrorContext.Provider,
      {
        value: error,
        children: this.props.component
      }
    )) : this.props.children;
    if (this.context) {
      return /* @__PURE__ */ reactExports.createElement(RSCErrorHandler, { error }, result);
    }
    return result;
  }
};
RenderErrorBoundary.contextType = RSCRouterContext;
var errorRedirectHandledMap = /* @__PURE__ */ new WeakMap();
function RSCErrorHandler({
  children,
  error
}) {
  let { basename } = reactExports.useContext(NavigationContext);
  if (typeof error === "object" && error && "digest" in error && typeof error.digest === "string") {
    let redirect2 = decodeRedirectErrorDigest(error.digest);
    if (redirect2) {
      let existingRedirect = errorRedirectHandledMap.get(error);
      if (existingRedirect) throw existingRedirect;
      let parsed = parseToInfo(redirect2.location, basename);
      if (isBrowser && !errorRedirectHandledMap.get(error)) {
        if (parsed.isExternal || redirect2.reloadDocument) {
          window.location.href = parsed.absoluteURL || parsed.to;
        } else {
          const redirectPromise = Promise.resolve().then(
            () => window.__reactRouterDataRouter.navigate(parsed.to, {
              replace: redirect2.replace
            })
          );
          errorRedirectHandledMap.set(error, redirectPromise);
          throw redirectPromise;
        }
      }
      return /* @__PURE__ */ reactExports.createElement(
        "meta",
        {
          httpEquiv: "refresh",
          content: `0;url=${parsed.absoluteURL || parsed.to}`
        }
      );
    }
  }
  return children;
}
function RenderedRoute({ routeContext, match, children }) {
  let dataRouterContext = reactExports.useContext(DataRouterContext);
  if (dataRouterContext && dataRouterContext.static && dataRouterContext.staticContext && (match.route.errorElement || match.route.ErrorBoundary)) {
    dataRouterContext.staticContext._deepestRenderedBoundaryId = match.route.id;
  }
  return /* @__PURE__ */ reactExports.createElement(RouteContext.Provider, { value: routeContext }, children);
}
function _renderMatches(matches2, parentMatches = [], dataRouterState = null, onErrorHandler = null, future = null) {
  if (matches2 == null) {
    if (!dataRouterState) {
      return null;
    }
    if (dataRouterState.errors) {
      matches2 = dataRouterState.matches;
    } else if (parentMatches.length === 0 && !dataRouterState.initialized && dataRouterState.matches.length > 0) {
      matches2 = dataRouterState.matches;
    } else {
      return null;
    }
  }
  let renderedMatches = matches2;
  let errors2 = dataRouterState == null ? void 0 : dataRouterState.errors;
  if (errors2 != null) {
    let errorIndex = renderedMatches.findIndex(
      (m2) => m2.route.id && (errors2 == null ? void 0 : errors2[m2.route.id]) !== void 0
    );
    invariant(
      errorIndex >= 0,
      `Could not find a matching route for errors on route IDs: ${Object.keys(
        errors2
      ).join(",")}`
    );
    renderedMatches = renderedMatches.slice(
      0,
      Math.min(renderedMatches.length, errorIndex + 1)
    );
  }
  let renderFallback = false;
  let fallbackIndex = -1;
  if (dataRouterState) {
    for (let i2 = 0; i2 < renderedMatches.length; i2++) {
      let match = renderedMatches[i2];
      if (match.route.HydrateFallback || match.route.hydrateFallbackElement) {
        fallbackIndex = i2;
      }
      if (match.route.id) {
        let { loaderData, errors: errors22 } = dataRouterState;
        let needsToRunLoader = match.route.loader && !loaderData.hasOwnProperty(match.route.id) && (!errors22 || errors22[match.route.id] === void 0);
        if (match.route.lazy || needsToRunLoader) {
          renderFallback = true;
          if (fallbackIndex >= 0) {
            renderedMatches = renderedMatches.slice(0, fallbackIndex + 1);
          } else {
            renderedMatches = [renderedMatches[0]];
          }
          break;
        }
      }
    }
  }
  let onError = dataRouterState && onErrorHandler ? (error, errorInfo) => {
    var _a, _b;
    onErrorHandler(error, {
      location: dataRouterState.location,
      params: ((_b = (_a = dataRouterState.matches) == null ? void 0 : _a[0]) == null ? void 0 : _b.params) ?? {},
      unstable_pattern: getRoutePattern(dataRouterState.matches),
      errorInfo
    });
  } : void 0;
  return renderedMatches.reduceRight(
    (outlet, match, index2) => {
      let error;
      let shouldRenderHydrateFallback = false;
      let errorElement = null;
      let hydrateFallbackElement = null;
      if (dataRouterState) {
        error = errors2 && match.route.id ? errors2[match.route.id] : void 0;
        errorElement = match.route.errorElement || defaultErrorElement;
        if (renderFallback) {
          if (fallbackIndex < 0 && index2 === 0) {
            warningOnce(
              "route-fallback",
              false,
              "No `HydrateFallback` element provided to render during initial hydration"
            );
            shouldRenderHydrateFallback = true;
            hydrateFallbackElement = null;
          } else if (fallbackIndex === index2) {
            shouldRenderHydrateFallback = true;
            hydrateFallbackElement = match.route.hydrateFallbackElement || null;
          }
        }
      }
      let matches22 = parentMatches.concat(renderedMatches.slice(0, index2 + 1));
      let getChildren = () => {
        let children;
        if (error) {
          children = errorElement;
        } else if (shouldRenderHydrateFallback) {
          children = hydrateFallbackElement;
        } else if (match.route.Component) {
          children = /* @__PURE__ */ reactExports.createElement(match.route.Component, null);
        } else if (match.route.element) {
          children = match.route.element;
        } else {
          children = outlet;
        }
        return /* @__PURE__ */ reactExports.createElement(
          RenderedRoute,
          {
            match,
            routeContext: {
              outlet,
              matches: matches22,
              isDataRoute: dataRouterState != null
            },
            children
          }
        );
      };
      return dataRouterState && (match.route.ErrorBoundary || match.route.errorElement || index2 === 0) ? /* @__PURE__ */ reactExports.createElement(
        RenderErrorBoundary,
        {
          location: dataRouterState.location,
          revalidation: dataRouterState.revalidation,
          component: errorElement,
          error,
          children: getChildren(),
          routeContext: { outlet: null, matches: matches22, isDataRoute: true },
          onError
        }
      ) : getChildren();
    },
    null
  );
}
function getDataRouterConsoleError(hookName) {
  return `${hookName} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`;
}
function useDataRouterContext(hookName) {
  let ctx = reactExports.useContext(DataRouterContext);
  invariant(ctx, getDataRouterConsoleError(hookName));
  return ctx;
}
function useDataRouterState(hookName) {
  let state = reactExports.useContext(DataRouterStateContext);
  invariant(state, getDataRouterConsoleError(hookName));
  return state;
}
function useRouteContext(hookName) {
  let route = reactExports.useContext(RouteContext);
  invariant(route, getDataRouterConsoleError(hookName));
  return route;
}
function useCurrentRouteId(hookName) {
  let route = useRouteContext(hookName);
  let thisRoute = route.matches[route.matches.length - 1];
  invariant(
    thisRoute.route.id,
    `${hookName} can only be used on routes that contain a unique "id"`
  );
  return thisRoute.route.id;
}
function useRouteId() {
  return useCurrentRouteId(
    "useRouteId"
    /* UseRouteId */
  );
}
function useRouteError() {
  var _a;
  let error = reactExports.useContext(RouteErrorContext);
  let state = useDataRouterState(
    "useRouteError"
    /* UseRouteError */
  );
  let routeId = useCurrentRouteId(
    "useRouteError"
    /* UseRouteError */
  );
  if (error !== void 0) {
    return error;
  }
  return (_a = state.errors) == null ? void 0 : _a[routeId];
}
function useNavigateStable() {
  let { router } = useDataRouterContext(
    "useNavigate"
    /* UseNavigateStable */
  );
  let id = useCurrentRouteId(
    "useNavigate"
    /* UseNavigateStable */
  );
  let activeRef = reactExports.useRef(false);
  useIsomorphicLayoutEffect$1(() => {
    activeRef.current = true;
  });
  let navigate = reactExports.useCallback(
    async (to, options = {}) => {
      warning(activeRef.current, navigateEffectWarning);
      if (!activeRef.current) return;
      if (typeof to === "number") {
        await router.navigate(to);
      } else {
        await router.navigate(to, { fromRouteId: id, ...options });
      }
    },
    [router, id]
  );
  return navigate;
}
var alreadyWarned$1 = {};
function warningOnce(key, cond, message) {
  if (!cond && !alreadyWarned$1[key]) {
    alreadyWarned$1[key] = true;
    warning(false, message);
  }
}
reactExports.memo(DataRoutes);
function DataRoutes({
  routes: routes2,
  future,
  state,
  onError
}) {
  return useRoutesImpl(routes2, void 0, state, onError, future);
}
function Route(props) {
  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>.`
  );
}
function Router({
  basename: basenameProp = "/",
  children = null,
  location: locationProp,
  navigationType = "POP",
  navigator: navigator2,
  static: staticProp = false,
  unstable_useTransitions
}) {
  invariant(
    !useInRouterContext(),
    `You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`
  );
  let basename = basenameProp.replace(/^\/*/, "/");
  let navigationContext = reactExports.useMemo(
    () => ({
      basename,
      navigator: navigator2,
      static: staticProp,
      unstable_useTransitions,
      future: {}
    }),
    [basename, navigator2, staticProp, unstable_useTransitions]
  );
  if (typeof locationProp === "string") {
    locationProp = parsePath(locationProp);
  }
  let {
    pathname = "/",
    search = "",
    hash = "",
    state = null,
    key = "default"
  } = locationProp;
  let locationContext = reactExports.useMemo(() => {
    let trailingPathname = stripBasename(pathname, basename);
    if (trailingPathname == null) {
      return null;
    }
    return {
      location: {
        pathname: trailingPathname,
        search,
        hash,
        state,
        key
      },
      navigationType
    };
  }, [basename, pathname, search, hash, state, key, navigationType]);
  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.`
  );
  if (locationContext == null) {
    return null;
  }
  return /* @__PURE__ */ reactExports.createElement(NavigationContext.Provider, { value: navigationContext }, /* @__PURE__ */ reactExports.createElement(LocationContext.Provider, { children, value: locationContext }));
}
function Routes({
  children,
  location
}) {
  return useRoutes(createRoutesFromChildren(children), location);
}
function createRoutesFromChildren(children, parentPath = []) {
  let routes2 = [];
  reactExports.Children.forEach(children, (element, index2) => {
    if (!reactExports.isValidElement(element)) {
      return;
    }
    let treePath = [...parentPath, index2];
    if (element.type === reactExports.Fragment) {
      routes2.push.apply(
        routes2,
        createRoutesFromChildren(element.props.children, treePath)
      );
      return;
    }
    invariant(
      element.type === Route,
      `[${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>`
    );
    invariant(
      !element.props.index || !element.props.children,
      "An index route cannot have child routes."
    );
    let route = {
      id: element.props.id || treePath.join("-"),
      caseSensitive: element.props.caseSensitive,
      element: element.props.element,
      Component: element.props.Component,
      index: element.props.index,
      path: element.props.path,
      middleware: element.props.middleware,
      loader: element.props.loader,
      action: element.props.action,
      hydrateFallbackElement: element.props.hydrateFallbackElement,
      HydrateFallback: element.props.HydrateFallback,
      errorElement: element.props.errorElement,
      ErrorBoundary: element.props.ErrorBoundary,
      hasErrorBoundary: element.props.hasErrorBoundary === true || element.props.ErrorBoundary != null || element.props.errorElement != null,
      shouldRevalidate: element.props.shouldRevalidate,
      handle: element.props.handle,
      lazy: element.props.lazy
    };
    if (element.props.children) {
      route.children = createRoutesFromChildren(
        element.props.children,
        treePath
      );
    }
    routes2.push(route);
  });
  return routes2;
}
var defaultMethod = "get";
var defaultEncType = "application/x-www-form-urlencoded";
function isHtmlElement(object) {
  return typeof HTMLElement !== "undefined" && object instanceof HTMLElement;
}
function isButtonElement(object) {
  return isHtmlElement(object) && object.tagName.toLowerCase() === "button";
}
function isFormElement(object) {
  return isHtmlElement(object) && object.tagName.toLowerCase() === "form";
}
function isInputElement(object) {
  return isHtmlElement(object) && object.tagName.toLowerCase() === "input";
}
function isModifiedEvent(event) {
  return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
}
function shouldProcessLinkClick(event, target) {
  return event.button === 0 && // Ignore everything but left clicks
  (!target || target === "_self") && // Let browser handle "target=_blank" etc.
  !isModifiedEvent(event);
}
var _formDataSupportsSubmitter = null;
function isFormDataSubmitterSupported() {
  if (_formDataSupportsSubmitter === null) {
    try {
      new FormData(
        document.createElement("form"),
        // @ts-expect-error if FormData supports the submitter parameter, this will throw
        0
      );
      _formDataSupportsSubmitter = false;
    } catch (e2) {
      _formDataSupportsSubmitter = true;
    }
  }
  return _formDataSupportsSubmitter;
}
var supportedFormEncTypes = /* @__PURE__ */ new Set([
  "application/x-www-form-urlencoded",
  "multipart/form-data",
  "text/plain"
]);
function getFormEncType(encType) {
  if (encType != null && !supportedFormEncTypes.has(encType)) {
    warning(
      false,
      `"${encType}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${defaultEncType}"`
    );
    return null;
  }
  return encType;
}
function getFormSubmissionInfo(target, basename) {
  let method;
  let action;
  let encType;
  let formData;
  let body;
  if (isFormElement(target)) {
    let attr = target.getAttribute("action");
    action = attr ? stripBasename(attr, basename) : null;
    method = target.getAttribute("method") || defaultMethod;
    encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
    formData = new FormData(target);
  } else if (isButtonElement(target) || isInputElement(target) && (target.type === "submit" || target.type === "image")) {
    let form = target.form;
    if (form == null) {
      throw new Error(
        `Cannot submit a <button> or <input type="submit"> without a <form>`
      );
    }
    let attr = target.getAttribute("formaction") || form.getAttribute("action");
    action = attr ? stripBasename(attr, basename) : null;
    method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
    encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
    formData = new FormData(form, target);
    if (!isFormDataSubmitterSupported()) {
      let { name, type, value } = target;
      if (type === "image") {
        let prefix2 = name ? `${name}.` : "";
        formData.append(`${prefix2}x`, "0");
        formData.append(`${prefix2}y`, "0");
      } else if (name) {
        formData.append(name, value);
      }
    }
  } else if (isHtmlElement(target)) {
    throw new Error(
      `Cannot submit element that is not <form>, <button>, or <input type="submit|image">`
    );
  } else {
    method = defaultMethod;
    action = null;
    encType = defaultEncType;
    body = target;
  }
  if (formData && encType === "text/plain") {
    body = formData;
    formData = void 0;
  }
  return { action, method: method.toLowerCase(), encType, formData, body };
}
Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
function invariant2(value, message) {
  if (value === false || value === null || typeof value === "undefined") {
    throw new Error(message);
  }
}
function singleFetchUrl(reqUrl, basename, trailingSlashAware, extension) {
  let url = typeof reqUrl === "string" ? new URL(
    reqUrl,
    // This can be called during the SSR flow via PrefetchPageLinksImpl so
    // don't assume window is available
    typeof window === "undefined" ? "server://singlefetch/" : window.location.origin
  ) : reqUrl;
  if (trailingSlashAware) {
    if (url.pathname.endsWith("/")) {
      url.pathname = `${url.pathname}_.${extension}`;
    } else {
      url.pathname = `${url.pathname}.${extension}`;
    }
  } else {
    if (url.pathname === "/") {
      url.pathname = `_root.${extension}`;
    } else if (basename && stripBasename(url.pathname, basename) === "/") {
      url.pathname = `${basename.replace(/\/$/, "")}/_root.${extension}`;
    } else {
      url.pathname = `${url.pathname.replace(/\/$/, "")}.${extension}`;
    }
  }
  return url;
}
async function loadRouteModule(route, routeModulesCache) {
  if (route.id in routeModulesCache) {
    return routeModulesCache[route.id];
  }
  try {
    let routeModule = await import(
      /* @vite-ignore */
      /* webpackIgnore: true */
      route.module
    );
    routeModulesCache[route.id] = routeModule;
    return routeModule;
  } catch (error) {
    console.error(
      `Error loading route module \`${route.module}\`, reloading page...`
    );
    console.error(error);
    if (window.__reactRouterContext && window.__reactRouterContext.isSpaMode && // @ts-expect-error
    void 0) ;
    window.location.reload();
    return new Promise(() => {
    });
  }
}
function isHtmlLinkDescriptor(object) {
  if (object == null) {
    return false;
  }
  if (object.href == null) {
    return object.rel === "preload" && typeof object.imageSrcSet === "string" && typeof object.imageSizes === "string";
  }
  return typeof object.rel === "string" && typeof object.href === "string";
}
async function getKeyedPrefetchLinks(matches2, manifest, routeModules) {
  let links = await Promise.all(
    matches2.map(async (match) => {
      let route = manifest.routes[match.route.id];
      if (route) {
        let mod = await loadRouteModule(route, routeModules);
        return mod.links ? mod.links() : [];
      }
      return [];
    })
  );
  return dedupeLinkDescriptors(
    links.flat(1).filter(isHtmlLinkDescriptor).filter((link) => link.rel === "stylesheet" || link.rel === "preload").map(
      (link) => link.rel === "stylesheet" ? { ...link, rel: "prefetch", as: "style" } : { ...link, rel: "prefetch" }
    )
  );
}
function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, location, mode) {
  let isNew = (match, index2) => {
    if (!currentMatches[index2]) return true;
    return match.route.id !== currentMatches[index2].route.id;
  };
  let matchPathChanged = (match, index2) => {
    var _a;
    return (
      // param change, /users/123 -> /users/456
      currentMatches[index2].pathname !== match.pathname || // splat param changed, which is not present in match.path
      // e.g. /files/images/avatar.jpg -> files/finances.xls
      ((_a = currentMatches[index2].route.path) == null ? void 0 : _a.endsWith("*")) && currentMatches[index2].params["*"] !== match.params["*"]
    );
  };
  if (mode === "assets") {
    return nextMatches.filter(
      (match, index2) => isNew(match, index2) || matchPathChanged(match, index2)
    );
  }
  if (mode === "data") {
    return nextMatches.filter((match, index2) => {
      var _a;
      let manifestRoute = manifest.routes[match.route.id];
      if (!manifestRoute || !manifestRoute.hasLoader) {
        return false;
      }
      if (isNew(match, index2) || matchPathChanged(match, index2)) {
        return true;
      }
      if (match.route.shouldRevalidate) {
        let routeChoice = match.route.shouldRevalidate({
          currentUrl: new URL(
            location.pathname + location.search + location.hash,
            window.origin
          ),
          currentParams: ((_a = currentMatches[0]) == null ? void 0 : _a.params) || {},
          nextUrl: new URL(page, window.origin),
          nextParams: match.params,
          defaultShouldRevalidate: true
        });
        if (typeof routeChoice === "boolean") {
          return routeChoice;
        }
      }
      return true;
    });
  }
  return [];
}
function getModuleLinkHrefs(matches2, manifest, { includeHydrateFallback } = {}) {
  return dedupeHrefs(
    matches2.map((match) => {
      let route = manifest.routes[match.route.id];
      if (!route) return [];
      let hrefs = [route.module];
      if (route.clientActionModule) {
        hrefs = hrefs.concat(route.clientActionModule);
      }
      if (route.clientLoaderModule) {
        hrefs = hrefs.concat(route.clientLoaderModule);
      }
      if (includeHydrateFallback && route.hydrateFallbackModule) {
        hrefs = hrefs.concat(route.hydrateFallbackModule);
      }
      if (route.imports) {
        hrefs = hrefs.concat(route.imports);
      }
      return hrefs;
    }).flat(1)
  );
}
function dedupeHrefs(hrefs) {
  return [...new Set(hrefs)];
}
function sortKeys(obj) {
  let sorted = {};
  let keys = Object.keys(obj).sort();
  for (let key of keys) {
    sorted[key] = obj[key];
  }
  return sorted;
}
function dedupeLinkDescriptors(descriptors2, preloads) {
  let set2 = /* @__PURE__ */ new Set();
  new Set(preloads);
  return descriptors2.reduce((deduped, descriptor) => {
    let key = JSON.stringify(sortKeys(descriptor));
    if (!set2.has(key)) {
      set2.add(key);
      deduped.push({ key, link: descriptor });
    }
    return deduped;
  }, []);
}
function useDataRouterContext2() {
  let context = reactExports.useContext(DataRouterContext);
  invariant2(
    context,
    "You must render this element inside a <DataRouterContext.Provider> element"
  );
  return context;
}
function useDataRouterStateContext() {
  let context = reactExports.useContext(DataRouterStateContext);
  invariant2(
    context,
    "You must render this element inside a <DataRouterStateContext.Provider> element"
  );
  return context;
}
var FrameworkContext = reactExports.createContext(void 0);
FrameworkContext.displayName = "FrameworkContext";
function useFrameworkContext() {
  let context = reactExports.useContext(FrameworkContext);
  invariant2(
    context,
    "You must render this element inside a <HydratedRouter> element"
  );
  return context;
}
function usePrefetchBehavior(prefetch, theirElementProps) {
  let frameworkContext = reactExports.useContext(FrameworkContext);
  let [maybePrefetch, setMaybePrefetch] = reactExports.useState(false);
  let [shouldPrefetch, setShouldPrefetch] = reactExports.useState(false);
  let { onFocus, onBlur, onMouseEnter, onMouseLeave, onTouchStart } = theirElementProps;
  let ref = reactExports.useRef(null);
  reactExports.useEffect(() => {
    if (prefetch === "render") {
      setShouldPrefetch(true);
    }
    if (prefetch === "viewport") {
      let callback = (entries) => {
        entries.forEach((entry) => {
          setShouldPrefetch(entry.isIntersecting);
        });
      };
      let observer = new IntersectionObserver(callback, { threshold: 0.5 });
      if (ref.current) observer.observe(ref.current);
      return () => {
        observer.disconnect();
      };
    }
  }, [prefetch]);
  reactExports.useEffect(() => {
    if (maybePrefetch) {
      let id = setTimeout(() => {
        setShouldPrefetch(true);
      }, 100);
      return () => {
        clearTimeout(id);
      };
    }
  }, [maybePrefetch]);
  let setIntent = () => {
    setMaybePrefetch(true);
  };
  let cancelIntent = () => {
    setMaybePrefetch(false);
    setShouldPrefetch(false);
  };
  if (!frameworkContext) {
    return [false, ref, {}];
  }
  if (prefetch !== "intent") {
    return [shouldPrefetch, ref, {}];
  }
  return [
    shouldPrefetch,
    ref,
    {
      onFocus: composeEventHandlers(onFocus, setIntent),
      onBlur: composeEventHandlers(onBlur, cancelIntent),
      onMouseEnter: composeEventHandlers(onMouseEnter, setIntent),
      onMouseLeave: composeEventHandlers(onMouseLeave, cancelIntent),
      onTouchStart: composeEventHandlers(onTouchStart, setIntent)
    }
  ];
}
function composeEventHandlers(theirHandler, ourHandler) {
  return (event) => {
    theirHandler && theirHandler(event);
    if (!event.defaultPrevented) {
      ourHandler(event);
    }
  };
}
function PrefetchPageLinks({ page, ...linkProps }) {
  let { router } = useDataRouterContext2();
  let matches2 = reactExports.useMemo(
    () => matchRoutes(router.routes, page, router.basename),
    [router.routes, page, router.basename]
  );
  if (!matches2) {
    return null;
  }
  return /* @__PURE__ */ reactExports.createElement(PrefetchPageLinksImpl, { page, matches: matches2, ...linkProps });
}
function useKeyedPrefetchLinks(matches2) {
  let { manifest, routeModules } = useFrameworkContext();
  let [keyedPrefetchLinks, setKeyedPrefetchLinks] = reactExports.useState([]);
  reactExports.useEffect(() => {
    let interrupted = false;
    void getKeyedPrefetchLinks(matches2, manifest, routeModules).then(
      (links) => {
        if (!interrupted) {
          setKeyedPrefetchLinks(links);
        }
      }
    );
    return () => {
      interrupted = true;
    };
  }, [matches2, manifest, routeModules]);
  return keyedPrefetchLinks;
}
function PrefetchPageLinksImpl({
  page,
  matches: nextMatches,
  ...linkProps
}) {
  let location = useLocation();
  let { future, manifest, routeModules } = useFrameworkContext();
  let { basename } = useDataRouterContext2();
  let { loaderData, matches: matches2 } = useDataRouterStateContext();
  let newMatchesForData = reactExports.useMemo(
    () => getNewMatchesForLinks(
      page,
      nextMatches,
      matches2,
      manifest,
      location,
      "data"
    ),
    [page, nextMatches, matches2, manifest, location]
  );
  let newMatchesForAssets = reactExports.useMemo(
    () => getNewMatchesForLinks(
      page,
      nextMatches,
      matches2,
      manifest,
      location,
      "assets"
    ),
    [page, nextMatches, matches2, manifest, location]
  );
  let dataHrefs = reactExports.useMemo(() => {
    if (page === location.pathname + location.search + location.hash) {
      return [];
    }
    let routesParams = /* @__PURE__ */ new Set();
    let foundOptOutRoute = false;
    nextMatches.forEach((m2) => {
      var _a;
      let manifestRoute = manifest.routes[m2.route.id];
      if (!manifestRoute || !manifestRoute.hasLoader) {
        return;
      }
      if (!newMatchesForData.some((m22) => m22.route.id === m2.route.id) && m2.route.id in loaderData && ((_a = routeModules[m2.route.id]) == null ? void 0 : _a.shouldRevalidate)) {
        foundOptOutRoute = true;
      } else if (manifestRoute.hasClientLoader) {
        foundOptOutRoute = true;
      } else {
        routesParams.add(m2.route.id);
      }
    });
    if (routesParams.size === 0) {
      return [];
    }
    let url = singleFetchUrl(
      page,
      basename,
      future.unstable_trailingSlashAwareDataRequests,
      "data"
    );
    if (foundOptOutRoute && routesParams.size > 0) {
      url.searchParams.set(
        "_routes",
        nextMatches.filter((m2) => routesParams.has(m2.route.id)).map((m2) => m2.route.id).join(",")
      );
    }
    return [url.pathname + url.search];
  }, [
    basename,
    future.unstable_trailingSlashAwareDataRequests,
    loaderData,
    location,
    manifest,
    newMatchesForData,
    nextMatches,
    page,
    routeModules
  ]);
  let moduleHrefs = reactExports.useMemo(
    () => getModuleLinkHrefs(newMatchesForAssets, manifest),
    [newMatchesForAssets, manifest]
  );
  let keyedPrefetchLinks = useKeyedPrefetchLinks(newMatchesForAssets);
  return /* @__PURE__ */ reactExports.createElement(reactExports.Fragment, null, dataHrefs.map((href) => /* @__PURE__ */ reactExports.createElement("link", { key: href, rel: "prefetch", as: "fetch", href, ...linkProps })), moduleHrefs.map((href) => /* @__PURE__ */ reactExports.createElement("link", { key: href, rel: "modulepreload", href, ...linkProps })), keyedPrefetchLinks.map(({ key, link }) => (
    // these don't spread `linkProps` because they are full link descriptors
    // already with their own props
    /* @__PURE__ */ reactExports.createElement("link", { key, nonce: linkProps.nonce, ...link })
  )));
}
function mergeRefs(...refs) {
  return (value) => {
    refs.forEach((ref) => {
      if (typeof ref === "function") {
        ref(value);
      } else if (ref != null) {
        ref.current = value;
      }
    });
  };
}
var isBrowser2 = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
try {
  if (isBrowser2) {
    window.__reactRouterVersion = // @ts-expect-error
    "7.12.0";
  }
} catch (e2) {
}
function BrowserRouter({
  basename,
  children,
  unstable_useTransitions,
  window: window2
}) {
  let historyRef = reactExports.useRef();
  if (historyRef.current == null) {
    historyRef.current = createBrowserHistory({ window: window2, v5Compat: true });
  }
  let history = historyRef.current;
  let [state, setStateImpl] = reactExports.useState({
    action: history.action,
    location: history.location
  });
  let setState = reactExports.useCallback(
    (newState) => {
      if (unstable_useTransitions === false) {
        setStateImpl(newState);
      } else {
        reactExports.startTransition(() => setStateImpl(newState));
      }
    },
    [unstable_useTransitions]
  );
  reactExports.useLayoutEffect(() => history.listen(setState), [history, setState]);
  return /* @__PURE__ */ reactExports.createElement(
    Router,
    {
      basename,
      children,
      location: state.location,
      navigationType: state.action,
      navigator: history,
      unstable_useTransitions
    }
  );
}
var ABSOLUTE_URL_REGEX2 = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
var Link = reactExports.forwardRef(
  function LinkWithRef({
    onClick,
    discover = "render",
    prefetch = "none",
    relative,
    reloadDocument,
    replace: replace2,
    state,
    target,
    to,
    preventScrollReset,
    viewTransition,
    unstable_defaultShouldRevalidate,
    ...rest
  }, forwardedRef) {
    let { basename, unstable_useTransitions } = reactExports.useContext(NavigationContext);
    let isAbsolute = typeof to === "string" && ABSOLUTE_URL_REGEX2.test(to);
    let parsed = parseToInfo(to, basename);
    to = parsed.to;
    let href = useHref(to, { relative });
    let [shouldPrefetch, prefetchRef, prefetchHandlers] = usePrefetchBehavior(
      prefetch,
      rest
    );
    let internalOnClick = useLinkClickHandler(to, {
      replace: replace2,
      state,
      target,
      preventScrollReset,
      relative,
      viewTransition,
      unstable_defaultShouldRevalidate,
      unstable_useTransitions
    });
    function handleClick(event) {
      if (onClick) onClick(event);
      if (!event.defaultPrevented) {
        internalOnClick(event);
      }
    }
    let link = (
      // eslint-disable-next-line jsx-a11y/anchor-has-content
      /* @__PURE__ */ reactExports.createElement(
        "a",
        {
          ...rest,
          ...prefetchHandlers,
          href: parsed.absoluteURL || href,
          onClick: parsed.isExternal || reloadDocument ? onClick : handleClick,
          ref: mergeRefs(forwardedRef, prefetchRef),
          target,
          "data-discover": !isAbsolute && discover === "render" ? "true" : void 0
        }
      )
    );
    return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ reactExports.createElement(reactExports.Fragment, null, link, /* @__PURE__ */ reactExports.createElement(PrefetchPageLinks, { page: href })) : link;
  }
);
Link.displayName = "Link";
var NavLink = reactExports.forwardRef(
  function NavLinkWithRef({
    "aria-current": ariaCurrentProp = "page",
    caseSensitive = false,
    className: classNameProp = "",
    end = false,
    style: styleProp,
    to,
    viewTransition,
    children,
    ...rest
  }, ref) {
    let path = useResolvedPath(to, { relative: rest.relative });
    let location = useLocation();
    let routerState = reactExports.useContext(DataRouterStateContext);
    let { navigator: navigator2, basename } = reactExports.useContext(NavigationContext);
    let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
    // eslint-disable-next-line react-hooks/rules-of-hooks
    useViewTransitionState(path) && viewTransition === true;
    let toPathname = navigator2.encodeLocation ? navigator2.encodeLocation(path).pathname : path.pathname;
    let locationPathname = location.pathname;
    let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;
    if (!caseSensitive) {
      locationPathname = locationPathname.toLowerCase();
      nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;
      toPathname = toPathname.toLowerCase();
    }
    if (nextLocationPathname && basename) {
      nextLocationPathname = stripBasename(nextLocationPathname, basename) || nextLocationPathname;
    }
    const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
    let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/";
    let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === "/");
    let renderProps = {
      isActive,
      isPending,
      isTransitioning
    };
    let ariaCurrent = isActive ? ariaCurrentProp : void 0;
    let className;
    if (typeof classNameProp === "function") {
      className = classNameProp(renderProps);
    } else {
      className = [
        classNameProp,
        isActive ? "active" : null,
        isPending ? "pending" : null,
        isTransitioning ? "transitioning" : null
      ].filter(Boolean).join(" ");
    }
    let style2 = typeof styleProp === "function" ? styleProp(renderProps) : styleProp;
    return /* @__PURE__ */ reactExports.createElement(
      Link,
      {
        ...rest,
        "aria-current": ariaCurrent,
        className,
        ref,
        style: style2,
        to,
        viewTransition
      },
      typeof children === "function" ? children(renderProps) : children
    );
  }
);
NavLink.displayName = "NavLink";
var Form = reactExports.forwardRef(
  ({
    discover = "render",
    fetcherKey,
    navigate,
    reloadDocument,
    replace: replace2,
    state,
    method = defaultMethod,
    action,
    onSubmit,
    relative,
    preventScrollReset,
    viewTransition,
    unstable_defaultShouldRevalidate,
    ...props
  }, forwardedRef) => {
    let { unstable_useTransitions } = reactExports.useContext(NavigationContext);
    let submit = useSubmit();
    let formAction = useFormAction(action, { relative });
    let formMethod = method.toLowerCase() === "get" ? "get" : "post";
    let isAbsolute = typeof action === "string" && ABSOLUTE_URL_REGEX2.test(action);
    let submitHandler = (event) => {
      onSubmit && onSubmit(event);
      if (event.defaultPrevented) return;
      event.preventDefault();
      let submitter = event.nativeEvent.submitter;
      let submitMethod = (submitter == null ? void 0 : submitter.getAttribute("formmethod")) || method;
      let doSubmit = () => submit(submitter || event.currentTarget, {
        fetcherKey,
        method: submitMethod,
        navigate,
        replace: replace2,
        state,
        relative,
        preventScrollReset,
        viewTransition,
        unstable_defaultShouldRevalidate
      });
      if (unstable_useTransitions && navigate !== false) {
        reactExports.startTransition(() => doSubmit());
      } else {
        doSubmit();
      }
    };
    return /* @__PURE__ */ reactExports.createElement(
      "form",
      {
        ref: forwardedRef,
        method: formMethod,
        action: formAction,
        onSubmit: reloadDocument ? onSubmit : submitHandler,
        ...props,
        "data-discover": !isAbsolute && discover === "render" ? "true" : void 0
      }
    );
  }
);
Form.displayName = "Form";
function getDataRouterConsoleError2(hookName) {
  return `${hookName} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`;
}
function useDataRouterContext3(hookName) {
  let ctx = reactExports.useContext(DataRouterContext);
  invariant(ctx, getDataRouterConsoleError2(hookName));
  return ctx;
}
function useLinkClickHandler(to, {
  target,
  replace: replaceProp,
  state,
  preventScrollReset,
  relative,
  viewTransition,
  unstable_defaultShouldRevalidate,
  unstable_useTransitions
} = {}) {
  let navigate = useNavigate();
  let location = useLocation();
  let path = useResolvedPath(to, { relative });
  return reactExports.useCallback(
    (event) => {
      if (shouldProcessLinkClick(event, target)) {
        event.preventDefault();
        let replace2 = replaceProp !== void 0 ? replaceProp : createPath(location) === createPath(path);
        let doNavigate = () => navigate(to, {
          replace: replace2,
          state,
          preventScrollReset,
          relative,
          viewTransition,
          unstable_defaultShouldRevalidate
        });
        if (unstable_useTransitions) {
          reactExports.startTransition(() => doNavigate());
        } else {
          doNavigate();
        }
      }
    },
    [
      location,
      navigate,
      path,
      replaceProp,
      state,
      target,
      to,
      preventScrollReset,
      relative,
      viewTransition,
      unstable_defaultShouldRevalidate,
      unstable_useTransitions
    ]
  );
}
var fetcherId = 0;
var getUniqueFetcherId = () => `__${String(++fetcherId)}__`;
function useSubmit() {
  let { router } = useDataRouterContext3(
    "useSubmit"
    /* UseSubmit */
  );
  let { basename } = reactExports.useContext(NavigationContext);
  let currentRouteId = useRouteId();
  let routerFetch = router.fetch;
  let routerNavigate = router.navigate;
  return reactExports.useCallback(
    async (target, options = {}) => {
      let { action, method, encType, formData, body } = getFormSubmissionInfo(
        target,
        basename
      );
      if (options.navigate === false) {
        let key = options.fetcherKey || getUniqueFetcherId();
        await routerFetch(key, currentRouteId, options.action || action, {
          unstable_defaultShouldRevalidate: options.unstable_defaultShouldRevalidate,
          preventScrollReset: options.preventScrollReset,
          formData,
          body,
          formMethod: options.method || method,
          formEncType: options.encType || encType,
          flushSync: options.flushSync
        });
      } else {
        await routerNavigate(options.action || action, {
          unstable_defaultShouldRevalidate: options.unstable_defaultShouldRevalidate,
          preventScrollReset: options.preventScrollReset,
          formData,
          body,
          formMethod: options.method || method,
          formEncType: options.encType || encType,
          replace: options.replace,
          state: options.state,
          fromRouteId: currentRouteId,
          flushSync: options.flushSync,
          viewTransition: options.viewTransition
        });
      }
    },
    [routerFetch, routerNavigate, basename, currentRouteId]
  );
}
function useFormAction(action, { relative } = {}) {
  let { basename } = reactExports.useContext(NavigationContext);
  let routeContext = reactExports.useContext(RouteContext);
  invariant(routeContext, "useFormAction must be used inside a RouteContext");
  let [match] = routeContext.matches.slice(-1);
  let path = { ...useResolvedPath(action ? action : ".", { relative }) };
  let location = useLocation();
  if (action == null) {
    path.search = location.search;
    let params = new URLSearchParams(path.search);
    let indexValues = params.getAll("index");
    let hasNakedIndexParam = indexValues.some((v2) => v2 === "");
    if (hasNakedIndexParam) {
      params.delete("index");
      indexValues.filter((v2) => v2).forEach((v2) => params.append("index", v2));
      let qs = params.toString();
      path.search = qs ? `?${qs}` : "";
    }
  }
  if ((!action || action === ".") && match.route.index) {
    path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
  }
  if (basename !== "/") {
    path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
  }
  return createPath(path);
}
function useViewTransitionState(to, { relative } = {}) {
  let vtContext = reactExports.useContext(ViewTransitionContext);
  invariant(
    vtContext != null,
    "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?"
  );
  let { basename } = useDataRouterContext3(
    "useViewTransitionState"
    /* useViewTransitionState */
  );
  let path = useResolvedPath(to, { relative });
  if (!vtContext.isTransitioning) {
    return false;
  }
  let currentPath = stripBasename(vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
  let nextPath = stripBasename(vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
  return matchPath(path.pathname, nextPath) != null || matchPath(path.pathname, currentPath) != null;
}
var withSelector = { exports: {} };
var useSyncExternalStoreWithSelector_production = {};
/**
 * @license React
 * use-sync-external-store-with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var React$1 = reactExports;
function is$2(x, y) {
  return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
}
var objectIs$1 = "function" === typeof Object.is ? Object.is : is$2, useSyncExternalStore = React$1.useSyncExternalStore, useRef = React$1.useRef, useEffect$1 = React$1.useEffect, useMemo = React$1.useMemo, useDebugValue$1 = React$1.useDebugValue;
useSyncExternalStoreWithSelector_production.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
  var instRef = useRef(null);
  if (null === instRef.current) {
    var inst = { hasValue: false, value: null };
    instRef.current = inst;
  } else inst = instRef.current;
  instRef = useMemo(
    function() {
      function memoizedSelector(nextSnapshot) {
        if (!hasMemo) {
          hasMemo = true;
          memoizedSnapshot = nextSnapshot;
          nextSnapshot = selector(nextSnapshot);
          if (void 0 !== isEqual && inst.hasValue) {
            var currentSelection = inst.value;
            if (isEqual(currentSelection, nextSnapshot))
              return memoizedSelection = currentSelection;
          }
          return memoizedSelection = nextSnapshot;
        }
        currentSelection = memoizedSelection;
        if (objectIs$1(memoizedSnapshot, nextSnapshot)) return currentSelection;
        var nextSelection = selector(nextSnapshot);
        if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
          return memoizedSnapshot = nextSnapshot, currentSelection;
        memoizedSnapshot = nextSnapshot;
        return memoizedSelection = nextSelection;
      }
      var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
      return [
        function() {
          return memoizedSelector(getSnapshot());
        },
        null === maybeGetServerSnapshot ? void 0 : function() {
          return memoizedSelector(maybeGetServerSnapshot());
        }
      ];
    },
    [getSnapshot, getServerSnapshot, selector, isEqual]
  );
  var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
  useEffect$1(
    function() {
      inst.hasValue = true;
      inst.value = value;
    },
    [value]
  );
  useDebugValue$1(value);
  return value;
};
{
  withSelector.exports = useSyncExternalStoreWithSelector_production;
}
var withSelectorExports = withSelector.exports;
function defaultNoopBatch(callback) {
  callback();
}
function createListenerCollection() {
  let first = null;
  let last = null;
  return {
    clear() {
      first = null;
      last = null;
    },
    notify() {
      defaultNoopBatch(() => {
        let listener = first;
        while (listener) {
          listener.callback();
          listener = listener.next;
        }
      });
    },
    get() {
      const listeners = [];
      let listener = first;
      while (listener) {
        listeners.push(listener);
        listener = listener.next;
      }
      return listeners;
    },
    subscribe(callback) {
      let isSubscribed = true;
      const listener = last = {
        callback,
        next: null,
        prev: last
      };
      if (listener.prev) {
        listener.prev.next = listener;
      } else {
        first = listener;
      }
      return function unsubscribe() {
        if (!isSubscribed || first === null) return;
        isSubscribed = false;
        if (listener.next) {
          listener.next.prev = listener.prev;
        } else {
          last = listener.prev;
        }
        if (listener.prev) {
          listener.prev.next = listener.next;
        } else {
          first = listener.next;
        }
      };
    }
  };
}
var nullListeners = {
  notify() {
  },
  get: () => []
};
function createSubscription(store2, parentSub) {
  let unsubscribe;
  let listeners = nullListeners;
  let subscriptionsAmount = 0;
  let selfSubscribed = false;
  function addNestedSub(listener) {
    trySubscribe();
    const cleanupListener = listeners.subscribe(listener);
    let removed = false;
    return () => {
      if (!removed) {
        removed = true;
        cleanupListener();
        tryUnsubscribe();
      }
    };
  }
  function notifyNestedSubs() {
    listeners.notify();
  }
  function handleChangeWrapper() {
    if (subscription.onStateChange) {
      subscription.onStateChange();
    }
  }
  function isSubscribed() {
    return selfSubscribed;
  }
  function trySubscribe() {
    subscriptionsAmount++;
    if (!unsubscribe) {
      unsubscribe = store2.subscribe(handleChangeWrapper);
      listeners = createListenerCollection();
    }
  }
  function tryUnsubscribe() {
    subscriptionsAmount--;
    if (unsubscribe && subscriptionsAmount === 0) {
      unsubscribe();
      unsubscribe = void 0;
      listeners.clear();
      listeners = nullListeners;
    }
  }
  function trySubscribeSelf() {
    if (!selfSubscribed) {
      selfSubscribed = true;
      trySubscribe();
    }
  }
  function tryUnsubscribeSelf() {
    if (selfSubscribed) {
      selfSubscribed = false;
      tryUnsubscribe();
    }
  }
  const subscription = {
    addNestedSub,
    notifyNestedSubs,
    handleChangeWrapper,
    isSubscribed,
    trySubscribe: trySubscribeSelf,
    tryUnsubscribe: tryUnsubscribeSelf,
    getListeners: () => listeners
  };
  return subscription;
}
var canUseDOM = () => !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
var isDOM = /* @__PURE__ */ canUseDOM();
var isRunningInReactNative = () => typeof navigator !== "undefined" && navigator.product === "ReactNative";
var isReactNative = /* @__PURE__ */ isRunningInReactNative();
var getUseIsomorphicLayoutEffect = () => isDOM || isReactNative ? reactExports.useLayoutEffect : reactExports.useEffect;
var useIsomorphicLayoutEffect = /* @__PURE__ */ getUseIsomorphicLayoutEffect();
var ContextKey = /* @__PURE__ */ Symbol.for(`react-redux-context`);
var gT = typeof globalThis !== "undefined" ? globalThis : (
  /* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */
  {}
);
function getContext() {
  if (!reactExports.createContext) return {};
  const contextMap = gT[ContextKey] ?? (gT[ContextKey] = /* @__PURE__ */ new Map());
  let realContext = contextMap.get(reactExports.createContext);
  if (!realContext) {
    realContext = reactExports.createContext(
      null
    );
    contextMap.set(reactExports.createContext, realContext);
  }
  return realContext;
}
var ReactReduxContext = /* @__PURE__ */ getContext();
function Provider(providerProps) {
  const { children, context, serverState, store: store2 } = providerProps;
  const contextValue = reactExports.useMemo(() => {
    const subscription = createSubscription(store2);
    const baseContextValue = {
      store: store2,
      subscription,
      getServerState: serverState ? () => serverState : void 0
    };
    {
      return baseContextValue;
    }
  }, [store2, serverState]);
  const previousState = reactExports.useMemo(() => store2.getState(), [store2]);
  useIsomorphicLayoutEffect(() => {
    const { subscription } = contextValue;
    subscription.onStateChange = subscription.notifyNestedSubs;
    subscription.trySubscribe();
    if (previousState !== store2.getState()) {
      subscription.notifyNestedSubs();
    }
    return () => {
      subscription.tryUnsubscribe();
      subscription.onStateChange = void 0;
    };
  }, [contextValue, previousState]);
  const Context = context || ReactReduxContext;
  return /* @__PURE__ */ reactExports.createElement(Context.Provider, { value: contextValue }, children);
}
var Provider_default = Provider;
function createReduxContextHook(context = ReactReduxContext) {
  return function useReduxContext2() {
    const contextValue = reactExports.useContext(context);
    return contextValue;
  };
}
var useReduxContext = /* @__PURE__ */ createReduxContextHook();
function createStoreHook(context = ReactReduxContext) {
  const useReduxContext2 = context === ReactReduxContext ? useReduxContext : (
    // @ts-ignore
    createReduxContextHook(context)
  );
  const useStore2 = () => {
    const { store: store2 } = useReduxContext2();
    return store2;
  };
  Object.assign(useStore2, {
    withTypes: () => useStore2
  });
  return useStore2;
}
var useStore = /* @__PURE__ */ createStoreHook();
function createDispatchHook(context = ReactReduxContext) {
  const useStore2 = context === ReactReduxContext ? useStore : createStoreHook(context);
  const useDispatch2 = () => {
    const store2 = useStore2();
    return store2.dispatch;
  };
  Object.assign(useDispatch2, {
    withTypes: () => useDispatch2
  });
  return useDispatch2;
}
var useDispatch = /* @__PURE__ */ createDispatchHook();
var refEquality = (a2, b) => a2 === b;
function createSelectorHook(context = ReactReduxContext) {
  const useReduxContext2 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context);
  const useSelector2 = (selector, equalityFnOrOptions = {}) => {
    const { equalityFn = refEquality } = typeof equalityFnOrOptions === "function" ? { equalityFn: equalityFnOrOptions } : equalityFnOrOptions;
    const reduxContext = useReduxContext2();
    const { store: store2, subscription, getServerState } = reduxContext;
    reactExports.useRef(true);
    const wrappedSelector = reactExports.useCallback(
      {
        [selector.name](state) {
          const selected = selector(state);
          return selected;
        }
      }[selector.name],
      [selector]
    );
    const selectedState = withSelectorExports.useSyncExternalStoreWithSelector(
      subscription.addNestedSub,
      store2.getState,
      getServerState || store2.getState,
      wrappedSelector,
      equalityFn
    );
    reactExports.useDebugValue(selectedState);
    return selectedState;
  };
  Object.assign(useSelector2, {
    withTypes: () => useSelector2
  });
  return useSelector2;
}
var useSelector = /* @__PURE__ */ createSelectorHook();
function formatProdErrorMessage$1(code) {
  return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;
}
var $$observable = /* @__PURE__ */ (() => typeof Symbol === "function" && Symbol.observable || "@@observable")();
var symbol_observable_default = $$observable;
var randomString = () => Math.random().toString(36).substring(7).split("").join(".");
var ActionTypes = {
  INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,
  REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,
  PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`
};
var actionTypes_default = ActionTypes;
function isPlainObject$2(obj) {
  if (typeof obj !== "object" || obj === null)
    return false;
  let proto = obj;
  while (Object.getPrototypeOf(proto) !== null) {
    proto = Object.getPrototypeOf(proto);
  }
  return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;
}
function createStore(reducer, preloadedState2, enhancer) {
  if (typeof reducer !== "function") {
    throw new Error(formatProdErrorMessage$1(2));
  }
  if (typeof preloadedState2 === "function" && typeof enhancer === "function" || typeof enhancer === "function" && typeof arguments[3] === "function") {
    throw new Error(formatProdErrorMessage$1(0));
  }
  if (typeof preloadedState2 === "function" && typeof enhancer === "undefined") {
    enhancer = preloadedState2;
    preloadedState2 = void 0;
  }
  if (typeof enhancer !== "undefined") {
    if (typeof enhancer !== "function") {
      throw new Error(formatProdErrorMessage$1(1));
    }
    return enhancer(createStore)(reducer, preloadedState2);
  }
  let currentReducer = reducer;
  let currentState = preloadedState2;
  let currentListeners = /* @__PURE__ */ new Map();
  let nextListeners = currentListeners;
  let listenerIdCounter = 0;
  let isDispatching = false;
  function ensureCanMutateNextListeners() {
    if (nextListeners === currentListeners) {
      nextListeners = /* @__PURE__ */ new Map();
      currentListeners.forEach((listener, key) => {
        nextListeners.set(key, listener);
      });
    }
  }
  function getState() {
    if (isDispatching) {
      throw new Error(formatProdErrorMessage$1(3));
    }
    return currentState;
  }
  function subscribe(listener) {
    if (typeof listener !== "function") {
      throw new Error(formatProdErrorMessage$1(4));
    }
    if (isDispatching) {
      throw new Error(formatProdErrorMessage$1(5));
    }
    let isSubscribed = true;
    ensureCanMutateNextListeners();
    const listenerId = listenerIdCounter++;
    nextListeners.set(listenerId, listener);
    return function unsubscribe() {
      if (!isSubscribed) {
        return;
      }
      if (isDispatching) {
        throw new Error(formatProdErrorMessage$1(6));
      }
      isSubscribed = false;
      ensureCanMutateNextListeners();
      nextListeners.delete(listenerId);
      currentListeners = null;
    };
  }
  function dispatch(action) {
    if (!isPlainObject$2(action)) {
      throw new Error(formatProdErrorMessage$1(7));
    }
    if (typeof action.type === "undefined") {
      throw new Error(formatProdErrorMessage$1(8));
    }
    if (typeof action.type !== "string") {
      throw new Error(formatProdErrorMessage$1(17));
    }
    if (isDispatching) {
      throw new Error(formatProdErrorMessage$1(9));
    }
    try {
      isDispatching = true;
      currentState = currentReducer(currentState, action);
    } finally {
      isDispatching = false;
    }
    const listeners = currentListeners = nextListeners;
    listeners.forEach((listener) => {
      listener();
    });
    return action;
  }
  function replaceReducer(nextReducer) {
    if (typeof nextReducer !== "function") {
      throw new Error(formatProdErrorMessage$1(10));
    }
    currentReducer = nextReducer;
    dispatch({
      type: actionTypes_default.REPLACE
    });
  }
  function observable() {
    const outerSubscribe = subscribe;
    return {
      /**
       * The minimal observable subscription method.
       * @param observer Any object that can be used as an observer.
       * The observer object should have a `next` method.
       * @returns An object with an `unsubscribe` method that can
       * be used to unsubscribe the observable from the store, and prevent further
       * emission of values from the observable.
       */
      subscribe(observer) {
        if (typeof observer !== "object" || observer === null) {
          throw new Error(formatProdErrorMessage$1(11));
        }
        function observeState() {
          const observerAsObserver = observer;
          if (observerAsObserver.next) {
            observerAsObserver.next(getState());
          }
        }
        observeState();
        const unsubscribe = outerSubscribe(observeState);
        return {
          unsubscribe
        };
      },
      [symbol_observable_default]() {
        return this;
      }
    };
  }
  dispatch({
    type: actionTypes_default.INIT
  });
  const store2 = {
    dispatch,
    subscribe,
    getState,
    replaceReducer,
    [symbol_observable_default]: observable
  };
  return store2;
}
function assertReducerShape(reducers) {
  Object.keys(reducers).forEach((key) => {
    const reducer = reducers[key];
    const initialState2 = reducer(void 0, {
      type: actionTypes_default.INIT
    });
    if (typeof initialState2 === "undefined") {
      throw new Error(formatProdErrorMessage$1(12));
    }
    if (typeof reducer(void 0, {
      type: actionTypes_default.PROBE_UNKNOWN_ACTION()
    }) === "undefined") {
      throw new Error(formatProdErrorMessage$1(13));
    }
  });
}
function combineReducers(reducers) {
  const reducerKeys = Object.keys(reducers);
  const finalReducers = {};
  for (let i2 = 0; i2 < reducerKeys.length; i2++) {
    const key = reducerKeys[i2];
    if (typeof reducers[key] === "function") {
      finalReducers[key] = reducers[key];
    }
  }
  const finalReducerKeys = Object.keys(finalReducers);
  let shapeAssertionError;
  try {
    assertReducerShape(finalReducers);
  } catch (e2) {
    shapeAssertionError = e2;
  }
  return function combination(state = {}, action) {
    if (shapeAssertionError) {
      throw shapeAssertionError;
    }
    let hasChanged = false;
    const nextState = {};
    for (let i2 = 0; i2 < finalReducerKeys.length; i2++) {
      const key = finalReducerKeys[i2];
      const reducer = finalReducers[key];
      const previousStateForKey = state[key];
      const nextStateForKey = reducer(previousStateForKey, action);
      if (typeof nextStateForKey === "undefined") {
        action && action.type;
        throw new Error(formatProdErrorMessage$1(14));
      }
      nextState[key] = nextStateForKey;
      hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
    }
    hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
    return hasChanged ? nextState : state;
  };
}
function compose(...funcs) {
  if (funcs.length === 0) {
    return (arg) => arg;
  }
  if (funcs.length === 1) {
    return funcs[0];
  }
  return funcs.reduce((a2, b) => (...args) => a2(b(...args)));
}
function applyMiddleware(...middlewares) {
  return (createStore2) => (reducer, preloadedState2) => {
    const store2 = createStore2(reducer, preloadedState2);
    let dispatch = () => {
      throw new Error(formatProdErrorMessage$1(15));
    };
    const middlewareAPI = {
      getState: store2.getState,
      dispatch: (action, ...args) => dispatch(action, ...args)
    };
    const chain = middlewares.map((middleware) => middleware(middlewareAPI));
    dispatch = compose(...chain)(store2.dispatch);
    return {
      ...store2,
      dispatch
    };
  };
}
function isAction(action) {
  return isPlainObject$2(action) && "type" in action && typeof action.type === "string";
}
var NOTHING = Symbol.for("immer-nothing");
var DRAFTABLE = Symbol.for("immer-draftable");
var DRAFT_STATE = Symbol.for("immer-state");
function die(error, ...args) {
  throw new Error(
    `[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`
  );
}
var O = Object;
var getPrototypeOf$1 = O.getPrototypeOf;
var CONSTRUCTOR = "constructor";
var PROTOTYPE = "prototype";
var CONFIGURABLE = "configurable";
var ENUMERABLE = "enumerable";
var WRITABLE = "writable";
var VALUE = "value";
var isDraft = (value) => !!value && !!value[DRAFT_STATE];
function isDraftable(value) {
  var _a;
  if (!value)
    return false;
  return isPlainObject$1(value) || isArray$1(value) || !!value[DRAFTABLE] || !!((_a = value[CONSTRUCTOR]) == null ? void 0 : _a[DRAFTABLE]) || isMap(value) || isSet(value);
}
var objectCtorString = O[PROTOTYPE][CONSTRUCTOR].toString();
var cachedCtorStrings = /* @__PURE__ */ new WeakMap();
function isPlainObject$1(value) {
  if (!value || !isObjectish(value))
    return false;
  const proto = getPrototypeOf$1(value);
  if (proto === null || proto === O[PROTOTYPE])
    return true;
  const Ctor = O.hasOwnProperty.call(proto, CONSTRUCTOR) && proto[CONSTRUCTOR];
  if (Ctor === Object)
    return true;
  if (!isFunction$2(Ctor))
    return false;
  let ctorString = cachedCtorStrings.get(Ctor);
  if (ctorString === void 0) {
    ctorString = Function.toString.call(Ctor);
    cachedCtorStrings.set(Ctor, ctorString);
  }
  return ctorString === objectCtorString;
}
function each(obj, iter, strict = true) {
  if (getArchtype(obj) === 0) {
    const keys = strict ? Reflect.ownKeys(obj) : O.keys(obj);
    keys.forEach((key) => {
      iter(key, obj[key], obj);
    });
  } else {
    obj.forEach((entry, index2) => iter(index2, entry, obj));
  }
}
function getArchtype(thing) {
  const state = thing[DRAFT_STATE];
  return state ? state.type_ : isArray$1(thing) ? 1 : isMap(thing) ? 2 : isSet(thing) ? 3 : 0;
}
var has = (thing, prop, type = getArchtype(thing)) => type === 2 ? thing.has(prop) : O[PROTOTYPE].hasOwnProperty.call(thing, prop);
var get$1 = (thing, prop, type = getArchtype(thing)) => (
  // @ts-ignore
  type === 2 ? thing.get(prop) : thing[prop]
);
var set = (thing, propOrOldValue, value, type = getArchtype(thing)) => {
  if (type === 2)
    thing.set(propOrOldValue, value);
  else if (type === 3) {
    thing.add(value);
  } else
    thing[propOrOldValue] = value;
};
function is$1(x, y) {
  if (x === y) {
    return x !== 0 || 1 / x === 1 / y;
  } else {
    return x !== x && y !== y;
  }
}
var isArray$1 = Array.isArray;
var isMap = (target) => target instanceof Map;
var isSet = (target) => target instanceof Set;
var isObjectish = (target) => typeof target === "object";
var isFunction$2 = (target) => typeof target === "function";
var isBoolean$2 = (target) => typeof target === "boolean";
function isArrayIndex(value) {
  const n2 = +value;
  return Number.isInteger(n2) && String(n2) === value;
}
var latest = (state) => state.copy_ || state.base_;
var getFinalValue = (state) => state.modified_ ? state.copy_ : state.base_;
function shallowCopy(base, strict) {
  if (isMap(base)) {
    return new Map(base);
  }
  if (isSet(base)) {
    return new Set(base);
  }
  if (isArray$1(base))
    return Array[PROTOTYPE].slice.call(base);
  const isPlain = isPlainObject$1(base);
  if (strict === true || strict === "class_only" && !isPlain) {
    const descriptors2 = O.getOwnPropertyDescriptors(base);
    delete descriptors2[DRAFT_STATE];
    let keys = Reflect.ownKeys(descriptors2);
    for (let i2 = 0; i2 < keys.length; i2++) {
      const key = keys[i2];
      const desc = descriptors2[key];
      if (desc[WRITABLE] === false) {
        desc[WRITABLE] = true;
        desc[CONFIGURABLE] = true;
      }
      if (desc.get || desc.set)
        descriptors2[key] = {
          [CONFIGURABLE]: true,
          [WRITABLE]: true,
          // could live with !!desc.set as well here...
          [ENUMERABLE]: desc[ENUMERABLE],
          [VALUE]: base[key]
        };
    }
    return O.create(getPrototypeOf$1(base), descriptors2);
  } else {
    const proto = getPrototypeOf$1(base);
    if (proto !== null && isPlain) {
      return { ...base };
    }
    const obj = O.create(proto);
    return O.assign(obj, base);
  }
}
function freeze(obj, deep = false) {
  if (isFrozen(obj) || isDraft(obj) || !isDraftable(obj))
    return obj;
  if (getArchtype(obj) > 1) {
    O.defineProperties(obj, {
      set: dontMutateMethodOverride,
      add: dontMutateMethodOverride,
      clear: dontMutateMethodOverride,
      delete: dontMutateMethodOverride
    });
  }
  O.freeze(obj);
  if (deep)
    each(
      obj,
      (_key, value) => {
        freeze(value, true);
      },
      false
    );
  return obj;
}
function dontMutateFrozenCollections() {
  die(2);
}
var dontMutateMethodOverride = {
  [VALUE]: dontMutateFrozenCollections
};
function isFrozen(obj) {
  if (obj === null || !isObjectish(obj))
    return true;
  return O.isFrozen(obj);
}
var PluginMapSet = "MapSet";
var PluginPatches = "Patches";
var PluginArrayMethods = "ArrayMethods";
var plugins = {};
function getPlugin(pluginKey) {
  const plugin = plugins[pluginKey];
  if (!plugin) {
    die(0, pluginKey);
  }
  return plugin;
}
var isPluginLoaded = (pluginKey) => !!plugins[pluginKey];
var currentScope;
var getCurrentScope = () => currentScope;
var createScope = (parent_, immer_) => ({
  drafts_: [],
  parent_,
  immer_,
  // Whenever the modified draft contains a draft from another scope, we
  // need to prevent auto-freezing so the unowned draft can be finalized.
  canAutoFreeze_: true,
  unfinalizedDrafts_: 0,
  handledSet_: /* @__PURE__ */ new Set(),
  processedForPatches_: /* @__PURE__ */ new Set(),
  mapSetPlugin_: isPluginLoaded(PluginMapSet) ? getPlugin(PluginMapSet) : void 0,
  arrayMethodsPlugin_: isPluginLoaded(PluginArrayMethods) ? getPlugin(PluginArrayMethods) : void 0
});
function usePatchesInScope(scope, patchListener) {
  if (patchListener) {
    scope.patchPlugin_ = getPlugin(PluginPatches);
    scope.patches_ = [];
    scope.inversePatches_ = [];
    scope.patchListener_ = patchListener;
  }
}
function revokeScope(scope) {
  leaveScope(scope);
  scope.drafts_.forEach(revokeDraft);
  scope.drafts_ = null;
}
function leaveScope(scope) {
  if (scope === currentScope) {
    currentScope = scope.parent_;
  }
}
var enterScope = (immer2) => currentScope = createScope(currentScope, immer2);
function revokeDraft(draft) {
  const state = draft[DRAFT_STATE];
  if (state.type_ === 0 || state.type_ === 1)
    state.revoke_();
  else
    state.revoked_ = true;
}
function processResult(result, scope) {
  scope.unfinalizedDrafts_ = scope.drafts_.length;
  const baseDraft = scope.drafts_[0];
  const isReplaced = result !== void 0 && result !== baseDraft;
  if (isReplaced) {
    if (baseDraft[DRAFT_STATE].modified_) {
      revokeScope(scope);
      die(4);
    }
    if (isDraftable(result)) {
      result = finalize(scope, result);
    }
    const { patchPlugin_ } = scope;
    if (patchPlugin_) {
      patchPlugin_.generateReplacementPatches_(
        baseDraft[DRAFT_STATE].base_,
        result,
        scope
      );
    }
  } else {
    result = finalize(scope, baseDraft);
  }
  maybeFreeze(scope, result, true);
  revokeScope(scope);
  if (scope.patches_) {
    scope.patchListener_(scope.patches_, scope.inversePatches_);
  }
  return result !== NOTHING ? result : void 0;
}
function finalize(rootScope, value) {
  if (isFrozen(value))
    return value;
  const state = value[DRAFT_STATE];
  if (!state) {
    const finalValue = handleValue(value, rootScope.handledSet_, rootScope);
    return finalValue;
  }
  if (!isSameScope(state, rootScope)) {
    return value;
  }
  if (!state.modified_) {
    return state.base_;
  }
  if (!state.finalized_) {
    const { callbacks_ } = state;
    if (callbacks_) {
      while (callbacks_.length > 0) {
        const callback = callbacks_.pop();
        callback(rootScope);
      }
    }
    generatePatchesAndFinalize(state, rootScope);
  }
  return state.copy_;
}
function maybeFreeze(scope, value, deep = false) {
  if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {
    freeze(value, deep);
  }
}
function markStateFinalized(state) {
  state.finalized_ = true;
  state.scope_.unfinalizedDrafts_--;
}
var isSameScope = (state, rootScope) => state.scope_ === rootScope;
var EMPTY_LOCATIONS_RESULT = [];
function updateDraftInParent(parent, draftValue, finalizedValue, originalKey) {
  const parentCopy = latest(parent);
  const parentType = parent.type_;
  if (originalKey !== void 0) {
    const currentValue = get$1(parentCopy, originalKey, parentType);
    if (currentValue === draftValue) {
      set(parentCopy, originalKey, finalizedValue, parentType);
      return;
    }
  }
  if (!parent.draftLocations_) {
    const draftLocations = parent.draftLocations_ = /* @__PURE__ */ new Map();
    each(parentCopy, (key, value) => {
      if (isDraft(value)) {
        const keys = draftLocations.get(value) || [];
        keys.push(key);
        draftLocations.set(value, keys);
      }
    });
  }
  const locations = parent.draftLocations_.get(draftValue) ?? EMPTY_LOCATIONS_RESULT;
  for (const location of locations) {
    set(parentCopy, location, finalizedValue, parentType);
  }
}
function registerChildFinalizationCallback(parent, child, key) {
  parent.callbacks_.push(function childCleanup(rootScope) {
    var _a;
    const state = child;
    if (!state || !isSameScope(state, rootScope)) {
      return;
    }
    (_a = rootScope.mapSetPlugin_) == null ? void 0 : _a.fixSetContents(state);
    const finalizedValue = getFinalValue(state);
    updateDraftInParent(parent, state.draft_ ?? state, finalizedValue, key);
    generatePatchesAndFinalize(state, rootScope);
  });
}
function generatePatchesAndFinalize(state, rootScope) {
  var _a;
  const shouldFinalize = state.modified_ && !state.finalized_ && (state.type_ === 3 || state.type_ === 1 && state.allIndicesReassigned_ || (((_a = state.assigned_) == null ? void 0 : _a.size) ?? 0) > 0);
  if (shouldFinalize) {
    const { patchPlugin_ } = rootScope;
    if (patchPlugin_) {
      const basePath = patchPlugin_.getPath(state);
      if (basePath) {
        patchPlugin_.generatePatches_(state, basePath, rootScope);
      }
    }
    markStateFinalized(state);
  }
}
function handleCrossReference(target, key, value) {
  const { scope_ } = target;
  if (isDraft(value)) {
    const state = value[DRAFT_STATE];
    if (isSameScope(state, scope_)) {
      state.callbacks_.push(function crossReferenceCleanup() {
        prepareCopy(target);
        const finalizedValue = getFinalValue(state);
        updateDraftInParent(target, value, finalizedValue, key);
      });
    }
  } else if (isDraftable(value)) {
    target.callbacks_.push(function nestedDraftCleanup() {
      const targetCopy = latest(target);
      if (target.type_ === 3) {
        if (targetCopy.has(value)) {
          handleValue(value, scope_.handledSet_, scope_);
        }
      } else {
        if (get$1(targetCopy, key, target.type_) === value) {
          if (scope_.drafts_.length > 1 && (target.assigned_.get(key) ?? false) === true && target.copy_) {
            handleValue(
              get$1(target.copy_, key, target.type_),
              scope_.handledSet_,
              scope_
            );
          }
        }
      }
    });
  }
}
function handleValue(target, handledSet, rootScope) {
  if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {
    return target;
  }
  if (isDraft(target) || handledSet.has(target) || !isDraftable(target) || isFrozen(target)) {
    return target;
  }
  handledSet.add(target);
  each(target, (key, value) => {
    if (isDraft(value)) {
      const state = value[DRAFT_STATE];
      if (isSameScope(state, rootScope)) {
        const updatedValue = getFinalValue(state);
        set(target, key, updatedValue, target.type_);
        markStateFinalized(state);
      }
    } else if (isDraftable(value)) {
      handleValue(value, handledSet, rootScope);
    }
  });
  return target;
}
function createProxyProxy(base, parent) {
  const baseIsArray = isArray$1(base);
  const state = {
    type_: baseIsArray ? 1 : 0,
    // Track which produce call this is associated with.
    scope_: parent ? parent.scope_ : getCurrentScope(),
    // True for both shallow and deep changes.
    modified_: false,
    // Used during finalization.
    finalized_: false,
    // Track which properties have been assigned (true) or deleted (false).
    // actually instantiated in `prepareCopy()`
    assigned_: void 0,
    // The parent draft state.
    parent_: parent,
    // The base state.
    base_: base,
    // The base proxy.
    draft_: null,
    // set below
    // The base copy with any updated values.
    copy_: null,
    // Called by the `produce` function.
    revoke_: null,
    isManual_: false,
    // `callbacks` actually gets assigned in `createProxy`
    callbacks_: void 0
  };
  let target = state;
  let traps = objectTraps;
  if (baseIsArray) {
    target = [state];
    traps = arrayTraps;
  }
  const { revoke, proxy } = Proxy.revocable(target, traps);
  state.draft_ = proxy;
  state.revoke_ = revoke;
  return [proxy, state];
}
var objectTraps = {
  get(state, prop) {
    if (prop === DRAFT_STATE)
      return state;
    let arrayPlugin = state.scope_.arrayMethodsPlugin_;
    const isArrayWithStringProp = state.type_ === 1 && typeof prop === "string";
    if (isArrayWithStringProp) {
      if (arrayPlugin == null ? void 0 : arrayPlugin.isArrayOperationMethod(prop)) {
        return arrayPlugin.createMethodInterceptor(state, prop);
      }
    }
    const source = latest(state);
    if (!has(source, prop, state.type_)) {
      return readPropFromProto(state, source, prop);
    }
    const value = source[prop];
    if (state.finalized_ || !isDraftable(value)) {
      return value;
    }
    if (isArrayWithStringProp && state.operationMethod && (arrayPlugin == null ? void 0 : arrayPlugin.isMutatingArrayMethod(
      state.operationMethod
    )) && isArrayIndex(prop)) {
      return value;
    }
    if (value === peek(state.base_, prop)) {
      prepareCopy(state);
      const childKey = state.type_ === 1 ? +prop : prop;
      const childDraft = createProxy$1(state.scope_, value, state, childKey);
      return state.copy_[childKey] = childDraft;
    }
    return value;
  },
  has(state, prop) {
    return prop in latest(state);
  },
  ownKeys(state) {
    return Reflect.ownKeys(latest(state));
  },
  set(state, prop, value) {
    const desc = getDescriptorFromProto(latest(state), prop);
    if (desc == null ? void 0 : desc.set) {
      desc.set.call(state.draft_, value);
      return true;
    }
    if (!state.modified_) {
      const current2 = peek(latest(state), prop);
      const currentState = current2 == null ? void 0 : current2[DRAFT_STATE];
      if (currentState && currentState.base_ === value) {
        state.copy_[prop] = value;
        state.assigned_.set(prop, false);
        return true;
      }
      if (is$1(value, current2) && (value !== void 0 || has(state.base_, prop, state.type_)))
        return true;
      prepareCopy(state);
      markChanged(state);
    }
    if (state.copy_[prop] === value && // special case: handle new props with value 'undefined'
    (value !== void 0 || prop in state.copy_) || // special case: NaN
    Number.isNaN(value) && Number.isNaN(state.copy_[prop]))
      return true;
    state.copy_[prop] = value;
    state.assigned_.set(prop, true);
    handleCrossReference(state, prop, value);
    return true;
  },
  deleteProperty(state, prop) {
    prepareCopy(state);
    if (peek(state.base_, prop) !== void 0 || prop in state.base_) {
      state.assigned_.set(prop, false);
      markChanged(state);
    } else {
      state.assigned_.delete(prop);
    }
    if (state.copy_) {
      delete state.copy_[prop];
    }
    return true;
  },
  // Note: We never coerce `desc.value` into an Immer draft, because we can't make
  // the same guarantee in ES5 mode.
  getOwnPropertyDescriptor(state, prop) {
    const owner = latest(state);
    const desc = Reflect.getOwnPropertyDescriptor(owner, prop);
    if (!desc)
      return desc;
    return {
      [WRITABLE]: true,
      [CONFIGURABLE]: state.type_ !== 1 || prop !== "length",
      [ENUMERABLE]: desc[ENUMERABLE],
      [VALUE]: owner[prop]
    };
  },
  defineProperty() {
    die(11);
  },
  getPrototypeOf(state) {
    return getPrototypeOf$1(state.base_);
  },
  setPrototypeOf() {
    die(12);
  }
};
var arrayTraps = {};
for (let key in objectTraps) {
  let fn = objectTraps[key];
  arrayTraps[key] = function() {
    const args = arguments;
    args[0] = args[0][0];
    return fn.apply(this, args);
  };
}
arrayTraps.deleteProperty = function(state, prop) {
  return arrayTraps.set.call(this, state, prop, void 0);
};
arrayTraps.set = function(state, prop, value) {
  return objectTraps.set.call(this, state[0], prop, value, state[0]);
};
function peek(draft, prop) {
  const state = draft[DRAFT_STATE];
  const source = state ? latest(state) : draft;
  return source[prop];
}
function readPropFromProto(state, source, prop) {
  var _a;
  const desc = getDescriptorFromProto(source, prop);
  return desc ? VALUE in desc ? desc[VALUE] : (
    // This is a very special case, if the prop is a getter defined by the
    // prototype, we should invoke it with the draft as context!
    (_a = desc.get) == null ? void 0 : _a.call(state.draft_)
  ) : void 0;
}
function getDescriptorFromProto(source, prop) {
  if (!(prop in source))
    return void 0;
  let proto = getPrototypeOf$1(source);
  while (proto) {
    const desc = Object.getOwnPropertyDescriptor(proto, prop);
    if (desc)
      return desc;
    proto = getPrototypeOf$1(proto);
  }
  return void 0;
}
function markChanged(state) {
  if (!state.modified_) {
    state.modified_ = true;
    if (state.parent_) {
      markChanged(state.parent_);
    }
  }
}
function prepareCopy(state) {
  if (!state.copy_) {
    state.assigned_ = /* @__PURE__ */ new Map();
    state.copy_ = shallowCopy(
      state.base_,
      state.scope_.immer_.useStrictShallowCopy_
    );
  }
}
var Immer2 = class {
  constructor(config) {
    this.autoFreeze_ = true;
    this.useStrictShallowCopy_ = false;
    this.useStrictIteration_ = false;
    this.produce = (base, recipe, patchListener) => {
      if (isFunction$2(base) && !isFunction$2(recipe)) {
        const defaultBase = recipe;
        recipe = base;
        const self2 = this;
        return function curriedProduce(base2 = defaultBase, ...args) {
          return self2.produce(base2, (draft) => recipe.call(this, draft, ...args));
        };
      }
      if (!isFunction$2(recipe))
        die(6);
      if (patchListener !== void 0 && !isFunction$2(patchListener))
        die(7);
      let result;
      if (isDraftable(base)) {
        const scope = enterScope(this);
        const proxy = createProxy$1(scope, base, void 0);
        let hasError = true;
        try {
          result = recipe(proxy);
          hasError = false;
        } finally {
          if (hasError)
            revokeScope(scope);
          else
            leaveScope(scope);
        }
        usePatchesInScope(scope, patchListener);
        return processResult(result, scope);
      } else if (!base || !isObjectish(base)) {
        result = recipe(base);
        if (result === void 0)
          result = base;
        if (result === NOTHING)
          result = void 0;
        if (this.autoFreeze_)
          freeze(result, true);
        if (patchListener) {
          const p2 = [];
          const ip = [];
          getPlugin(PluginPatches).generateReplacementPatches_(base, result, {
            patches_: p2,
            inversePatches_: ip
          });
          patchListener(p2, ip);
        }
        return result;
      } else
        die(1, base);
    };
    this.produceWithPatches = (base, recipe) => {
      if (isFunction$2(base)) {
        return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args));
      }
      let patches, inversePatches;
      const result = this.produce(base, recipe, (p2, ip) => {
        patches = p2;
        inversePatches = ip;
      });
      return [result, patches, inversePatches];
    };
    if (isBoolean$2(config == null ? void 0 : config.autoFreeze))
      this.setAutoFreeze(config.autoFreeze);
    if (isBoolean$2(config == null ? void 0 : config.useStrictShallowCopy))
      this.setUseStrictShallowCopy(config.useStrictShallowCopy);
    if (isBoolean$2(config == null ? void 0 : config.useStrictIteration))
      this.setUseStrictIteration(config.useStrictIteration);
  }
  createDraft(base) {
    if (!isDraftable(base))
      die(8);
    if (isDraft(base))
      base = current(base);
    const scope = enterScope(this);
    const proxy = createProxy$1(scope, base, void 0);
    proxy[DRAFT_STATE].isManual_ = true;
    leaveScope(scope);
    return proxy;
  }
  finishDraft(draft, patchListener) {
    const state = draft && draft[DRAFT_STATE];
    if (!state || !state.isManual_)
      die(9);
    const { scope_: scope } = state;
    usePatchesInScope(scope, patchListener);
    return processResult(void 0, scope);
  }
  /**
   * Pass true to automatically freeze all copies created by Immer.
   *
   * By default, auto-freezing is enabled.
   */
  setAutoFreeze(value) {
    this.autoFreeze_ = value;
  }
  /**
   * Pass true to enable strict shallow copy.
   *
   * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.
   */
  setUseStrictShallowCopy(value) {
    this.useStrictShallowCopy_ = value;
  }
  /**
   * Pass false to use faster iteration that skips non-enumerable properties
   * but still handles symbols for compatibility.
   *
   * By default, strict iteration is enabled (includes all own properties).
   */
  setUseStrictIteration(value) {
    this.useStrictIteration_ = value;
  }
  shouldUseStrictIteration() {
    return this.useStrictIteration_;
  }
  applyPatches(base, patches) {
    let i2;
    for (i2 = patches.length - 1; i2 >= 0; i2--) {
      const patch = patches[i2];
      if (patch.path.length === 0 && patch.op === "replace") {
        base = patch.value;
        break;
      }
    }
    if (i2 > -1) {
      patches = patches.slice(i2 + 1);
    }
    const applyPatchesImpl = getPlugin(PluginPatches).applyPatches_;
    if (isDraft(base)) {
      return applyPatchesImpl(base, patches);
    }
    return this.produce(
      base,
      (draft) => applyPatchesImpl(draft, patches)
    );
  }
};
function createProxy$1(rootScope, value, parent, key) {
  const [draft, state] = isMap(value) ? getPlugin(PluginMapSet).proxyMap_(value, parent) : isSet(value) ? getPlugin(PluginMapSet).proxySet_(value, parent) : createProxyProxy(value, parent);
  const scope = (parent == null ? void 0 : parent.scope_) ?? getCurrentScope();
  scope.drafts_.push(draft);
  state.callbacks_ = (parent == null ? void 0 : parent.callbacks_) ?? [];
  state.key_ = key;
  if (parent && key !== void 0) {
    registerChildFinalizationCallback(parent, state, key);
  } else {
    state.callbacks_.push(function rootDraftCleanup(rootScope2) {
      var _a;
      (_a = rootScope2.mapSetPlugin_) == null ? void 0 : _a.fixSetContents(state);
      const { patchPlugin_ } = rootScope2;
      if (state.modified_ && patchPlugin_) {
        patchPlugin_.generatePatches_(state, [], rootScope2);
      }
    });
  }
  return draft;
}
function current(value) {
  if (!isDraft(value))
    die(10, value);
  return currentImpl(value);
}
function currentImpl(value) {
  if (!isDraftable(value) || isFrozen(value))
    return value;
  const state = value[DRAFT_STATE];
  let copy2;
  let strict = true;
  if (state) {
    if (!state.modified_)
      return state.base_;
    state.finalized_ = true;
    copy2 = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);
    strict = state.scope_.immer_.shouldUseStrictIteration();
  } else {
    copy2 = shallowCopy(value, true);
  }
  each(
    copy2,
    (key, childValue) => {
      set(copy2, key, currentImpl(childValue));
    },
    strict
  );
  if (state) {
    state.finalized_ = false;
  }
  return copy2;
}
var immer = new Immer2();
var produce = immer.produce;
function createThunkMiddleware(extraArgument) {
  const middleware = ({ dispatch, getState }) => (next) => (action) => {
    if (typeof action === "function") {
      return action(dispatch, getState, extraArgument);
    }
    return next(action);
  };
  return middleware;
}
var thunk = createThunkMiddleware();
var withExtraArgument = createThunkMiddleware;
var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() {
  if (arguments.length === 0) return void 0;
  if (typeof arguments[0] === "object") return compose;
  return compose.apply(null, arguments);
};
var hasMatchFunction = (v2) => {
  return v2 && typeof v2.match === "function";
};
function createAction(type, prepareAction) {
  function actionCreator(...args) {
    if (prepareAction) {
      let prepared = prepareAction(...args);
      if (!prepared) {
        throw new Error(formatProdErrorMessage(0));
      }
      return {
        type,
        payload: prepared.payload,
        ..."meta" in prepared && {
          meta: prepared.meta
        },
        ..."error" in prepared && {
          error: prepared.error
        }
      };
    }
    return {
      type,
      payload: args[0]
    };
  }
  actionCreator.toString = () => `${type}`;
  actionCreator.type = type;
  actionCreator.match = (action) => isAction(action) && action.type === type;
  return actionCreator;
}
var Tuple = class _Tuple extends Array {
  constructor(...items) {
    super(...items);
    Object.setPrototypeOf(this, _Tuple.prototype);
  }
  static get [Symbol.species]() {
    return _Tuple;
  }
  concat(...arr) {
    return super.concat.apply(this, arr);
  }
  prepend(...arr) {
    if (arr.length === 1 && Array.isArray(arr[0])) {
      return new _Tuple(...arr[0].concat(this));
    }
    return new _Tuple(...arr.concat(this));
  }
};
function freezeDraftable(val) {
  return isDraftable(val) ? produce(val, () => {
  }) : val;
}
function getOrInsertComputed(map, key, compute) {
  if (map.has(key)) return map.get(key);
  return map.set(key, compute(key)).get(key);
}
function isBoolean$1(x) {
  return typeof x === "boolean";
}
var buildGetDefaultMiddleware = () => function getDefaultMiddleware(options) {
  const {
    thunk: thunk$1 = true,
    immutableCheck = true,
    serializableCheck = true,
    actionCreatorCheck = true
  } = options ?? {};
  let middlewareArray = new Tuple();
  if (thunk$1) {
    if (isBoolean$1(thunk$1)) {
      middlewareArray.push(thunk);
    } else {
      middlewareArray.push(withExtraArgument(thunk$1.extraArgument));
    }
  }
  return middlewareArray;
};
var SHOULD_AUTOBATCH = "RTK_autoBatch";
var createQueueWithTimer = (timeout) => {
  return (notify) => {
    setTimeout(notify, timeout);
  };
};
var autoBatchEnhancer = (options = {
  type: "raf"
}) => (next) => (...args) => {
  const store2 = next(...args);
  let notifying = true;
  let shouldNotifyAtEndOfTick = false;
  let notificationQueued = false;
  const listeners = /* @__PURE__ */ new Set();
  const queueCallback = options.type === "tick" ? queueMicrotask : options.type === "raf" ? (
    // requestAnimationFrame won't exist in SSR environments. Fall back to a vague approximation just to keep from erroring.
    typeof window !== "undefined" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10)
  ) : options.type === "callback" ? options.queueNotification : createQueueWithTimer(options.timeout);
  const notifyListeners = () => {
    notificationQueued = false;
    if (shouldNotifyAtEndOfTick) {
      shouldNotifyAtEndOfTick = false;
      listeners.forEach((l2) => l2());
    }
  };
  return Object.assign({}, store2, {
    // Override the base `store.subscribe` method to keep original listeners
    // from running if we're delaying notifications
    subscribe(listener2) {
      const wrappedListener = () => notifying && listener2();
      const unsubscribe = store2.subscribe(wrappedListener);
      listeners.add(listener2);
      return () => {
        unsubscribe();
        listeners.delete(listener2);
      };
    },
    // Override the base `store.dispatch` method so that we can check actions
    // for the `shouldAutoBatch` flag and determine if batching is active
    dispatch(action) {
      var _a;
      try {
        notifying = !((_a = action == null ? void 0 : action.meta) == null ? void 0 : _a[SHOULD_AUTOBATCH]);
        shouldNotifyAtEndOfTick = !notifying;
        if (shouldNotifyAtEndOfTick) {
          if (!notificationQueued) {
            notificationQueued = true;
            queueCallback(notifyListeners);
          }
        }
        return store2.dispatch(action);
      } finally {
        notifying = true;
      }
    }
  });
};
var buildGetDefaultEnhancers = (middlewareEnhancer) => function getDefaultEnhancers(options) {
  const {
    autoBatch = true
  } = options ?? {};
  let enhancerArray = new Tuple(middlewareEnhancer);
  if (autoBatch) {
    enhancerArray.push(autoBatchEnhancer(typeof autoBatch === "object" ? autoBatch : void 0));
  }
  return enhancerArray;
};
function configureStore(options) {
  const getDefaultMiddleware = buildGetDefaultMiddleware();
  const {
    reducer = void 0,
    middleware,
    devTools = true,
    preloadedState: preloadedState2 = void 0,
    enhancers = void 0
  } = options || {};
  let rootReducer;
  if (typeof reducer === "function") {
    rootReducer = reducer;
  } else if (isPlainObject$2(reducer)) {
    rootReducer = combineReducers(reducer);
  } else {
    throw new Error(formatProdErrorMessage(1));
  }
  let finalMiddleware;
  if (typeof middleware === "function") {
    finalMiddleware = middleware(getDefaultMiddleware);
  } else {
    finalMiddleware = getDefaultMiddleware();
  }
  let finalCompose = compose;
  if (devTools) {
    finalCompose = composeWithDevTools({
      // Enable capture of stack traces for dispatched Redux actions
      trace: false,
      ...typeof devTools === "object" && devTools
    });
  }
  const middlewareEnhancer = applyMiddleware(...finalMiddleware);
  const getDefaultEnhancers = buildGetDefaultEnhancers(middlewareEnhancer);
  let storeEnhancers = typeof enhancers === "function" ? enhancers(getDefaultEnhancers) : getDefaultEnhancers();
  const composedEnhancer = finalCompose(...storeEnhancers);
  return createStore(rootReducer, preloadedState2, composedEnhancer);
}
function executeReducerBuilderCallback(builderCallback) {
  const actionsMap = {};
  const actionMatchers = [];
  let defaultCaseReducer;
  const builder = {
    addCase(typeOrActionCreator, reducer) {
      const type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
      if (!type) {
        throw new Error(formatProdErrorMessage(28));
      }
      if (type in actionsMap) {
        throw new Error(formatProdErrorMessage(29));
      }
      actionsMap[type] = reducer;
      return builder;
    },
    addAsyncThunk(asyncThunk, reducers) {
      if (reducers.pending) actionsMap[asyncThunk.pending.type] = reducers.pending;
      if (reducers.rejected) actionsMap[asyncThunk.rejected.type] = reducers.rejected;
      if (reducers.fulfilled) actionsMap[asyncThunk.fulfilled.type] = reducers.fulfilled;
      if (reducers.settled) actionMatchers.push({
        matcher: asyncThunk.settled,
        reducer: reducers.settled
      });
      return builder;
    },
    addMatcher(matcher, reducer) {
      actionMatchers.push({
        matcher,
        reducer
      });
      return builder;
    },
    addDefaultCase(reducer) {
      defaultCaseReducer = reducer;
      return builder;
    }
  };
  builderCallback(builder);
  return [actionsMap, actionMatchers, defaultCaseReducer];
}
function isStateFunction(x) {
  return typeof x === "function";
}
function createReducer(initialState2, mapOrBuilderCallback) {
  let [actionsMap, finalActionMatchers, finalDefaultCaseReducer] = executeReducerBuilderCallback(mapOrBuilderCallback);
  let getInitialState;
  if (isStateFunction(initialState2)) {
    getInitialState = () => freezeDraftable(initialState2());
  } else {
    const frozenInitialState = freezeDraftable(initialState2);
    getInitialState = () => frozenInitialState;
  }
  function reducer(state = getInitialState(), action) {
    let caseReducers = [actionsMap[action.type], ...finalActionMatchers.filter(({
      matcher
    }) => matcher(action)).map(({
      reducer: reducer2
    }) => reducer2)];
    if (caseReducers.filter((cr) => !!cr).length === 0) {
      caseReducers = [finalDefaultCaseReducer];
    }
    return caseReducers.reduce((previousState, caseReducer) => {
      if (caseReducer) {
        if (isDraft(previousState)) {
          const draft = previousState;
          const result = caseReducer(draft, action);
          if (result === void 0) {
            return previousState;
          }
          return result;
        } else if (!isDraftable(previousState)) {
          const result = caseReducer(previousState, action);
          if (result === void 0) {
            if (previousState === null) {
              return previousState;
            }
            throw Error("A case reducer on a non-draftable value must not return undefined");
          }
          return result;
        } else {
          return produce(previousState, (draft) => {
            return caseReducer(draft, action);
          });
        }
      }
      return previousState;
    }, state);
  }
  reducer.getInitialState = getInitialState;
  return reducer;
}
var matches = (matcher, action) => {
  if (hasMatchFunction(matcher)) {
    return matcher.match(action);
  } else {
    return matcher(action);
  }
};
function isAnyOf(...matchers) {
  return (action) => {
    return matchers.some((matcher) => matches(matcher, action));
  };
}
var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";
var nanoid = (size = 21) => {
  let id = "";
  let i2 = size;
  while (i2--) {
    id += urlAlphabet[Math.random() * 64 | 0];
  }
  return id;
};
var commonProperties = ["name", "message", "stack", "code"];
var RejectWithValue = class {
  constructor(payload, meta) {
    /*
    type-only property to distinguish between RejectWithValue and FulfillWithMeta
    does not exist at runtime
    */
    __publicField(this, "_type");
    this.payload = payload;
    this.meta = meta;
  }
};
var FulfillWithMeta = class {
  constructor(payload, meta) {
    /*
    type-only property to distinguish between RejectWithValue and FulfillWithMeta
    does not exist at runtime
    */
    __publicField(this, "_type");
    this.payload = payload;
    this.meta = meta;
  }
};
var miniSerializeError = (value) => {
  if (typeof value === "object" && value !== null) {
    const simpleError = {};
    for (const property of commonProperties) {
      if (typeof value[property] === "string") {
        simpleError[property] = value[property];
      }
    }
    return simpleError;
  }
  return {
    message: String(value)
  };
};
var externalAbortMessage = "External signal was aborted";
var createAsyncThunk = /* @__PURE__ */ (() => {
  function createAsyncThunk2(typePrefix, payloadCreator, options) {
    const fulfilled = createAction(typePrefix + "/fulfilled", (payload, requestId, arg, meta) => ({
      payload,
      meta: {
        ...meta || {},
        arg,
        requestId,
        requestStatus: "fulfilled"
      }
    }));
    const pending = createAction(typePrefix + "/pending", (requestId, arg, meta) => ({
      payload: void 0,
      meta: {
        ...meta || {},
        arg,
        requestId,
        requestStatus: "pending"
      }
    }));
    const rejected = createAction(typePrefix + "/rejected", (error, requestId, arg, payload, meta) => ({
      payload,
      error: (options && options.serializeError || miniSerializeError)(error || "Rejected"),
      meta: {
        ...meta || {},
        arg,
        requestId,
        rejectedWithValue: !!payload,
        requestStatus: "rejected",
        aborted: (error == null ? void 0 : error.name) === "AbortError",
        condition: (error == null ? void 0 : error.name) === "ConditionError"
      }
    }));
    function actionCreator(arg, {
      signal
    } = {}) {
      return (dispatch, getState, extra) => {
        const requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid();
        const abortController = new AbortController();
        let abortHandler;
        let abortReason;
        function abort(reason) {
          abortReason = reason;
          abortController.abort();
        }
        if (signal) {
          if (signal.aborted) {
            abort(externalAbortMessage);
          } else {
            signal.addEventListener("abort", () => abort(externalAbortMessage), {
              once: true
            });
          }
        }
        const promise = async function() {
          var _a, _b;
          let finalAction;
          try {
            let conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, {
              getState,
              extra
            });
            if (isThenable$1(conditionResult)) {
              conditionResult = await conditionResult;
            }
            if (conditionResult === false || abortController.signal.aborted) {
              throw {
                name: "ConditionError",
                message: "Aborted due to condition callback returning false."
              };
            }
            const abortedPromise = new Promise((_2, reject) => {
              abortHandler = () => {
                reject({
                  name: "AbortError",
                  message: abortReason || "Aborted"
                });
              };
              abortController.signal.addEventListener("abort", abortHandler, {
                once: true
              });
            });
            dispatch(pending(requestId, arg, (_b = options == null ? void 0 : options.getPendingMeta) == null ? void 0 : _b.call(options, {
              requestId,
              arg
            }, {
              getState,
              extra
            })));
            finalAction = await Promise.race([abortedPromise, Promise.resolve(payloadCreator(arg, {
              dispatch,
              getState,
              extra,
              requestId,
              signal: abortController.signal,
              abort,
              rejectWithValue: (value, meta) => {
                return new RejectWithValue(value, meta);
              },
              fulfillWithValue: (value, meta) => {
                return new FulfillWithMeta(value, meta);
              }
            })).then((result) => {
              if (result instanceof RejectWithValue) {
                throw result;
              }
              if (result instanceof FulfillWithMeta) {
                return fulfilled(result.payload, requestId, arg, result.meta);
              }
              return fulfilled(result, requestId, arg);
            })]);
          } catch (err) {
            finalAction = err instanceof RejectWithValue ? rejected(null, requestId, arg, err.payload, err.meta) : rejected(err, requestId, arg);
          } finally {
            if (abortHandler) {
              abortController.signal.removeEventListener("abort", abortHandler);
            }
          }
          const skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;
          if (!skipDispatch) {
            dispatch(finalAction);
          }
          return finalAction;
        }();
        return Object.assign(promise, {
          abort,
          requestId,
          arg,
          unwrap() {
            return promise.then(unwrapResult);
          }
        });
      };
    }
    return Object.assign(actionCreator, {
      pending,
      rejected,
      fulfilled,
      settled: isAnyOf(rejected, fulfilled),
      typePrefix
    });
  }
  createAsyncThunk2.withTypes = () => createAsyncThunk2;
  return createAsyncThunk2;
})();
function unwrapResult(action) {
  if (action.meta && action.meta.rejectedWithValue) {
    throw action.payload;
  }
  if (action.error) {
    throw action.error;
  }
  return action.payload;
}
function isThenable$1(value) {
  return value !== null && typeof value === "object" && typeof value.then === "function";
}
var asyncThunkSymbol = /* @__PURE__ */ Symbol.for("rtk-slice-createasyncthunk");
function getType(slice, actionKey) {
  return `${slice}/${actionKey}`;
}
function buildCreateSlice({
  creators
} = {}) {
  var _a;
  const cAT = (_a = creators == null ? void 0 : creators.asyncThunk) == null ? void 0 : _a[asyncThunkSymbol];
  return function createSlice2(options) {
    const {
      name,
      reducerPath = name
    } = options;
    if (!name) {
      throw new Error(formatProdErrorMessage(11));
    }
    const reducers = (typeof options.reducers === "function" ? options.reducers(buildReducerCreators()) : options.reducers) || {};
    const reducerNames = Object.keys(reducers);
    const context = {
      sliceCaseReducersByName: {},
      sliceCaseReducersByType: {},
      actionCreators: {},
      sliceMatchers: []
    };
    const contextMethods = {
      addCase(typeOrActionCreator, reducer2) {
        const type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
        if (!type) {
          throw new Error(formatProdErrorMessage(12));
        }
        if (type in context.sliceCaseReducersByType) {
          throw new Error(formatProdErrorMessage(13));
        }
        context.sliceCaseReducersByType[type] = reducer2;
        return contextMethods;
      },
      addMatcher(matcher, reducer2) {
        context.sliceMatchers.push({
          matcher,
          reducer: reducer2
        });
        return contextMethods;
      },
      exposeAction(name2, actionCreator) {
        context.actionCreators[name2] = actionCreator;
        return contextMethods;
      },
      exposeCaseReducer(name2, reducer2) {
        context.sliceCaseReducersByName[name2] = reducer2;
        return contextMethods;
      }
    };
    reducerNames.forEach((reducerName) => {
      const reducerDefinition = reducers[reducerName];
      const reducerDetails = {
        reducerName,
        type: getType(name, reducerName),
        createNotation: typeof options.reducers === "function"
      };
      if (isAsyncThunkSliceReducerDefinition(reducerDefinition)) {
        handleThunkCaseReducerDefinition(reducerDetails, reducerDefinition, contextMethods, cAT);
      } else {
        handleNormalReducerDefinition(reducerDetails, reducerDefinition, contextMethods);
      }
    });
    function buildReducer() {
      const [extraReducers = {}, actionMatchers = [], defaultCaseReducer = void 0] = typeof options.extraReducers === "function" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers];
      const finalCaseReducers = {
        ...extraReducers,
        ...context.sliceCaseReducersByType
      };
      return createReducer(options.initialState, (builder) => {
        for (let key in finalCaseReducers) {
          builder.addCase(key, finalCaseReducers[key]);
        }
        for (let sM of context.sliceMatchers) {
          builder.addMatcher(sM.matcher, sM.reducer);
        }
        for (let m2 of actionMatchers) {
          builder.addMatcher(m2.matcher, m2.reducer);
        }
        if (defaultCaseReducer) {
          builder.addDefaultCase(defaultCaseReducer);
        }
      });
    }
    const selectSelf = (state) => state;
    const injectedSelectorCache = /* @__PURE__ */ new Map();
    const injectedStateCache = /* @__PURE__ */ new WeakMap();
    let _reducer;
    function reducer(state, action) {
      if (!_reducer) _reducer = buildReducer();
      return _reducer(state, action);
    }
    function getInitialState() {
      if (!_reducer) _reducer = buildReducer();
      return _reducer.getInitialState();
    }
    function makeSelectorProps(reducerPath2, injected = false) {
      function selectSlice(state) {
        let sliceState = state[reducerPath2];
        if (typeof sliceState === "undefined") {
          if (injected) {
            sliceState = getOrInsertComputed(injectedStateCache, selectSlice, getInitialState);
          }
        }
        return sliceState;
      }
      function getSelectors(selectState = selectSelf) {
        const selectorCache = getOrInsertComputed(injectedSelectorCache, injected, () => /* @__PURE__ */ new WeakMap());
        return getOrInsertComputed(selectorCache, selectState, () => {
          const map = {};
          for (const [name2, selector] of Object.entries(options.selectors ?? {})) {
            map[name2] = wrapSelector(selector, selectState, () => getOrInsertComputed(injectedStateCache, selectState, getInitialState), injected);
          }
          return map;
        });
      }
      return {
        reducerPath: reducerPath2,
        getSelectors,
        get selectors() {
          return getSelectors(selectSlice);
        },
        selectSlice
      };
    }
    const slice = {
      name,
      reducer,
      actions: context.actionCreators,
      caseReducers: context.sliceCaseReducersByName,
      getInitialState,
      ...makeSelectorProps(reducerPath),
      injectInto(injectable, {
        reducerPath: pathOpt,
        ...config
      } = {}) {
        const newReducerPath = pathOpt ?? reducerPath;
        injectable.inject({
          reducerPath: newReducerPath,
          reducer
        }, config);
        return {
          ...slice,
          ...makeSelectorProps(newReducerPath, true)
        };
      }
    };
    return slice;
  };
}
function wrapSelector(selector, selectState, getInitialState, injected) {
  function wrapper(rootState, ...args) {
    let sliceState = selectState(rootState);
    if (typeof sliceState === "undefined") {
      if (injected) {
        sliceState = getInitialState();
      }
    }
    return selector(sliceState, ...args);
  }
  wrapper.unwrapped = selector;
  return wrapper;
}
var createSlice = /* @__PURE__ */ buildCreateSlice();
function buildReducerCreators() {
  function asyncThunk(payloadCreator, config) {
    return {
      _reducerDefinitionType: "asyncThunk",
      payloadCreator,
      ...config
    };
  }
  asyncThunk.withTypes = () => asyncThunk;
  return {
    reducer(caseReducer) {
      return Object.assign({
        // hack so the wrapping function has the same name as the original
        // we need to create a wrapper so the `reducerDefinitionType` is not assigned to the original
        [caseReducer.name](...args) {
          return caseReducer(...args);
        }
      }[caseReducer.name], {
        _reducerDefinitionType: "reducer"
        /* reducer */
      });
    },
    preparedReducer(prepare, reducer) {
      return {
        _reducerDefinitionType: "reducerWithPrepare",
        prepare,
        reducer
      };
    },
    asyncThunk
  };
}
function handleNormalReducerDefinition({
  type,
  reducerName,
  createNotation
}, maybeReducerWithPrepare, context) {
  let caseReducer;
  let prepareCallback;
  if ("reducer" in maybeReducerWithPrepare) {
    if (createNotation && !isCaseReducerWithPrepareDefinition(maybeReducerWithPrepare)) {
      throw new Error(formatProdErrorMessage(17));
    }
    caseReducer = maybeReducerWithPrepare.reducer;
    prepareCallback = maybeReducerWithPrepare.prepare;
  } else {
    caseReducer = maybeReducerWithPrepare;
  }
  context.addCase(type, caseReducer).exposeCaseReducer(reducerName, caseReducer).exposeAction(reducerName, prepareCallback ? createAction(type, prepareCallback) : createAction(type));
}
function isAsyncThunkSliceReducerDefinition(reducerDefinition) {
  return reducerDefinition._reducerDefinitionType === "asyncThunk";
}
function isCaseReducerWithPrepareDefinition(reducerDefinition) {
  return reducerDefinition._reducerDefinitionType === "reducerWithPrepare";
}
function handleThunkCaseReducerDefinition({
  type,
  reducerName
}, reducerDefinition, context, cAT) {
  if (!cAT) {
    throw new Error(formatProdErrorMessage(18));
  }
  const {
    payloadCreator,
    fulfilled,
    pending,
    rejected,
    settled,
    options
  } = reducerDefinition;
  const thunk2 = cAT(type, payloadCreator, options);
  context.exposeAction(reducerName, thunk2);
  if (fulfilled) {
    context.addCase(thunk2.fulfilled, fulfilled);
  }
  if (pending) {
    context.addCase(thunk2.pending, pending);
  }
  if (rejected) {
    context.addCase(thunk2.rejected, rejected);
  }
  if (settled) {
    context.addMatcher(thunk2.settled, settled);
  }
  context.exposeCaseReducer(reducerName, {
    fulfilled: fulfilled || noop$2,
    pending: pending || noop$2,
    rejected: rejected || noop$2,
    settled: settled || noop$2
  });
}
function noop$2() {
}
function formatProdErrorMessage(code) {
  return `Minified Redux Toolkit error #${code}; visit https://redux-toolkit.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;
}
function bind(fn, thisArg) {
  return function wrap() {
    return fn.apply(thisArg, arguments);
  };
}
const { toString } = Object.prototype;
const { getPrototypeOf } = Object;
const { iterator, toStringTag } = Symbol;
const kindOf = /* @__PURE__ */ ((cache) => (thing) => {
  const str = toString.call(thing);
  return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null));
const kindOfTest = (type) => {
  type = type.toLowerCase();
  return (thing) => kindOf(thing) === type;
};
const typeOfTest = (type) => (thing) => typeof thing === type;
const { isArray } = Array;
const isUndefined = typeOfTest("undefined");
function isBuffer(val) {
  return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
}
const isArrayBuffer = kindOfTest("ArrayBuffer");
function isArrayBufferView(val) {
  let result;
  if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
    result = ArrayBuffer.isView(val);
  } else {
    result = val && val.buffer && isArrayBuffer(val.buffer);
  }
  return result;
}
const isString$2 = typeOfTest("string");
const isFunction$1 = typeOfTest("function");
const isNumber = typeOfTest("number");
const isObject$1 = (thing) => thing !== null && typeof thing === "object";
const isBoolean = (thing) => thing === true || thing === false;
const isPlainObject = (val) => {
  if (kindOf(val) !== "object") {
    return false;
  }
  const prototype2 = getPrototypeOf(val);
  return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val);
};
const isEmptyObject = (val) => {
  if (!isObject$1(val) || isBuffer(val)) {
    return false;
  }
  try {
    return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
  } catch (e2) {
    return false;
  }
};
const isDate = kindOfTest("Date");
const isFile = kindOfTest("File");
const isBlob = kindOfTest("Blob");
const isFileList = kindOfTest("FileList");
const isStream = (val) => isObject$1(val) && isFunction$1(val.pipe);
const isFormData = (thing) => {
  let kind;
  return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
  kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"));
};
const isURLSearchParams = kindOfTest("URLSearchParams");
const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function forEach(obj, fn, { allOwnKeys = false } = {}) {
  if (obj === null || typeof obj === "undefined") {
    return;
  }
  let i2;
  let l2;
  if (typeof obj !== "object") {
    obj = [obj];
  }
  if (isArray(obj)) {
    for (i2 = 0, l2 = obj.length; i2 < l2; i2++) {
      fn.call(null, obj[i2], i2, obj);
    }
  } else {
    if (isBuffer(obj)) {
      return;
    }
    const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
    const len = keys.length;
    let key;
    for (i2 = 0; i2 < len; i2++) {
      key = keys[i2];
      fn.call(null, obj[key], key, obj);
    }
  }
}
function findKey(obj, key) {
  if (isBuffer(obj)) {
    return null;
  }
  key = key.toLowerCase();
  const keys = Object.keys(obj);
  let i2 = keys.length;
  let _key;
  while (i2-- > 0) {
    _key = keys[i2];
    if (key === _key.toLowerCase()) {
      return _key;
    }
  }
  return null;
}
const _global = (() => {
  if (typeof globalThis !== "undefined") return globalThis;
  return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
})();
const isContextDefined = (context) => !isUndefined(context) && context !== _global;
function merge() {
  const { caseless, skipUndefined } = isContextDefined(this) && this || {};
  const result = {};
  const assignValue = (val, key) => {
    const targetKey = caseless && findKey(result, key) || key;
    if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
      result[targetKey] = merge(result[targetKey], val);
    } else if (isPlainObject(val)) {
      result[targetKey] = merge({}, val);
    } else if (isArray(val)) {
      result[targetKey] = val.slice();
    } else if (!skipUndefined || !isUndefined(val)) {
      result[targetKey] = val;
    }
  };
  for (let i2 = 0, l2 = arguments.length; i2 < l2; i2++) {
    arguments[i2] && forEach(arguments[i2], assignValue);
  }
  return result;
}
const extend = (a2, b, thisArg, { allOwnKeys } = {}) => {
  forEach(b, (val, key) => {
    if (thisArg && isFunction$1(val)) {
      a2[key] = bind(val, thisArg);
    } else {
      a2[key] = val;
    }
  }, { allOwnKeys });
  return a2;
};
const stripBOM = (content) => {
  if (content.charCodeAt(0) === 65279) {
    content = content.slice(1);
  }
  return content;
};
const inherits = (constructor, superConstructor, props, descriptors2) => {
  constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
  constructor.prototype.constructor = constructor;
  Object.defineProperty(constructor, "super", {
    value: superConstructor.prototype
  });
  props && Object.assign(constructor.prototype, props);
};
const toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
  let props;
  let i2;
  let prop;
  const merged = {};
  destObj = destObj || {};
  if (sourceObj == null) return destObj;
  do {
    props = Object.getOwnPropertyNames(sourceObj);
    i2 = props.length;
    while (i2-- > 0) {
      prop = props[i2];
      if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
        destObj[prop] = sourceObj[prop];
        merged[prop] = true;
      }
    }
    sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
  } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
  return destObj;
};
const endsWith = (str, searchString, position) => {
  str = String(str);
  if (position === void 0 || position > str.length) {
    position = str.length;
  }
  position -= searchString.length;
  const lastIndex = str.indexOf(searchString, position);
  return lastIndex !== -1 && lastIndex === position;
};
const toArray = (thing) => {
  if (!thing) return null;
  if (isArray(thing)) return thing;
  let i2 = thing.length;
  if (!isNumber(i2)) return null;
  const arr = new Array(i2);
  while (i2-- > 0) {
    arr[i2] = thing[i2];
  }
  return arr;
};
const isTypedArray = /* @__PURE__ */ ((TypedArray) => {
  return (thing) => {
    return TypedArray && thing instanceof TypedArray;
  };
})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
const forEachEntry = (obj, fn) => {
  const generator = obj && obj[iterator];
  const _iterator = generator.call(obj);
  let result;
  while ((result = _iterator.next()) && !result.done) {
    const pair = result.value;
    fn.call(obj, pair[0], pair[1]);
  }
};
const matchAll = (regExp, str) => {
  let matches2;
  const arr = [];
  while ((matches2 = regExp.exec(str)) !== null) {
    arr.push(matches2);
  }
  return arr;
};
const isHTMLForm = kindOfTest("HTMLFormElement");
const toCamelCase$1 = (str) => {
  return str.toLowerCase().replace(
    /[-_\s]([a-z\d])(\w*)/g,
    function replacer(m2, p1, p2) {
      return p1.toUpperCase() + p2;
    }
  );
};
const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
const isRegExp = kindOfTest("RegExp");
const reduceDescriptors = (obj, reducer) => {
  const descriptors2 = Object.getOwnPropertyDescriptors(obj);
  const reducedDescriptors = {};
  forEach(descriptors2, (descriptor, name) => {
    let ret;
    if ((ret = reducer(descriptor, name, obj)) !== false) {
      reducedDescriptors[name] = ret || descriptor;
    }
  });
  Object.defineProperties(obj, reducedDescriptors);
};
const freezeMethods = (obj) => {
  reduceDescriptors(obj, (descriptor, name) => {
    if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
      return false;
    }
    const value = obj[name];
    if (!isFunction$1(value)) return;
    descriptor.enumerable = false;
    if ("writable" in descriptor) {
      descriptor.writable = false;
      return;
    }
    if (!descriptor.set) {
      descriptor.set = () => {
        throw Error("Can not rewrite read-only method '" + name + "'");
      };
    }
  });
};
const toObjectSet = (arrayOrString, delimiter) => {
  const obj = {};
  const define = (arr) => {
    arr.forEach((value) => {
      obj[value] = true;
    });
  };
  isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
  return obj;
};
const noop$1 = () => {
};
const toFiniteNumber = (value, defaultValue) => {
  return value != null && Number.isFinite(value = +value) ? value : defaultValue;
};
function isSpecCompliantForm(thing) {
  return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
}
const toJSONObject = (obj) => {
  const stack = new Array(10);
  const visit = (source, i2) => {
    if (isObject$1(source)) {
      if (stack.indexOf(source) >= 0) {
        return;
      }
      if (isBuffer(source)) {
        return source;
      }
      if (!("toJSON" in source)) {
        stack[i2] = source;
        const target = isArray(source) ? [] : {};
        forEach(source, (value, key) => {
          const reducedValue = visit(value, i2 + 1);
          !isUndefined(reducedValue) && (target[key] = reducedValue);
        });
        stack[i2] = void 0;
        return target;
      }
    }
    return source;
  };
  return visit(obj, 0);
};
const isAsyncFn = kindOfTest("AsyncFunction");
const isThenable = (thing) => thing && (isObject$1(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
  if (setImmediateSupported) {
    return setImmediate;
  }
  return postMessageSupported ? ((token, callbacks) => {
    _global.addEventListener("message", ({ source, data }) => {
      if (source === _global && data === token) {
        callbacks.length && callbacks.shift()();
      }
    }, false);
    return (cb) => {
      callbacks.push(cb);
      _global.postMessage(token, "*");
    };
  })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
})(
  typeof setImmediate === "function",
  isFunction$1(_global.postMessage)
);
const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
const utils$1 = {
  isArray,
  isArrayBuffer,
  isBuffer,
  isFormData,
  isArrayBufferView,
  isString: isString$2,
  isNumber,
  isBoolean,
  isObject: isObject$1,
  isPlainObject,
  isEmptyObject,
  isReadableStream,
  isRequest,
  isResponse,
  isHeaders,
  isUndefined,
  isDate,
  isFile,
  isBlob,
  isRegExp,
  isFunction: isFunction$1,
  isStream,
  isURLSearchParams,
  isTypedArray,
  isFileList,
  forEach,
  merge,
  extend,
  trim,
  stripBOM,
  inherits,
  toFlatObject,
  kindOf,
  kindOfTest,
  endsWith,
  toArray,
  forEachEntry,
  matchAll,
  isHTMLForm,
  hasOwnProperty,
  hasOwnProp: hasOwnProperty,
  // an alias to avoid ESLint no-prototype-builtins detection
  reduceDescriptors,
  freezeMethods,
  toObjectSet,
  toCamelCase: toCamelCase$1,
  noop: noop$1,
  toFiniteNumber,
  findKey,
  global: _global,
  isContextDefined,
  isSpecCompliantForm,
  toJSONObject,
  isAsyncFn,
  isThenable,
  setImmediate: _setImmediate,
  asap,
  isIterable
};
function AxiosError$1(message, code, config, request, response) {
  Error.call(this);
  if (Error.captureStackTrace) {
    Error.captureStackTrace(this, this.constructor);
  } else {
    this.stack = new Error().stack;
  }
  this.message = message;
  this.name = "AxiosError";
  code && (this.code = code);
  config && (this.config = config);
  request && (this.request = request);
  if (response) {
    this.response = response;
    this.status = response.status ? response.status : null;
  }
}
utils$1.inherits(AxiosError$1, Error, {
  toJSON: function toJSON() {
    return {
      // Standard
      message: this.message,
      name: this.name,
      // Microsoft
      description: this.description,
      number: this.number,
      // Mozilla
      fileName: this.fileName,
      lineNumber: this.lineNumber,
      columnNumber: this.columnNumber,
      stack: this.stack,
      // Axios
      config: utils$1.toJSONObject(this.config),
      code: this.code,
      status: this.status
    };
  }
});
const prototype$1 = AxiosError$1.prototype;
const descriptors = {};
[
  "ERR_BAD_OPTION_VALUE",
  "ERR_BAD_OPTION",
  "ECONNABORTED",
  "ETIMEDOUT",
  "ERR_NETWORK",
  "ERR_FR_TOO_MANY_REDIRECTS",
  "ERR_DEPRECATED",
  "ERR_BAD_RESPONSE",
  "ERR_BAD_REQUEST",
  "ERR_CANCELED",
  "ERR_NOT_SUPPORT",
  "ERR_INVALID_URL"
  // eslint-disable-next-line func-names
].forEach((code) => {
  descriptors[code] = { value: code };
});
Object.defineProperties(AxiosError$1, descriptors);
Object.defineProperty(prototype$1, "isAxiosError", { value: true });
AxiosError$1.from = (error, code, config, request, response, customProps) => {
  const axiosError = Object.create(prototype$1);
  utils$1.toFlatObject(error, axiosError, function filter2(obj) {
    return obj !== Error.prototype;
  }, (prop) => {
    return prop !== "isAxiosError";
  });
  const msg = error && error.message ? error.message : "Error";
  const errCode = code == null && error ? error.code : code;
  AxiosError$1.call(axiosError, msg, errCode, config, request, response);
  if (error && axiosError.cause == null) {
    Object.defineProperty(axiosError, "cause", { value: error, configurable: true });
  }
  axiosError.name = error && error.name || "Error";
  customProps && Object.assign(axiosError, customProps);
  return axiosError;
};
const httpAdapter = null;
function isVisitable(thing) {
  return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
}
function removeBrackets(key) {
  return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
}
function renderKey(path, key, dots) {
  if (!path) return key;
  return path.concat(key).map(function each2(token, i2) {
    token = removeBrackets(token);
    return !dots && i2 ? "[" + token + "]" : token;
  }).join(dots ? "." : "");
}
function isFlatArray(arr) {
  return utils$1.isArray(arr) && !arr.some(isVisitable);
}
const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
  return /^is[A-Z]/.test(prop);
});
function toFormData$1(obj, formData, options) {
  if (!utils$1.isObject(obj)) {
    throw new TypeError("target must be an object");
  }
  formData = formData || new FormData();
  options = utils$1.toFlatObject(options, {
    metaTokens: true,
    dots: false,
    indexes: false
  }, false, function defined(option, source) {
    return !utils$1.isUndefined(source[option]);
  });
  const metaTokens = options.metaTokens;
  const visitor = options.visitor || defaultVisitor;
  const dots = options.dots;
  const indexes = options.indexes;
  const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
  const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
  if (!utils$1.isFunction(visitor)) {
    throw new TypeError("visitor must be a function");
  }
  function convertValue(value) {
    if (value === null) return "";
    if (utils$1.isDate(value)) {
      return value.toISOString();
    }
    if (utils$1.isBoolean(value)) {
      return value.toString();
    }
    if (!useBlob && utils$1.isBlob(value)) {
      throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
    }
    if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
      return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
    }
    return value;
  }
  function defaultVisitor(value, key, path) {
    let arr = value;
    if (value && !path && typeof value === "object") {
      if (utils$1.endsWith(key, "{}")) {
        key = metaTokens ? key : key.slice(0, -2);
        value = JSON.stringify(value);
      } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
        key = removeBrackets(key);
        arr.forEach(function each2(el, index2) {
          !(utils$1.isUndefined(el) || el === null) && formData.append(
            // eslint-disable-next-line no-nested-ternary
            indexes === true ? renderKey([key], index2, dots) : indexes === null ? key : key + "[]",
            convertValue(el)
          );
        });
        return false;
      }
    }
    if (isVisitable(value)) {
      return true;
    }
    formData.append(renderKey(path, key, dots), convertValue(value));
    return false;
  }
  const stack = [];
  const exposedHelpers = Object.assign(predicates, {
    defaultVisitor,
    convertValue,
    isVisitable
  });
  function build(value, path) {
    if (utils$1.isUndefined(value)) return;
    if (stack.indexOf(value) !== -1) {
      throw Error("Circular reference detected in " + path.join("."));
    }
    stack.push(value);
    utils$1.forEach(value, function each2(el, key) {
      const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
        formData,
        el,
        utils$1.isString(key) ? key.trim() : key,
        path,
        exposedHelpers
      );
      if (result === true) {
        build(el, path ? path.concat(key) : [key]);
      }
    });
    stack.pop();
  }
  if (!utils$1.isObject(obj)) {
    throw new TypeError("data must be an object");
  }
  build(obj);
  return formData;
}
function encode$1(str) {
  const charMap = {
    "!": "%21",
    "'": "%27",
    "(": "%28",
    ")": "%29",
    "~": "%7E",
    "%20": "+",
    "%00": "\0"
  };
  return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
    return charMap[match];
  });
}
function AxiosURLSearchParams(params, options) {
  this._pairs = [];
  params && toFormData$1(params, this, options);
}
const prototype = AxiosURLSearchParams.prototype;
prototype.append = function append(name, value) {
  this._pairs.push([name, value]);
};
prototype.toString = function toString2(encoder) {
  const _encode = encoder ? function(value) {
    return encoder.call(this, value, encode$1);
  } : encode$1;
  return this._pairs.map(function each2(pair) {
    return _encode(pair[0]) + "=" + _encode(pair[1]);
  }, "").join("&");
};
function encode(val) {
  return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
}
function buildURL(url, params, options) {
  if (!params) {
    return url;
  }
  const _encode = options && options.encode || encode;
  if (utils$1.isFunction(options)) {
    options = {
      serialize: options
    };
  }
  const serializeFn = options && options.serialize;
  let serializedParams;
  if (serializeFn) {
    serializedParams = serializeFn(params, options);
  } else {
    serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
  }
  if (serializedParams) {
    const hashmarkIndex = url.indexOf("#");
    if (hashmarkIndex !== -1) {
      url = url.slice(0, hashmarkIndex);
    }
    url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
  }
  return url;
}
class InterceptorManager {
  constructor() {
    this.handlers = [];
  }
  /**
   * Add a new interceptor to the stack
   *
   * @param {Function} fulfilled The function to handle `then` for a `Promise`
   * @param {Function} rejected The function to handle `reject` for a `Promise`
   *
   * @return {Number} An ID used to remove interceptor later
   */
  use(fulfilled, rejected, options) {
    this.handlers.push({
      fulfilled,
      rejected,
      synchronous: options ? options.synchronous : false,
      runWhen: options ? options.runWhen : null
    });
    return this.handlers.length - 1;
  }
  /**
   * Remove an interceptor from the stack
   *
   * @param {Number} id The ID that was returned by `use`
   *
   * @returns {void}
   */
  eject(id) {
    if (this.handlers[id]) {
      this.handlers[id] = null;
    }
  }
  /**
   * Clear all interceptors from the stack
   *
   * @returns {void}
   */
  clear() {
    if (this.handlers) {
      this.handlers = [];
    }
  }
  /**
   * Iterate over all the registered interceptors
   *
   * This method is particularly useful for skipping over any
   * interceptors that may have become `null` calling `eject`.
   *
   * @param {Function} fn The function to call for each interceptor
   *
   * @returns {void}
   */
  forEach(fn) {
    utils$1.forEach(this.handlers, function forEachHandler(h2) {
      if (h2 !== null) {
        fn(h2);
      }
    });
  }
}
const transitionalDefaults = {
  silentJSONParsing: true,
  forcedJSONParsing: true,
  clarifyTimeoutError: false
};
const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
const FormData$1 = typeof FormData !== "undefined" ? FormData : null;
const Blob$1 = typeof Blob !== "undefined" ? Blob : null;
const platform$1 = {
  isBrowser: true,
  classes: {
    URLSearchParams: URLSearchParams$1,
    FormData: FormData$1,
    Blob: Blob$1
  },
  protocols: ["http", "https", "file", "blob", "url", "data"]
};
const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
const _navigator = typeof navigator === "object" && navigator || void 0;
const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
const hasStandardBrowserWebWorkerEnv = (() => {
  return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
  self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
})();
const origin = hasBrowserEnv && window.location.href || "http://localhost";
const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  hasBrowserEnv,
  hasStandardBrowserEnv,
  hasStandardBrowserWebWorkerEnv,
  navigator: _navigator,
  origin
}, Symbol.toStringTag, { value: "Module" }));
const platform = {
  ...utils,
  ...platform$1
};
function toURLEncodedForm(data, options) {
  return toFormData$1(data, new platform.classes.URLSearchParams(), {
    visitor: function(value, key, path, helpers) {
      if (platform.isNode && utils$1.isBuffer(value)) {
        this.append(key, value.toString("base64"));
        return false;
      }
      return helpers.defaultVisitor.apply(this, arguments);
    },
    ...options
  });
}
function parsePropPath(name) {
  return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
    return match[0] === "[]" ? "" : match[1] || match[0];
  });
}
function arrayToObject(arr) {
  const obj = {};
  const keys = Object.keys(arr);
  let i2;
  const len = keys.length;
  let key;
  for (i2 = 0; i2 < len; i2++) {
    key = keys[i2];
    obj[key] = arr[key];
  }
  return obj;
}
function formDataToJSON(formData) {
  function buildPath(path, value, target, index2) {
    let name = path[index2++];
    if (name === "__proto__") return true;
    const isNumericKey = Number.isFinite(+name);
    const isLast = index2 >= path.length;
    name = !name && utils$1.isArray(target) ? target.length : name;
    if (isLast) {
      if (utils$1.hasOwnProp(target, name)) {
        target[name] = [target[name], value];
      } else {
        target[name] = value;
      }
      return !isNumericKey;
    }
    if (!target[name] || !utils$1.isObject(target[name])) {
      target[name] = [];
    }
    const result = buildPath(path, value, target[name], index2);
    if (result && utils$1.isArray(target[name])) {
      target[name] = arrayToObject(target[name]);
    }
    return !isNumericKey;
  }
  if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
    const obj = {};
    utils$1.forEachEntry(formData, (name, value) => {
      buildPath(parsePropPath(name), value, obj, 0);
    });
    return obj;
  }
  return null;
}
function stringifySafely(rawValue, parser, encoder) {
  if (utils$1.isString(rawValue)) {
    try {
      (parser || JSON.parse)(rawValue);
      return utils$1.trim(rawValue);
    } catch (e2) {
      if (e2.name !== "SyntaxError") {
        throw e2;
      }
    }
  }
  return (encoder || JSON.stringify)(rawValue);
}
const defaults = {
  transitional: transitionalDefaults,
  adapter: ["xhr", "http", "fetch"],
  transformRequest: [function transformRequest(data, headers) {
    const contentType = headers.getContentType() || "";
    const hasJSONContentType = contentType.indexOf("application/json") > -1;
    const isObjectPayload = utils$1.isObject(data);
    if (isObjectPayload && utils$1.isHTMLForm(data)) {
      data = new FormData(data);
    }
    const isFormData2 = utils$1.isFormData(data);
    if (isFormData2) {
      return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
    }
    if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
      return data;
    }
    if (utils$1.isArrayBufferView(data)) {
      return data.buffer;
    }
    if (utils$1.isURLSearchParams(data)) {
      headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
      return data.toString();
    }
    let isFileList2;
    if (isObjectPayload) {
      if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
        return toURLEncodedForm(data, this.formSerializer).toString();
      }
      if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
        const _FormData = this.env && this.env.FormData;
        return toFormData$1(
          isFileList2 ? { "files[]": data } : data,
          _FormData && new _FormData(),
          this.formSerializer
        );
      }
    }
    if (isObjectPayload || hasJSONContentType) {
      headers.setContentType("application/json", false);
      return stringifySafely(data);
    }
    return data;
  }],
  transformResponse: [function transformResponse(data) {
    const transitional2 = this.transitional || defaults.transitional;
    const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
    const JSONRequested = this.responseType === "json";
    if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
      return data;
    }
    if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
      const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
      const strictJSONParsing = !silentJSONParsing && JSONRequested;
      try {
        return JSON.parse(data, this.parseReviver);
      } catch (e2) {
        if (strictJSONParsing) {
          if (e2.name === "SyntaxError") {
            throw AxiosError$1.from(e2, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
          }
          throw e2;
        }
      }
    }
    return data;
  }],
  /**
   * A timeout in milliseconds to abort a request. If set to 0 (default) a
   * timeout is not created.
   */
  timeout: 0,
  xsrfCookieName: "XSRF-TOKEN",
  xsrfHeaderName: "X-XSRF-TOKEN",
  maxContentLength: -1,
  maxBodyLength: -1,
  env: {
    FormData: platform.classes.FormData,
    Blob: platform.classes.Blob
  },
  validateStatus: function validateStatus(status) {
    return status >= 200 && status < 300;
  },
  headers: {
    common: {
      "Accept": "application/json, text/plain, */*",
      "Content-Type": void 0
    }
  }
};
utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
  defaults.headers[method] = {};
});
const ignoreDuplicateOf = utils$1.toObjectSet([
  "age",
  "authorization",
  "content-length",
  "content-type",
  "etag",
  "expires",
  "from",
  "host",
  "if-modified-since",
  "if-unmodified-since",
  "last-modified",
  "location",
  "max-forwards",
  "proxy-authorization",
  "referer",
  "retry-after",
  "user-agent"
]);
const parseHeaders = (rawHeaders) => {
  const parsed = {};
  let key;
  let val;
  let i2;
  rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
    i2 = line.indexOf(":");
    key = line.substring(0, i2).trim().toLowerCase();
    val = line.substring(i2 + 1).trim();
    if (!key || parsed[key] && ignoreDuplicateOf[key]) {
      return;
    }
    if (key === "set-cookie") {
      if (parsed[key]) {
        parsed[key].push(val);
      } else {
        parsed[key] = [val];
      }
    } else {
      parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
    }
  });
  return parsed;
};
const $internals = Symbol("internals");
function normalizeHeader(header) {
  return header && String(header).trim().toLowerCase();
}
function normalizeValue(value) {
  if (value === false || value == null) {
    return value;
  }
  return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
}
function parseTokens(str) {
  const tokens = /* @__PURE__ */ Object.create(null);
  const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
  let match;
  while (match = tokensRE.exec(str)) {
    tokens[match[1]] = match[2];
  }
  return tokens;
}
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
  if (utils$1.isFunction(filter2)) {
    return filter2.call(this, value, header);
  }
  if (isHeaderNameFilter) {
    value = header;
  }
  if (!utils$1.isString(value)) return;
  if (utils$1.isString(filter2)) {
    return value.indexOf(filter2) !== -1;
  }
  if (utils$1.isRegExp(filter2)) {
    return filter2.test(value);
  }
}
function formatHeader(header) {
  return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w2, char, str) => {
    return char.toUpperCase() + str;
  });
}
function buildAccessors(obj, header) {
  const accessorName = utils$1.toCamelCase(" " + header);
  ["get", "set", "has"].forEach((methodName) => {
    Object.defineProperty(obj, methodName + accessorName, {
      value: function(arg1, arg2, arg3) {
        return this[methodName].call(this, header, arg1, arg2, arg3);
      },
      configurable: true
    });
  });
}
let AxiosHeaders$1 = class AxiosHeaders {
  constructor(headers) {
    headers && this.set(headers);
  }
  set(header, valueOrRewrite, rewrite) {
    const self2 = this;
    function setHeader(_value, _header, _rewrite) {
      const lHeader = normalizeHeader(_header);
      if (!lHeader) {
        throw new Error("header name must be a non-empty string");
      }
      const key = utils$1.findKey(self2, lHeader);
      if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
        self2[key || _header] = normalizeValue(_value);
      }
    }
    const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
    if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
      setHeaders(header, valueOrRewrite);
    } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
      setHeaders(parseHeaders(header), valueOrRewrite);
    } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
      let obj = {}, dest, key;
      for (const entry of header) {
        if (!utils$1.isArray(entry)) {
          throw TypeError("Object iterator must return a key-value pair");
        }
        obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
      }
      setHeaders(obj, valueOrRewrite);
    } else {
      header != null && setHeader(valueOrRewrite, header, rewrite);
    }
    return this;
  }
  get(header, parser) {
    header = normalizeHeader(header);
    if (header) {
      const key = utils$1.findKey(this, header);
      if (key) {
        const value = this[key];
        if (!parser) {
          return value;
        }
        if (parser === true) {
          return parseTokens(value);
        }
        if (utils$1.isFunction(parser)) {
          return parser.call(this, value, key);
        }
        if (utils$1.isRegExp(parser)) {
          return parser.exec(value);
        }
        throw new TypeError("parser must be boolean|regexp|function");
      }
    }
  }
  has(header, matcher) {
    header = normalizeHeader(header);
    if (header) {
      const key = utils$1.findKey(this, header);
      return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
    }
    return false;
  }
  delete(header, matcher) {
    const self2 = this;
    let deleted = false;
    function deleteHeader(_header) {
      _header = normalizeHeader(_header);
      if (_header) {
        const key = utils$1.findKey(self2, _header);
        if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
          delete self2[key];
          deleted = true;
        }
      }
    }
    if (utils$1.isArray(header)) {
      header.forEach(deleteHeader);
    } else {
      deleteHeader(header);
    }
    return deleted;
  }
  clear(matcher) {
    const keys = Object.keys(this);
    let i2 = keys.length;
    let deleted = false;
    while (i2--) {
      const key = keys[i2];
      if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
        delete this[key];
        deleted = true;
      }
    }
    return deleted;
  }
  normalize(format) {
    const self2 = this;
    const headers = {};
    utils$1.forEach(this, (value, header) => {
      const key = utils$1.findKey(headers, header);
      if (key) {
        self2[key] = normalizeValue(value);
        delete self2[header];
        return;
      }
      const normalized = format ? formatHeader(header) : String(header).trim();
      if (normalized !== header) {
        delete self2[header];
      }
      self2[normalized] = normalizeValue(value);
      headers[normalized] = true;
    });
    return this;
  }
  concat(...targets) {
    return this.constructor.concat(this, ...targets);
  }
  toJSON(asStrings) {
    const obj = /* @__PURE__ */ Object.create(null);
    utils$1.forEach(this, (value, header) => {
      value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
    });
    return obj;
  }
  [Symbol.iterator]() {
    return Object.entries(this.toJSON())[Symbol.iterator]();
  }
  toString() {
    return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
  }
  getSetCookie() {
    return this.get("set-cookie") || [];
  }
  get [Symbol.toStringTag]() {
    return "AxiosHeaders";
  }
  static from(thing) {
    return thing instanceof this ? thing : new this(thing);
  }
  static concat(first, ...targets) {
    const computed = new this(first);
    targets.forEach((target) => computed.set(target));
    return computed;
  }
  static accessor(header) {
    const internals = this[$internals] = this[$internals] = {
      accessors: {}
    };
    const accessors = internals.accessors;
    const prototype2 = this.prototype;
    function defineAccessor(_header) {
      const lHeader = normalizeHeader(_header);
      if (!accessors[lHeader]) {
        buildAccessors(prototype2, _header);
        accessors[lHeader] = true;
      }
    }
    utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
    return this;
  }
};
AxiosHeaders$1.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
  let mapped = key[0].toUpperCase() + key.slice(1);
  return {
    get: () => value,
    set(headerValue) {
      this[mapped] = headerValue;
    }
  };
});
utils$1.freezeMethods(AxiosHeaders$1);
function transformData(fns, response) {
  const config = this || defaults;
  const context = response || config;
  const headers = AxiosHeaders$1.from(context.headers);
  let data = context.data;
  utils$1.forEach(fns, function transform(fn) {
    data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
  });
  headers.normalize();
  return data;
}
function isCancel$1(value) {
  return !!(value && value.__CANCEL__);
}
function CanceledError$1(message, config, request) {
  AxiosError$1.call(this, message == null ? "canceled" : message, AxiosError$1.ERR_CANCELED, config, request);
  this.name = "CanceledError";
}
utils$1.inherits(CanceledError$1, AxiosError$1, {
  __CANCEL__: true
});
function settle(resolve, reject, response) {
  const validateStatus2 = response.config.validateStatus;
  if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
    resolve(response);
  } else {
    reject(new AxiosError$1(
      "Request failed with status code " + response.status,
      [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
      response.config,
      response.request,
      response
    ));
  }
}
function parseProtocol(url) {
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
  return match && match[1] || "";
}
function speedometer(samplesCount, min) {
  samplesCount = samplesCount || 10;
  const bytes = new Array(samplesCount);
  const timestamps = new Array(samplesCount);
  let head = 0;
  let tail = 0;
  let firstSampleTS;
  min = min !== void 0 ? min : 1e3;
  return function push2(chunkLength) {
    const now2 = Date.now();
    const startedAt = timestamps[tail];
    if (!firstSampleTS) {
      firstSampleTS = now2;
    }
    bytes[head] = chunkLength;
    timestamps[head] = now2;
    let i2 = tail;
    let bytesCount = 0;
    while (i2 !== head) {
      bytesCount += bytes[i2++];
      i2 = i2 % samplesCount;
    }
    head = (head + 1) % samplesCount;
    if (head === tail) {
      tail = (tail + 1) % samplesCount;
    }
    if (now2 - firstSampleTS < min) {
      return;
    }
    const passed = startedAt && now2 - startedAt;
    return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
  };
}
function throttle(fn, freq) {
  let timestamp = 0;
  let threshold = 1e3 / freq;
  let lastArgs;
  let timer;
  const invoke = (args, now2 = Date.now()) => {
    timestamp = now2;
    lastArgs = null;
    if (timer) {
      clearTimeout(timer);
      timer = null;
    }
    fn(...args);
  };
  const throttled = (...args) => {
    const now2 = Date.now();
    const passed = now2 - timestamp;
    if (passed >= threshold) {
      invoke(args, now2);
    } else {
      lastArgs = args;
      if (!timer) {
        timer = setTimeout(() => {
          timer = null;
          invoke(lastArgs);
        }, threshold - passed);
      }
    }
  };
  const flush = () => lastArgs && invoke(lastArgs);
  return [throttled, flush];
}
const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
  let bytesNotified = 0;
  const _speedometer = speedometer(50, 250);
  return throttle((e2) => {
    const loaded = e2.loaded;
    const total = e2.lengthComputable ? e2.total : void 0;
    const progressBytes = loaded - bytesNotified;
    const rate = _speedometer(progressBytes);
    const inRange = loaded <= total;
    bytesNotified = loaded;
    const data = {
      loaded,
      total,
      progress: total ? loaded / total : void 0,
      bytes: progressBytes,
      rate: rate ? rate : void 0,
      estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
      event: e2,
      lengthComputable: total != null,
      [isDownloadStream ? "download" : "upload"]: true
    };
    listener(data);
  }, freq);
};
const progressEventDecorator = (total, throttled) => {
  const lengthComputable = total != null;
  return [(loaded) => throttled[0]({
    lengthComputable,
    total,
    loaded
  }), throttled[1]];
};
const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
const isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url) => {
  url = new URL(url, platform.origin);
  return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port);
})(
  new URL(platform.origin),
  platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
) : () => true;
const cookies = platform.hasStandardBrowserEnv ? (
  // Standard browser envs support document.cookie
  {
    write(name, value, expires, path, domain, secure, sameSite) {
      if (typeof document === "undefined") return;
      const cookie = [`${name}=${encodeURIComponent(value)}`];
      if (utils$1.isNumber(expires)) {
        cookie.push(`expires=${new Date(expires).toUTCString()}`);
      }
      if (utils$1.isString(path)) {
        cookie.push(`path=${path}`);
      }
      if (utils$1.isString(domain)) {
        cookie.push(`domain=${domain}`);
      }
      if (secure === true) {
        cookie.push("secure");
      }
      if (utils$1.isString(sameSite)) {
        cookie.push(`SameSite=${sameSite}`);
      }
      document.cookie = cookie.join("; ");
    },
    read(name) {
      if (typeof document === "undefined") return null;
      const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
      return match ? decodeURIComponent(match[1]) : null;
    },
    remove(name) {
      this.write(name, "", Date.now() - 864e5, "/");
    }
  }
) : (
  // Non-standard browser env (web workers, react-native) lack needed support.
  {
    write() {
    },
    read() {
      return null;
    },
    remove() {
    }
  }
);
function isAbsoluteURL(url) {
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
}
function combineURLs(baseURL, relativeURL) {
  return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
}
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
  let isRelativeUrl = !isAbsoluteURL(requestedURL);
  if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
    return combineURLs(baseURL, requestedURL);
  }
  return requestedURL;
}
const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
function mergeConfig$1(config1, config2) {
  config2 = config2 || {};
  const config = {};
  function getMergedValue(target, source, prop, caseless) {
    if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
      return utils$1.merge.call({ caseless }, target, source);
    } else if (utils$1.isPlainObject(source)) {
      return utils$1.merge({}, source);
    } else if (utils$1.isArray(source)) {
      return source.slice();
    }
    return source;
  }
  function mergeDeepProperties(a2, b, prop, caseless) {
    if (!utils$1.isUndefined(b)) {
      return getMergedValue(a2, b, prop, caseless);
    } else if (!utils$1.isUndefined(a2)) {
      return getMergedValue(void 0, a2, prop, caseless);
    }
  }
  function valueFromConfig2(a2, b) {
    if (!utils$1.isUndefined(b)) {
      return getMergedValue(void 0, b);
    }
  }
  function defaultToConfig2(a2, b) {
    if (!utils$1.isUndefined(b)) {
      return getMergedValue(void 0, b);
    } else if (!utils$1.isUndefined(a2)) {
      return getMergedValue(void 0, a2);
    }
  }
  function mergeDirectKeys(a2, b, prop) {
    if (prop in config2) {
      return getMergedValue(a2, b);
    } else if (prop in config1) {
      return getMergedValue(void 0, a2);
    }
  }
  const mergeMap = {
    url: valueFromConfig2,
    method: valueFromConfig2,
    data: valueFromConfig2,
    baseURL: defaultToConfig2,
    transformRequest: defaultToConfig2,
    transformResponse: defaultToConfig2,
    paramsSerializer: defaultToConfig2,
    timeout: defaultToConfig2,
    timeoutMessage: defaultToConfig2,
    withCredentials: defaultToConfig2,
    withXSRFToken: defaultToConfig2,
    adapter: defaultToConfig2,
    responseType: defaultToConfig2,
    xsrfCookieName: defaultToConfig2,
    xsrfHeaderName: defaultToConfig2,
    onUploadProgress: defaultToConfig2,
    onDownloadProgress: defaultToConfig2,
    decompress: defaultToConfig2,
    maxContentLength: defaultToConfig2,
    maxBodyLength: defaultToConfig2,
    beforeRedirect: defaultToConfig2,
    transport: defaultToConfig2,
    httpAgent: defaultToConfig2,
    httpsAgent: defaultToConfig2,
    cancelToken: defaultToConfig2,
    socketPath: defaultToConfig2,
    responseEncoding: defaultToConfig2,
    validateStatus: mergeDirectKeys,
    headers: (a2, b, prop) => mergeDeepProperties(headersToObject(a2), headersToObject(b), prop, true)
  };
  utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
    const merge2 = mergeMap[prop] || mergeDeepProperties;
    const configValue = merge2(config1[prop], config2[prop], prop);
    utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
  });
  return config;
}
const resolveConfig = (config) => {
  const newConfig = mergeConfig$1({}, config);
  let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth: auth2 } = newConfig;
  newConfig.headers = headers = AxiosHeaders$1.from(headers);
  newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
  if (auth2) {
    headers.set(
      "Authorization",
      "Basic " + btoa((auth2.username || "") + ":" + (auth2.password ? unescape(encodeURIComponent(auth2.password)) : ""))
    );
  }
  if (utils$1.isFormData(data)) {
    if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
      headers.setContentType(void 0);
    } else if (utils$1.isFunction(data.getHeaders)) {
      const formHeaders = data.getHeaders();
      const allowedHeaders = ["content-type", "content-length"];
      Object.entries(formHeaders).forEach(([key, val]) => {
        if (allowedHeaders.includes(key.toLowerCase())) {
          headers.set(key, val);
        }
      });
    }
  }
  if (platform.hasStandardBrowserEnv) {
    withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
    if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
      const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
      if (xsrfValue) {
        headers.set(xsrfHeaderName, xsrfValue);
      }
    }
  }
  return newConfig;
};
const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
const xhrAdapter = isXHRAdapterSupported && function(config) {
  return new Promise(function dispatchXhrRequest(resolve, reject) {
    const _config = resolveConfig(config);
    let requestData = _config.data;
    const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
    let { responseType, onUploadProgress, onDownloadProgress } = _config;
    let onCanceled;
    let uploadThrottled, downloadThrottled;
    let flushUpload, flushDownload;
    function done() {
      flushUpload && flushUpload();
      flushDownload && flushDownload();
      _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
      _config.signal && _config.signal.removeEventListener("abort", onCanceled);
    }
    let request = new XMLHttpRequest();
    request.open(_config.method.toUpperCase(), _config.url, true);
    request.timeout = _config.timeout;
    function onloadend() {
      if (!request) {
        return;
      }
      const responseHeaders = AxiosHeaders$1.from(
        "getAllResponseHeaders" in request && request.getAllResponseHeaders()
      );
      const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
      const response = {
        data: responseData,
        status: request.status,
        statusText: request.statusText,
        headers: responseHeaders,
        config,
        request
      };
      settle(function _resolve(value) {
        resolve(value);
        done();
      }, function _reject(err) {
        reject(err);
        done();
      }, response);
      request = null;
    }
    if ("onloadend" in request) {
      request.onloadend = onloadend;
    } else {
      request.onreadystatechange = function handleLoad() {
        if (!request || request.readyState !== 4) {
          return;
        }
        if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
          return;
        }
        setTimeout(onloadend);
      };
    }
    request.onabort = function handleAbort() {
      if (!request) {
        return;
      }
      reject(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config, request));
      request = null;
    };
    request.onerror = function handleError(event) {
      const msg = event && event.message ? event.message : "Network Error";
      const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
      err.event = event || null;
      reject(err);
      request = null;
    };
    request.ontimeout = function handleTimeout() {
      let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
      const transitional2 = _config.transitional || transitionalDefaults;
      if (_config.timeoutErrorMessage) {
        timeoutErrorMessage = _config.timeoutErrorMessage;
      }
      reject(new AxiosError$1(
        timeoutErrorMessage,
        transitional2.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
        config,
        request
      ));
      request = null;
    };
    requestData === void 0 && requestHeaders.setContentType(null);
    if ("setRequestHeader" in request) {
      utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
        request.setRequestHeader(key, val);
      });
    }
    if (!utils$1.isUndefined(_config.withCredentials)) {
      request.withCredentials = !!_config.withCredentials;
    }
    if (responseType && responseType !== "json") {
      request.responseType = _config.responseType;
    }
    if (onDownloadProgress) {
      [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
      request.addEventListener("progress", downloadThrottled);
    }
    if (onUploadProgress && request.upload) {
      [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
      request.upload.addEventListener("progress", uploadThrottled);
      request.upload.addEventListener("loadend", flushUpload);
    }
    if (_config.cancelToken || _config.signal) {
      onCanceled = (cancel) => {
        if (!request) {
          return;
        }
        reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
        request.abort();
        request = null;
      };
      _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
      if (_config.signal) {
        _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
      }
    }
    const protocol = parseProtocol(_config.url);
    if (protocol && platform.protocols.indexOf(protocol) === -1) {
      reject(new AxiosError$1("Unsupported protocol " + protocol + ":", AxiosError$1.ERR_BAD_REQUEST, config));
      return;
    }
    request.send(requestData || null);
  });
};
const composeSignals = (signals, timeout) => {
  const { length } = signals = signals ? signals.filter(Boolean) : [];
  if (timeout || length) {
    let controller = new AbortController();
    let aborted;
    const onabort = function(reason) {
      if (!aborted) {
        aborted = true;
        unsubscribe();
        const err = reason instanceof Error ? reason : this.reason;
        controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
      }
    };
    let timer = timeout && setTimeout(() => {
      timer = null;
      onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT));
    }, timeout);
    const unsubscribe = () => {
      if (signals) {
        timer && clearTimeout(timer);
        timer = null;
        signals.forEach((signal2) => {
          signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
        });
        signals = null;
      }
    };
    signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
    const { signal } = controller;
    signal.unsubscribe = () => utils$1.asap(unsubscribe);
    return signal;
  }
};
const streamChunk = function* (chunk, chunkSize) {
  let len = chunk.byteLength;
  if (len < chunkSize) {
    yield chunk;
    return;
  }
  let pos = 0;
  let end;
  while (pos < len) {
    end = pos + chunkSize;
    yield chunk.slice(pos, end);
    pos = end;
  }
};
const readBytes = async function* (iterable, chunkSize) {
  for await (const chunk of readStream(iterable)) {
    yield* streamChunk(chunk, chunkSize);
  }
};
const readStream = async function* (stream) {
  if (stream[Symbol.asyncIterator]) {
    yield* stream;
    return;
  }
  const reader = stream.getReader();
  try {
    for (; ; ) {
      const { done, value } = await reader.read();
      if (done) {
        break;
      }
      yield value;
    }
  } finally {
    await reader.cancel();
  }
};
const trackStream = (stream, chunkSize, onProgress, onFinish) => {
  const iterator2 = readBytes(stream, chunkSize);
  let bytes = 0;
  let done;
  let _onFinish = (e2) => {
    if (!done) {
      done = true;
      onFinish && onFinish(e2);
    }
  };
  return new ReadableStream({
    async pull(controller) {
      try {
        const { done: done2, value } = await iterator2.next();
        if (done2) {
          _onFinish();
          controller.close();
          return;
        }
        let len = value.byteLength;
        if (onProgress) {
          let loadedBytes = bytes += len;
          onProgress(loadedBytes);
        }
        controller.enqueue(new Uint8Array(value));
      } catch (err) {
        _onFinish(err);
        throw err;
      }
    },
    cancel(reason) {
      _onFinish(reason);
      return iterator2.return();
    }
  }, {
    highWaterMark: 2
  });
};
const DEFAULT_CHUNK_SIZE = 64 * 1024;
const { isFunction } = utils$1;
const globalFetchAPI = (({ Request, Response }) => ({
  Request,
  Response
}))(utils$1.global);
const {
  ReadableStream: ReadableStream$1,
  TextEncoder
} = utils$1.global;
const test = (fn, ...args) => {
  try {
    return !!fn(...args);
  } catch (e2) {
    return false;
  }
};
const factory = (env) => {
  env = utils$1.merge.call({
    skipUndefined: true
  }, globalFetchAPI, env);
  const { fetch: envFetch, Request, Response } = env;
  const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function";
  const isRequestSupported = isFunction(Request);
  const isResponseSupported = isFunction(Response);
  if (!isFetchSupported) {
    return false;
  }
  const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
  const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
  const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
    let duplexAccessed = false;
    const hasContentType = new Request(platform.origin, {
      body: new ReadableStream$1(),
      method: "POST",
      get duplex() {
        duplexAccessed = true;
        return "half";
      }
    }).headers.has("Content-Type");
    return duplexAccessed && !hasContentType;
  });
  const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body));
  const resolvers = {
    stream: supportsResponseStream && ((res) => res.body)
  };
  isFetchSupported && (() => {
    ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
      !resolvers[type] && (resolvers[type] = (res, config) => {
        let method = res && res[type];
        if (method) {
          return method.call(res);
        }
        throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
      });
    });
  })();
  const getBodyLength = async (body) => {
    if (body == null) {
      return 0;
    }
    if (utils$1.isBlob(body)) {
      return body.size;
    }
    if (utils$1.isSpecCompliantForm(body)) {
      const _request = new Request(platform.origin, {
        method: "POST",
        body
      });
      return (await _request.arrayBuffer()).byteLength;
    }
    if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
      return body.byteLength;
    }
    if (utils$1.isURLSearchParams(body)) {
      body = body + "";
    }
    if (utils$1.isString(body)) {
      return (await encodeText(body)).byteLength;
    }
  };
  const resolveBodyLength = async (headers, body) => {
    const length = utils$1.toFiniteNumber(headers.getContentLength());
    return length == null ? getBodyLength(body) : length;
  };
  return async (config) => {
    let {
      url,
      method,
      data,
      signal,
      cancelToken,
      timeout,
      onDownloadProgress,
      onUploadProgress,
      responseType,
      headers,
      withCredentials = "same-origin",
      fetchOptions
    } = resolveConfig(config);
    let _fetch = envFetch || fetch;
    responseType = responseType ? (responseType + "").toLowerCase() : "text";
    let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
    let request = null;
    const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
      composedSignal.unsubscribe();
    });
    let requestContentLength;
    try {
      if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
        let _request = new Request(url, {
          method: "POST",
          body: data,
          duplex: "half"
        });
        let contentTypeHeader;
        if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
          headers.setContentType(contentTypeHeader);
        }
        if (_request.body) {
          const [onProgress, flush] = progressEventDecorator(
            requestContentLength,
            progressEventReducer(asyncDecorator(onUploadProgress))
          );
          data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
        }
      }
      if (!utils$1.isString(withCredentials)) {
        withCredentials = withCredentials ? "include" : "omit";
      }
      const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
      const resolvedOptions = {
        ...fetchOptions,
        signal: composedSignal,
        method: method.toUpperCase(),
        headers: headers.normalize().toJSON(),
        body: data,
        duplex: "half",
        credentials: isCredentialsSupported ? withCredentials : void 0
      };
      request = isRequestSupported && new Request(url, resolvedOptions);
      let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
      const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
      if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
        const options = {};
        ["status", "statusText", "headers"].forEach((prop) => {
          options[prop] = response[prop];
        });
        const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
        const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
          responseContentLength,
          progressEventReducer(asyncDecorator(onDownloadProgress), true)
        ) || [];
        response = new Response(
          trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
            flush && flush();
            unsubscribe && unsubscribe();
          }),
          options
        );
      }
      responseType = responseType || "text";
      let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
      !isStreamResponse && unsubscribe && unsubscribe();
      return await new Promise((resolve, reject) => {
        settle(resolve, reject, {
          data: responseData,
          headers: AxiosHeaders$1.from(response.headers),
          status: response.status,
          statusText: response.statusText,
          config,
          request
        });
      });
    } catch (err) {
      unsubscribe && unsubscribe();
      if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
        throw Object.assign(
          new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request),
          {
            cause: err.cause || err
          }
        );
      }
      throw AxiosError$1.from(err, err && err.code, config, request);
    }
  };
};
const seedCache = /* @__PURE__ */ new Map();
const getFetch = (config) => {
  let env = config && config.env || {};
  const { fetch: fetch2, Request, Response } = env;
  const seeds = [
    Request,
    Response,
    fetch2
  ];
  let len = seeds.length, i2 = len, seed, target, map = seedCache;
  while (i2--) {
    seed = seeds[i2];
    target = map.get(seed);
    target === void 0 && map.set(seed, target = i2 ? /* @__PURE__ */ new Map() : factory(env));
    map = target;
  }
  return target;
};
getFetch();
const knownAdapters = {
  http: httpAdapter,
  xhr: xhrAdapter,
  fetch: {
    get: getFetch
  }
};
utils$1.forEach(knownAdapters, (fn, value) => {
  if (fn) {
    try {
      Object.defineProperty(fn, "name", { value });
    } catch (e2) {
    }
    Object.defineProperty(fn, "adapterName", { value });
  }
});
const renderReason = (reason) => `- ${reason}`;
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
function getAdapter$1(adapters2, config) {
  adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
  const { length } = adapters2;
  let nameOrAdapter;
  let adapter;
  const rejectedReasons = {};
  for (let i2 = 0; i2 < length; i2++) {
    nameOrAdapter = adapters2[i2];
    let id;
    adapter = nameOrAdapter;
    if (!isResolvedHandle(nameOrAdapter)) {
      adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
      if (adapter === void 0) {
        throw new AxiosError$1(`Unknown adapter '${id}'`);
      }
    }
    if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
      break;
    }
    rejectedReasons[id || "#" + i2] = adapter;
  }
  if (!adapter) {
    const reasons = Object.entries(rejectedReasons).map(
      ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
    );
    let s2 = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
    throw new AxiosError$1(
      `There is no suitable adapter to dispatch the request ` + s2,
      "ERR_NOT_SUPPORT"
    );
  }
  return adapter;
}
const adapters = {
  /**
   * Resolve an adapter from a list of adapter names or functions.
   * @type {Function}
   */
  getAdapter: getAdapter$1,
  /**
   * Exposes all known adapters
   * @type {Object<string, Function|Object>}
   */
  adapters: knownAdapters
};
function throwIfCancellationRequested(config) {
  if (config.cancelToken) {
    config.cancelToken.throwIfRequested();
  }
  if (config.signal && config.signal.aborted) {
    throw new CanceledError$1(null, config);
  }
}
function dispatchRequest(config) {
  throwIfCancellationRequested(config);
  config.headers = AxiosHeaders$1.from(config.headers);
  config.data = transformData.call(
    config,
    config.transformRequest
  );
  if (["post", "put", "patch"].indexOf(config.method) !== -1) {
    config.headers.setContentType("application/x-www-form-urlencoded", false);
  }
  const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
  return adapter(config).then(function onAdapterResolution(response) {
    throwIfCancellationRequested(config);
    response.data = transformData.call(
      config,
      config.transformResponse,
      response
    );
    response.headers = AxiosHeaders$1.from(response.headers);
    return response;
  }, function onAdapterRejection(reason) {
    if (!isCancel$1(reason)) {
      throwIfCancellationRequested(config);
      if (reason && reason.response) {
        reason.response.data = transformData.call(
          config,
          config.transformResponse,
          reason.response
        );
        reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
      }
    }
    return Promise.reject(reason);
  });
}
const VERSION$1 = "1.13.2";
const validators$1 = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i2) => {
  validators$1[type] = function validator2(thing) {
    return typeof thing === type || "a" + (i2 < 1 ? "n " : " ") + type;
  };
});
const deprecatedWarnings = {};
validators$1.transitional = function transitional(validator2, version, message) {
  function formatMessage(opt, desc) {
    return "[Axios v" + VERSION$1 + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
  }
  return (value, opt, opts) => {
    if (validator2 === false) {
      throw new AxiosError$1(
        formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
        AxiosError$1.ERR_DEPRECATED
      );
    }
    if (version && !deprecatedWarnings[opt]) {
      deprecatedWarnings[opt] = true;
      console.warn(
        formatMessage(
          opt,
          " has been deprecated since v" + version + " and will be removed in the near future"
        )
      );
    }
    return validator2 ? validator2(value, opt, opts) : true;
  };
};
validators$1.spelling = function spelling(correctSpelling) {
  return (value, opt) => {
    console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
    return true;
  };
};
function assertOptions(options, schema, allowUnknown) {
  if (typeof options !== "object") {
    throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
  }
  const keys = Object.keys(options);
  let i2 = keys.length;
  while (i2-- > 0) {
    const opt = keys[i2];
    const validator2 = schema[opt];
    if (validator2) {
      const value = options[opt];
      const result = value === void 0 || validator2(value, opt, options);
      if (result !== true) {
        throw new AxiosError$1("option " + opt + " must be " + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
      }
      continue;
    }
    if (allowUnknown !== true) {
      throw new AxiosError$1("Unknown option " + opt, AxiosError$1.ERR_BAD_OPTION);
    }
  }
}
const validator = {
  assertOptions,
  validators: validators$1
};
const validators = validator.validators;
let Axios$1 = class Axios {
  constructor(instanceConfig) {
    this.defaults = instanceConfig || {};
    this.interceptors = {
      request: new InterceptorManager(),
      response: new InterceptorManager()
    };
  }
  /**
   * Dispatch a request
   *
   * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
   * @param {?Object} config
   *
   * @returns {Promise} The Promise to be fulfilled
   */
  async request(configOrUrl, config) {
    try {
      return await this._request(configOrUrl, config);
    } catch (err) {
      if (err instanceof Error) {
        let dummy = {};
        Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
        const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
        try {
          if (!err.stack) {
            err.stack = stack;
          } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
            err.stack += "\n" + stack;
          }
        } catch (e2) {
        }
      }
      throw err;
    }
  }
  _request(configOrUrl, config) {
    if (typeof configOrUrl === "string") {
      config = config || {};
      config.url = configOrUrl;
    } else {
      config = configOrUrl || {};
    }
    config = mergeConfig$1(this.defaults, config);
    const { transitional: transitional2, paramsSerializer, headers } = config;
    if (transitional2 !== void 0) {
      validator.assertOptions(transitional2, {
        silentJSONParsing: validators.transitional(validators.boolean),
        forcedJSONParsing: validators.transitional(validators.boolean),
        clarifyTimeoutError: validators.transitional(validators.boolean)
      }, false);
    }
    if (paramsSerializer != null) {
      if (utils$1.isFunction(paramsSerializer)) {
        config.paramsSerializer = {
          serialize: paramsSerializer
        };
      } else {
        validator.assertOptions(paramsSerializer, {
          encode: validators.function,
          serialize: validators.function
        }, true);
      }
    }
    if (config.allowAbsoluteUrls !== void 0) ;
    else if (this.defaults.allowAbsoluteUrls !== void 0) {
      config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
    } else {
      config.allowAbsoluteUrls = true;
    }
    validator.assertOptions(config, {
      baseUrl: validators.spelling("baseURL"),
      withXsrfToken: validators.spelling("withXSRFToken")
    }, true);
    config.method = (config.method || this.defaults.method || "get").toLowerCase();
    let contextHeaders = headers && utils$1.merge(
      headers.common,
      headers[config.method]
    );
    headers && utils$1.forEach(
      ["delete", "get", "head", "post", "put", "patch", "common"],
      (method) => {
        delete headers[method];
      }
    );
    config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
    const requestInterceptorChain = [];
    let synchronousRequestInterceptors = true;
    this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
      if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
        return;
      }
      synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
      requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
    });
    const responseInterceptorChain = [];
    this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
      responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
    });
    let promise;
    let i2 = 0;
    let len;
    if (!synchronousRequestInterceptors) {
      const chain = [dispatchRequest.bind(this), void 0];
      chain.unshift(...requestInterceptorChain);
      chain.push(...responseInterceptorChain);
      len = chain.length;
      promise = Promise.resolve(config);
      while (i2 < len) {
        promise = promise.then(chain[i2++], chain[i2++]);
      }
      return promise;
    }
    len = requestInterceptorChain.length;
    let newConfig = config;
    while (i2 < len) {
      const onFulfilled = requestInterceptorChain[i2++];
      const onRejected = requestInterceptorChain[i2++];
      try {
        newConfig = onFulfilled(newConfig);
      } catch (error) {
        onRejected.call(this, error);
        break;
      }
    }
    try {
      promise = dispatchRequest.call(this, newConfig);
    } catch (error) {
      return Promise.reject(error);
    }
    i2 = 0;
    len = responseInterceptorChain.length;
    while (i2 < len) {
      promise = promise.then(responseInterceptorChain[i2++], responseInterceptorChain[i2++]);
    }
    return promise;
  }
  getUri(config) {
    config = mergeConfig$1(this.defaults, config);
    const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
    return buildURL(fullPath, config.params, config.paramsSerializer);
  }
};
utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
  Axios$1.prototype[method] = function(url, config) {
    return this.request(mergeConfig$1(config || {}, {
      method,
      url,
      data: (config || {}).data
    }));
  };
});
utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
  function generateHTTPMethod(isForm) {
    return function httpMethod(url, data, config) {
      return this.request(mergeConfig$1(config || {}, {
        method,
        headers: isForm ? {
          "Content-Type": "multipart/form-data"
        } : {},
        url,
        data
      }));
    };
  }
  Axios$1.prototype[method] = generateHTTPMethod();
  Axios$1.prototype[method + "Form"] = generateHTTPMethod(true);
});
let CancelToken$1 = class CancelToken {
  constructor(executor) {
    if (typeof executor !== "function") {
      throw new TypeError("executor must be a function.");
    }
    let resolvePromise;
    this.promise = new Promise(function promiseExecutor(resolve) {
      resolvePromise = resolve;
    });
    const token = this;
    this.promise.then((cancel) => {
      if (!token._listeners) return;
      let i2 = token._listeners.length;
      while (i2-- > 0) {
        token._listeners[i2](cancel);
      }
      token._listeners = null;
    });
    this.promise.then = (onfulfilled) => {
      let _resolve;
      const promise = new Promise((resolve) => {
        token.subscribe(resolve);
        _resolve = resolve;
      }).then(onfulfilled);
      promise.cancel = function reject() {
        token.unsubscribe(_resolve);
      };
      return promise;
    };
    executor(function cancel(message, config, request) {
      if (token.reason) {
        return;
      }
      token.reason = new CanceledError$1(message, config, request);
      resolvePromise(token.reason);
    });
  }
  /**
   * Throws a `CanceledError` if cancellation has been requested.
   */
  throwIfRequested() {
    if (this.reason) {
      throw this.reason;
    }
  }
  /**
   * Subscribe to the cancel signal
   */
  subscribe(listener) {
    if (this.reason) {
      listener(this.reason);
      return;
    }
    if (this._listeners) {
      this._listeners.push(listener);
    } else {
      this._listeners = [listener];
    }
  }
  /**
   * Unsubscribe from the cancel signal
   */
  unsubscribe(listener) {
    if (!this._listeners) {
      return;
    }
    const index2 = this._listeners.indexOf(listener);
    if (index2 !== -1) {
      this._listeners.splice(index2, 1);
    }
  }
  toAbortSignal() {
    const controller = new AbortController();
    const abort = (err) => {
      controller.abort(err);
    };
    this.subscribe(abort);
    controller.signal.unsubscribe = () => this.unsubscribe(abort);
    return controller.signal;
  }
  /**
   * Returns an object that contains a new `CancelToken` and a function that, when called,
   * cancels the `CancelToken`.
   */
  static source() {
    let cancel;
    const token = new CancelToken(function executor(c2) {
      cancel = c2;
    });
    return {
      token,
      cancel
    };
  }
};
function spread$1(callback) {
  return function wrap(arr) {
    return callback.apply(null, arr);
  };
}
function isAxiosError$1(payload) {
  return utils$1.isObject(payload) && payload.isAxiosError === true;
}
const HttpStatusCode$1 = {
  Continue: 100,
  SwitchingProtocols: 101,
  Processing: 102,
  EarlyHints: 103,
  Ok: 200,
  Created: 201,
  Accepted: 202,
  NonAuthoritativeInformation: 203,
  NoContent: 204,
  ResetContent: 205,
  PartialContent: 206,
  MultiStatus: 207,
  AlreadyReported: 208,
  ImUsed: 226,
  MultipleChoices: 300,
  MovedPermanently: 301,
  Found: 302,
  SeeOther: 303,
  NotModified: 304,
  UseProxy: 305,
  Unused: 306,
  TemporaryRedirect: 307,
  PermanentRedirect: 308,
  BadRequest: 400,
  Unauthorized: 401,
  PaymentRequired: 402,
  Forbidden: 403,
  NotFound: 404,
  MethodNotAllowed: 405,
  NotAcceptable: 406,
  ProxyAuthenticationRequired: 407,
  RequestTimeout: 408,
  Conflict: 409,
  Gone: 410,
  LengthRequired: 411,
  PreconditionFailed: 412,
  PayloadTooLarge: 413,
  UriTooLong: 414,
  UnsupportedMediaType: 415,
  RangeNotSatisfiable: 416,
  ExpectationFailed: 417,
  ImATeapot: 418,
  MisdirectedRequest: 421,
  UnprocessableEntity: 422,
  Locked: 423,
  FailedDependency: 424,
  TooEarly: 425,
  UpgradeRequired: 426,
  PreconditionRequired: 428,
  TooManyRequests: 429,
  RequestHeaderFieldsTooLarge: 431,
  UnavailableForLegalReasons: 451,
  InternalServerError: 500,
  NotImplemented: 501,
  BadGateway: 502,
  ServiceUnavailable: 503,
  GatewayTimeout: 504,
  HttpVersionNotSupported: 505,
  VariantAlsoNegotiates: 506,
  InsufficientStorage: 507,
  LoopDetected: 508,
  NotExtended: 510,
  NetworkAuthenticationRequired: 511,
  WebServerIsDown: 521,
  ConnectionTimedOut: 522,
  OriginIsUnreachable: 523,
  TimeoutOccurred: 524,
  SslHandshakeFailed: 525,
  InvalidSslCertificate: 526
};
Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
  HttpStatusCode$1[value] = key;
});
function createInstance(defaultConfig) {
  const context = new Axios$1(defaultConfig);
  const instance2 = bind(Axios$1.prototype.request, context);
  utils$1.extend(instance2, Axios$1.prototype, context, { allOwnKeys: true });
  utils$1.extend(instance2, context, null, { allOwnKeys: true });
  instance2.create = function create(instanceConfig) {
    return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
  };
  return instance2;
}
const axios = createInstance(defaults);
axios.Axios = Axios$1;
axios.CanceledError = CanceledError$1;
axios.CancelToken = CancelToken$1;
axios.isCancel = isCancel$1;
axios.VERSION = VERSION$1;
axios.toFormData = toFormData$1;
axios.AxiosError = AxiosError$1;
axios.Cancel = axios.CanceledError;
axios.all = function all(promises) {
  return Promise.all(promises);
};
axios.spread = spread$1;
axios.isAxiosError = isAxiosError$1;
axios.mergeConfig = mergeConfig$1;
axios.AxiosHeaders = AxiosHeaders$1;
axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
axios.getAdapter = adapters.getAdapter;
axios.HttpStatusCode = HttpStatusCode$1;
axios.default = axios;
const {
  Axios: Axios2,
  AxiosError,
  CanceledError,
  isCancel,
  CancelToken: CancelToken2,
  VERSION,
  all: all2,
  Cancel,
  isAxiosError,
  spread,
  toFormData,
  AxiosHeaders: AxiosHeaders2,
  HttpStatusCode,
  formToJSON,
  getAdapter,
  mergeConfig
} = axios;
const { hostname } = window.location;
const API_BASE_URL$1 = `https://server.${hostname}/api/v1`;
const api = axios.create({
  baseURL: API_BASE_URL$1,
  headers: {
    "Content-Type": "application/json"
  }
});
let isRefreshing = false;
let failedQueue = [];
const processQueue = (error, token = null) => {
  failedQueue.forEach((prom) => {
    if (error) {
      prom.reject(error);
    } else {
      prom.resolve(token);
    }
  });
  failedQueue = [];
};
api.interceptors.request.use(
  (config) => {
    const token = localStorage.getItem("accessToken");
    if (token) {
      config.headers.Authorization = `Bearer ${token}`;
    }
    const language = localStorage.getItem("app_language") || localStorage.getItem("i18nextLng") || "en";
    config.headers["Accept-Language"] = language;
    return config;
  },
  (error) => {
    return Promise.reject(error);
  }
);
api.interceptors.response.use(
  (response) => response,
  async (error) => {
    var _a, _b, _c, _d, _e;
    const originalRequest = error.config;
    if (((_a = error.response) == null ? void 0 : _a.status) === 401 && !originalRequest._retry) {
      if (((_b = originalRequest.url) == null ? void 0 : _b.includes("/auth/login")) || ((_c = originalRequest.url) == null ? void 0 : _c.includes("/auth/register")) || ((_d = originalRequest.url) == null ? void 0 : _d.includes("/auth/refresh-token")) || ((_e = originalRequest.url) == null ? void 0 : _e.includes("/auth/send-otp"))) {
        return Promise.reject(error);
      }
      if (isRefreshing) {
        return new Promise((resolve, reject) => {
          failedQueue.push({ resolve, reject });
        }).then((token) => {
          originalRequest.headers.Authorization = `Bearer ${token}`;
          return api(originalRequest);
        }).catch((err) => {
          return Promise.reject(err);
        });
      }
      originalRequest._retry = true;
      isRefreshing = true;
      const refreshToken = localStorage.getItem("refreshToken");
      if (!refreshToken) {
        isRefreshing = false;
        handleLogout();
        return Promise.reject(error);
      }
      try {
        const response = await axios.post(`${API_BASE_URL$1}/auth/refresh-token`, {
          refreshToken
        });
        const { accessToken, refreshToken: newRefreshToken } = response.data.data || response.data;
        if (accessToken) {
          localStorage.setItem("accessToken", accessToken);
        }
        if (newRefreshToken) {
          localStorage.setItem("refreshToken", newRefreshToken);
        }
        api.defaults.headers.common["Authorization"] = `Bearer ${accessToken}`;
        originalRequest.headers.Authorization = `Bearer ${accessToken}`;
        processQueue(null, accessToken);
        isRefreshing = false;
        return api(originalRequest);
      } catch (refreshError) {
        processQueue(refreshError, null);
        isRefreshing = false;
        handleLogout();
        return Promise.reject(refreshError);
      }
    }
    return Promise.reject(error);
  }
);
const handleLogout = () => {
  localStorage.removeItem("accessToken");
  localStorage.removeItem("refreshToken");
  localStorage.removeItem("user");
  if (window.location.pathname !== "/" && !window.location.pathname.includes("/register")) {
    window.location.href = "/";
  }
};
let e = { data: "" }, t = (t2) => {
  if ("object" == typeof window) {
    let e2 = (t2 ? t2.querySelector("#_goober") : window._goober) || Object.assign(document.createElement("style"), { innerHTML: " ", id: "_goober" });
    return e2.nonce = window.__nonce__, e2.parentNode || (t2 || document.head).appendChild(e2), e2.firstChild;
  }
  return t2 || e;
}, l = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, a = /\/\*[^]*?\*\/|  +/g, n$1 = /\n+/g, o = (e2, t2) => {
  let r = "", l2 = "", a2 = "";
  for (let n2 in e2) {
    let c2 = e2[n2];
    "@" == n2[0] ? "i" == n2[1] ? r = n2 + " " + c2 + ";" : l2 += "f" == n2[1] ? o(c2, n2) : n2 + "{" + o(c2, "k" == n2[1] ? "" : t2) + "}" : "object" == typeof c2 ? l2 += o(c2, t2 ? t2.replace(/([^,])+/g, (e3) => n2.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g, (t3) => /&/.test(t3) ? t3.replace(/&/g, e3) : e3 ? e3 + " " + t3 : t3)) : n2) : null != c2 && (n2 = /^--/.test(n2) ? n2 : n2.replace(/[A-Z]/g, "-$&").toLowerCase(), a2 += o.p ? o.p(n2, c2) : n2 + ":" + c2 + ";");
  }
  return r + (t2 && a2 ? t2 + "{" + a2 + "}" : a2) + l2;
}, c = {}, s = (e2) => {
  if ("object" == typeof e2) {
    let t2 = "";
    for (let r in e2) t2 += r + s(e2[r]);
    return t2;
  }
  return e2;
}, i = (e2, t2, r, i2, p2) => {
  let u2 = s(e2), d2 = c[u2] || (c[u2] = ((e3) => {
    let t3 = 0, r2 = 11;
    for (; t3 < e3.length; ) r2 = 101 * r2 + e3.charCodeAt(t3++) >>> 0;
    return "go" + r2;
  })(u2));
  if (!c[d2]) {
    let t3 = u2 !== e2 ? e2 : ((e3) => {
      let t4, r2, o2 = [{}];
      for (; t4 = l.exec(e3.replace(a, "")); ) t4[4] ? o2.shift() : t4[3] ? (r2 = t4[3].replace(n$1, " ").trim(), o2.unshift(o2[0][r2] = o2[0][r2] || {})) : o2[0][t4[1]] = t4[2].replace(n$1, " ").trim();
      return o2[0];
    })(e2);
    c[d2] = o(p2 ? { ["@keyframes " + d2]: t3 } : t3, r ? "" : "." + d2);
  }
  let f2 = r && c.g ? c.g : null;
  return r && (c.g = c[d2]), ((e3, t3, r2, l2) => {
    l2 ? t3.data = t3.data.replace(l2, e3) : -1 === t3.data.indexOf(e3) && (t3.data = r2 ? e3 + t3.data : t3.data + e3);
  })(c[d2], t2, i2, f2), d2;
}, p = (e2, t2, r) => e2.reduce((e3, l2, a2) => {
  let n2 = t2[a2];
  if (n2 && n2.call) {
    let e4 = n2(r), t3 = e4 && e4.props && e4.props.className || /^go/.test(e4) && e4;
    n2 = t3 ? "." + t3 : e4 && "object" == typeof e4 ? e4.props ? "" : o(e4, "") : false === e4 ? "" : e4;
  }
  return e3 + l2 + (null == n2 ? "" : n2);
}, "");
function u(e2) {
  let r = this || {}, l2 = e2.call ? e2(r.p) : e2;
  return i(l2.unshift ? l2.raw ? p(l2, [].slice.call(arguments, 1), r.p) : l2.reduce((e3, t2) => Object.assign(e3, t2 && t2.call ? t2(r.p) : t2), {}) : l2, t(r.target), r.g, r.o, r.k);
}
let d, f$1, g;
u.bind({ g: 1 });
let h$1 = u.bind({ k: 1 });
function m(e2, t2, r, l2) {
  o.p = t2, d = e2, f$1 = r, g = l2;
}
function w$1(e2, t2) {
  let r = this || {};
  return function() {
    let l2 = arguments;
    function a2(n2, o2) {
      let c2 = Object.assign({}, n2), s2 = c2.className || a2.className;
      r.p = Object.assign({ theme: f$1 && f$1() }, c2), r.o = / *go\d+/.test(s2), c2.className = u.apply(r, l2) + (s2 ? " " + s2 : "");
      let i2 = e2;
      return e2[0] && (i2 = c2.as || e2, delete c2.as), g && i2[0] && g(c2), d(i2, c2);
    }
    return a2;
  };
}
var Z = (e2) => typeof e2 == "function", h = (e2, t2) => Z(e2) ? e2(t2) : e2;
var W = /* @__PURE__ */ (() => {
  let e2 = 0;
  return () => (++e2).toString();
})(), E = /* @__PURE__ */ (() => {
  let e2;
  return () => {
    if (e2 === void 0 && typeof window < "u") {
      let t2 = matchMedia("(prefers-reduced-motion: reduce)");
      e2 = !t2 || t2.matches;
    }
    return e2;
  };
})();
var re = 20, k = "default";
var H = (e2, t2) => {
  let { toastLimit: o2 } = e2.settings;
  switch (t2.type) {
    case 0:
      return { ...e2, toasts: [t2.toast, ...e2.toasts].slice(0, o2) };
    case 1:
      return { ...e2, toasts: e2.toasts.map((r) => r.id === t2.toast.id ? { ...r, ...t2.toast } : r) };
    case 2:
      let { toast: s2 } = t2;
      return H(e2, { type: e2.toasts.find((r) => r.id === s2.id) ? 1 : 0, toast: s2 });
    case 3:
      let { toastId: a2 } = t2;
      return { ...e2, toasts: e2.toasts.map((r) => r.id === a2 || a2 === void 0 ? { ...r, dismissed: true, visible: false } : r) };
    case 4:
      return t2.toastId === void 0 ? { ...e2, toasts: [] } : { ...e2, toasts: e2.toasts.filter((r) => r.id !== t2.toastId) };
    case 5:
      return { ...e2, pausedAt: t2.time };
    case 6:
      let i2 = t2.time - (e2.pausedAt || 0);
      return { ...e2, pausedAt: void 0, toasts: e2.toasts.map((r) => ({ ...r, pauseDuration: r.pauseDuration + i2 })) };
  }
}, v = [], j = { toasts: [], pausedAt: void 0, settings: { toastLimit: re } }, f = {}, Y = (e2, t2 = k) => {
  f[t2] = H(f[t2] || j, e2), v.forEach(([o2, s2]) => {
    o2 === t2 && s2(f[t2]);
  });
}, _ = (e2) => Object.keys(f).forEach((t2) => Y(e2, t2)), Q = (e2) => Object.keys(f).find((t2) => f[t2].toasts.some((o2) => o2.id === e2)), S = (e2 = k) => (t2) => {
  Y(t2, e2);
}, se = { blank: 4e3, error: 4e3, success: 2e3, loading: 1 / 0, custom: 4e3 }, V = (e2 = {}, t2 = k) => {
  let [o2, s2] = reactExports.useState(f[t2] || j), a2 = reactExports.useRef(f[t2]);
  reactExports.useEffect(() => (a2.current !== f[t2] && s2(f[t2]), v.push([t2, s2]), () => {
    let r = v.findIndex(([l2]) => l2 === t2);
    r > -1 && v.splice(r, 1);
  }), [t2]);
  let i2 = o2.toasts.map((r) => {
    var l2, g2, T;
    return { ...e2, ...e2[r.type], ...r, removeDelay: r.removeDelay || ((l2 = e2[r.type]) == null ? void 0 : l2.removeDelay) || (e2 == null ? void 0 : e2.removeDelay), duration: r.duration || ((g2 = e2[r.type]) == null ? void 0 : g2.duration) || (e2 == null ? void 0 : e2.duration) || se[r.type], style: { ...e2.style, ...(T = e2[r.type]) == null ? void 0 : T.style, ...r.style } };
  });
  return { ...o2, toasts: i2 };
};
var ie = (e2, t2 = "blank", o2) => ({ createdAt: Date.now(), visible: true, dismissed: false, type: t2, ariaProps: { role: "status", "aria-live": "polite" }, message: e2, pauseDuration: 0, ...o2, id: (o2 == null ? void 0 : o2.id) || W() }), P = (e2) => (t2, o2) => {
  let s2 = ie(t2, e2, o2);
  return S(s2.toasterId || Q(s2.id))({ type: 2, toast: s2 }), s2.id;
}, n = (e2, t2) => P("blank")(e2, t2);
n.error = P("error");
n.success = P("success");
n.loading = P("loading");
n.custom = P("custom");
n.dismiss = (e2, t2) => {
  let o2 = { type: 3, toastId: e2 };
  t2 ? S(t2)(o2) : _(o2);
};
n.dismissAll = (e2) => n.dismiss(void 0, e2);
n.remove = (e2, t2) => {
  let o2 = { type: 4, toastId: e2 };
  t2 ? S(t2)(o2) : _(o2);
};
n.removeAll = (e2) => n.remove(void 0, e2);
n.promise = (e2, t2, o2) => {
  let s2 = n.loading(t2.loading, { ...o2, ...o2 == null ? void 0 : o2.loading });
  return typeof e2 == "function" && (e2 = e2()), e2.then((a2) => {
    let i2 = t2.success ? h(t2.success, a2) : void 0;
    return i2 ? n.success(i2, { id: s2, ...o2, ...o2 == null ? void 0 : o2.success }) : n.dismiss(s2), a2;
  }).catch((a2) => {
    let i2 = t2.error ? h(t2.error, a2) : void 0;
    i2 ? n.error(i2, { id: s2, ...o2, ...o2 == null ? void 0 : o2.error }) : n.dismiss(s2);
  }), e2;
};
var ce = 1e3, w = (e2, t2 = "default") => {
  let { toasts: o2, pausedAt: s2 } = V(e2, t2), a2 = reactExports.useRef(/* @__PURE__ */ new Map()).current, i2 = reactExports.useCallback((c2, m2 = ce) => {
    if (a2.has(c2)) return;
    let p2 = setTimeout(() => {
      a2.delete(c2), r({ type: 4, toastId: c2 });
    }, m2);
    a2.set(c2, p2);
  }, []);
  reactExports.useEffect(() => {
    if (s2) return;
    let c2 = Date.now(), m2 = o2.map((p2) => {
      if (p2.duration === 1 / 0) return;
      let R = (p2.duration || 0) + p2.pauseDuration - (c2 - p2.createdAt);
      if (R < 0) {
        p2.visible && n.dismiss(p2.id);
        return;
      }
      return setTimeout(() => n.dismiss(p2.id, t2), R);
    });
    return () => {
      m2.forEach((p2) => p2 && clearTimeout(p2));
    };
  }, [o2, s2, t2]);
  let r = reactExports.useCallback(S(t2), [t2]), l2 = reactExports.useCallback(() => {
    r({ type: 5, time: Date.now() });
  }, [r]), g2 = reactExports.useCallback((c2, m2) => {
    r({ type: 1, toast: { id: c2, height: m2 } });
  }, [r]), T = reactExports.useCallback(() => {
    s2 && r({ type: 6, time: Date.now() });
  }, [s2, r]), d2 = reactExports.useCallback((c2, m2) => {
    let { reverseOrder: p2 = false, gutter: R = 8, defaultPosition: z } = m2 || {}, O2 = o2.filter((u2) => (u2.position || z) === (c2.position || z) && u2.height), K = O2.findIndex((u2) => u2.id === c2.id), B = O2.filter((u2, I) => I < K && u2.visible).length;
    return O2.filter((u2) => u2.visible).slice(...p2 ? [B + 1] : [0, B]).reduce((u2, I) => u2 + (I.height || 0) + R, 0);
  }, [o2]);
  return reactExports.useEffect(() => {
    o2.forEach((c2) => {
      if (c2.dismissed) i2(c2.id, c2.removeDelay);
      else {
        let m2 = a2.get(c2.id);
        m2 && (clearTimeout(m2), a2.delete(c2.id));
      }
    });
  }, [o2, i2]), { toasts: o2, handlers: { updateHeight: g2, startPause: l2, endPause: T, calculateOffset: d2 } };
};
var de = h$1`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
 transform: scale(1) rotate(45deg);
  opacity: 1;
}`, me = h$1`
from {
  transform: scale(0);
  opacity: 0;
}
to {
  transform: scale(1);
  opacity: 1;
}`, le = h$1`
from {
  transform: scale(0) rotate(90deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(90deg);
	opacity: 1;
}`, C = w$1("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${(e2) => e2.primary || "#ff4b4b"};
  position: relative;
  transform: rotate(45deg);

  animation: ${de} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;

  &:after,
  &:before {
    content: '';
    animation: ${me} 0.15s ease-out forwards;
    animation-delay: 150ms;
    position: absolute;
    border-radius: 3px;
    opacity: 0;
    background: ${(e2) => e2.secondary || "#fff"};
    bottom: 9px;
    left: 4px;
    height: 2px;
    width: 12px;
  }

  &:before {
    animation: ${le} 0.15s ease-out forwards;
    animation-delay: 180ms;
    transform: rotate(90deg);
  }
`;
var Te = h$1`
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
`, F = w$1("div")`
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 2px solid;
  border-radius: 100%;
  border-color: ${(e2) => e2.secondary || "#e0e0e0"};
  border-right-color: ${(e2) => e2.primary || "#616161"};
  animation: ${Te} 1s linear infinite;
`;
var ge = h$1`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(45deg);
	opacity: 1;
}`, he = h$1`
0% {
	height: 0;
	width: 0;
	opacity: 0;
}
40% {
  height: 0;
	width: 6px;
	opacity: 1;
}
100% {
  opacity: 1;
  height: 10px;
}`, L = w$1("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${(e2) => e2.primary || "#61d345"};
  position: relative;
  transform: rotate(45deg);

  animation: ${ge} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;
  &:after {
    content: '';
    box-sizing: border-box;
    animation: ${he} 0.2s ease-out forwards;
    opacity: 0;
    animation-delay: 200ms;
    position: absolute;
    border-right: 2px solid;
    border-bottom: 2px solid;
    border-color: ${(e2) => e2.secondary || "#fff"};
    bottom: 6px;
    left: 6px;
    height: 10px;
    width: 6px;
  }
`;
var be = w$1("div")`
  position: absolute;
`, Se = w$1("div")`
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  min-height: 20px;
`, Ae = h$1`
from {
  transform: scale(0.6);
  opacity: 0.4;
}
to {
  transform: scale(1);
  opacity: 1;
}`, Pe = w$1("div")`
  position: relative;
  transform: scale(0.6);
  opacity: 0.4;
  min-width: 20px;
  animation: ${Ae} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
`, $ = ({ toast: e2 }) => {
  let { icon: t2, type: o2, iconTheme: s2 } = e2;
  return t2 !== void 0 ? typeof t2 == "string" ? reactExports.createElement(Pe, null, t2) : t2 : o2 === "blank" ? null : reactExports.createElement(Se, null, reactExports.createElement(F, { ...s2 }), o2 !== "loading" && reactExports.createElement(be, null, o2 === "error" ? reactExports.createElement(C, { ...s2 }) : reactExports.createElement(L, { ...s2 })));
};
var Re = (e2) => `
0% {transform: translate3d(0,${e2 * -200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`, Ee = (e2) => `
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${e2 * -150}%,-1px) scale(.6); opacity:0;}
`, ve = "0%{opacity:0;} 100%{opacity:1;}", De = "0%{opacity:1;} 100%{opacity:0;}", Oe = w$1("div")`
  display: flex;
  align-items: center;
  background: #fff;
  color: #363636;
  line-height: 1.3;
  will-change: transform;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
  max-width: 350px;
  pointer-events: auto;
  padding: 8px 10px;
  border-radius: 8px;
`, Ie = w$1("div")`
  display: flex;
  justify-content: center;
  margin: 4px 10px;
  color: inherit;
  flex: 1 1 auto;
  white-space: pre-line;
`, ke = (e2, t2) => {
  let s2 = e2.includes("top") ? 1 : -1, [a2, i2] = E() ? [ve, De] : [Re(s2), Ee(s2)];
  return { animation: t2 ? `${h$1(a2)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards` : `${h$1(i2)} 0.4s forwards cubic-bezier(.06,.71,.55,1)` };
}, N = reactExports.memo(({ toast: e2, position: t2, style: o2, children: s2 }) => {
  let a2 = e2.height ? ke(e2.position || t2 || "top-center", e2.visible) : { opacity: 0 }, i2 = reactExports.createElement($, { toast: e2 }), r = reactExports.createElement(Ie, { ...e2.ariaProps }, h(e2.message, e2));
  return reactExports.createElement(Oe, { className: e2.className, style: { ...a2, ...o2, ...e2.style } }, typeof s2 == "function" ? s2({ icon: i2, message: r }) : reactExports.createElement(reactExports.Fragment, null, i2, r));
});
m(reactExports.createElement);
var we = ({ id: e2, className: t2, style: o2, onHeightUpdate: s2, children: a2 }) => {
  let i2 = reactExports.useCallback((r) => {
    if (r) {
      let l2 = () => {
        let g2 = r.getBoundingClientRect().height;
        s2(e2, g2);
      };
      l2(), new MutationObserver(l2).observe(r, { subtree: true, childList: true, characterData: true });
    }
  }, [e2, s2]);
  return reactExports.createElement("div", { ref: i2, className: t2, style: o2 }, a2);
}, Me = (e2, t2) => {
  let o2 = e2.includes("top"), s2 = o2 ? { top: 0 } : { bottom: 0 }, a2 = e2.includes("center") ? { justifyContent: "center" } : e2.includes("right") ? { justifyContent: "flex-end" } : {};
  return { left: 0, right: 0, display: "flex", position: "absolute", transition: E() ? void 0 : "all 230ms cubic-bezier(.21,1.02,.73,1)", transform: `translateY(${t2 * (o2 ? 1 : -1)}px)`, ...s2, ...a2 };
}, Ce = u`
  z-index: 9999;
  > * {
    pointer-events: auto;
  }
`, D = 16, Fe = ({ reverseOrder: e2, position: t2 = "top-center", toastOptions: o2, gutter: s2, children: a2, toasterId: i2, containerStyle: r, containerClassName: l2 }) => {
  let { toasts: g2, handlers: T } = w(o2, i2);
  return reactExports.createElement("div", { "data-rht-toaster": i2 || "", style: { position: "fixed", zIndex: 9999, top: D, left: D, right: D, bottom: D, pointerEvents: "none", ...r }, className: l2, onMouseEnter: T.startPause, onMouseLeave: T.endPause }, g2.map((d2) => {
    let c2 = d2.position || t2, m2 = T.calculateOffset(d2, { reverseOrder: e2, gutter: s2, defaultPosition: t2 }), p2 = Me(c2, m2);
    return reactExports.createElement(we, { id: d2.id, key: d2.id, onHeightUpdate: T.updateHeight, className: d2.visible ? Ce : "", style: p2 }, d2.type === "custom" ? h(d2.message, d2) : a2 ? a2(d2) : reactExports.createElement(N, { toast: d2, position: c2 }));
  }));
};
var zt = n;
const activeToasts = /* @__PURE__ */ new Set();
const createToast = (type, message, options = {}) => {
  const key = `${type}-${message}`;
  if (activeToasts.has(key)) {
    return;
  }
  activeToasts.add(key);
  const defaultOptions2 = {
    duration: 4e3,
    position: "top-center",
    ...options
  };
  let toastId;
  switch (type) {
    case "success":
      toastId = n.success(message, defaultOptions2);
      break;
    case "error":
      toastId = n.error(message, defaultOptions2);
      break;
    case "loading":
      toastId = n.loading(message, defaultOptions2);
      break;
    default:
      toastId = n(message, defaultOptions2);
  }
  setTimeout(() => {
    activeToasts.delete(key);
  }, defaultOptions2.duration + 500);
  return toastId;
};
const toast = {
  success: (message, options) => createToast("success", message, options),
  error: (message, options) => createToast("error", message, options),
  loading: (message, options) => createToast("loading", message, options),
  dismiss: n.dismiss,
  remove: n.remove,
  // Clear all active toasts
  clear: () => {
    activeToasts.clear();
    n.dismiss();
  },
  // Auth-specific toasts with predefined messages
  auth: {
    loginSuccess: () => createToast("success", "Login successful!", { duration: 3e3 }),
    loginError: (error) => createToast("error", error || "Login failed", { duration: 5e3 }),
    otpSent: () => createToast("success", "OTP sent successfully!", { duration: 3e3 }),
    otpError: (error) => createToast("error", error || "Failed to send OTP", { duration: 5e3 }),
    registerSuccess: () => createToast("success", "Registration successful!", { duration: 3e3 }),
    registerError: (error) => createToast("error", error || "Registration failed", { duration: 5e3 }),
    googleLoginSuccess: () => createToast("success", "Login successful with Google!", { duration: 3e3 }),
    googleLoginError: (error) => createToast("error", error || "Google login failed", { duration: 5e3 })
  }
};
const isSSR$4 = typeof window === "undefined";
const getUserFromStorage = () => {
  if (isSSR$4) return null;
  try {
    const user = localStorage.getItem("user");
    return user ? JSON.parse(user) : null;
  } catch (error) {
    return null;
  }
};
const getTokenFromStorage = () => {
  if (isSSR$4) return null;
  return localStorage.getItem("accessToken") || null;
};
const initialState$5 = {
  user: getUserFromStorage(),
  token: getTokenFromStorage(),
  isAuthenticated: !!getTokenFromStorage(),
  loading: false,
  error: null,
  otpSent: false,
  message: null,
  // For success messages
  registerSuccess: false,
  // To trigger redirects after registration
  profileLoading: false,
  // Specific loading states
  passwordLoading: false,
  socialConfig: null
  // For storing enabled providers and client IDs
};
const getCurrentUser = createAsyncThunk(
  "auth/getCurrentUser",
  async (_2, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.post("/auth/");
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch user" });
    }
  }
);
const registerUser = createAsyncThunk(
  "auth/register",
  async (formData, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.post("/auth/register", formData, {
        headers: {
          "Content-Type": "multipart/form-data"
        }
      });
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Registration failed" });
    }
  }
);
const sendOtp = createAsyncThunk(
  "auth/sendOtp",
  async ({ identifier, type = "phone" }, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.post("/auth/send-otp", {
        identifier,
        type
      });
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to send OTP" });
    }
  }
);
const login = createAsyncThunk(
  "auth/login",
  async ({ phone, otp, email, password }, { rejectWithValue }) => {
    var _a, _b, _c, _d;
    try {
      const payload = {};
      if (phone && otp) {
        payload.phone = phone;
        payload.otp = otp;
      } else if (email && password) {
        payload.email = email;
        payload.password = password;
      }
      const response = await api.post("/auth/login", payload);
      const userRole = ((_b = (_a = response.data) == null ? void 0 : _a.user) == null ? void 0 : _b.role) || ((_c = response.data) == null ? void 0 : _c.role);
      if (userRole && userRole !== "user") {
        return rejectWithValue({ message: "Access denied. This panel is only for User accounts." });
      }
      return response.data;
    } catch (error) {
      return rejectWithValue(((_d = error.response) == null ? void 0 : _d.data) || { message: "Login failed" });
    }
  }
);
const logoutUser = createAsyncThunk(
  "auth/logout",
  async (_2, { rejectWithValue }) => {
    try {
      await api.post("/auth/logout");
      return null;
    } catch (error) {
      console.warn("Server logout failed, clearing local state anyway", error);
      return null;
    }
  }
);
createAsyncThunk(
  "auth/refreshToken",
  async (_2, { rejectWithValue }) => {
    var _a;
    try {
      const currentRefreshToken = localStorage.getItem("refreshToken");
      if (!currentRefreshToken) throw new Error("No refresh token");
      const response = await api.post("/auth/refresh-token", {
        refreshToken: currentRefreshToken
      });
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Session expired" });
    }
  }
);
createAsyncThunk(
  "auth/forgotPassword",
  async (email, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.post("/auth/forget-password", { email });
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to send reset link" });
    }
  }
);
createAsyncThunk(
  "auth/resetPassword",
  async ({ resetToken, password }, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.post("/auth/reset-password", {
        resetToken,
        password
      });
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Password reset failed" });
    }
  }
);
const getProfile = createAsyncThunk(
  "auth/getProfile",
  async (_2, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get("/auth/profile");
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch profile" });
    }
  }
);
const updateProfile = createAsyncThunk(
  "auth/updateProfile",
  async (profileData, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.patch("/auth/profile", profileData);
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to update profile" });
    }
  }
);
const changePassword = createAsyncThunk(
  "auth/changePassword",
  async ({ currentPassword, newPassword }, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.patch("/auth/password", {
        currentPassword,
        newPassword
      });
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to change password" });
    }
  }
);
const deleteAccount = createAsyncThunk(
  "auth/deleteAccount",
  async (_2, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.delete("/auth/profile");
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to delete account" });
    }
  }
);
const getSocialConfig = createAsyncThunk(
  "auth/getSocialConfig",
  async (_2, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get("/auth/social/config");
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch social config" });
    }
  }
);
const loginWithGoogle = createAsyncThunk(
  "auth/loginWithGoogle",
  async ({ token }, { rejectWithValue }) => {
    var _a, _b, _c, _d;
    try {
      const response = await api.post("/auth/social/google", {
        token,
        tokenType: "id_token"
      });
      const userRole = ((_b = (_a = response.data) == null ? void 0 : _a.user) == null ? void 0 : _b.role) || ((_c = response.data) == null ? void 0 : _c.role);
      if (userRole && userRole !== "user") {
        return rejectWithValue({ message: "Access denied. This panel is only for User accounts." });
      }
      return response.data;
    } catch (error) {
      return rejectWithValue(((_d = error.response) == null ? void 0 : _d.data) || { message: "Google login failed" });
    }
  }
);
const authSlice = createSlice({
  name: "auth",
  initialState: initialState$5,
  reducers: {
    resetAuth: (state) => {
      state.loading = false;
      state.error = null;
      state.message = null;
      state.otpSent = false;
      state.registerSuccess = false;
    },
    clearErrors: (state) => {
      state.error = null;
    }
  },
  extraReducers: (builder) => {
    builder.addCase(sendOtp.pending, (state) => {
      state.loading = true;
      state.error = null;
      state.otpSent = false;
    }).addCase(sendOtp.fulfilled, (state) => {
      state.loading = false;
      state.otpSent = true;
      state.message = "OTP sent successfully";
      toast.auth.otpSent();
    }).addCase(sendOtp.rejected, (state, action) => {
      var _a, _b;
      state.loading = false;
      state.error = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to send OTP";
      state.otpSent = false;
      toast.auth.otpError((_b = action.payload) == null ? void 0 : _b.message);
    });
    builder.addCase(login.pending, (state) => {
      state.loading = true;
      state.error = null;
    }).addCase(login.fulfilled, (state, action) => {
      var _a, _b, _c, _d;
      state.loading = false;
      state.isAuthenticated = true;
      state.user = action.payload.user || ((_a = action.payload.data) == null ? void 0 : _a.user);
      state.token = action.payload.accessToken || ((_b = action.payload.data) == null ? void 0 : _b.accessToken);
      if (state.user) localStorage.setItem("user", JSON.stringify(state.user));
      if (state.token) localStorage.setItem("accessToken", state.token);
      if (action.payload.refreshToken || ((_c = action.payload.data) == null ? void 0 : _c.refreshToken)) {
        localStorage.setItem("refreshToken", action.payload.refreshToken || ((_d = action.payload.data) == null ? void 0 : _d.refreshToken));
      }
      toast.auth.loginSuccess();
    }).addCase(login.rejected, (state, action) => {
      var _a, _b;
      state.loading = false;
      state.error = ((_a = action.payload) == null ? void 0 : _a.message) || "Login failed";
      state.isAuthenticated = false;
      toast.auth.loginError((_b = action.payload) == null ? void 0 : _b.message);
    });
    builder.addCase(registerUser.pending, (state) => {
      state.loading = true;
      state.error = null;
      state.registerSuccess = false;
    }).addCase(registerUser.fulfilled, (state, action) => {
      state.loading = false;
      state.registerSuccess = true;
      state.message = "Registration successful! Please login.";
      toast.auth.registerSuccess();
    }).addCase(registerUser.rejected, (state, action) => {
      var _a, _b;
      state.loading = false;
      state.error = ((_a = action.payload) == null ? void 0 : _a.message) || "Registration failed";
      state.registerSuccess = false;
      toast.auth.registerError((_b = action.payload) == null ? void 0 : _b.message);
    });
    builder.addCase(logoutUser.fulfilled, (state) => {
      state.user = null;
      state.token = null;
      state.isAuthenticated = false;
      state.otpSent = false;
      localStorage.removeItem("user");
      localStorage.removeItem("accessToken");
      localStorage.removeItem("refreshToken");
    }).addCase(logoutUser.rejected, (state) => {
      state.user = null;
      state.token = null;
      state.isAuthenticated = false;
      localStorage.removeItem("user");
      localStorage.removeItem("accessToken");
      localStorage.removeItem("refreshToken");
    });
    builder.addCase(getCurrentUser.fulfilled, (state, action) => {
      state.user = action.payload.data || action.payload;
      localStorage.setItem("user", JSON.stringify(state.user));
    }).addCase(getCurrentUser.rejected, (state) => {
    });
    builder.addCase(getProfile.pending, (state) => {
      state.profileLoading = true;
    }).addCase(getProfile.fulfilled, (state, action) => {
      state.profileLoading = false;
      state.user = action.payload.data || action.payload.user || action.payload;
      localStorage.setItem("user", JSON.stringify(state.user));
    }).addCase(getProfile.rejected, (state, action) => {
      var _a;
      state.profileLoading = false;
      state.error = (_a = action.payload) == null ? void 0 : _a.message;
    });
    builder.addCase(updateProfile.pending, (state) => {
      state.profileLoading = true;
    }).addCase(updateProfile.fulfilled, (state, action) => {
      state.profileLoading = false;
      const updatedUser = action.payload.user || action.payload.data || action.payload;
      state.user = { ...state.user, ...updatedUser };
      localStorage.setItem("user", JSON.stringify(state.user));
      state.message = action.payload.message || "Profile updated successfully";
    }).addCase(updateProfile.rejected, (state, action) => {
      var _a;
      state.profileLoading = false;
      state.error = (_a = action.payload) == null ? void 0 : _a.message;
    });
    builder.addCase(changePassword.pending, (state) => {
      state.passwordLoading = true;
    }).addCase(changePassword.fulfilled, (state) => {
      state.passwordLoading = false;
      state.message = "Password changed successfully";
    }).addCase(changePassword.rejected, (state, action) => {
      var _a;
      state.passwordLoading = false;
      state.error = (_a = action.payload) == null ? void 0 : _a.message;
    });
    builder.addCase(deleteAccount.fulfilled, (state) => {
      state.user = null;
      state.token = null;
      state.isAuthenticated = false;
      localStorage.clear();
    });
    builder.addCase(getSocialConfig.fulfilled, (state, action) => {
      state.socialConfig = action.payload.data;
    });
    builder.addCase(loginWithGoogle.pending, (state) => {
      state.loading = true;
      state.error = null;
    }).addCase(loginWithGoogle.fulfilled, (state, action) => {
      state.loading = false;
      state.isAuthenticated = true;
      state.user = action.payload.user;
      state.token = action.payload.accessToken;
      if (state.user) localStorage.setItem("user", JSON.stringify(state.user));
      if (state.token) localStorage.setItem("accessToken", state.token);
      if (action.payload.refreshToken) {
        localStorage.setItem("refreshToken", action.payload.refreshToken);
      }
      toast.auth.googleLoginSuccess();
    }).addCase(loginWithGoogle.rejected, (state, action) => {
      var _a, _b;
      state.loading = false;
      state.error = ((_a = action.payload) == null ? void 0 : _a.message) || "Google login failed";
      state.isAuthenticated = false;
      toast.auth.googleLoginError((_b = action.payload) == null ? void 0 : _b.message);
    });
  }
});
const { resetAuth, clearErrors: clearErrors$2 } = authSlice.actions;
const authReducer = authSlice.reducer;
const searchCabs = createAsyncThunk(
  "booking/searchCabs",
  async (searchParams, { rejectWithValue }) => {
    var _a;
    try {
      const {
        // Coordinates - frontend uses sourceLat/sourceLong but backend expects picklat/picklng
        sourceLat,
        // Will be sent as picklat
        sourceLong,
        // Will be sent as picklng
        destLat,
        // Will be sent as droplat
        destLong,
        // Will be sent as droplng
        // Trip details
        tripType = "oneWay",
        distance,
        // Distance in km
        // Filters
        fuelType = "petrol",
        isAc = true,
        // Backend expects boolean or 'true'/'false'
        // Time
        startTime,
        // Will be sent as scheduledTime
        // Rental package
        rentalPackage,
        // { hours, distance }
        // Pagination
        page = 1,
        limit = 10
      } = searchParams;
      const params = new URLSearchParams();
      params.append("picklat", sourceLat.toString());
      params.append("picklng", sourceLong.toString());
      if (destLat) params.append("droplat", destLat.toString());
      if (destLong) params.append("droplng", destLong.toString());
      if (distance) params.append("distance", distance.toString());
      params.append("tripType", tripType);
      params.append("fuelType", fuelType);
      params.append("isAc", typeof isAc === "boolean" ? isAc.toString() : isAc);
      if (tripType === "rental" && rentalPackage) {
        params.append("rentalPackageHours", rentalPackage.hours.toString());
        params.append("rentalPackageDistance", rentalPackage.distance.toString());
      }
      if (startTime) params.append("scheduledTime", startTime);
      params.append("page", page.toString());
      params.append("limit", limit.toString());
      const response = await api.get(`/booking/search-cabs?${params.toString()}`);
      return response.data;
    } catch (error) {
      return rejectWithValue(
        ((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to search cabs" }
      );
    }
  }
);
const getBookingReview = createAsyncThunk(
  "booking/getBookingReview",
  async (reviewParams, { rejectWithValue }) => {
    var _a;
    try {
      const {
        vehicleId,
        picklat,
        picklng,
        pickupAddress,
        pickupCity,
        pickupState,
        droplat,
        droplng,
        dropAddress,
        dropCity,
        dropState,
        distance,
        tripType = "oneWay",
        fuelType = "petrol",
        isAc = true,
        // Can be boolean or string
        scheduledTime,
        promoCode,
        rentalPackage
      } = reviewParams;
      if (!vehicleId || !picklat || !picklng || !distance) {
        return rejectWithValue({ message: "Missing required fields: vehicleId, pickup coordinates, and distance are mandatory" });
      }
      const params = new URLSearchParams();
      params.append("vehicleId", vehicleId);
      params.append("picklat", picklat.toString());
      params.append("picklng", picklng.toString());
      params.append("distance", distance.toString());
      params.append("tripType", tripType);
      params.append("fuelType", fuelType);
      params.append("isAc", typeof isAc === "boolean" ? isAc.toString() : isAc);
      if (rentalPackage) {
        params.append("rentalPackage", JSON.stringify(rentalPackage));
      }
      if (pickupAddress) params.append("pickupAddress", pickupAddress);
      if (pickupCity) params.append("pickupCity", pickupCity);
      if (pickupState) params.append("pickupState", pickupState);
      if (droplat) params.append("droplat", droplat.toString());
      if (droplng) params.append("droplng", droplng.toString());
      if (dropAddress) params.append("dropAddress", dropAddress);
      if (dropCity) params.append("dropCity", dropCity);
      if (dropState) params.append("dropState", dropState);
      if (scheduledTime) params.append("scheduledTime", scheduledTime);
      if (promoCode) params.append("promoCode", promoCode);
      const response = await api.get(`/booking/review?${params.toString()}`);
      return response.data;
    } catch (error) {
      return rejectWithValue(
        ((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to get booking review" }
      );
    }
  }
);
const createBooking = createAsyncThunk(
  "booking/createBooking",
  async (bookingData, { rejectWithValue }) => {
    var _a;
    try {
      const {
        pickupLocation,
        // { address: string, coordinates: [lng, lat] }
        dropLocation,
        // { address: string, coordinates: [lng, lat] }
        stops,
        // Array of stop objects
        vehicleId,
        groupId,
        // NEW: Group ID for grouped bookings
        modelId,
        // NEW: Model ID for grouped bookings
        tripType,
        // 'oneWay', 'roundTrip', 'rental', 'airport'
        rentalPackage,
        // { hours: number, distance: number } - for rental trips
        pickupDate,
        // 'YYYY-MM-DD'
        pickupTime,
        // 'HH:MM AM/PM'
        returnDate,
        // 'YYYY-MM-DD' - for roundTrip
        returnTime,
        // 'HH:MM AM/PM' - for roundTrip
        distance,
        // in km
        duration,
        // in minutes
        paymentMode,
        // 'cash', 'online', etc.
        fuelType,
        // 'petrol', 'diesel', 'cng', 'electric'
        isAc
        // boolean
      } = bookingData;
      const payload = {
        pickupLocation,
        vehicleId,
        groupId,
        // Include in payload
        modelId,
        // Include in payload
        tripType,
        pickupDate,
        pickupTime,
        distance,
        duration,
        paymentMode: paymentMode || "cash"
      };
      if (dropLocation) payload.dropLocation = dropLocation;
      if (stops && stops.length > 0) payload.stops = stops;
      if (rentalPackage) payload.rentalPackage = rentalPackage;
      if (returnDate) payload.returnDate = returnDate;
      if (returnTime) payload.returnTime = returnTime;
      if (fuelType) payload.fuelType = fuelType;
      if (isAc !== void 0) payload.isAc = isAc;
      const response = await api.post("/booking/book-ride", payload);
      return response.data;
    } catch (error) {
      return rejectWithValue(
        ((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to create booking" }
      );
    }
  }
);
const getAllBookings = createAsyncThunk(
  "booking/getAllBookings",
  async (queryParams = {}, { rejectWithValue }) => {
    var _a;
    try {
      const {
        page = 1,
        limit = 10,
        status,
        date,
        search
      } = queryParams;
      const params = new URLSearchParams({
        page: page.toString(),
        limit: limit.toString()
      });
      if (status) params.append("status", status);
      if (date) params.append("date", date);
      if (search) params.append("search", search);
      const response = await api.get(`/booking/?${params.toString()}`);
      return response.data;
    } catch (error) {
      return rejectWithValue(
        ((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch bookings" }
      );
    }
  }
);
const getBookingById = createAsyncThunk(
  "booking/getBookingById",
  async (bookingId, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get(`/booking/${bookingId}`);
      return response.data;
    } catch (error) {
      return rejectWithValue(
        ((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch booking details" }
      );
    }
  }
);
const getBookingTimeline = createAsyncThunk(
  "booking/getBookingTimeline",
  async (bookingId, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get(`/booking/${bookingId}/timeline`);
      return response.data;
    } catch (error) {
      return rejectWithValue(
        ((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch booking timeline" }
      );
    }
  }
);
const getBookingInvoice = createAsyncThunk(
  "booking/getBookingInvoice",
  async (bookingId, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get(`/booking/${bookingId}/invoice`);
      return response.data;
    } catch (error) {
      return rejectWithValue(
        ((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch invoice" }
      );
    }
  }
);
const previewCancellation = createAsyncThunk(
  "booking/previewCancellation",
  async (bookingId, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get(`/booking/${bookingId}/cancel/preview`);
      return response.data;
    } catch (error) {
      return rejectWithValue(
        ((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to preview cancellation" }
      );
    }
  }
);
const cancelBooking = createAsyncThunk(
  "booking/cancelBooking",
  async ({ bookingId, reason }, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.post(`/booking/${bookingId}/cancel`, { reason });
      return response.data;
    } catch (error) {
      return rejectWithValue(
        ((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to cancel booking" }
      );
    }
  }
);
const initialState$4 = {
  // Search Cabs
  searchResults: {
    cabs: [],
    route: null,
    tripType: null,
    pagination: null
  },
  searchLoading: false,
  searchError: null,
  // Booking Review
  bookingReview: null,
  reviewLoading: false,
  reviewError: null,
  // Create Booking
  currentBooking: null,
  createLoading: false,
  createError: null,
  createSuccess: false,
  // All Bookings
  bookings: [],
  bookingsLoading: false,
  bookingsError: null,
  bookingsPagination: null,
  // Single Booking Details
  bookingDetails: null,
  detailsLoading: false,
  detailsError: null,
  // Booking Timeline
  timeline: [],
  timelineLoading: false,
  timelineError: null,
  // Invoice
  invoice: null,
  invoiceLoading: false,
  invoiceError: null,
  // Cancellation Preview
  cancellationPreview: null,
  previewCancellationLoading: false,
  previewCancellationError: null,
  // Cancel Booking
  cancellationResult: null,
  cancelLoading: false,
  cancelError: null,
  cancelSuccess: false
};
const bookingSlice = createSlice({
  name: "booking",
  initialState: initialState$4,
  reducers: {
    // Reset search results
    resetSearchResults: (state) => {
      state.searchResults = { cabs: [], route: null, tripType: null, pagination: null };
      state.searchError = null;
    },
    // Reset booking review
    resetBookingReview: (state) => {
      state.bookingReview = null;
      state.reviewError = null;
    },
    // Reset create booking state
    resetCreateBooking: (state) => {
      state.currentBooking = null;
      state.createError = null;
      state.createSuccess = false;
    },
    // Reset booking details
    resetBookingDetails: (state) => {
      state.bookingDetails = null;
      state.detailsError = null;
    },
    // Reset timeline
    resetTimeline: (state) => {
      state.timeline = [];
      state.timelineError = null;
    },
    // Reset invoice
    resetInvoice: (state) => {
      state.invoice = null;
      state.invoiceError = null;
    },
    // Reset cancellation preview
    resetCancellationPreview: (state) => {
      state.cancellationPreview = null;
      state.previewCancellationError = null;
    },
    // Reset cancel booking state
    resetCancelBooking: (state) => {
      state.cancellationResult = null;
      state.cancelError = null;
      state.cancelSuccess = false;
    },
    // Reset all errors
    clearAllErrors: (state) => {
      state.searchError = null;
      state.reviewError = null;
      state.createError = null;
      state.bookingsError = null;
      state.detailsError = null;
      state.timelineError = null;
      state.invoiceError = null;
      state.previewCancellationError = null;
      state.cancelError = null;
    }
  },
  extraReducers: (builder) => {
    builder.addCase(searchCabs.pending, (state) => {
      state.searchLoading = true;
      state.searchError = null;
    }).addCase(searchCabs.fulfilled, (state, action) => {
      state.searchLoading = false;
      if (action.payload.success && action.payload.data) {
        state.searchResults = {
          cabs: action.payload.data.vehicles || action.payload.data.cabs || [],
          route: action.payload.data.route || null,
          tripType: action.payload.data.tripType || null,
          pagination: action.payload.data.pagination || null,
          distance: action.payload.data.distance || action.payload.data.totalDistance || 0,
          estimatedDuration: action.payload.data.estimatedDuration || 0,
          displayDistanceLabel: action.payload.data.displayDistanceLabel || null
        };
      }
    }).addCase(searchCabs.rejected, (state, action) => {
      var _a;
      state.searchLoading = false;
      state.searchError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to search cabs";
    });
    builder.addCase(getBookingReview.pending, (state) => {
      state.reviewLoading = true;
      state.reviewError = null;
    }).addCase(getBookingReview.fulfilled, (state, action) => {
      state.reviewLoading = false;
      if (action.payload.success) {
        state.bookingReview = action.payload.data;
      }
    }).addCase(getBookingReview.rejected, (state, action) => {
      var _a;
      state.reviewLoading = false;
      state.reviewError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to get booking review";
    });
    builder.addCase(createBooking.pending, (state) => {
      state.createLoading = true;
      state.createError = null;
      state.createSuccess = false;
    }).addCase(createBooking.fulfilled, (state, action) => {
      state.createLoading = false;
      state.createSuccess = true;
      if (action.payload.success) {
        state.currentBooking = action.payload.data;
      }
    }).addCase(createBooking.rejected, (state, action) => {
      var _a;
      state.createLoading = false;
      state.createError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to create booking";
      state.createSuccess = false;
    });
    builder.addCase(getAllBookings.pending, (state) => {
      state.bookingsLoading = true;
      state.bookingsError = null;
    }).addCase(getAllBookings.fulfilled, (state, action) => {
      state.bookingsLoading = false;
      if (action.payload.success) {
        state.bookings = action.payload.data || [];
        state.bookingsPagination = action.payload.pagination || null;
      }
    }).addCase(getAllBookings.rejected, (state, action) => {
      var _a;
      state.bookingsLoading = false;
      state.bookingsError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to fetch bookings";
    });
    builder.addCase(getBookingById.pending, (state) => {
      state.detailsLoading = true;
      state.detailsError = null;
    }).addCase(getBookingById.fulfilled, (state, action) => {
      state.detailsLoading = false;
      if (action.payload.success) {
        state.bookingDetails = action.payload.data;
      }
    }).addCase(getBookingById.rejected, (state, action) => {
      var _a;
      state.detailsLoading = false;
      state.detailsError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to fetch booking details";
    });
    builder.addCase(getBookingTimeline.pending, (state) => {
      state.timelineLoading = true;
      state.timelineError = null;
    }).addCase(getBookingTimeline.fulfilled, (state, action) => {
      state.timelineLoading = false;
      if (action.payload.success) {
        state.timeline = action.payload.data || [];
      }
    }).addCase(getBookingTimeline.rejected, (state, action) => {
      var _a;
      state.timelineLoading = false;
      state.timelineError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to fetch timeline";
    });
    builder.addCase(getBookingInvoice.pending, (state) => {
      state.invoiceLoading = true;
      state.invoiceError = null;
    }).addCase(getBookingInvoice.fulfilled, (state, action) => {
      state.invoiceLoading = false;
      if (action.payload.success) {
        state.invoice = action.payload.data;
      }
    }).addCase(getBookingInvoice.rejected, (state, action) => {
      var _a;
      state.invoiceLoading = false;
      state.invoiceError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to fetch invoice";
    });
    builder.addCase(previewCancellation.pending, (state) => {
      state.previewCancellationLoading = true;
      state.previewCancellationError = null;
    }).addCase(previewCancellation.fulfilled, (state, action) => {
      state.previewCancellationLoading = false;
      if (action.payload.success) {
        state.cancellationPreview = action.payload.data;
      }
    }).addCase(previewCancellation.rejected, (state, action) => {
      var _a;
      state.previewCancellationLoading = false;
      state.previewCancellationError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to preview cancellation";
    });
    builder.addCase(cancelBooking.pending, (state) => {
      state.cancelLoading = true;
      state.cancelError = null;
      state.cancelSuccess = false;
    }).addCase(cancelBooking.fulfilled, (state, action) => {
      state.cancelLoading = false;
      state.cancelSuccess = true;
      if (action.payload.success) {
        state.cancellationResult = action.payload.data;
        if (state.bookingDetails && state.bookingDetails._id === action.payload.data.bookingId) {
          state.bookingDetails.status = "cancelled";
          state.bookingDetails.cancellation = action.payload.data.cancellation;
        }
        const bookingIndex = state.bookings.findIndex((b) => b._id === action.payload.data.bookingId);
        if (bookingIndex !== -1) {
          state.bookings[bookingIndex].status = "cancelled";
          state.bookings[bookingIndex].cancellation = action.payload.data.cancellation;
        }
      }
    }).addCase(cancelBooking.rejected, (state, action) => {
      var _a;
      state.cancelLoading = false;
      state.cancelError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to cancel booking";
      state.cancelSuccess = false;
    });
  }
});
const {
  resetSearchResults: resetSearchResults$1,
  resetBookingReview,
  resetCreateBooking,
  resetBookingDetails,
  resetTimeline,
  resetInvoice,
  resetCancellationPreview,
  resetCancelBooking,
  clearAllErrors: clearAllErrors$2
} = bookingSlice.actions;
const bookingReducer = bookingSlice.reducer;
const getIntercityRoutes = createAsyncThunk(
  "seo/getIntercityRoutes",
  async (params = {}, { rejectWithValue }) => {
    var _a;
    try {
      const { page = 1, limit = 50, search = "" } = params;
      const queryParams = new URLSearchParams({
        page: page.toString(),
        limit: limit.toString()
      });
      if (search) queryParams.append("search", search);
      const response = await api.get(`/seo/intercity-routes?${queryParams.toString()}`);
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch intercity routes" });
    }
  }
);
const getIntercityRouteBySlug = createAsyncThunk(
  "seo/getIntercityRouteBySlug",
  async (slug, { rejectWithValue }) => {
    var _a, _b;
    try {
      const response = await api.get(`/seo/intercity-routes/${slug}`);
      return response.data;
    } catch (error) {
      if (((_a = error.response) == null ? void 0 : _a.status) === 404) {
        return { success: false, data: null, message: "Route not found" };
      }
      return rejectWithValue(((_b = error.response) == null ? void 0 : _b.data) || { message: "Failed to fetch route details" });
    }
  }
);
const getAirportRoutes = createAsyncThunk(
  "seo/getAirportRoutes",
  async (params = {}, { rejectWithValue }) => {
    var _a;
    try {
      const { page = 1, limit = 50, search = "", routeType } = params;
      const queryParams = new URLSearchParams({
        page: page.toString(),
        limit: limit.toString()
      });
      if (search) queryParams.append("search", search);
      if (routeType) queryParams.append("routeType", routeType);
      const response = await api.get(`/seo/airport-routes?${queryParams.toString()}`);
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch airport routes" });
    }
  }
);
const getAirportRouteBySlug = createAsyncThunk(
  "seo/getAirportRouteBySlug",
  async (slug, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get(`/seo/airport-routes/${slug}`);
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch airport route details" });
    }
  }
);
const getCityServices = createAsyncThunk(
  "seo/getCityServices",
  async (params = {}, { rejectWithValue }) => {
    var _a;
    try {
      const { page = 1, limit = 50, search = "" } = params;
      const queryParams = new URLSearchParams({
        page: page.toString(),
        limit: limit.toString()
      });
      if (search) queryParams.append("search", search);
      const response = await api.get(`/seo/city-services?${queryParams.toString()}`);
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch city services" });
    }
  }
);
const getCityServiceBySlug = createAsyncThunk(
  "seo/getCityServiceBySlug",
  async (slug, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get(`/seo/city-services/${slug}`);
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch city service details" });
    }
  }
);
const searchIntercityCabs = createAsyncThunk(
  "seo/searchIntercityCabs",
  async ({ slug, params = {} }, { rejectWithValue }) => {
    var _a;
    try {
      const { startTime, fuelType, isAc = true, page = 1, limit = 10, tripType = "oneWay" } = params;
      const queryParams = new URLSearchParams({
        page: page.toString(),
        limit: limit.toString(),
        isAc: isAc.toString(),
        tripType
      });
      if (startTime) queryParams.append("startTime", startTime);
      if (fuelType) queryParams.append("fuelType", fuelType);
      const response = await api.get(`/seo/search/intercity/${slug}?${queryParams.toString()}`);
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to search cabs" });
    }
  }
);
const searchAirportCabs = createAsyncThunk(
  "seo/searchAirportCabs",
  async ({ slug, params = {} }, { rejectWithValue }) => {
    var _a;
    try {
      const { startTime, fuelType, isAc = true, page = 1, limit = 10, sourceLat, sourceLong, destLat, destLong } = params;
      const queryParams = new URLSearchParams({
        page: page.toString(),
        limit: limit.toString(),
        isAc: isAc.toString()
      });
      if (startTime) queryParams.append("startTime", startTime);
      if (fuelType) queryParams.append("fuelType", fuelType);
      if (sourceLat) queryParams.append("sourceLat", sourceLat);
      if (sourceLong) queryParams.append("sourceLong", sourceLong);
      if (destLat) queryParams.append("destLat", destLat);
      if (destLong) queryParams.append("destLong", destLong);
      const response = await api.get(`/seo/search/airport/${slug}?${queryParams.toString()}`);
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to search airport cabs" });
    }
  }
);
const searchCityCabs = createAsyncThunk(
  "seo/searchCityCabs",
  async ({ slug, params = {} }, { rejectWithValue }) => {
    var _a;
    try {
      const { startTime, fuelType, isAc = true, page = 1, limit = 10 } = params;
      const queryParams = new URLSearchParams({
        page: page.toString(),
        limit: limit.toString(),
        isAc: isAc.toString()
      });
      if (startTime) queryParams.append("startTime", startTime);
      if (fuelType) queryParams.append("fuelType", fuelType);
      const response = await api.get(`/seo/city-services/${slug}?${queryParams.toString()}`);
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to search city cabs" });
    }
  }
);
const initialState$3 = {
  // Intercity Routes
  intercityRoutes: [],
  intercityPagination: null,
  intercityLoading: false,
  intercityError: null,
  // Single Intercity Route
  currentIntercityRoute: null,
  currentIntercityLoading: false,
  currentIntercityError: null,
  // Airport Routes
  airportRoutes: [],
  airportPagination: null,
  airportLoading: false,
  airportError: null,
  // Single Airport Route
  currentAirportRoute: null,
  currentAirportLoading: false,
  currentAirportError: null,
  // City Services
  cityServices: [],
  cityPagination: null,
  cityLoading: false,
  cityError: null,
  // Single City Service
  currentCityService: null,
  currentCityLoading: false,
  currentCityError: null,
  // Real-time Cab Search Results
  searchResults: {
    cabs: [],
    pagination: null,
    route: null
  },
  searchLoading: false,
  searchError: null
};
const seoSlice = createSlice({
  name: "seo",
  initialState: initialState$3,
  reducers: {
    clearCurrentRoute: (state) => {
      state.currentIntercityRoute = null;
      state.currentAirportRoute = null;
      state.currentCityService = null;
    },
    clearSearchResults: (state) => {
      state.searchResults = { cabs: [], pagination: null, route: null };
      state.searchError = null;
    },
    clearAllErrors: (state) => {
      state.intercityError = null;
      state.airportError = null;
      state.cityError = null;
      state.currentIntercityError = null;
      state.currentAirportError = null;
      state.currentCityError = null;
      state.searchError = null;
    }
  },
  extraReducers: (builder) => {
    builder.addCase(getIntercityRoutes.pending, (state) => {
      state.intercityLoading = true;
      state.intercityError = null;
    }).addCase(getIntercityRoutes.fulfilled, (state, action) => {
      state.intercityLoading = false;
      if (action.payload.success) {
        state.intercityRoutes = action.payload.routes || [];
        state.intercityPagination = action.payload.pagination || null;
      }
    }).addCase(getIntercityRoutes.rejected, (state, action) => {
      var _a;
      state.intercityLoading = false;
      state.intercityError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to fetch routes";
    });
    builder.addCase(getIntercityRouteBySlug.pending, (state) => {
      state.currentIntercityLoading = true;
      state.currentIntercityError = null;
    }).addCase(getIntercityRouteBySlug.fulfilled, (state, action) => {
      state.currentIntercityLoading = false;
      if (action.payload.success && action.payload.data) {
        state.currentIntercityRoute = action.payload.data;
      } else {
        state.currentIntercityRoute = null;
      }
    }).addCase(getIntercityRouteBySlug.rejected, (state, action) => {
      var _a;
      state.currentIntercityLoading = false;
      state.currentIntercityError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to fetch route";
      state.currentIntercityRoute = null;
    });
    builder.addCase(getAirportRoutes.pending, (state) => {
      state.airportLoading = true;
      state.airportError = null;
    }).addCase(getAirportRoutes.fulfilled, (state, action) => {
      state.airportLoading = false;
      if (action.payload.success) {
        state.airportRoutes = action.payload.routes || [];
        state.airportPagination = action.payload.pagination || null;
      }
    }).addCase(getAirportRoutes.rejected, (state, action) => {
      var _a;
      state.airportLoading = false;
      state.airportError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to fetch airport routes";
    });
    builder.addCase(getAirportRouteBySlug.pending, (state) => {
      state.currentAirportLoading = true;
      state.currentAirportError = null;
    }).addCase(getAirportRouteBySlug.fulfilled, (state, action) => {
      state.currentAirportLoading = false;
      if (action.payload.success) {
        state.currentAirportRoute = action.payload.data;
      }
    }).addCase(getAirportRouteBySlug.rejected, (state, action) => {
      var _a;
      state.currentAirportLoading = false;
      state.currentAirportError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to fetch airport route";
    });
    builder.addCase(getCityServices.pending, (state) => {
      state.cityLoading = true;
      state.cityError = null;
    }).addCase(getCityServices.fulfilled, (state, action) => {
      state.cityLoading = false;
      if (action.payload.success) {
        state.cityServices = action.payload.services || [];
        state.cityPagination = action.payload.pagination || null;
      }
    }).addCase(getCityServices.rejected, (state, action) => {
      var _a;
      state.cityLoading = false;
      state.cityError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to fetch city services";
    });
    builder.addCase(getCityServiceBySlug.pending, (state) => {
      state.currentCityLoading = true;
      state.currentCityError = null;
    }).addCase(getCityServiceBySlug.fulfilled, (state, action) => {
      state.currentCityLoading = false;
      if (action.payload.success) {
        state.currentCityService = action.payload.data;
      }
    }).addCase(getCityServiceBySlug.rejected, (state, action) => {
      var _a;
      state.currentCityLoading = false;
      state.currentCityError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to fetch city service";
    });
    builder.addCase(searchIntercityCabs.pending, (state) => {
      state.searchLoading = true;
      state.searchError = null;
    }).addCase(searchIntercityCabs.fulfilled, (state, action) => {
      var _a, _b, _c, _d;
      state.searchLoading = false;
      if (action.payload.success) {
        state.searchResults = {
          cabs: ((_a = action.payload.data) == null ? void 0 : _a.cabs) || ((_b = action.payload.data) == null ? void 0 : _b.vehicles) || [],
          pagination: ((_c = action.payload.data) == null ? void 0 : _c.pagination) || null,
          route: ((_d = action.payload.data) == null ? void 0 : _d.route) || null
        };
      }
    }).addCase(searchIntercityCabs.rejected, (state, action) => {
      var _a;
      state.searchLoading = false;
      state.searchError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to search cabs";
    });
    builder.addCase(searchAirportCabs.pending, (state) => {
      state.searchLoading = true;
      state.searchError = null;
    }).addCase(searchAirportCabs.fulfilled, (state, action) => {
      var _a, _b, _c, _d;
      state.searchLoading = false;
      if (action.payload.success) {
        state.searchResults = {
          cabs: ((_a = action.payload.data) == null ? void 0 : _a.cabs) || ((_b = action.payload.data) == null ? void 0 : _b.vehicles) || [],
          pagination: ((_c = action.payload.data) == null ? void 0 : _c.pagination) || null,
          route: ((_d = action.payload.data) == null ? void 0 : _d.route) || null
        };
      }
    }).addCase(searchAirportCabs.rejected, (state, action) => {
      var _a;
      state.searchLoading = false;
      state.searchError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to search airport cabs";
    });
    builder.addCase(searchCityCabs.pending, (state) => {
      state.searchLoading = true;
      state.searchError = null;
    }).addCase(searchCityCabs.fulfilled, (state, action) => {
      var _a, _b, _c, _d;
      state.searchLoading = false;
      if (action.payload.success) {
        state.searchResults = {
          cabs: ((_a = action.payload.data) == null ? void 0 : _a.cabs) || ((_b = action.payload.data) == null ? void 0 : _b.vehicles) || [],
          pagination: ((_c = action.payload.data) == null ? void 0 : _c.pagination) || null,
          route: ((_d = action.payload.data) == null ? void 0 : _d.route) || null
        };
      }
    }).addCase(searchCityCabs.rejected, (state, action) => {
      var _a;
      state.searchLoading = false;
      state.searchError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to search city cabs";
    });
  }
});
const { clearCurrentRoute, clearSearchResults, clearAllErrors: clearAllErrors$1 } = seoSlice.actions;
const seoReducer = seoSlice.reducer;
const getCategories = createAsyncThunk(
  "support/getCategories",
  async (_2, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get("/tickets/categories");
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch categories" });
    }
  }
);
const getCallbackReasons = createAsyncThunk(
  "support/getCallbackReasons",
  async (_2, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get("/tickets/callback-reasons");
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch callback reasons" });
    }
  }
);
const getTimeSlots = createAsyncThunk(
  "support/getTimeSlots",
  async (_2, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get("/tickets/time-slots");
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch time slots" });
    }
  }
);
const getSupportStats = createAsyncThunk(
  "support/getSupportStats",
  async (_2, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get("/tickets/stats");
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch stats" });
    }
  }
);
const getMyOrders = createAsyncThunk(
  "support/getMyOrders",
  async (_2, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get("/tickets/orders");
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch orders" });
    }
  }
);
const createTicket = createAsyncThunk(
  "support/createTicket",
  async (ticketData, { rejectWithValue }) => {
    var _a;
    try {
      const formData = new FormData();
      formData.append("category", ticketData.category);
      formData.append("subject", ticketData.subject);
      formData.append("text", ticketData.text);
      if (ticketData.orderId) formData.append("orderId", ticketData.orderId);
      if (ticketData.attachments && ticketData.attachments.length > 0) {
        ticketData.attachments.forEach((file) => {
          formData.append("attachments", file);
        });
      }
      const response = await api.post("/tickets/", formData, {
        headers: {
          "Content-Type": "multipart/form-data"
        }
      });
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to create ticket" });
    }
  }
);
const getMyTickets = createAsyncThunk(
  "support/getMyTickets",
  async (params = {}, { rejectWithValue }) => {
    var _a;
    try {
      const { page = 1, limit = 10, status } = params;
      const queryParams = new URLSearchParams({ page, limit });
      if (status) queryParams.append("status", status);
      const response = await api.get(`/tickets/my?${queryParams}`);
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch tickets" });
    }
  }
);
const getTicketDetails = createAsyncThunk(
  "support/getTicketDetails",
  async (ticketId, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get(`/tickets/${ticketId}`);
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch ticket details" });
    }
  }
);
const addMessage = createAsyncThunk(
  "support/addMessage",
  async ({ ticketId, text, attachments }, { rejectWithValue }) => {
    var _a;
    try {
      const formData = new FormData();
      formData.append("text", text);
      if (attachments && attachments.length > 0) {
        attachments.forEach((file) => {
          formData.append("attachments", file);
        });
      }
      const response = await api.post(`/tickets/${ticketId}/messages`, formData, {
        headers: {
          "Content-Type": "multipart/form-data"
        }
      });
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to send message" });
    }
  }
);
const requestCallback = createAsyncThunk(
  "support/requestCallback",
  async (callbackData, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.post("/tickets/callback", callbackData);
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to request callback" });
    }
  }
);
const getMyCallbacks = createAsyncThunk(
  "support/getMyCallbacks",
  async (params = {}, { rejectWithValue }) => {
    var _a;
    try {
      const { page = 1, limit = 10 } = params;
      const response = await api.get(`/tickets/callback?page=${page}&limit=${limit}`);
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch callbacks" });
    }
  }
);
const cancelCallback = createAsyncThunk(
  "support/cancelCallback",
  async (callbackId, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.delete(`/tickets/callback/${callbackId}`);
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to cancel callback" });
    }
  }
);
const initialState$2 = {
  // Categories & Options
  categories: [],
  callbackReasons: [],
  timeSlots: [],
  orders: [],
  optionsLoading: false,
  optionsError: null,
  // Stats
  stats: null,
  statsLoading: false,
  // Tickets
  tickets: [],
  ticketsPagination: null,
  ticketsLoading: false,
  ticketsError: null,
  // Current Ticket
  currentTicket: null,
  ticketLoading: false,
  ticketError: null,
  // Create Ticket
  createLoading: false,
  createSuccess: false,
  createError: null,
  // Message
  messageLoading: false,
  messageError: null,
  // Callbacks
  callbacks: [],
  callbacksLoading: false,
  callbackSuccess: false,
  callbackError: null
};
const supportSlice = createSlice({
  name: "support",
  initialState: initialState$2,
  reducers: {
    resetCreateState: (state) => {
      state.createLoading = false;
      state.createSuccess = false;
      state.createError = null;
    },
    resetCallbackState: (state) => {
      state.callbackSuccess = false;
      state.callbackError = null;
    },
    clearCurrentTicket: (state) => {
      state.currentTicket = null;
      state.ticketError = null;
    },
    clearErrors: (state) => {
      state.optionsError = null;
      state.ticketsError = null;
      state.ticketError = null;
      state.createError = null;
      state.messageError = null;
      state.callbackError = null;
    }
  },
  extraReducers: (builder) => {
    builder.addCase(getCategories.pending, (state) => {
      state.optionsLoading = true;
    }).addCase(getCategories.fulfilled, (state, action) => {
      state.optionsLoading = false;
      state.categories = action.payload.data || [];
    }).addCase(getCategories.rejected, (state, action) => {
      var _a;
      state.optionsLoading = false;
      state.optionsError = (_a = action.payload) == null ? void 0 : _a.message;
    });
    builder.addCase(getCallbackReasons.fulfilled, (state, action) => {
      state.callbackReasons = action.payload.data || [];
    });
    builder.addCase(getTimeSlots.fulfilled, (state, action) => {
      state.timeSlots = action.payload.data || [];
    });
    builder.addCase(getSupportStats.pending, (state) => {
      state.statsLoading = true;
    }).addCase(getSupportStats.fulfilled, (state, action) => {
      state.statsLoading = false;
      state.stats = action.payload.data;
    });
    builder.addCase(getMyOrders.fulfilled, (state, action) => {
      state.orders = action.payload.data || [];
    });
    builder.addCase(createTicket.pending, (state) => {
      state.createLoading = true;
      state.createError = null;
      state.createSuccess = false;
    }).addCase(createTicket.fulfilled, (state) => {
      state.createLoading = false;
      state.createSuccess = true;
    }).addCase(createTicket.rejected, (state, action) => {
      var _a;
      state.createLoading = false;
      state.createError = (_a = action.payload) == null ? void 0 : _a.message;
    });
    builder.addCase(getMyTickets.pending, (state) => {
      state.ticketsLoading = true;
      state.ticketsError = null;
    }).addCase(getMyTickets.fulfilled, (state, action) => {
      state.ticketsLoading = false;
      state.tickets = action.payload.tickets || action.payload.data || [];
      state.ticketsPagination = action.payload.pagination || null;
    }).addCase(getMyTickets.rejected, (state, action) => {
      var _a;
      state.ticketsLoading = false;
      state.ticketsError = (_a = action.payload) == null ? void 0 : _a.message;
    });
    builder.addCase(getTicketDetails.pending, (state) => {
      state.ticketLoading = true;
      state.ticketError = null;
    }).addCase(getTicketDetails.fulfilled, (state, action) => {
      state.ticketLoading = false;
      state.currentTicket = action.payload.data;
    }).addCase(getTicketDetails.rejected, (state, action) => {
      var _a;
      state.ticketLoading = false;
      state.ticketError = (_a = action.payload) == null ? void 0 : _a.message;
    });
    builder.addCase(addMessage.pending, (state) => {
      state.messageLoading = true;
      state.messageError = null;
    }).addCase(addMessage.fulfilled, (state, action) => {
      state.messageLoading = false;
      if (state.currentTicket && action.payload.data) {
        state.currentTicket = action.payload.data;
      }
    }).addCase(addMessage.rejected, (state, action) => {
      var _a;
      state.messageLoading = false;
      state.messageError = (_a = action.payload) == null ? void 0 : _a.message;
    });
    builder.addCase(requestCallback.pending, (state) => {
      state.callbacksLoading = true;
      state.callbackError = null;
      state.callbackSuccess = false;
    }).addCase(requestCallback.fulfilled, (state) => {
      state.callbacksLoading = false;
      state.callbackSuccess = true;
    }).addCase(requestCallback.rejected, (state, action) => {
      var _a;
      state.callbacksLoading = false;
      state.callbackError = (_a = action.payload) == null ? void 0 : _a.message;
    });
    builder.addCase(getMyCallbacks.fulfilled, (state, action) => {
      state.callbacks = action.payload.data || [];
    });
    builder.addCase(cancelCallback.fulfilled, (state, action) => {
      const cancelledId = action.meta.arg;
      state.callbacks = state.callbacks.filter((cb) => cb._id !== cancelledId);
    });
  }
});
const { resetCreateState, resetCallbackState, clearCurrentTicket, clearErrors: clearErrors$1 } = supportSlice.actions;
const supportReducer = supportSlice.reducer;
const createPaymentOrder = createAsyncThunk(
  "payment/createOrder",
  async ({ bookingId, amount, paymentType }, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.post("/payment/create-order", {
        bookingId,
        amount,
        paymentType
      });
      return response.data;
    } catch (error) {
      return rejectWithValue(
        ((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to create payment order" }
      );
    }
  }
);
const verifyPayment = createAsyncThunk(
  "payment/verify",
  async (paymentData, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.post("/payment/verify", paymentData);
      return response.data;
    } catch (error) {
      return rejectWithValue(
        ((_a = error.response) == null ? void 0 : _a.data) || { message: "Payment verification failed" }
      );
    }
  }
);
const paymentSlice = createSlice({
  name: "payment",
  initialState: {
    loading: false,
    error: null,
    success: false,
    paymentDetails: null
  },
  reducers: {
    resetPaymentState: (state) => {
      state.loading = false;
      state.error = null;
      state.success = false;
      state.paymentDetails = null;
    }
  },
  extraReducers: (builder) => {
    builder.addCase(createPaymentOrder.pending, (state) => {
      state.loading = true;
      state.error = null;
    });
    builder.addCase(createPaymentOrder.fulfilled, (state, action) => {
      state.loading = false;
      state.error = null;
    });
    builder.addCase(createPaymentOrder.rejected, (state, action) => {
      var _a;
      state.loading = false;
      state.error = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to initiate payment";
    });
    builder.addCase(verifyPayment.pending, (state) => {
      state.loading = true;
      state.error = null;
    });
    builder.addCase(verifyPayment.fulfilled, (state, action) => {
      state.loading = false;
      state.success = true;
      state.paymentDetails = action.payload.data;
    });
    builder.addCase(verifyPayment.rejected, (state, action) => {
      var _a;
      state.loading = false;
      state.error = ((_a = action.payload) == null ? void 0 : _a.message) || "Payment verification failed";
      state.success = false;
    });
  }
});
const { resetPaymentState } = paymentSlice.actions;
const paymentReducer = paymentSlice.reducer;
const fetchSettings = createAsyncThunk(
  "setting/fetchSettings",
  async (_2, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get("/settings/public");
      return response.data;
    } catch (error) {
      return rejectWithValue(
        ((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch settings" }
      );
    }
  }
);
const settingSlice = createSlice({
  name: "setting",
  initialState: {
    settings: null,
    loading: false,
    error: null
  },
  reducers: {
    // ...
  },
  extraReducers: (builder) => {
    builder.addCase(fetchSettings.pending, (state) => {
      state.loading = true;
      state.error = null;
    });
    builder.addCase(fetchSettings.fulfilled, (state, action) => {
      state.loading = false;
      state.settings = action.payload.data;
    });
    builder.addCase(fetchSettings.rejected, (state, action) => {
      var _a;
      state.loading = false;
      state.error = (_a = action.payload) == null ? void 0 : _a.message;
    });
  }
});
const settingReducer = settingSlice.reducer;
const getBanners = createAsyncThunk(
  "cms/getBanners",
  async (_2, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get("/cms/banner");
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch banners" });
    }
  }
);
const getFAQs = createAsyncThunk(
  "cms/getFAQs",
  async (_2, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get("/faq/grouped");
      return response.data.data || response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch FAQs" });
    }
  }
);
const getFooter = createAsyncThunk(
  "cms/getFooter",
  async (_2, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get("/cms/footer");
      return response.data;
    } catch (error) {
      return rejectWithValue(((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch footer content" });
    }
  },
  {
    condition: (_2, { getState }) => {
      const { cms } = getState();
      if (cms.loading || cms.footer && cms.footer.length > 0) {
        return false;
      }
    }
  }
);
const initialState$1 = {
  banners: [],
  faqs: [],
  footer: [],
  loading: false,
  error: null
};
const cmsSlice = createSlice({
  name: "cms",
  initialState: initialState$1,
  reducers: {
    clearErrors: (state) => {
      state.error = null;
    }
  },
  extraReducers: (builder) => {
    builder.addCase(getBanners.pending, (state) => {
      state.loading = true;
    }).addCase(getBanners.fulfilled, (state, action) => {
      state.loading = false;
      state.banners = action.payload;
    }).addCase(getBanners.rejected, (state, action) => {
      var _a;
      state.loading = false;
      state.error = (_a = action.payload) == null ? void 0 : _a.message;
    });
    builder.addCase(getFAQs.pending, (state) => {
      state.loading = true;
    }).addCase(getFAQs.fulfilled, (state, action) => {
      state.loading = false;
      state.faqs = action.payload;
    }).addCase(getFAQs.rejected, (state, action) => {
      var _a;
      state.loading = false;
      state.error = (_a = action.payload) == null ? void 0 : _a.message;
    });
    builder.addCase(getFooter.pending, (state) => {
      state.loading = true;
    }).addCase(getFooter.fulfilled, (state, action) => {
      state.loading = false;
      state.footer = action.payload;
    }).addCase(getFooter.rejected, (state, action) => {
      var _a;
      state.loading = false;
      state.error = (_a = action.payload) == null ? void 0 : _a.message;
    });
  }
});
const { clearErrors } = cmsSlice.actions;
const cmsReducer = cmsSlice.reducer;
const isString$1 = (obj) => typeof obj === "string";
const defer = () => {
  let res;
  let rej;
  const promise = new Promise((resolve, reject) => {
    res = resolve;
    rej = reject;
  });
  promise.resolve = res;
  promise.reject = rej;
  return promise;
};
const makeString = (object) => {
  if (object == null) return "";
  return "" + object;
};
const copy = (a2, s2, t2) => {
  a2.forEach((m2) => {
    if (s2[m2]) t2[m2] = s2[m2];
  });
};
const lastOfPathSeparatorRegExp = /###/g;
const cleanKey = (key) => key && key.indexOf("###") > -1 ? key.replace(lastOfPathSeparatorRegExp, ".") : key;
const canNotTraverseDeeper = (object) => !object || isString$1(object);
const getLastOfPath = (object, path, Empty) => {
  const stack = !isString$1(path) ? path : path.split(".");
  let stackIndex = 0;
  while (stackIndex < stack.length - 1) {
    if (canNotTraverseDeeper(object)) return {};
    const key = cleanKey(stack[stackIndex]);
    if (!object[key] && Empty) object[key] = new Empty();
    if (Object.prototype.hasOwnProperty.call(object, key)) {
      object = object[key];
    } else {
      object = {};
    }
    ++stackIndex;
  }
  if (canNotTraverseDeeper(object)) return {};
  return {
    obj: object,
    k: cleanKey(stack[stackIndex])
  };
};
const setPath = (object, path, newValue) => {
  const {
    obj,
    k: k2
  } = getLastOfPath(object, path, Object);
  if (obj !== void 0 || path.length === 1) {
    obj[k2] = newValue;
    return;
  }
  let e2 = path[path.length - 1];
  let p2 = path.slice(0, path.length - 1);
  let last = getLastOfPath(object, p2, Object);
  while (last.obj === void 0 && p2.length) {
    e2 = `${p2[p2.length - 1]}.${e2}`;
    p2 = p2.slice(0, p2.length - 1);
    last = getLastOfPath(object, p2, Object);
    if ((last == null ? void 0 : last.obj) && typeof last.obj[`${last.k}.${e2}`] !== "undefined") {
      last.obj = void 0;
    }
  }
  last.obj[`${last.k}.${e2}`] = newValue;
};
const pushPath = (object, path, newValue, concat) => {
  const {
    obj,
    k: k2
  } = getLastOfPath(object, path, Object);
  obj[k2] = obj[k2] || [];
  obj[k2].push(newValue);
};
const getPath = (object, path) => {
  const {
    obj,
    k: k2
  } = getLastOfPath(object, path);
  if (!obj) return void 0;
  if (!Object.prototype.hasOwnProperty.call(obj, k2)) return void 0;
  return obj[k2];
};
const getPathWithDefaults = (data, defaultData, key) => {
  const value = getPath(data, key);
  if (value !== void 0) {
    return value;
  }
  return getPath(defaultData, key);
};
const deepExtend = (target, source, overwrite) => {
  for (const prop in source) {
    if (prop !== "__proto__" && prop !== "constructor") {
      if (prop in target) {
        if (isString$1(target[prop]) || target[prop] instanceof String || isString$1(source[prop]) || source[prop] instanceof String) {
          if (overwrite) target[prop] = source[prop];
        } else {
          deepExtend(target[prop], source[prop], overwrite);
        }
      } else {
        target[prop] = source[prop];
      }
    }
  }
  return target;
};
const regexEscape = (str) => str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
var _entityMap = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;",
  "/": "&#x2F;"
};
const escape = (data) => {
  if (isString$1(data)) {
    return data.replace(/[&<>"'\/]/g, (s2) => _entityMap[s2]);
  }
  return data;
};
class RegExpCache {
  constructor(capacity) {
    this.capacity = capacity;
    this.regExpMap = /* @__PURE__ */ new Map();
    this.regExpQueue = [];
  }
  getRegExp(pattern) {
    const regExpFromCache = this.regExpMap.get(pattern);
    if (regExpFromCache !== void 0) {
      return regExpFromCache;
    }
    const regExpNew = new RegExp(pattern);
    if (this.regExpQueue.length === this.capacity) {
      this.regExpMap.delete(this.regExpQueue.shift());
    }
    this.regExpMap.set(pattern, regExpNew);
    this.regExpQueue.push(pattern);
    return regExpNew;
  }
}
const chars = [" ", ",", "?", "!", ";"];
const looksLikeObjectPathRegExpCache = new RegExpCache(20);
const looksLikeObjectPath = (key, nsSeparator, keySeparator) => {
  nsSeparator = nsSeparator || "";
  keySeparator = keySeparator || "";
  const possibleChars = chars.filter((c2) => nsSeparator.indexOf(c2) < 0 && keySeparator.indexOf(c2) < 0);
  if (possibleChars.length === 0) return true;
  const r = looksLikeObjectPathRegExpCache.getRegExp(`(${possibleChars.map((c2) => c2 === "?" ? "\\?" : c2).join("|")})`);
  let matched = !r.test(key);
  if (!matched) {
    const ki = key.indexOf(keySeparator);
    if (ki > 0 && !r.test(key.substring(0, ki))) {
      matched = true;
    }
  }
  return matched;
};
const deepFind = (obj, path, keySeparator = ".") => {
  if (!obj) return void 0;
  if (obj[path]) {
    if (!Object.prototype.hasOwnProperty.call(obj, path)) return void 0;
    return obj[path];
  }
  const tokens = path.split(keySeparator);
  let current2 = obj;
  for (let i2 = 0; i2 < tokens.length; ) {
    if (!current2 || typeof current2 !== "object") {
      return void 0;
    }
    let next;
    let nextPath = "";
    for (let j2 = i2; j2 < tokens.length; ++j2) {
      if (j2 !== i2) {
        nextPath += keySeparator;
      }
      nextPath += tokens[j2];
      next = current2[nextPath];
      if (next !== void 0) {
        if (["string", "number", "boolean"].indexOf(typeof next) > -1 && j2 < tokens.length - 1) {
          continue;
        }
        i2 += j2 - i2 + 1;
        break;
      }
    }
    current2 = next;
  }
  return current2;
};
const getCleanedCode = (code) => code == null ? void 0 : code.replace("_", "-");
const consoleLogger = {
  type: "logger",
  log(args) {
    this.output("log", args);
  },
  warn(args) {
    this.output("warn", args);
  },
  error(args) {
    this.output("error", args);
  },
  output(type, args) {
    var _a, _b;
    (_b = (_a = console == null ? void 0 : console[type]) == null ? void 0 : _a.apply) == null ? void 0 : _b.call(_a, console, args);
  }
};
class Logger {
  constructor(concreteLogger, options = {}) {
    this.init(concreteLogger, options);
  }
  init(concreteLogger, options = {}) {
    this.prefix = options.prefix || "i18next:";
    this.logger = concreteLogger || consoleLogger;
    this.options = options;
    this.debug = options.debug;
  }
  log(...args) {
    return this.forward(args, "log", "", true);
  }
  warn(...args) {
    return this.forward(args, "warn", "", true);
  }
  error(...args) {
    return this.forward(args, "error", "");
  }
  deprecate(...args) {
    return this.forward(args, "warn", "WARNING DEPRECATED: ", true);
  }
  forward(args, lvl, prefix2, debugOnly) {
    if (debugOnly && !this.debug) return null;
    if (isString$1(args[0])) args[0] = `${prefix2}${this.prefix} ${args[0]}`;
    return this.logger[lvl](args);
  }
  create(moduleName) {
    return new Logger(this.logger, {
      ...{
        prefix: `${this.prefix}:${moduleName}:`
      },
      ...this.options
    });
  }
  clone(options) {
    options = options || this.options;
    options.prefix = options.prefix || this.prefix;
    return new Logger(this.logger, options);
  }
}
var baseLogger = new Logger();
class EventEmitter {
  constructor() {
    this.observers = {};
  }
  on(events, listener) {
    events.split(" ").forEach((event) => {
      if (!this.observers[event]) this.observers[event] = /* @__PURE__ */ new Map();
      const numListeners = this.observers[event].get(listener) || 0;
      this.observers[event].set(listener, numListeners + 1);
    });
    return this;
  }
  off(event, listener) {
    if (!this.observers[event]) return;
    if (!listener) {
      delete this.observers[event];
      return;
    }
    this.observers[event].delete(listener);
  }
  emit(event, ...args) {
    if (this.observers[event]) {
      const cloned = Array.from(this.observers[event].entries());
      cloned.forEach(([observer, numTimesAdded]) => {
        for (let i2 = 0; i2 < numTimesAdded; i2++) {
          observer(...args);
        }
      });
    }
    if (this.observers["*"]) {
      const cloned = Array.from(this.observers["*"].entries());
      cloned.forEach(([observer, numTimesAdded]) => {
        for (let i2 = 0; i2 < numTimesAdded; i2++) {
          observer.apply(observer, [event, ...args]);
        }
      });
    }
  }
}
class ResourceStore extends EventEmitter {
  constructor(data, options = {
    ns: ["translation"],
    defaultNS: "translation"
  }) {
    super();
    this.data = data || {};
    this.options = options;
    if (this.options.keySeparator === void 0) {
      this.options.keySeparator = ".";
    }
    if (this.options.ignoreJSONStructure === void 0) {
      this.options.ignoreJSONStructure = true;
    }
  }
  addNamespaces(ns) {
    if (this.options.ns.indexOf(ns) < 0) {
      this.options.ns.push(ns);
    }
  }
  removeNamespaces(ns) {
    const index2 = this.options.ns.indexOf(ns);
    if (index2 > -1) {
      this.options.ns.splice(index2, 1);
    }
  }
  getResource(lng, ns, key, options = {}) {
    var _a, _b;
    const keySeparator = options.keySeparator !== void 0 ? options.keySeparator : this.options.keySeparator;
    const ignoreJSONStructure = options.ignoreJSONStructure !== void 0 ? options.ignoreJSONStructure : this.options.ignoreJSONStructure;
    let path;
    if (lng.indexOf(".") > -1) {
      path = lng.split(".");
    } else {
      path = [lng, ns];
      if (key) {
        if (Array.isArray(key)) {
          path.push(...key);
        } else if (isString$1(key) && keySeparator) {
          path.push(...key.split(keySeparator));
        } else {
          path.push(key);
        }
      }
    }
    const result = getPath(this.data, path);
    if (!result && !ns && !key && lng.indexOf(".") > -1) {
      lng = path[0];
      ns = path[1];
      key = path.slice(2).join(".");
    }
    if (result || !ignoreJSONStructure || !isString$1(key)) return result;
    return deepFind((_b = (_a = this.data) == null ? void 0 : _a[lng]) == null ? void 0 : _b[ns], key, keySeparator);
  }
  addResource(lng, ns, key, value, options = {
    silent: false
  }) {
    const keySeparator = options.keySeparator !== void 0 ? options.keySeparator : this.options.keySeparator;
    let path = [lng, ns];
    if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);
    if (lng.indexOf(".") > -1) {
      path = lng.split(".");
      value = ns;
      ns = path[1];
    }
    this.addNamespaces(ns);
    setPath(this.data, path, value);
    if (!options.silent) this.emit("added", lng, ns, key, value);
  }
  addResources(lng, ns, resources2, options = {
    silent: false
  }) {
    for (const m2 in resources2) {
      if (isString$1(resources2[m2]) || Array.isArray(resources2[m2])) this.addResource(lng, ns, m2, resources2[m2], {
        silent: true
      });
    }
    if (!options.silent) this.emit("added", lng, ns, resources2);
  }
  addResourceBundle(lng, ns, resources2, deep, overwrite, options = {
    silent: false,
    skipCopy: false
  }) {
    let path = [lng, ns];
    if (lng.indexOf(".") > -1) {
      path = lng.split(".");
      deep = resources2;
      resources2 = ns;
      ns = path[1];
    }
    this.addNamespaces(ns);
    let pack = getPath(this.data, path) || {};
    if (!options.skipCopy) resources2 = JSON.parse(JSON.stringify(resources2));
    if (deep) {
      deepExtend(pack, resources2, overwrite);
    } else {
      pack = {
        ...pack,
        ...resources2
      };
    }
    setPath(this.data, path, pack);
    if (!options.silent) this.emit("added", lng, ns, resources2);
  }
  removeResourceBundle(lng, ns) {
    if (this.hasResourceBundle(lng, ns)) {
      delete this.data[lng][ns];
    }
    this.removeNamespaces(ns);
    this.emit("removed", lng, ns);
  }
  hasResourceBundle(lng, ns) {
    return this.getResource(lng, ns) !== void 0;
  }
  getResourceBundle(lng, ns) {
    if (!ns) ns = this.options.defaultNS;
    return this.getResource(lng, ns);
  }
  getDataByLanguage(lng) {
    return this.data[lng];
  }
  hasLanguageSomeTranslations(lng) {
    const data = this.getDataByLanguage(lng);
    const n2 = data && Object.keys(data) || [];
    return !!n2.find((v2) => data[v2] && Object.keys(data[v2]).length > 0);
  }
  toJSON() {
    return this.data;
  }
}
var postProcessor = {
  processors: {},
  addPostProcessor(module) {
    this.processors[module.name] = module;
  },
  handle(processors, value, key, options, translator) {
    processors.forEach((processor) => {
      var _a;
      value = ((_a = this.processors[processor]) == null ? void 0 : _a.process(value, key, options, translator)) ?? value;
    });
    return value;
  }
};
const PATH_KEY = Symbol("i18next/PATH_KEY");
function createProxy() {
  const state = [];
  const handler = /* @__PURE__ */ Object.create(null);
  let proxy;
  handler.get = (target, key) => {
    var _a;
    (_a = proxy == null ? void 0 : proxy.revoke) == null ? void 0 : _a.call(proxy);
    if (key === PATH_KEY) return state;
    state.push(key);
    proxy = Proxy.revocable(target, handler);
    return proxy.proxy;
  };
  return Proxy.revocable(/* @__PURE__ */ Object.create(null), handler).proxy;
}
function keysFromSelector(selector, opts) {
  const {
    [PATH_KEY]: path
  } = selector(createProxy());
  return path.join((opts == null ? void 0 : opts.keySeparator) ?? ".");
}
const checkedLoadedFor = {};
const shouldHandleAsObject = (res) => !isString$1(res) && typeof res !== "boolean" && typeof res !== "number";
class Translator extends EventEmitter {
  constructor(services, options = {}) {
    super();
    copy(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], services, this);
    this.options = options;
    if (this.options.keySeparator === void 0) {
      this.options.keySeparator = ".";
    }
    this.logger = baseLogger.create("translator");
  }
  changeLanguage(lng) {
    if (lng) this.language = lng;
  }
  exists(key, o2 = {
    interpolation: {}
  }) {
    const opt = {
      ...o2
    };
    if (key == null) return false;
    const resolved = this.resolve(key, opt);
    if ((resolved == null ? void 0 : resolved.res) === void 0) return false;
    const isObject2 = shouldHandleAsObject(resolved.res);
    if (opt.returnObjects === false && isObject2) {
      return false;
    }
    return true;
  }
  extractFromKey(key, opt) {
    let nsSeparator = opt.nsSeparator !== void 0 ? opt.nsSeparator : this.options.nsSeparator;
    if (nsSeparator === void 0) nsSeparator = ":";
    const keySeparator = opt.keySeparator !== void 0 ? opt.keySeparator : this.options.keySeparator;
    let namespaces = opt.ns || this.options.defaultNS || [];
    const wouldCheckForNsInKey = nsSeparator && key.indexOf(nsSeparator) > -1;
    const seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !opt.keySeparator && !this.options.userDefinedNsSeparator && !opt.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator);
    if (wouldCheckForNsInKey && !seemsNaturalLanguage) {
      const m2 = key.match(this.interpolator.nestingRegexp);
      if (m2 && m2.length > 0) {
        return {
          key,
          namespaces: isString$1(namespaces) ? [namespaces] : namespaces
        };
      }
      const parts = key.split(nsSeparator);
      if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift();
      key = parts.join(keySeparator);
    }
    return {
      key,
      namespaces: isString$1(namespaces) ? [namespaces] : namespaces
    };
  }
  translate(keys, o2, lastKey) {
    let opt = typeof o2 === "object" ? {
      ...o2
    } : o2;
    if (typeof opt !== "object" && this.options.overloadTranslationOptionHandler) {
      opt = this.options.overloadTranslationOptionHandler(arguments);
    }
    if (typeof opt === "object") opt = {
      ...opt
    };
    if (!opt) opt = {};
    if (keys == null) return "";
    if (typeof keys === "function") keys = keysFromSelector(keys, {
      ...this.options,
      ...opt
    });
    if (!Array.isArray(keys)) keys = [String(keys)];
    const returnDetails = opt.returnDetails !== void 0 ? opt.returnDetails : this.options.returnDetails;
    const keySeparator = opt.keySeparator !== void 0 ? opt.keySeparator : this.options.keySeparator;
    const {
      key,
      namespaces
    } = this.extractFromKey(keys[keys.length - 1], opt);
    const namespace = namespaces[namespaces.length - 1];
    let nsSeparator = opt.nsSeparator !== void 0 ? opt.nsSeparator : this.options.nsSeparator;
    if (nsSeparator === void 0) nsSeparator = ":";
    const lng = opt.lng || this.language;
    const appendNamespaceToCIMode = opt.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
    if ((lng == null ? void 0 : lng.toLowerCase()) === "cimode") {
      if (appendNamespaceToCIMode) {
        if (returnDetails) {
          return {
            res: `${namespace}${nsSeparator}${key}`,
            usedKey: key,
            exactUsedKey: key,
            usedLng: lng,
            usedNS: namespace,
            usedParams: this.getUsedParamsDetails(opt)
          };
        }
        return `${namespace}${nsSeparator}${key}`;
      }
      if (returnDetails) {
        return {
          res: key,
          usedKey: key,
          exactUsedKey: key,
          usedLng: lng,
          usedNS: namespace,
          usedParams: this.getUsedParamsDetails(opt)
        };
      }
      return key;
    }
    const resolved = this.resolve(keys, opt);
    let res = resolved == null ? void 0 : resolved.res;
    const resUsedKey = (resolved == null ? void 0 : resolved.usedKey) || key;
    const resExactUsedKey = (resolved == null ? void 0 : resolved.exactUsedKey) || key;
    const noObject = ["[object Number]", "[object Function]", "[object RegExp]"];
    const joinArrays = opt.joinArrays !== void 0 ? opt.joinArrays : this.options.joinArrays;
    const handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;
    const needsPluralHandling = opt.count !== void 0 && !isString$1(opt.count);
    const hasDefaultValue = Translator.hasDefaultValue(opt);
    const defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, opt) : "";
    const defaultValueSuffixOrdinalFallback = opt.ordinal && needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, {
      ordinal: false
    }) : "";
    const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0;
    const defaultValue = needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] || opt[`defaultValue${defaultValueSuffix}`] || opt[`defaultValue${defaultValueSuffixOrdinalFallback}`] || opt.defaultValue;
    let resForObjHndl = res;
    if (handleAsObjectInI18nFormat && !res && hasDefaultValue) {
      resForObjHndl = defaultValue;
    }
    const handleAsObject = shouldHandleAsObject(resForObjHndl);
    const resType = Object.prototype.toString.apply(resForObjHndl);
    if (handleAsObjectInI18nFormat && resForObjHndl && handleAsObject && noObject.indexOf(resType) < 0 && !(isString$1(joinArrays) && Array.isArray(resForObjHndl))) {
      if (!opt.returnObjects && !this.options.returnObjects) {
        if (!this.options.returnedObjectHandler) {
          this.logger.warn("accessing an object - but returnObjects options is not enabled!");
        }
        const r = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, resForObjHndl, {
          ...opt,
          ns: namespaces
        }) : `key '${key} (${this.language})' returned an object instead of string.`;
        if (returnDetails) {
          resolved.res = r;
          resolved.usedParams = this.getUsedParamsDetails(opt);
          return resolved;
        }
        return r;
      }
      if (keySeparator) {
        const resTypeIsArray = Array.isArray(resForObjHndl);
        const copy2 = resTypeIsArray ? [] : {};
        const newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey;
        for (const m2 in resForObjHndl) {
          if (Object.prototype.hasOwnProperty.call(resForObjHndl, m2)) {
            const deepKey = `${newKeyToUse}${keySeparator}${m2}`;
            if (hasDefaultValue && !res) {
              copy2[m2] = this.translate(deepKey, {
                ...opt,
                defaultValue: shouldHandleAsObject(defaultValue) ? defaultValue[m2] : void 0,
                ...{
                  joinArrays: false,
                  ns: namespaces
                }
              });
            } else {
              copy2[m2] = this.translate(deepKey, {
                ...opt,
                ...{
                  joinArrays: false,
                  ns: namespaces
                }
              });
            }
            if (copy2[m2] === deepKey) copy2[m2] = resForObjHndl[m2];
          }
        }
        res = copy2;
      }
    } else if (handleAsObjectInI18nFormat && isString$1(joinArrays) && Array.isArray(res)) {
      res = res.join(joinArrays);
      if (res) res = this.extendTranslation(res, keys, opt, lastKey);
    } else {
      let usedDefault = false;
      let usedKey = false;
      if (!this.isValidLookup(res) && hasDefaultValue) {
        usedDefault = true;
        res = defaultValue;
      }
      if (!this.isValidLookup(res)) {
        usedKey = true;
        res = key;
      }
      const missingKeyNoValueFallbackToKey = opt.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey;
      const resForMissing = missingKeyNoValueFallbackToKey && usedKey ? void 0 : res;
      const updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing;
      if (usedKey || usedDefault || updateMissing) {
        this.logger.log(updateMissing ? "updateKey" : "missingKey", lng, namespace, key, updateMissing ? defaultValue : res);
        if (keySeparator) {
          const fk = this.resolve(key, {
            ...opt,
            keySeparator: false
          });
          if (fk && fk.res) this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
        }
        let lngs = [];
        const fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, opt.lng || this.language);
        if (this.options.saveMissingTo === "fallback" && fallbackLngs && fallbackLngs[0]) {
          for (let i2 = 0; i2 < fallbackLngs.length; i2++) {
            lngs.push(fallbackLngs[i2]);
          }
        } else if (this.options.saveMissingTo === "all") {
          lngs = this.languageUtils.toResolveHierarchy(opt.lng || this.language);
        } else {
          lngs.push(opt.lng || this.language);
        }
        const send = (l2, k2, specificDefaultValue) => {
          var _a;
          const defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;
          if (this.options.missingKeyHandler) {
            this.options.missingKeyHandler(l2, namespace, k2, defaultForMissing, updateMissing, opt);
          } else if ((_a = this.backendConnector) == null ? void 0 : _a.saveMissing) {
            this.backendConnector.saveMissing(l2, namespace, k2, defaultForMissing, updateMissing, opt);
          }
          this.emit("missingKey", l2, namespace, k2, res);
        };
        if (this.options.saveMissing) {
          if (this.options.saveMissingPlurals && needsPluralHandling) {
            lngs.forEach((language) => {
              const suffixes = this.pluralResolver.getSuffixes(language, opt);
              if (needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] && suffixes.indexOf(`${this.options.pluralSeparator}zero`) < 0) {
                suffixes.push(`${this.options.pluralSeparator}zero`);
              }
              suffixes.forEach((suffix2) => {
                send([language], key + suffix2, opt[`defaultValue${suffix2}`] || defaultValue);
              });
            });
          } else {
            send(lngs, key, defaultValue);
          }
        }
      }
      res = this.extendTranslation(res, keys, opt, resolved, lastKey);
      if (usedKey && res === key && this.options.appendNamespaceToMissingKey) {
        res = `${namespace}${nsSeparator}${key}`;
      }
      if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) {
        res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}${nsSeparator}${key}` : key, usedDefault ? res : void 0, opt);
      }
    }
    if (returnDetails) {
      resolved.res = res;
      resolved.usedParams = this.getUsedParamsDetails(opt);
      return resolved;
    }
    return res;
  }
  extendTranslation(res, key, opt, resolved, lastKey) {
    var _a, _b;
    if ((_a = this.i18nFormat) == null ? void 0 : _a.parse) {
      res = this.i18nFormat.parse(res, {
        ...this.options.interpolation.defaultVariables,
        ...opt
      }, opt.lng || this.language || resolved.usedLng, resolved.usedNS, resolved.usedKey, {
        resolved
      });
    } else if (!opt.skipInterpolation) {
      if (opt.interpolation) this.interpolator.init({
        ...opt,
        ...{
          interpolation: {
            ...this.options.interpolation,
            ...opt.interpolation
          }
        }
      });
      const skipOnVariables = isString$1(res) && (((_b = opt == null ? void 0 : opt.interpolation) == null ? void 0 : _b.skipOnVariables) !== void 0 ? opt.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
      let nestBef;
      if (skipOnVariables) {
        const nb = res.match(this.interpolator.nestingRegexp);
        nestBef = nb && nb.length;
      }
      let data = opt.replace && !isString$1(opt.replace) ? opt.replace : opt;
      if (this.options.interpolation.defaultVariables) data = {
        ...this.options.interpolation.defaultVariables,
        ...data
      };
      res = this.interpolator.interpolate(res, data, opt.lng || this.language || resolved.usedLng, opt);
      if (skipOnVariables) {
        const na = res.match(this.interpolator.nestingRegexp);
        const nestAft = na && na.length;
        if (nestBef < nestAft) opt.nest = false;
      }
      if (!opt.lng && resolved && resolved.res) opt.lng = this.language || resolved.usedLng;
      if (opt.nest !== false) res = this.interpolator.nest(res, (...args) => {
        if ((lastKey == null ? void 0 : lastKey[0]) === args[0] && !opt.context) {
          this.logger.warn(`It seems you are nesting recursively key: ${args[0]} in key: ${key[0]}`);
          return null;
        }
        return this.translate(...args, key);
      }, opt);
      if (opt.interpolation) this.interpolator.reset();
    }
    const postProcess = opt.postProcess || this.options.postProcess;
    const postProcessorNames = isString$1(postProcess) ? [postProcess] : postProcess;
    if (res != null && (postProcessorNames == null ? void 0 : postProcessorNames.length) && opt.applyPostProcessor !== false) {
      res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? {
        i18nResolved: {
          ...resolved,
          usedParams: this.getUsedParamsDetails(opt)
        },
        ...opt
      } : opt, this);
    }
    return res;
  }
  resolve(keys, opt = {}) {
    let found;
    let usedKey;
    let exactUsedKey;
    let usedLng;
    let usedNS;
    if (isString$1(keys)) keys = [keys];
    keys.forEach((k2) => {
      if (this.isValidLookup(found)) return;
      const extracted = this.extractFromKey(k2, opt);
      const key = extracted.key;
      usedKey = key;
      let namespaces = extracted.namespaces;
      if (this.options.fallbackNS) namespaces = namespaces.concat(this.options.fallbackNS);
      const needsPluralHandling = opt.count !== void 0 && !isString$1(opt.count);
      const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0;
      const needsContextHandling = opt.context !== void 0 && (isString$1(opt.context) || typeof opt.context === "number") && opt.context !== "";
      const codes = opt.lngs ? opt.lngs : this.languageUtils.toResolveHierarchy(opt.lng || this.language, opt.fallbackLng);
      namespaces.forEach((ns) => {
        var _a, _b;
        if (this.isValidLookup(found)) return;
        usedNS = ns;
        if (!checkedLoadedFor[`${codes[0]}-${ns}`] && ((_a = this.utils) == null ? void 0 : _a.hasLoadedNamespace) && !((_b = this.utils) == null ? void 0 : _b.hasLoadedNamespace(usedNS))) {
          checkedLoadedFor[`${codes[0]}-${ns}`] = true;
          this.logger.warn(`key "${usedKey}" for languages "${codes.join(", ")}" won't get resolved as namespace "${usedNS}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
        }
        codes.forEach((code) => {
          var _a2;
          if (this.isValidLookup(found)) return;
          usedLng = code;
          const finalKeys = [key];
          if ((_a2 = this.i18nFormat) == null ? void 0 : _a2.addLookupKeys) {
            this.i18nFormat.addLookupKeys(finalKeys, key, code, ns, opt);
          } else {
            let pluralSuffix;
            if (needsPluralHandling) pluralSuffix = this.pluralResolver.getSuffix(code, opt.count, opt);
            const zeroSuffix = `${this.options.pluralSeparator}zero`;
            const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
            if (needsPluralHandling) {
              if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
                finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
              }
              finalKeys.push(key + pluralSuffix);
              if (needsZeroSuffixLookup) {
                finalKeys.push(key + zeroSuffix);
              }
            }
            if (needsContextHandling) {
              const contextKey = `${key}${this.options.contextSeparator || "_"}${opt.context}`;
              finalKeys.push(contextKey);
              if (needsPluralHandling) {
                if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
                  finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
                }
                finalKeys.push(contextKey + pluralSuffix);
                if (needsZeroSuffixLookup) {
                  finalKeys.push(contextKey + zeroSuffix);
                }
              }
            }
          }
          let possibleKey;
          while (possibleKey = finalKeys.pop()) {
            if (!this.isValidLookup(found)) {
              exactUsedKey = possibleKey;
              found = this.getResource(code, ns, possibleKey, opt);
            }
          }
        });
      });
    });
    return {
      res: found,
      usedKey,
      exactUsedKey,
      usedLng,
      usedNS
    };
  }
  isValidLookup(res) {
    return res !== void 0 && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === "");
  }
  getResource(code, ns, key, options = {}) {
    var _a;
    if ((_a = this.i18nFormat) == null ? void 0 : _a.getResource) return this.i18nFormat.getResource(code, ns, key, options);
    return this.resourceStore.getResource(code, ns, key, options);
  }
  getUsedParamsDetails(options = {}) {
    const optionsKeys = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"];
    const useOptionsReplaceForData = options.replace && !isString$1(options.replace);
    let data = useOptionsReplaceForData ? options.replace : options;
    if (useOptionsReplaceForData && typeof options.count !== "undefined") {
      data.count = options.count;
    }
    if (this.options.interpolation.defaultVariables) {
      data = {
        ...this.options.interpolation.defaultVariables,
        ...data
      };
    }
    if (!useOptionsReplaceForData) {
      data = {
        ...data
      };
      for (const key of optionsKeys) {
        delete data[key];
      }
    }
    return data;
  }
  static hasDefaultValue(options) {
    const prefix2 = "defaultValue";
    for (const option in options) {
      if (Object.prototype.hasOwnProperty.call(options, option) && prefix2 === option.substring(0, prefix2.length) && void 0 !== options[option]) {
        return true;
      }
    }
    return false;
  }
}
class LanguageUtil {
  constructor(options) {
    this.options = options;
    this.supportedLngs = this.options.supportedLngs || false;
    this.logger = baseLogger.create("languageUtils");
  }
  getScriptPartFromCode(code) {
    code = getCleanedCode(code);
    if (!code || code.indexOf("-") < 0) return null;
    const p2 = code.split("-");
    if (p2.length === 2) return null;
    p2.pop();
    if (p2[p2.length - 1].toLowerCase() === "x") return null;
    return this.formatLanguageCode(p2.join("-"));
  }
  getLanguagePartFromCode(code) {
    code = getCleanedCode(code);
    if (!code || code.indexOf("-") < 0) return code;
    const p2 = code.split("-");
    return this.formatLanguageCode(p2[0]);
  }
  formatLanguageCode(code) {
    if (isString$1(code) && code.indexOf("-") > -1) {
      let formattedCode;
      try {
        formattedCode = Intl.getCanonicalLocales(code)[0];
      } catch (e2) {
      }
      if (formattedCode && this.options.lowerCaseLng) {
        formattedCode = formattedCode.toLowerCase();
      }
      if (formattedCode) return formattedCode;
      if (this.options.lowerCaseLng) {
        return code.toLowerCase();
      }
      return code;
    }
    return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;
  }
  isSupportedCode(code) {
    if (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) {
      code = this.getLanguagePartFromCode(code);
    }
    return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1;
  }
  getBestMatchFromCodes(codes) {
    if (!codes) return null;
    let found;
    codes.forEach((code) => {
      if (found) return;
      const cleanedLng = this.formatLanguageCode(code);
      if (!this.options.supportedLngs || this.isSupportedCode(cleanedLng)) found = cleanedLng;
    });
    if (!found && this.options.supportedLngs) {
      codes.forEach((code) => {
        if (found) return;
        const lngScOnly = this.getScriptPartFromCode(code);
        if (this.isSupportedCode(lngScOnly)) return found = lngScOnly;
        const lngOnly = this.getLanguagePartFromCode(code);
        if (this.isSupportedCode(lngOnly)) return found = lngOnly;
        found = this.options.supportedLngs.find((supportedLng) => {
          if (supportedLng === lngOnly) return supportedLng;
          if (supportedLng.indexOf("-") < 0 && lngOnly.indexOf("-") < 0) return;
          if (supportedLng.indexOf("-") > 0 && lngOnly.indexOf("-") < 0 && supportedLng.substring(0, supportedLng.indexOf("-")) === lngOnly) return supportedLng;
          if (supportedLng.indexOf(lngOnly) === 0 && lngOnly.length > 1) return supportedLng;
        });
      });
    }
    if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0];
    return found;
  }
  getFallbackCodes(fallbacks, code) {
    if (!fallbacks) return [];
    if (typeof fallbacks === "function") fallbacks = fallbacks(code);
    if (isString$1(fallbacks)) fallbacks = [fallbacks];
    if (Array.isArray(fallbacks)) return fallbacks;
    if (!code) return fallbacks.default || [];
    let found = fallbacks[code];
    if (!found) found = fallbacks[this.getScriptPartFromCode(code)];
    if (!found) found = fallbacks[this.formatLanguageCode(code)];
    if (!found) found = fallbacks[this.getLanguagePartFromCode(code)];
    if (!found) found = fallbacks.default;
    return found || [];
  }
  toResolveHierarchy(code, fallbackCode) {
    const fallbackCodes = this.getFallbackCodes((fallbackCode === false ? [] : fallbackCode) || this.options.fallbackLng || [], code);
    const codes = [];
    const addCode = (c2) => {
      if (!c2) return;
      if (this.isSupportedCode(c2)) {
        codes.push(c2);
      } else {
        this.logger.warn(`rejecting language code not found in supportedLngs: ${c2}`);
      }
    };
    if (isString$1(code) && (code.indexOf("-") > -1 || code.indexOf("_") > -1)) {
      if (this.options.load !== "languageOnly") addCode(this.formatLanguageCode(code));
      if (this.options.load !== "languageOnly" && this.options.load !== "currentOnly") addCode(this.getScriptPartFromCode(code));
      if (this.options.load !== "currentOnly") addCode(this.getLanguagePartFromCode(code));
    } else if (isString$1(code)) {
      addCode(this.formatLanguageCode(code));
    }
    fallbackCodes.forEach((fc) => {
      if (codes.indexOf(fc) < 0) addCode(this.formatLanguageCode(fc));
    });
    return codes;
  }
}
const suffixesOrder = {
  zero: 0,
  one: 1,
  two: 2,
  few: 3,
  many: 4,
  other: 5
};
const dummyRule = {
  select: (count) => count === 1 ? "one" : "other",
  resolvedOptions: () => ({
    pluralCategories: ["one", "other"]
  })
};
class PluralResolver {
  constructor(languageUtils, options = {}) {
    this.languageUtils = languageUtils;
    this.options = options;
    this.logger = baseLogger.create("pluralResolver");
    this.pluralRulesCache = {};
  }
  clearCache() {
    this.pluralRulesCache = {};
  }
  getRule(code, options = {}) {
    const cleanedCode = getCleanedCode(code === "dev" ? "en" : code);
    const type = options.ordinal ? "ordinal" : "cardinal";
    const cacheKey = JSON.stringify({
      cleanedCode,
      type
    });
    if (cacheKey in this.pluralRulesCache) {
      return this.pluralRulesCache[cacheKey];
    }
    let rule;
    try {
      rule = new Intl.PluralRules(cleanedCode, {
        type
      });
    } catch (err) {
      if (!Intl) {
        this.logger.error("No Intl support, please use an Intl polyfill!");
        return dummyRule;
      }
      if (!code.match(/-|_/)) return dummyRule;
      const lngPart = this.languageUtils.getLanguagePartFromCode(code);
      rule = this.getRule(lngPart, options);
    }
    this.pluralRulesCache[cacheKey] = rule;
    return rule;
  }
  needsPlural(code, options = {}) {
    let rule = this.getRule(code, options);
    if (!rule) rule = this.getRule("dev", options);
    return (rule == null ? void 0 : rule.resolvedOptions().pluralCategories.length) > 1;
  }
  getPluralFormsOfKey(code, key, options = {}) {
    return this.getSuffixes(code, options).map((suffix2) => `${key}${suffix2}`);
  }
  getSuffixes(code, options = {}) {
    let rule = this.getRule(code, options);
    if (!rule) rule = this.getRule("dev", options);
    if (!rule) return [];
    return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map((pluralCategory) => `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ""}${pluralCategory}`);
  }
  getSuffix(code, count, options = {}) {
    const rule = this.getRule(code, options);
    if (rule) {
      return `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ""}${rule.select(count)}`;
    }
    this.logger.warn(`no plural rule found for: ${code}`);
    return this.getSuffix("dev", count, options);
  }
}
const deepFindWithDefaults = (data, defaultData, key, keySeparator = ".", ignoreJSONStructure = true) => {
  let path = getPathWithDefaults(data, defaultData, key);
  if (!path && ignoreJSONStructure && isString$1(key)) {
    path = deepFind(data, key, keySeparator);
    if (path === void 0) path = deepFind(defaultData, key, keySeparator);
  }
  return path;
};
const regexSafe = (val) => val.replace(/\$/g, "$$$$");
class Interpolator {
  constructor(options = {}) {
    var _a;
    this.logger = baseLogger.create("interpolator");
    this.options = options;
    this.format = ((_a = options == null ? void 0 : options.interpolation) == null ? void 0 : _a.format) || ((value) => value);
    this.init(options);
  }
  init(options = {}) {
    if (!options.interpolation) options.interpolation = {
      escapeValue: true
    };
    const {
      escape: escape$12,
      escapeValue,
      useRawValueToEscape,
      prefix: prefix2,
      prefixEscaped,
      suffix: suffix2,
      suffixEscaped,
      formatSeparator,
      unescapeSuffix,
      unescapePrefix,
      nestingPrefix,
      nestingPrefixEscaped,
      nestingSuffix,
      nestingSuffixEscaped,
      nestingOptionsSeparator,
      maxReplaces,
      alwaysFormat
    } = options.interpolation;
    this.escape = escape$12 !== void 0 ? escape$12 : escape;
    this.escapeValue = escapeValue !== void 0 ? escapeValue : true;
    this.useRawValueToEscape = useRawValueToEscape !== void 0 ? useRawValueToEscape : false;
    this.prefix = prefix2 ? regexEscape(prefix2) : prefixEscaped || "{{";
    this.suffix = suffix2 ? regexEscape(suffix2) : suffixEscaped || "}}";
    this.formatSeparator = formatSeparator || ",";
    this.unescapePrefix = unescapeSuffix ? "" : unescapePrefix || "-";
    this.unescapeSuffix = this.unescapePrefix ? "" : unescapeSuffix || "";
    this.nestingPrefix = nestingPrefix ? regexEscape(nestingPrefix) : nestingPrefixEscaped || regexEscape("$t(");
    this.nestingSuffix = nestingSuffix ? regexEscape(nestingSuffix) : nestingSuffixEscaped || regexEscape(")");
    this.nestingOptionsSeparator = nestingOptionsSeparator || ",";
    this.maxReplaces = maxReplaces || 1e3;
    this.alwaysFormat = alwaysFormat !== void 0 ? alwaysFormat : false;
    this.resetRegExp();
  }
  reset() {
    if (this.options) this.init(this.options);
  }
  resetRegExp() {
    const getOrResetRegExp = (existingRegExp, pattern) => {
      if ((existingRegExp == null ? void 0 : existingRegExp.source) === pattern) {
        existingRegExp.lastIndex = 0;
        return existingRegExp;
      }
      return new RegExp(pattern, "g");
    };
    this.regexp = getOrResetRegExp(this.regexp, `${this.prefix}(.+?)${this.suffix}`);
    this.regexpUnescape = getOrResetRegExp(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`);
    this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
  }
  interpolate(str, data, lng, options) {
    var _a;
    let match;
    let value;
    let replaces;
    const defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
    const handleFormat = (key) => {
      if (key.indexOf(this.formatSeparator) < 0) {
        const path = deepFindWithDefaults(data, defaultData, key, this.options.keySeparator, this.options.ignoreJSONStructure);
        return this.alwaysFormat ? this.format(path, void 0, lng, {
          ...options,
          ...data,
          interpolationkey: key
        }) : path;
      }
      const p2 = key.split(this.formatSeparator);
      const k2 = p2.shift().trim();
      const f2 = p2.join(this.formatSeparator).trim();
      return this.format(deepFindWithDefaults(data, defaultData, k2, this.options.keySeparator, this.options.ignoreJSONStructure), f2, lng, {
        ...options,
        ...data,
        interpolationkey: k2
      });
    };
    this.resetRegExp();
    const missingInterpolationHandler = (options == null ? void 0 : options.missingInterpolationHandler) || this.options.missingInterpolationHandler;
    const skipOnVariables = ((_a = options == null ? void 0 : options.interpolation) == null ? void 0 : _a.skipOnVariables) !== void 0 ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
    const todos = [{
      regex: this.regexpUnescape,
      safeValue: (val) => regexSafe(val)
    }, {
      regex: this.regexp,
      safeValue: (val) => this.escapeValue ? regexSafe(this.escape(val)) : regexSafe(val)
    }];
    todos.forEach((todo) => {
      replaces = 0;
      while (match = todo.regex.exec(str)) {
        const matchedVar = match[1].trim();
        value = handleFormat(matchedVar);
        if (value === void 0) {
          if (typeof missingInterpolationHandler === "function") {
            const temp = missingInterpolationHandler(str, match, options);
            value = isString$1(temp) ? temp : "";
          } else if (options && Object.prototype.hasOwnProperty.call(options, matchedVar)) {
            value = "";
          } else if (skipOnVariables) {
            value = match[0];
            continue;
          } else {
            this.logger.warn(`missed to pass in variable ${matchedVar} for interpolating ${str}`);
            value = "";
          }
        } else if (!isString$1(value) && !this.useRawValueToEscape) {
          value = makeString(value);
        }
        const safeValue = todo.safeValue(value);
        str = str.replace(match[0], safeValue);
        if (skipOnVariables) {
          todo.regex.lastIndex += value.length;
          todo.regex.lastIndex -= match[0].length;
        } else {
          todo.regex.lastIndex = 0;
        }
        replaces++;
        if (replaces >= this.maxReplaces) {
          break;
        }
      }
    });
    return str;
  }
  nest(str, fc, options = {}) {
    let match;
    let value;
    let clonedOptions;
    const handleHasOptions = (key, inheritedOptions) => {
      const sep = this.nestingOptionsSeparator;
      if (key.indexOf(sep) < 0) return key;
      const c2 = key.split(new RegExp(`${sep}[ ]*{`));
      let optionsString = `{${c2[1]}`;
      key = c2[0];
      optionsString = this.interpolate(optionsString, clonedOptions);
      const matchedSingleQuotes = optionsString.match(/'/g);
      const matchedDoubleQuotes = optionsString.match(/"/g);
      if (((matchedSingleQuotes == null ? void 0 : matchedSingleQuotes.length) ?? 0) % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {
        optionsString = optionsString.replace(/'/g, '"');
      }
      try {
        clonedOptions = JSON.parse(optionsString);
        if (inheritedOptions) clonedOptions = {
          ...inheritedOptions,
          ...clonedOptions
        };
      } catch (e2) {
        this.logger.warn(`failed parsing options string in nesting for key ${key}`, e2);
        return `${key}${sep}${optionsString}`;
      }
      if (clonedOptions.defaultValue && clonedOptions.defaultValue.indexOf(this.prefix) > -1) delete clonedOptions.defaultValue;
      return key;
    };
    while (match = this.nestingRegexp.exec(str)) {
      let formatters = [];
      clonedOptions = {
        ...options
      };
      clonedOptions = clonedOptions.replace && !isString$1(clonedOptions.replace) ? clonedOptions.replace : clonedOptions;
      clonedOptions.applyPostProcessor = false;
      delete clonedOptions.defaultValue;
      const keyEndIndex = /{.*}/.test(match[1]) ? match[1].lastIndexOf("}") + 1 : match[1].indexOf(this.formatSeparator);
      if (keyEndIndex !== -1) {
        formatters = match[1].slice(keyEndIndex).split(this.formatSeparator).map((elem) => elem.trim()).filter(Boolean);
        match[1] = match[1].slice(0, keyEndIndex);
      }
      value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions);
      if (value && match[0] === str && !isString$1(value)) return value;
      if (!isString$1(value)) value = makeString(value);
      if (!value) {
        this.logger.warn(`missed to resolve ${match[1]} for nesting ${str}`);
        value = "";
      }
      if (formatters.length) {
        value = formatters.reduce((v2, f2) => this.format(v2, f2, options.lng, {
          ...options,
          interpolationkey: match[1].trim()
        }), value.trim());
      }
      str = str.replace(match[0], value);
      this.regexp.lastIndex = 0;
    }
    return str;
  }
}
const parseFormatStr = (formatStr) => {
  let formatName = formatStr.toLowerCase().trim();
  const formatOptions = {};
  if (formatStr.indexOf("(") > -1) {
    const p2 = formatStr.split("(");
    formatName = p2[0].toLowerCase().trim();
    const optStr = p2[1].substring(0, p2[1].length - 1);
    if (formatName === "currency" && optStr.indexOf(":") < 0) {
      if (!formatOptions.currency) formatOptions.currency = optStr.trim();
    } else if (formatName === "relativetime" && optStr.indexOf(":") < 0) {
      if (!formatOptions.range) formatOptions.range = optStr.trim();
    } else {
      const opts = optStr.split(";");
      opts.forEach((opt) => {
        if (opt) {
          const [key, ...rest] = opt.split(":");
          const val = rest.join(":").trim().replace(/^'+|'+$/g, "");
          const trimmedKey = key.trim();
          if (!formatOptions[trimmedKey]) formatOptions[trimmedKey] = val;
          if (val === "false") formatOptions[trimmedKey] = false;
          if (val === "true") formatOptions[trimmedKey] = true;
          if (!isNaN(val)) formatOptions[trimmedKey] = parseInt(val, 10);
        }
      });
    }
  }
  return {
    formatName,
    formatOptions
  };
};
const createCachedFormatter = (fn) => {
  const cache = {};
  return (v2, l2, o2) => {
    let optForCache = o2;
    if (o2 && o2.interpolationkey && o2.formatParams && o2.formatParams[o2.interpolationkey] && o2[o2.interpolationkey]) {
      optForCache = {
        ...optForCache,
        [o2.interpolationkey]: void 0
      };
    }
    const key = l2 + JSON.stringify(optForCache);
    let frm = cache[key];
    if (!frm) {
      frm = fn(getCleanedCode(l2), o2);
      cache[key] = frm;
    }
    return frm(v2);
  };
};
const createNonCachedFormatter = (fn) => (v2, l2, o2) => fn(getCleanedCode(l2), o2)(v2);
class Formatter {
  constructor(options = {}) {
    this.logger = baseLogger.create("formatter");
    this.options = options;
    this.init(options);
  }
  init(services, options = {
    interpolation: {}
  }) {
    this.formatSeparator = options.interpolation.formatSeparator || ",";
    const cf = options.cacheInBuiltFormats ? createCachedFormatter : createNonCachedFormatter;
    this.formats = {
      number: cf((lng, opt) => {
        const formatter = new Intl.NumberFormat(lng, {
          ...opt
        });
        return (val) => formatter.format(val);
      }),
      currency: cf((lng, opt) => {
        const formatter = new Intl.NumberFormat(lng, {
          ...opt,
          style: "currency"
        });
        return (val) => formatter.format(val);
      }),
      datetime: cf((lng, opt) => {
        const formatter = new Intl.DateTimeFormat(lng, {
          ...opt
        });
        return (val) => formatter.format(val);
      }),
      relativetime: cf((lng, opt) => {
        const formatter = new Intl.RelativeTimeFormat(lng, {
          ...opt
        });
        return (val) => formatter.format(val, opt.range || "day");
      }),
      list: cf((lng, opt) => {
        const formatter = new Intl.ListFormat(lng, {
          ...opt
        });
        return (val) => formatter.format(val);
      })
    };
  }
  add(name, fc) {
    this.formats[name.toLowerCase().trim()] = fc;
  }
  addCached(name, fc) {
    this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc);
  }
  format(value, format, lng, options = {}) {
    const formats = format.split(this.formatSeparator);
    if (formats.length > 1 && formats[0].indexOf("(") > 1 && formats[0].indexOf(")") < 0 && formats.find((f2) => f2.indexOf(")") > -1)) {
      const lastIndex = formats.findIndex((f2) => f2.indexOf(")") > -1);
      formats[0] = [formats[0], ...formats.splice(1, lastIndex)].join(this.formatSeparator);
    }
    const result = formats.reduce((mem, f2) => {
      var _a;
      const {
        formatName,
        formatOptions
      } = parseFormatStr(f2);
      if (this.formats[formatName]) {
        let formatted = mem;
        try {
          const valOptions = ((_a = options == null ? void 0 : options.formatParams) == null ? void 0 : _a[options.interpolationkey]) || {};
          const l2 = valOptions.locale || valOptions.lng || options.locale || options.lng || lng;
          formatted = this.formats[formatName](mem, l2, {
            ...formatOptions,
            ...options,
            ...valOptions
          });
        } catch (error) {
          this.logger.warn(error);
        }
        return formatted;
      } else {
        this.logger.warn(`there was no format function for ${formatName}`);
      }
      return mem;
    }, value);
    return result;
  }
}
const removePending = (q, name) => {
  if (q.pending[name] !== void 0) {
    delete q.pending[name];
    q.pendingCount--;
  }
};
class Connector extends EventEmitter {
  constructor(backend, store2, services, options = {}) {
    var _a, _b;
    super();
    this.backend = backend;
    this.store = store2;
    this.services = services;
    this.languageUtils = services.languageUtils;
    this.options = options;
    this.logger = baseLogger.create("backendConnector");
    this.waitingReads = [];
    this.maxParallelReads = options.maxParallelReads || 10;
    this.readingCalls = 0;
    this.maxRetries = options.maxRetries >= 0 ? options.maxRetries : 5;
    this.retryTimeout = options.retryTimeout >= 1 ? options.retryTimeout : 350;
    this.state = {};
    this.queue = [];
    (_b = (_a = this.backend) == null ? void 0 : _a.init) == null ? void 0 : _b.call(_a, services, options.backend, options);
  }
  queueLoad(languages, namespaces, options, callback) {
    const toLoad = {};
    const pending = {};
    const toLoadLanguages = {};
    const toLoadNamespaces = {};
    languages.forEach((lng) => {
      let hasAllNamespaces = true;
      namespaces.forEach((ns) => {
        const name = `${lng}|${ns}`;
        if (!options.reload && this.store.hasResourceBundle(lng, ns)) {
          this.state[name] = 2;
        } else if (this.state[name] < 0) ;
        else if (this.state[name] === 1) {
          if (pending[name] === void 0) pending[name] = true;
        } else {
          this.state[name] = 1;
          hasAllNamespaces = false;
          if (pending[name] === void 0) pending[name] = true;
          if (toLoad[name] === void 0) toLoad[name] = true;
          if (toLoadNamespaces[ns] === void 0) toLoadNamespaces[ns] = true;
        }
      });
      if (!hasAllNamespaces) toLoadLanguages[lng] = true;
    });
    if (Object.keys(toLoad).length || Object.keys(pending).length) {
      this.queue.push({
        pending,
        pendingCount: Object.keys(pending).length,
        loaded: {},
        errors: [],
        callback
      });
    }
    return {
      toLoad: Object.keys(toLoad),
      pending: Object.keys(pending),
      toLoadLanguages: Object.keys(toLoadLanguages),
      toLoadNamespaces: Object.keys(toLoadNamespaces)
    };
  }
  loaded(name, err, data) {
    const s2 = name.split("|");
    const lng = s2[0];
    const ns = s2[1];
    if (err) this.emit("failedLoading", lng, ns, err);
    if (!err && data) {
      this.store.addResourceBundle(lng, ns, data, void 0, void 0, {
        skipCopy: true
      });
    }
    this.state[name] = err ? -1 : 2;
    if (err && data) this.state[name] = 0;
    const loaded = {};
    this.queue.forEach((q) => {
      pushPath(q.loaded, [lng], ns);
      removePending(q, name);
      if (err) q.errors.push(err);
      if (q.pendingCount === 0 && !q.done) {
        Object.keys(q.loaded).forEach((l2) => {
          if (!loaded[l2]) loaded[l2] = {};
          const loadedKeys = q.loaded[l2];
          if (loadedKeys.length) {
            loadedKeys.forEach((n2) => {
              if (loaded[l2][n2] === void 0) loaded[l2][n2] = true;
            });
          }
        });
        q.done = true;
        if (q.errors.length) {
          q.callback(q.errors);
        } else {
          q.callback();
        }
      }
    });
    this.emit("loaded", loaded);
    this.queue = this.queue.filter((q) => !q.done);
  }
  read(lng, ns, fcName, tried = 0, wait = this.retryTimeout, callback) {
    if (!lng.length) return callback(null, {});
    if (this.readingCalls >= this.maxParallelReads) {
      this.waitingReads.push({
        lng,
        ns,
        fcName,
        tried,
        wait,
        callback
      });
      return;
    }
    this.readingCalls++;
    const resolver = (err, data) => {
      this.readingCalls--;
      if (this.waitingReads.length > 0) {
        const next = this.waitingReads.shift();
        this.read(next.lng, next.ns, next.fcName, next.tried, next.wait, next.callback);
      }
      if (err && data && tried < this.maxRetries) {
        setTimeout(() => {
          this.read.call(this, lng, ns, fcName, tried + 1, wait * 2, callback);
        }, wait);
        return;
      }
      callback(err, data);
    };
    const fc = this.backend[fcName].bind(this.backend);
    if (fc.length === 2) {
      try {
        const r = fc(lng, ns);
        if (r && typeof r.then === "function") {
          r.then((data) => resolver(null, data)).catch(resolver);
        } else {
          resolver(null, r);
        }
      } catch (err) {
        resolver(err);
      }
      return;
    }
    return fc(lng, ns, resolver);
  }
  prepareLoading(languages, namespaces, options = {}, callback) {
    if (!this.backend) {
      this.logger.warn("No backend was added via i18next.use. Will not load resources.");
      return callback && callback();
    }
    if (isString$1(languages)) languages = this.languageUtils.toResolveHierarchy(languages);
    if (isString$1(namespaces)) namespaces = [namespaces];
    const toLoad = this.queueLoad(languages, namespaces, options, callback);
    if (!toLoad.toLoad.length) {
      if (!toLoad.pending.length) callback();
      return null;
    }
    toLoad.toLoad.forEach((name) => {
      this.loadOne(name);
    });
  }
  load(languages, namespaces, callback) {
    this.prepareLoading(languages, namespaces, {}, callback);
  }
  reload(languages, namespaces, callback) {
    this.prepareLoading(languages, namespaces, {
      reload: true
    }, callback);
  }
  loadOne(name, prefix2 = "") {
    const s2 = name.split("|");
    const lng = s2[0];
    const ns = s2[1];
    this.read(lng, ns, "read", void 0, void 0, (err, data) => {
      if (err) this.logger.warn(`${prefix2}loading namespace ${ns} for language ${lng} failed`, err);
      if (!err && data) this.logger.log(`${prefix2}loaded namespace ${ns} for language ${lng}`, data);
      this.loaded(name, err, data);
    });
  }
  saveMissing(languages, namespace, key, fallbackValue, isUpdate, options = {}, clb = () => {
  }) {
    var _a, _b, _c, _d, _e;
    if (((_b = (_a = this.services) == null ? void 0 : _a.utils) == null ? void 0 : _b.hasLoadedNamespace) && !((_d = (_c = this.services) == null ? void 0 : _c.utils) == null ? void 0 : _d.hasLoadedNamespace(namespace))) {
      this.logger.warn(`did not save key "${key}" as the namespace "${namespace}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
      return;
    }
    if (key === void 0 || key === null || key === "") return;
    if ((_e = this.backend) == null ? void 0 : _e.create) {
      const opts = {
        ...options,
        isUpdate
      };
      const fc = this.backend.create.bind(this.backend);
      if (fc.length < 6) {
        try {
          let r;
          if (fc.length === 5) {
            r = fc(languages, namespace, key, fallbackValue, opts);
          } else {
            r = fc(languages, namespace, key, fallbackValue);
          }
          if (r && typeof r.then === "function") {
            r.then((data) => clb(null, data)).catch(clb);
          } else {
            clb(null, r);
          }
        } catch (err) {
          clb(err);
        }
      } else {
        fc(languages, namespace, key, fallbackValue, clb, opts);
      }
    }
    if (!languages || !languages[0]) return;
    this.store.addResource(languages[0], namespace, key, fallbackValue);
  }
}
const get = () => ({
  debug: false,
  initAsync: true,
  ns: ["translation"],
  defaultNS: ["translation"],
  fallbackLng: ["dev"],
  fallbackNS: false,
  supportedLngs: false,
  nonExplicitSupportedLngs: false,
  load: "all",
  preload: false,
  simplifyPluralSuffix: true,
  keySeparator: ".",
  nsSeparator: ":",
  pluralSeparator: "_",
  contextSeparator: "_",
  partialBundledLanguages: false,
  saveMissing: false,
  updateMissing: false,
  saveMissingTo: "fallback",
  saveMissingPlurals: true,
  missingKeyHandler: false,
  missingInterpolationHandler: false,
  postProcess: false,
  postProcessPassResolved: false,
  returnNull: false,
  returnEmptyString: true,
  returnObjects: false,
  joinArrays: false,
  returnedObjectHandler: false,
  parseMissingKeyHandler: false,
  appendNamespaceToMissingKey: false,
  appendNamespaceToCIMode: false,
  overloadTranslationOptionHandler: (args) => {
    let ret = {};
    if (typeof args[1] === "object") ret = args[1];
    if (isString$1(args[1])) ret.defaultValue = args[1];
    if (isString$1(args[2])) ret.tDescription = args[2];
    if (typeof args[2] === "object" || typeof args[3] === "object") {
      const options = args[3] || args[2];
      Object.keys(options).forEach((key) => {
        ret[key] = options[key];
      });
    }
    return ret;
  },
  interpolation: {
    escapeValue: true,
    format: (value) => value,
    prefix: "{{",
    suffix: "}}",
    formatSeparator: ",",
    unescapePrefix: "-",
    nestingPrefix: "$t(",
    nestingSuffix: ")",
    nestingOptionsSeparator: ",",
    maxReplaces: 1e3,
    skipOnVariables: true
  },
  cacheInBuiltFormats: true
});
const transformOptions = (options) => {
  var _a, _b;
  if (isString$1(options.ns)) options.ns = [options.ns];
  if (isString$1(options.fallbackLng)) options.fallbackLng = [options.fallbackLng];
  if (isString$1(options.fallbackNS)) options.fallbackNS = [options.fallbackNS];
  if (((_b = (_a = options.supportedLngs) == null ? void 0 : _a.indexOf) == null ? void 0 : _b.call(_a, "cimode")) < 0) {
    options.supportedLngs = options.supportedLngs.concat(["cimode"]);
  }
  if (typeof options.initImmediate === "boolean") options.initAsync = options.initImmediate;
  return options;
};
const noop = () => {
};
const bindMemberFunctions = (inst) => {
  const mems = Object.getOwnPropertyNames(Object.getPrototypeOf(inst));
  mems.forEach((mem) => {
    if (typeof inst[mem] === "function") {
      inst[mem] = inst[mem].bind(inst);
    }
  });
};
class I18n extends EventEmitter {
  constructor(options = {}, callback) {
    super();
    this.options = transformOptions(options);
    this.services = {};
    this.logger = baseLogger;
    this.modules = {
      external: []
    };
    bindMemberFunctions(this);
    if (callback && !this.isInitialized && !options.isClone) {
      if (!this.options.initAsync) {
        this.init(options, callback);
        return this;
      }
      setTimeout(() => {
        this.init(options, callback);
      }, 0);
    }
  }
  init(options = {}, callback) {
    this.isInitializing = true;
    if (typeof options === "function") {
      callback = options;
      options = {};
    }
    if (options.defaultNS == null && options.ns) {
      if (isString$1(options.ns)) {
        options.defaultNS = options.ns;
      } else if (options.ns.indexOf("translation") < 0) {
        options.defaultNS = options.ns[0];
      }
    }
    const defOpts = get();
    this.options = {
      ...defOpts,
      ...this.options,
      ...transformOptions(options)
    };
    this.options.interpolation = {
      ...defOpts.interpolation,
      ...this.options.interpolation
    };
    if (options.keySeparator !== void 0) {
      this.options.userDefinedKeySeparator = options.keySeparator;
    }
    if (options.nsSeparator !== void 0) {
      this.options.userDefinedNsSeparator = options.nsSeparator;
    }
    if (typeof this.options.overloadTranslationOptionHandler !== "function") {
      this.options.overloadTranslationOptionHandler = defOpts.overloadTranslationOptionHandler;
    }
    if (this.options.debug === true) {
      if (typeof console !== "undefined") console.warn("i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com");
    }
    const createClassOnDemand = (ClassOrObject) => {
      if (!ClassOrObject) return null;
      if (typeof ClassOrObject === "function") return new ClassOrObject();
      return ClassOrObject;
    };
    if (!this.options.isClone) {
      if (this.modules.logger) {
        baseLogger.init(createClassOnDemand(this.modules.logger), this.options);
      } else {
        baseLogger.init(null, this.options);
      }
      let formatter;
      if (this.modules.formatter) {
        formatter = this.modules.formatter;
      } else {
        formatter = Formatter;
      }
      const lu = new LanguageUtil(this.options);
      this.store = new ResourceStore(this.options.resources, this.options);
      const s2 = this.services;
      s2.logger = baseLogger;
      s2.resourceStore = this.store;
      s2.languageUtils = lu;
      s2.pluralResolver = new PluralResolver(lu, {
        prepend: this.options.pluralSeparator,
        simplifyPluralSuffix: this.options.simplifyPluralSuffix
      });
      const usingLegacyFormatFunction = this.options.interpolation.format && this.options.interpolation.format !== defOpts.interpolation.format;
      if (usingLegacyFormatFunction) {
        this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`);
      }
      if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
        s2.formatter = createClassOnDemand(formatter);
        if (s2.formatter.init) s2.formatter.init(s2, this.options);
        this.options.interpolation.format = s2.formatter.format.bind(s2.formatter);
      }
      s2.interpolator = new Interpolator(this.options);
      s2.utils = {
        hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
      };
      s2.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s2.resourceStore, s2, this.options);
      s2.backendConnector.on("*", (event, ...args) => {
        this.emit(event, ...args);
      });
      if (this.modules.languageDetector) {
        s2.languageDetector = createClassOnDemand(this.modules.languageDetector);
        if (s2.languageDetector.init) s2.languageDetector.init(s2, this.options.detection, this.options);
      }
      if (this.modules.i18nFormat) {
        s2.i18nFormat = createClassOnDemand(this.modules.i18nFormat);
        if (s2.i18nFormat.init) s2.i18nFormat.init(this);
      }
      this.translator = new Translator(this.services, this.options);
      this.translator.on("*", (event, ...args) => {
        this.emit(event, ...args);
      });
      this.modules.external.forEach((m2) => {
        if (m2.init) m2.init(this);
      });
    }
    this.format = this.options.interpolation.format;
    if (!callback) callback = noop;
    if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
      const codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
      if (codes.length > 0 && codes[0] !== "dev") this.options.lng = codes[0];
    }
    if (!this.services.languageDetector && !this.options.lng) {
      this.logger.warn("init: no languageDetector is used and no lng is defined");
    }
    const storeApi = ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"];
    storeApi.forEach((fcName) => {
      this[fcName] = (...args) => this.store[fcName](...args);
    });
    const storeApiChained = ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"];
    storeApiChained.forEach((fcName) => {
      this[fcName] = (...args) => {
        this.store[fcName](...args);
        return this;
      };
    });
    const deferred = defer();
    const load = () => {
      const finish = (err, t2) => {
        this.isInitializing = false;
        if (this.isInitialized && !this.initializedStoreOnce) this.logger.warn("init: i18next is already initialized. You should call init just once!");
        this.isInitialized = true;
        if (!this.options.isClone) this.logger.log("initialized", this.options);
        this.emit("initialized", this.options);
        deferred.resolve(t2);
        callback(err, t2);
      };
      if (this.languages && !this.isInitialized) return finish(null, this.t.bind(this));
      this.changeLanguage(this.options.lng, finish);
    };
    if (this.options.resources || !this.options.initAsync) {
      load();
    } else {
      setTimeout(load, 0);
    }
    return deferred;
  }
  loadResources(language, callback = noop) {
    var _a, _b;
    let usedCallback = callback;
    const usedLng = isString$1(language) ? language : this.language;
    if (typeof language === "function") usedCallback = language;
    if (!this.options.resources || this.options.partialBundledLanguages) {
      if ((usedLng == null ? void 0 : usedLng.toLowerCase()) === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return usedCallback();
      const toLoad = [];
      const append2 = (lng) => {
        if (!lng) return;
        if (lng === "cimode") return;
        const lngs = this.services.languageUtils.toResolveHierarchy(lng);
        lngs.forEach((l2) => {
          if (l2 === "cimode") return;
          if (toLoad.indexOf(l2) < 0) toLoad.push(l2);
        });
      };
      if (!usedLng) {
        const fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
        fallbacks.forEach((l2) => append2(l2));
      } else {
        append2(usedLng);
      }
      (_b = (_a = this.options.preload) == null ? void 0 : _a.forEach) == null ? void 0 : _b.call(_a, (l2) => append2(l2));
      this.services.backendConnector.load(toLoad, this.options.ns, (e2) => {
        if (!e2 && !this.resolvedLanguage && this.language) this.setResolvedLanguage(this.language);
        usedCallback(e2);
      });
    } else {
      usedCallback(null);
    }
  }
  reloadResources(lngs, ns, callback) {
    const deferred = defer();
    if (typeof lngs === "function") {
      callback = lngs;
      lngs = void 0;
    }
    if (typeof ns === "function") {
      callback = ns;
      ns = void 0;
    }
    if (!lngs) lngs = this.languages;
    if (!ns) ns = this.options.ns;
    if (!callback) callback = noop;
    this.services.backendConnector.reload(lngs, ns, (err) => {
      deferred.resolve();
      callback(err);
    });
    return deferred;
  }
  use(module) {
    if (!module) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
    if (!module.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
    if (module.type === "backend") {
      this.modules.backend = module;
    }
    if (module.type === "logger" || module.log && module.warn && module.error) {
      this.modules.logger = module;
    }
    if (module.type === "languageDetector") {
      this.modules.languageDetector = module;
    }
    if (module.type === "i18nFormat") {
      this.modules.i18nFormat = module;
    }
    if (module.type === "postProcessor") {
      postProcessor.addPostProcessor(module);
    }
    if (module.type === "formatter") {
      this.modules.formatter = module;
    }
    if (module.type === "3rdParty") {
      this.modules.external.push(module);
    }
    return this;
  }
  setResolvedLanguage(l2) {
    if (!l2 || !this.languages) return;
    if (["cimode", "dev"].indexOf(l2) > -1) return;
    for (let li = 0; li < this.languages.length; li++) {
      const lngInLngs = this.languages[li];
      if (["cimode", "dev"].indexOf(lngInLngs) > -1) continue;
      if (this.store.hasLanguageSomeTranslations(lngInLngs)) {
        this.resolvedLanguage = lngInLngs;
        break;
      }
    }
    if (!this.resolvedLanguage && this.languages.indexOf(l2) < 0 && this.store.hasLanguageSomeTranslations(l2)) {
      this.resolvedLanguage = l2;
      this.languages.unshift(l2);
    }
  }
  changeLanguage(lng, callback) {
    this.isLanguageChangingTo = lng;
    const deferred = defer();
    this.emit("languageChanging", lng);
    const setLngProps = (l2) => {
      this.language = l2;
      this.languages = this.services.languageUtils.toResolveHierarchy(l2);
      this.resolvedLanguage = void 0;
      this.setResolvedLanguage(l2);
    };
    const done = (err, l2) => {
      if (l2) {
        if (this.isLanguageChangingTo === lng) {
          setLngProps(l2);
          this.translator.changeLanguage(l2);
          this.isLanguageChangingTo = void 0;
          this.emit("languageChanged", l2);
          this.logger.log("languageChanged", l2);
        }
      } else {
        this.isLanguageChangingTo = void 0;
      }
      deferred.resolve((...args) => this.t(...args));
      if (callback) callback(err, (...args) => this.t(...args));
    };
    const setLng = (lngs) => {
      var _a, _b;
      if (!lng && !lngs && this.services.languageDetector) lngs = [];
      const fl = isString$1(lngs) ? lngs : lngs && lngs[0];
      const l2 = this.store.hasLanguageSomeTranslations(fl) ? fl : this.services.languageUtils.getBestMatchFromCodes(isString$1(lngs) ? [lngs] : lngs);
      if (l2) {
        if (!this.language) {
          setLngProps(l2);
        }
        if (!this.translator.language) this.translator.changeLanguage(l2);
        (_b = (_a = this.services.languageDetector) == null ? void 0 : _a.cacheUserLanguage) == null ? void 0 : _b.call(_a, l2);
      }
      this.loadResources(l2, (err) => {
        done(err, l2);
      });
    };
    if (!lng && this.services.languageDetector && !this.services.languageDetector.async) {
      setLng(this.services.languageDetector.detect());
    } else if (!lng && this.services.languageDetector && this.services.languageDetector.async) {
      if (this.services.languageDetector.detect.length === 0) {
        this.services.languageDetector.detect().then(setLng);
      } else {
        this.services.languageDetector.detect(setLng);
      }
    } else {
      setLng(lng);
    }
    return deferred;
  }
  getFixedT(lng, ns, keyPrefix) {
    const fixedT = (key, opts, ...rest) => {
      let o2;
      if (typeof opts !== "object") {
        o2 = this.options.overloadTranslationOptionHandler([key, opts].concat(rest));
      } else {
        o2 = {
          ...opts
        };
      }
      o2.lng = o2.lng || fixedT.lng;
      o2.lngs = o2.lngs || fixedT.lngs;
      o2.ns = o2.ns || fixedT.ns;
      if (o2.keyPrefix !== "") o2.keyPrefix = o2.keyPrefix || keyPrefix || fixedT.keyPrefix;
      const keySeparator = this.options.keySeparator || ".";
      let resultKey;
      if (o2.keyPrefix && Array.isArray(key)) {
        resultKey = key.map((k2) => {
          if (typeof k2 === "function") k2 = keysFromSelector(k2, {
            ...this.options,
            ...opts
          });
          return `${o2.keyPrefix}${keySeparator}${k2}`;
        });
      } else {
        if (typeof key === "function") key = keysFromSelector(key, {
          ...this.options,
          ...opts
        });
        resultKey = o2.keyPrefix ? `${o2.keyPrefix}${keySeparator}${key}` : key;
      }
      return this.t(resultKey, o2);
    };
    if (isString$1(lng)) {
      fixedT.lng = lng;
    } else {
      fixedT.lngs = lng;
    }
    fixedT.ns = ns;
    fixedT.keyPrefix = keyPrefix;
    return fixedT;
  }
  t(...args) {
    var _a;
    return (_a = this.translator) == null ? void 0 : _a.translate(...args);
  }
  exists(...args) {
    var _a;
    return (_a = this.translator) == null ? void 0 : _a.exists(...args);
  }
  setDefaultNamespace(ns) {
    this.options.defaultNS = ns;
  }
  hasLoadedNamespace(ns, options = {}) {
    if (!this.isInitialized) {
      this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages);
      return false;
    }
    if (!this.languages || !this.languages.length) {
      this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages);
      return false;
    }
    const lng = options.lng || this.resolvedLanguage || this.languages[0];
    const fallbackLng = this.options ? this.options.fallbackLng : false;
    const lastLng = this.languages[this.languages.length - 1];
    if (lng.toLowerCase() === "cimode") return true;
    const loadNotPending = (l2, n2) => {
      const loadState = this.services.backendConnector.state[`${l2}|${n2}`];
      return loadState === -1 || loadState === 0 || loadState === 2;
    };
    if (options.precheck) {
      const preResult = options.precheck(this, loadNotPending);
      if (preResult !== void 0) return preResult;
    }
    if (this.hasResourceBundle(lng, ns)) return true;
    if (!this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true;
    if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
    return false;
  }
  loadNamespaces(ns, callback) {
    const deferred = defer();
    if (!this.options.ns) {
      if (callback) callback();
      return Promise.resolve();
    }
    if (isString$1(ns)) ns = [ns];
    ns.forEach((n2) => {
      if (this.options.ns.indexOf(n2) < 0) this.options.ns.push(n2);
    });
    this.loadResources((err) => {
      deferred.resolve();
      if (callback) callback(err);
    });
    return deferred;
  }
  loadLanguages(lngs, callback) {
    const deferred = defer();
    if (isString$1(lngs)) lngs = [lngs];
    const preloaded = this.options.preload || [];
    const newLngs = lngs.filter((lng) => preloaded.indexOf(lng) < 0 && this.services.languageUtils.isSupportedCode(lng));
    if (!newLngs.length) {
      if (callback) callback();
      return Promise.resolve();
    }
    this.options.preload = preloaded.concat(newLngs);
    this.loadResources((err) => {
      deferred.resolve();
      if (callback) callback(err);
    });
    return deferred;
  }
  dir(lng) {
    var _a, _b;
    if (!lng) lng = this.resolvedLanguage || (((_a = this.languages) == null ? void 0 : _a.length) > 0 ? this.languages[0] : this.language);
    if (!lng) return "rtl";
    try {
      const l2 = new Intl.Locale(lng);
      if (l2 && l2.getTextInfo) {
        const ti = l2.getTextInfo();
        if (ti && ti.direction) return ti.direction;
      }
    } catch (e2) {
    }
    const rtlLngs = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"];
    const languageUtils = ((_b = this.services) == null ? void 0 : _b.languageUtils) || new LanguageUtil(get());
    if (lng.toLowerCase().indexOf("-latn") > 1) return "ltr";
    return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
  }
  static createInstance(options = {}, callback) {
    const instance2 = new I18n(options, callback);
    instance2.createInstance = I18n.createInstance;
    return instance2;
  }
  cloneInstance(options = {}, callback = noop) {
    const forkResourceStore = options.forkResourceStore;
    if (forkResourceStore) delete options.forkResourceStore;
    const mergedOptions = {
      ...this.options,
      ...options,
      ...{
        isClone: true
      }
    };
    const clone = new I18n(mergedOptions);
    if (options.debug !== void 0 || options.prefix !== void 0) {
      clone.logger = clone.logger.clone(options);
    }
    const membersToCopy = ["store", "services", "language"];
    membersToCopy.forEach((m2) => {
      clone[m2] = this[m2];
    });
    clone.services = {
      ...this.services
    };
    clone.services.utils = {
      hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
    };
    if (forkResourceStore) {
      const clonedData = Object.keys(this.store.data).reduce((prev, l2) => {
        prev[l2] = {
          ...this.store.data[l2]
        };
        prev[l2] = Object.keys(prev[l2]).reduce((acc, n2) => {
          acc[n2] = {
            ...prev[l2][n2]
          };
          return acc;
        }, prev[l2]);
        return prev;
      }, {});
      clone.store = new ResourceStore(clonedData, mergedOptions);
      clone.services.resourceStore = clone.store;
    }
    if (options.interpolation) {
      const defOpts = get();
      const mergedInterpolation = {
        ...defOpts.interpolation,
        ...this.options.interpolation,
        ...options.interpolation
      };
      const mergedForInterpolator = {
        ...mergedOptions,
        interpolation: mergedInterpolation
      };
      clone.services.interpolator = new Interpolator(mergedForInterpolator);
    }
    clone.translator = new Translator(clone.services, mergedOptions);
    clone.translator.on("*", (event, ...args) => {
      clone.emit(event, ...args);
    });
    clone.init(mergedOptions, callback);
    clone.translator.options = mergedOptions;
    clone.translator.backendConnector.services.utils = {
      hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
    };
    return clone;
  }
  toJSON() {
    return {
      options: this.options,
      store: this.store,
      language: this.language,
      languages: this.languages,
      resolvedLanguage: this.resolvedLanguage
    };
  }
}
const instance = I18n.createInstance();
instance.createInstance;
instance.dir;
instance.init;
instance.loadResources;
instance.reloadResources;
instance.use;
instance.changeLanguage;
instance.getFixedT;
instance.t;
instance.exists;
instance.setDefaultNamespace;
instance.hasLoadedNamespace;
instance.loadNamespaces;
instance.loadLanguages;
const warn = (i18n, code, msg, rest) => {
  var _a, _b, _c, _d;
  const args = [msg, {
    code,
    ...rest || {}
  }];
  if ((_b = (_a = i18n == null ? void 0 : i18n.services) == null ? void 0 : _a.logger) == null ? void 0 : _b.forward) {
    return i18n.services.logger.forward(args, "warn", "react-i18next::", true);
  }
  if (isString(args[0])) args[0] = `react-i18next:: ${args[0]}`;
  if ((_d = (_c = i18n == null ? void 0 : i18n.services) == null ? void 0 : _c.logger) == null ? void 0 : _d.warn) {
    i18n.services.logger.warn(...args);
  } else if (console == null ? void 0 : console.warn) {
    console.warn(...args);
  }
};
const alreadyWarned = {};
const warnOnce = (i18n, code, msg, rest) => {
  if (isString(msg) && alreadyWarned[msg]) return;
  if (isString(msg)) alreadyWarned[msg] = /* @__PURE__ */ new Date();
  warn(i18n, code, msg, rest);
};
const loadedClb = (i18n, cb) => () => {
  if (i18n.isInitialized) {
    cb();
  } else {
    const initialized = () => {
      setTimeout(() => {
        i18n.off("initialized", initialized);
      }, 0);
      cb();
    };
    i18n.on("initialized", initialized);
  }
};
const loadNamespaces = (i18n, ns, cb) => {
  i18n.loadNamespaces(ns, loadedClb(i18n, cb));
};
const loadLanguages = (i18n, lng, ns, cb) => {
  if (isString(ns)) ns = [ns];
  if (i18n.options.preload && i18n.options.preload.indexOf(lng) > -1) return loadNamespaces(i18n, ns, cb);
  ns.forEach((n2) => {
    if (i18n.options.ns.indexOf(n2) < 0) i18n.options.ns.push(n2);
  });
  i18n.loadLanguages(lng, loadedClb(i18n, cb));
};
const hasLoadedNamespace = (ns, i18n, options = {}) => {
  if (!i18n.languages || !i18n.languages.length) {
    warnOnce(i18n, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
      languages: i18n.languages
    });
    return true;
  }
  return i18n.hasLoadedNamespace(ns, {
    lng: options.lng,
    precheck: (i18nInstance2, loadNotPending) => {
      if (options.bindI18n && options.bindI18n.indexOf("languageChanging") > -1 && i18nInstance2.services.backendConnector.backend && i18nInstance2.isLanguageChangingTo && !loadNotPending(i18nInstance2.isLanguageChangingTo, ns)) return false;
    }
  });
};
const isString = (obj) => typeof obj === "string";
const isObject = (obj) => typeof obj === "object" && obj !== null;
const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
const htmlEntities = {
  "&amp;": "&",
  "&#38;": "&",
  "&lt;": "<",
  "&#60;": "<",
  "&gt;": ">",
  "&#62;": ">",
  "&apos;": "'",
  "&#39;": "'",
  "&quot;": '"',
  "&#34;": '"',
  "&nbsp;": " ",
  "&#160;": " ",
  "&copy;": "©",
  "&#169;": "©",
  "&reg;": "®",
  "&#174;": "®",
  "&hellip;": "…",
  "&#8230;": "…",
  "&#x2F;": "/",
  "&#47;": "/"
};
const unescapeHtmlEntity = (m2) => htmlEntities[m2];
const unescape$1 = (text) => text.replace(matchHtmlEntity, unescapeHtmlEntity);
let defaultOptions = {
  bindI18n: "languageChanged",
  bindI18nStore: "",
  transEmptyNodeValue: "",
  transSupportBasicHtmlNodes: true,
  transWrapTextNodes: "",
  transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
  useSuspense: true,
  unescape: unescape$1,
  transDefaultProps: void 0
};
const setDefaults = (options = {}) => {
  defaultOptions = {
    ...defaultOptions,
    ...options
  };
};
const getDefaults = () => defaultOptions;
let i18nInstance;
const setI18n = (instance2) => {
  i18nInstance = instance2;
};
const getI18n = () => i18nInstance;
const initReactI18next = {
  type: "3rdParty",
  init(instance2) {
    setDefaults(instance2.options.react);
    setI18n(instance2);
  }
};
const I18nContext = reactExports.createContext();
class ReportNamespaces {
  constructor() {
    this.usedNamespaces = {};
  }
  addUsedNamespaces(namespaces) {
    namespaces.forEach((ns) => {
      if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;
    });
  }
  getUsedNamespaces() {
    return Object.keys(this.usedNamespaces);
  }
}
var shim$1 = { exports: {} };
var useSyncExternalStoreShim_production = {};
/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var React = reactExports;
function is(x, y) {
  return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
}
var objectIs = "function" === typeof Object.is ? Object.is : is, useState = React.useState, useEffect = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue;
function useSyncExternalStore$2(subscribe, getSnapshot) {
  var value = getSnapshot(), _useState = useState({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
  useLayoutEffect(
    function() {
      inst.value = value;
      inst.getSnapshot = getSnapshot;
      checkIfSnapshotChanged(inst) && forceUpdate({ inst });
    },
    [subscribe, value, getSnapshot]
  );
  useEffect(
    function() {
      checkIfSnapshotChanged(inst) && forceUpdate({ inst });
      return subscribe(function() {
        checkIfSnapshotChanged(inst) && forceUpdate({ inst });
      });
    },
    [subscribe]
  );
  useDebugValue(value);
  return value;
}
function checkIfSnapshotChanged(inst) {
  var latestGetSnapshot = inst.getSnapshot;
  inst = inst.value;
  try {
    var nextValue = latestGetSnapshot();
    return !objectIs(inst, nextValue);
  } catch (error) {
    return true;
  }
}
function useSyncExternalStore$1(subscribe, getSnapshot) {
  return getSnapshot();
}
var shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
useSyncExternalStoreShim_production.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
{
  shim$1.exports = useSyncExternalStoreShim_production;
}
var shimExports = shim$1.exports;
const notReadyT = (k2, optsOrDefaultValue) => {
  if (isString(optsOrDefaultValue)) return optsOrDefaultValue;
  if (isObject(optsOrDefaultValue) && isString(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue;
  return Array.isArray(k2) ? k2[k2.length - 1] : k2;
};
const notReadySnapshot = {
  t: notReadyT,
  ready: false
};
const dummySubscribe = () => () => {
};
const useTranslation = (ns, props = {}) => {
  var _a, _b, _c;
  const {
    i18n: i18nFromProps
  } = props;
  const {
    i18n: i18nFromContext,
    defaultNS: defaultNSFromContext
  } = reactExports.useContext(I18nContext) || {};
  const i18n = i18nFromProps || i18nFromContext || getI18n();
  if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
  if (!i18n) {
    warnOnce(i18n, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
  }
  const i18nOptions = reactExports.useMemo(() => {
    var _a2;
    return {
      ...getDefaults(),
      ...(_a2 = i18n == null ? void 0 : i18n.options) == null ? void 0 : _a2.react,
      ...props
    };
  }, [i18n, props]);
  const {
    useSuspense,
    keyPrefix
  } = i18nOptions;
  const nsOrContext = defaultNSFromContext || ((_a = i18n == null ? void 0 : i18n.options) == null ? void 0 : _a.defaultNS);
  const unstableNamespaces = isString(nsOrContext) ? [nsOrContext] : nsOrContext || ["translation"];
  const namespaces = reactExports.useMemo(() => unstableNamespaces, unstableNamespaces);
  (_c = (_b = i18n == null ? void 0 : i18n.reportNamespaces) == null ? void 0 : _b.addUsedNamespaces) == null ? void 0 : _c.call(_b, namespaces);
  const revisionRef = reactExports.useRef(0);
  const subscribe = reactExports.useCallback((callback) => {
    if (!i18n) return dummySubscribe;
    const {
      bindI18n,
      bindI18nStore
    } = i18nOptions;
    const wrappedCallback = () => {
      revisionRef.current += 1;
      callback();
    };
    if (bindI18n) i18n.on(bindI18n, wrappedCallback);
    if (bindI18nStore) i18n.store.on(bindI18nStore, wrappedCallback);
    return () => {
      if (bindI18n) bindI18n.split(" ").forEach((e2) => i18n.off(e2, wrappedCallback));
      if (bindI18nStore) bindI18nStore.split(" ").forEach((e2) => i18n.store.off(e2, wrappedCallback));
    };
  }, [i18n, i18nOptions]);
  const snapshotRef = reactExports.useRef();
  const getSnapshot = reactExports.useCallback(() => {
    if (!i18n) {
      return notReadySnapshot;
    }
    const calculatedReady = !!(i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every((n2) => hasLoadedNamespace(n2, i18n, i18nOptions));
    const currentLng = props.lng || i18n.language;
    const currentRevision = revisionRef.current;
    const lastSnapshot = snapshotRef.current;
    if (lastSnapshot && lastSnapshot.ready === calculatedReady && lastSnapshot.lng === currentLng && lastSnapshot.keyPrefix === keyPrefix && lastSnapshot.revision === currentRevision) {
      return lastSnapshot;
    }
    const calculatedT = i18n.getFixedT(currentLng, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
    const newSnapshot = {
      t: calculatedT,
      ready: calculatedReady,
      lng: currentLng,
      keyPrefix,
      revision: currentRevision
    };
    snapshotRef.current = newSnapshot;
    return newSnapshot;
  }, [i18n, namespaces, keyPrefix, i18nOptions, props.lng]);
  const [loadCount, setLoadCount] = reactExports.useState(0);
  const {
    t: t2,
    ready
  } = shimExports.useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
  reactExports.useEffect(() => {
    if (i18n && !ready && !useSuspense) {
      const onLoaded = () => setLoadCount((c2) => c2 + 1);
      if (props.lng) {
        loadLanguages(i18n, props.lng, namespaces, onLoaded);
      } else {
        loadNamespaces(i18n, namespaces, onLoaded);
      }
    }
  }, [i18n, props.lng, namespaces, ready, useSuspense, loadCount]);
  const finalI18n = i18n || {};
  const wrapperRef = reactExports.useRef(null);
  const wrapperLangRef = reactExports.useRef();
  const createI18nWrapper = (original) => {
    const descriptors2 = Object.getOwnPropertyDescriptors(original);
    if (descriptors2.__original) delete descriptors2.__original;
    const wrapper = Object.create(Object.getPrototypeOf(original), descriptors2);
    if (!Object.prototype.hasOwnProperty.call(wrapper, "__original")) {
      try {
        Object.defineProperty(wrapper, "__original", {
          value: original,
          writable: false,
          enumerable: false,
          configurable: false
        });
      } catch (_2) {
      }
    }
    return wrapper;
  };
  const ret = reactExports.useMemo(() => {
    const original = finalI18n;
    const lang = original == null ? void 0 : original.language;
    let i18nWrapper = original;
    if (original) {
      if (wrapperRef.current && wrapperRef.current.__original === original) {
        if (wrapperLangRef.current !== lang) {
          i18nWrapper = createI18nWrapper(original);
          wrapperRef.current = i18nWrapper;
          wrapperLangRef.current = lang;
        } else {
          i18nWrapper = wrapperRef.current;
        }
      } else {
        i18nWrapper = createI18nWrapper(original);
        wrapperRef.current = i18nWrapper;
        wrapperLangRef.current = lang;
      }
    }
    const arr = [t2, i18nWrapper, ready];
    arr.t = t2;
    arr.i18n = i18nWrapper;
    arr.ready = ready;
    return arr;
  }, [t2, finalI18n, ready, finalI18n.resolvedLanguage, finalI18n.language, finalI18n.languages]);
  if (i18n && useSuspense && !ready) {
    throw new Promise((resolve) => {
      const onLoaded = () => resolve();
      if (props.lng) {
        loadLanguages(i18n, props.lng, namespaces, onLoaded);
      } else {
        loadNamespaces(i18n, namespaces, onLoaded);
      }
    });
  }
  return ret;
};
const common$1 = {
  save: "Save",
  cancel: "Cancel",
  loading: "Loading...",
  error: "Error",
  success: "Success",
  submit: "Submit",
  back: "Back",
  next: "Next",
  search: "Search",
  noData: "No data available",
  view: "View",
  close: "Close",
  confirm: "Confirm",
  yes: "Yes",
  no: "No",
  ok: "OK",
  readMore: "Read More",
  readLess: "Read Less",
  exploreMore: "Explore More",
  saving: "SAVING...",
  updating: "UPDATING...",
  showDetails: "Show details",
  hideDetails: "Hide details",
  km: "km",
  kms: "kms",
  mins: "mins",
  at: "at",
  "for": "for",
  after: "after",
  useCurrentLocation: "Use Current Location",
  recentSearches: "Recent Searches",
  done: "Done",
  creatingAccount: "Creating Account...",
  updateSearch: "Update Search",
  update: "Update",
  select: "Select",
  selectDate: "Select Date",
  viewDetails: "View Details",
  note: "Note",
  notAvailable: "N/A"
};
const nav$1 = {
  home: "Home",
  bookings: "My Bookings",
  profile: "Profile",
  support: "Support",
  cabBooking: "Cab Booking",
  logout: "Logout",
  manageBooking: "Manage Booking",
  myTrips: "My Trips",
  loginSignup: "Login / Signup"
};
const hero$1 = {
  bookOnlineCab: "Book Online Cab",
  bookAirportTaxi: "Book Airport Taxi",
  hourlyCarRental: "Hourly Car Rental",
  searchCabs: "Search Cabs",
  from: "From",
  to: "To",
  enterPickup: "Enter Pickup location",
  enterDrop: "Enter Drop location",
  pickupDate: "Pickup Date",
  pickupTime: "Pickup Time",
  returnDate: "Return Date",
  returnTime: "Return Time",
  addStops: "+ Add Stops",
  "new": "New",
  experiencedDrivers: "Experienced And Polite Drivers",
  cleanCabs: "Clean And Comfortable Cabs",
  tripType: "Trip Type",
  bookAirportTaxiDynamic: 'Book {{airport}} Taxi & use "GOCAB" for 10% off',
  startsFrom: "Starts from ₹{{price}}"
};
const tripTypes$1 = {
  oneway: "Outstation One-way",
  round: "Outstation Round Trip",
  airport: "Airport Transfer",
  hourly: "Hourly Rental"
};
const booking$1 = {
  title: "Book a Ride",
  pickup: "Pickup",
  dropoff: "Drop-off Location",
  selectVehicle: "Select Vehicle",
  estimatedFare: "Estimated Fare",
  bookNow: "Book Now",
  confirmBooking: "Confirm Booking",
  myBookings: "My Bookings",
  noBookings: "No bookings yet",
  bookingDetails: "Booking Details",
  bookingId: "Booking ID",
  orderId: "Order ID",
  tripDetails: "Trip Details",
  paymentDetails: "Payment Details",
  driverDetails: "Driver Details",
  vehicleDetails: "Vehicle Details",
  status: {
    pending: "Pending",
    confirmed: "Confirmed",
    inProgress: "In Progress",
    completed: "Completed",
    cancelled: "Cancelled",
    created: "Created",
    assigned: "Assigned",
    arrived: "Arrived"
  },
  pickupLocation: "Pickup Location",
  dropLocation: "Drop Location",
  distance: "Distance",
  duration: "Duration",
  baseFare: "Base Fare",
  taxes: "Taxes",
  totalFare: "Total Fare",
  paidAmount: "Paid Amount",
  pendingAmount: "Pending Amount",
  payNow: "Pay Now",
  payLater: "Pay Later",
  cashOnDelivery: "Cash Payment",
  reviewYourBooking: "Review your Booking",
  hurry: "Hurry! Limited cars left",
  goodChoice: "Reasons you've made a good choice",
  cabOperator: "Cab Operator",
  willBeAssigned: "will be assigned",
  bookingComplete: "on booking complete",
  detailsShared: "details will be shared",
  onRegisteredMobile: "on your registered mobile number",
  imagesOfVehicle: "Images of selected vehicle category",
  imageDisclaimer: "The car images shown here are for representation.",
  inclusionsExclusions: "Inclusions & exclusions",
  includedInFare: "Included in your fare",
  stateTaxes: "State Taxes",
  onePickupDrop: "Only One Pickup and Drop",
  tollCharges: "Toll Charges",
  extraCharges: "Extra charges (based on your usage)",
  fareBeyond: "Fare beyond",
  specialRequests: "Special Requests",
  roofCarrier: "Roof Carrier",
  roofCarrierDesc: "Car with roof carrier with extra luggage",
  pickupAddress: "Pickup Address",
  enterPickup: "Enter Pickup Location",
  selectPickup: "Select Pickup Location",
  locationUpdateWarning: "Exact location needs to be updated",
  useAsBilling: "Use this as billing address for text invoice",
  travellerDetails: "Traveller details",
  signInPrompt: "SignIn/SignUp to speed up your booking process",
  emailDisclaimer: "(Your E-ticket and updates will be sent here)",
  afterBookingConfirmed: "After Booking Confirmed",
  afterTime: "After",
  noRefund: "No refund",
  otherInformation: "Other information",
  acOffHilly: "AC will be switched off in hilly areas",
  oneStopIncluded: "Only one pick-up, one drop & one pit stop for meal is included",
  tollStateTax: "Toll & State Tax",
  zoneExtraCharges: "Zone extra charges",
  tripInformation: "Trip Information",
  scheduledTime: "Scheduled Time",
  customerDetails: "Customer Details",
  driverNotAssigned: "Driver not yet assigned",
  bookingTimeline: "Booking Timeline",
  noTimelineEvents: "No timeline events available",
  date: "Date",
  customer: "Customer",
  invoice: "Invoice",
  downloadInvoicePDF: "Download Invoice PDF",
  invoiceNotAvailable: "Invoice not available",
  backToMyTrips: "Back to My Trips",
  drop: "Drop",
  airportPickup: "Airport Pickup",
  airportDrop: "Airport Drop"
};
const cabSearch$1 = {
  title: "Search Cabs",
  searchResults: "Search Results",
  noCabs: "No cabs available in this area",
  tryDifferent: "Please try a different location",
  filters: "Filters",
  sortBy: "Sort By",
  priceLowest: "Lowest Price",
  priceHighest: "Highest Price",
  rating: "Rating",
  seater: "Seater",
  ac: "AC",
  nonAc: "Non AC",
  petrol: "Petrol",
  diesel: "Diesel",
  cng: "CNG",
  electric: "Electric",
  selectCab: "Select Cab",
  viewDetails: "View Details",
  perKm: "per km",
  includedKm: "Included KM",
  extraKmFare: "Extra KM Fare",
  availableCabsFor: "Available Cabs for",
  searchingCabs: "Searching available cabs...",
  fixedFare: "Fixed Fare",
  instantConfirmation: "Instant Confirmation",
  economicalCarDesc: "Economical car with limited luggage",
  comfortableRideDesc: "Comfortable ride with ample space",
  spaciousCarDesc: "Spacious car for large groups",
  kmsIncluded: "{{kms}} kms included. After that ₹{{rate}}/km",
  freeCancellationHour: "Free cancellation until 1 hour before pickup",
  reserveAtOnly: "Reserve this cab at ₹{{amount}} only",
  cngCar: "CNG Car",
  petrolCar: "Petrol Car",
  dieselCar: "Diesel Car",
  ratingsCount: "{{count}} ratings",
  off: "off",
  only: "only",
  afterThat: "After that",
  reserve: "Reserve this cab at"
};
const cabInfo$1 = {
  title: "Online Cab Booking On Easy Ride",
  description: "Most Indian tourists prefer to travel to their favorite destinations by road. This is because road travel allows you to enjoy the natural beauty at your own pace.",
  bookYourCab: "Book Your Cab Online",
  premiumServices: "We provide premium services with high reliability.",
  easyToUse: "Due to the easy-to-use interface and quick menu options of EasyRide, online cab booking is not a difficult process. In fact, cab booking has become a part of our everyday life. You can also opt for intercity car rentals in order to visit other cities.",
  premiumServicesText: "We offer premium services with high reliability. EasyRide is one of the most popular platforms for car booking. You can also use the website for train, flight, and bus tickets. The best part is you get top-notch cars for your preferred destination.",
  roadTrips: "Road trips are one of the most exciting ways to travel across the country, and EasyRide ensures your road trip is enjoyable.",
  cancellationPolicy: "Cancellation Policy",
  freeCancellation: "Free cancellation",
  sanitizers: "Sanitizers installed",
  routeExpert: "Route expert"
};
const weekDays$1 = {
  mon: "MON",
  tue: "TUE",
  wed: "WED",
  thu: "THU",
  fri: "FRI",
  sat: "SAT",
  sun: "SUN"
};
const payment$1 = {
  title: "Payment",
  paymentMethod: "Payment Method",
  online: "Online Payment",
  cash: "Cash Payment",
  wallet: "Wallet",
  upi: "UPI",
  card: "Card",
  netBanking: "Net Banking",
  payNow: "Pay Now",
  processing: "Processing...",
  success: "Payment Successful!",
  failed: "Payment Failed",
  tryAgain: "Try Again",
  totalAmount: "Total Amount",
  partialPayment: "Partial Payment",
  fullPayment: "Full Payment",
  payToConfirm: "Pay to confirm booking",
  timeLeft: "Time Left",
  allPaymentOptions: "All Payment Options",
  upiOptions: "UPI Options",
  getCashback: "Get upto ₹1000 Cashback*",
  creditDebit: "Credit/Debit/ATM Card",
  cardProviders: "Visa, MasterCard, Amex, Rupay and more",
  bookNowPayLater: "Book Now Pay Later",
  bnplProviders: "Lazypay, Simpl, HDFC, ICICI, IDFC",
  grandTotal: "Grand Total",
  cabDriverDetails: "Cab & Driver details will be shared by",
  includedBenefits: "Included Benefits",
  freeCancellation: "Free Cancellation till",
  freeWaiting: "Free waiting up to 45 minutes",
  scanToPay: "Scan to Pay",
  instantRefund: "Instant Refund & High Success Rate",
  creatingBooking: "Creating Booking...",
  initiatingPayment: "Initiating Payment...",
  waitingPayment: "Waiting for Payment...",
  verifying: "Verifying...",
  payAndConfirm: "Pay & Confirm Booking",
  verifyingPayment: "Verifying Payment...",
  doNotClose: "Please do not close this window",
  inclusiveGST: "Inclusive of GST",
  distanceCharge: "Distance Charge",
  nightCharge: "Night Charge",
  airportSurcharge: "Airport Surcharge",
  stopsCharge: "Stops Charge",
  gstTaxes: "GST & Taxes",
  discountApplied: "Discount Applied",
  fareBreakdown: "Fare Breakdown",
  distanceFare: "Distance Fare",
  pendingAmount: "Pending Amount",
  paidAmount: "Paid Amount",
  totalFare: "Total Fare",
  taxes: "Taxes",
  baseFare: "Base Fare",
  driverDetails: "Driver Details",
  waitingCharges: "Waiting charges ₹300/60 mins after 30 minutes",
  minimumBookingCharge: "Minimum booking charge",
  perKilometerCharges: "Per kilometer charges",
  additionalStops: "Additional stops during trip",
  lateNightSurcharge: "Late night/early morning surcharge",
  zoneExtraCharge: "Zone Extra Charge",
  additionalZoneCharges: "Additional zone-based charges",
  governmentTaxes: "Government taxes and service fees",
  subtotal: "Subtotal",
  promotionalDiscount: "Promotional discount",
  finalAmountToPay: "Final amount to be paid",
  onlinePaymentReceived: "Online payment received",
  toBePaidToDriver: "To be paid to driver",
  paymentStatus: "Payment Status",
  fullyPaidOnline: "Fully paid online",
  paid: "PAID",
  noFareInfo: "No fare information available",
  fareCalculationNote: "Fare is calculated based on distance, time, and applicable charges. Additional charges may apply for tolls, parking, or route changes.",
  additionalChargesNote: "Additional charges may apply based on route, time, and stops.",
  saved: "saved"
};
const auth$1 = {
  login: "Login",
  register: "Register",
  phone: "Phone Number",
  email: "Email",
  password: "Password",
  otp: "Enter OTP",
  sendOtp: "Send OTP",
  verifyOtp: "Verify OTP",
  resendOtp: "Resend OTP",
  forgotPassword: "Forgot Password?",
  loginWithGoogle: "Continue with Google",
  createAccount: "Create Account",
  alreadyHaveAccount: "Already have an account?",
  dontHaveAccount: "Don't have an account?",
  signUp: "Sign Up",
  signIn: "Sign In",
  fullName: "Full Name",
  enterPhone: "Enter your phone number",
  enterEmail: "Enter your email",
  enterPassword: "Enter your password",
  enterName: "Enter your name",
  verifying: "Verifying...",
  loggingIn: "Logging In...",
  loginToContinue: "Please login to continue with booking",
  userName: "Username"
};
const profile$1 = {
  title: "My Profile",
  name: "Full Name",
  email: "Email",
  phone: "Phone",
  updateProfile: "Update Profile",
  changePassword: "Change Password",
  savedAddresses: "Saved Addresses",
  addAddress: "Add Address",
  home: "Home",
  work: "Work",
  other: "Other",
  walletBalance: "Wallet Balance",
  myTrips: "My Trips",
  helpCenter: "Help Center",
  myAccount: "MY ACCOUNT",
  security: "Security (Password)",
  deleteAccount: "Delete Account",
  generalInfo: "General Information",
  address: "Address",
  streetAddress: "Street Address",
  city: "City",
  state: "State",
  pincode: "Pincode",
  gender: "Gender",
  male: "Male",
  female: "Female",
  dob: "Date of Birth",
  nationality: "Nationality",
  maritalStatus: "Marital Status",
  actionRequired: "Action Required: Incomplete Profile",
  provideDetails: "Please provide your official email and complete address to ensure smooth bookings and communications.",
  profileComplete: "Profile Complete",
  profileVerified: "Your profile is verified and up to date. You can now enjoy full access to all features.",
  currentPassword: "Current Password",
  newPassword: "New Password",
  confirmPassword: "Confirm New Password",
  passwordSecure: "Ensure your account is using a long, random password to stay secure.",
  deleteConfirm: "Are you sure you want to permanently delete your account? This action cannot be undone.",
  passwordMismatch: "New passwords do not match!",
  profileImage: "Profile Image"
};
const trips$1 = {
  yourTrips: "Your Trips",
  upcomingBookings: "Upcoming Bookings",
  cancelledBookings: "Cancelled Bookings",
  completedBookings: "Completed Bookings",
  loadingTrips: "Loading your trips...",
  noTrips: "Looks like you have no",
  bookingsWithEasyride: "bookings with EasyRide",
  tripsWillShowHere: "When you book, your trips will be shown here.",
  startBookingNow: "Start Booking Now",
  orderId: "Order ID"
};
const support$1 = {
  title: "Support",
  createTicket: "Create Ticket",
  myTickets: "My Tickets",
  subject: "Subject",
  message: "Message",
  priority: "Priority",
  low: "Low",
  medium: "Medium",
  high: "High",
  status: "Status",
  open: "Open",
  closed: "Closed",
  inProgress: "In Progress",
  contactUs: "Contact Us",
  faq: "FAQ",
  helpAndSupport: "Help & Support"
};
const faq$1 = {
  title: "Frequently Asked Questions",
  howToBook: "How to book a cab?",
  cancellationPolicy: "What is the cancellation policy?",
  paymentMethods: "What payment methods are available?",
  driverContact: "How do I contact the driver?",
  economicalCabQ: "Which is the most economical cab available at {{airport}}?",
  economicalCabA: "The most economical cab available at {{airport}} at present is Sedan.",
  optionsQ: "What are the cab booking options available at {{airport}}?",
  optionsA: "You can book following types of cabs from {{airport}}:"
};
const cities$1 = {
  title: "Cities",
  popularCities: "Popular Cities",
  allCities: "All Cities",
  selectCity: "Select City"
};
const routes$1 = {
  title: "Routes",
  popularRoutes: "Popular Routes",
  intercityRoutes: "Intercity Routes",
  airportRoutes: "Airport Routes"
};
const errors$1 = {
  enterPickup: "Please enter pickup location",
  enterDrop: "Please enter drop location",
  locationNotFound: "Location not found",
  searchFailed: "Search failed. Please try again.",
  bookingFailed: "Booking failed. Please try again.",
  paymentFailed: "Payment failed. Please try again.",
  loginRequired: "Please login to continue",
  invalidOtp: "Invalid OTP",
  razorpayFailed: "Razorpay SDK failed to load. Are you online?",
  paymentVerifyFailed: "Payment verification failed. Please contact support.",
  paymentCancelled: "Payment cancelled. You can retry from My Trips."
};
const toasts$1 = {
  findingCabs: "Finding cabs...",
  bookingSuccess: "Booking successful!",
  paymentSuccess: "Payment successful!",
  loginSuccess: "Login successful!",
  logoutSuccess: "Logout successful!",
  profileUpdated: "Profile updated!",
  ticketCreated: "Ticket created!",
  registerSuccess: "Registration Successful!"
};
const footer$1 = {
  aboutUs: "About Us",
  contactUs: "Contact Us",
  termsConditions: "Terms & Conditions",
  privacyPolicy: "Privacy Policy",
  refundPolicy: "Refund Policy",
  careers: "Careers",
  blog: "Blog",
  downloadApp: "Download App",
  followUs: "Follow Us",
  copyright: "© 2025 Easy Ride. All rights reserved."
};
const tripDetails = {
  stop: "Stop"
};
const months$1 = {
  jan: "Jan",
  feb: "Feb",
  mar: "Mar",
  apr: "Apr",
  may: "May",
  jun: "Jun",
  jul: "Jul",
  aug: "Aug",
  sep: "Sep",
  oct: "Oct",
  nov: "Nov",
  dec: "Dec"
};
const en = {
  common: common$1,
  nav: nav$1,
  hero: hero$1,
  tripTypes: tripTypes$1,
  booking: booking$1,
  cabSearch: cabSearch$1,
  cabInfo: cabInfo$1,
  weekDays: weekDays$1,
  payment: payment$1,
  auth: auth$1,
  profile: profile$1,
  trips: trips$1,
  support: support$1,
  faq: faq$1,
  cities: cities$1,
  routes: routes$1,
  errors: errors$1,
  toasts: toasts$1,
  footer: footer$1,
  tripDetails,
  months: months$1
};
const common = {
  save: "सहेजें",
  cancel: "रद्द करें",
  loading: "लोड हो रहा है...",
  error: "त्रुटि",
  success: "सफलता",
  submit: "जमा करें",
  back: "वापस",
  next: "अगला",
  search: "खोजें",
  noData: "कोई डेटा उपलब्ध नहीं",
  view: "देखें",
  close: "बंद करें",
  confirm: "पुष्टि करें",
  yes: "हाँ",
  no: "नहीं",
  ok: "ठीक है",
  readMore: "और पढ़ें",
  readLess: "कम पढ़ें",
  exploreMore: "और देखें",
  saving: "सहेजा जा रहा है...",
  updating: "अपडेट हो रहा है...",
  showDetails: "विवरण देखें",
  hideDetails: "विवरण छुपाएं",
  km: "किमी",
  kms: "किमी",
  mins: "मिनट",
  at: "पर",
  "for": "के लिए",
  after: "के बाद",
  useCurrentLocation: "वर्तमान स्थान का उपयोग करें",
  recentSearches: "हाल की खोजें",
  done: "हो गया",
  creatingAccount: "खाता बनाया जा रहा है...",
  updateSearch: "खोज अपडेट करें",
  update: "अपडेट",
  select: "चुनें",
  selectDate: "तिथि चुनें",
  viewDetails: "विवरण देखें",
  note: "नोट",
  notAvailable: "उपलब्ध नहीं"
};
const nav = {
  home: "होम",
  bookings: "मेरी बुकिंग",
  profile: "प्रोफ़ाइल",
  support: "सहायता",
  cabBooking: "कैब बुकिंग",
  logout: "लॉगआउट",
  manageBooking: "बुकिंग प्रबंधन",
  myTrips: "मेरी यात्राएं",
  loginSignup: "लॉगिन / साइनअप"
};
const hero = {
  bookOnlineCab: "ऑनलाइन कैब बुक करें",
  bookAirportTaxi: "एयरपोर्ट टैक्सी बुक करें",
  hourlyCarRental: "घंटे के अनुसार कार किराया",
  searchCabs: "कैब खोजें",
  from: "से",
  to: "तक",
  enterPickup: "पिकअप स्थान दर्ज करें",
  enterDrop: "ड्रॉप स्थान दर्ज करें",
  pickupDate: "पिकअप दिनांक",
  pickupTime: "पिकअप समय",
  returnDate: "वापसी दिनांक",
  returnTime: "वापसी समय",
  addStops: "+ स्टॉप जोड़ें",
  "new": "नया",
  experiencedDrivers: "अनुभवी और विनम्र ड्राइवर",
  cleanCabs: "स्वच्छ और आरामदायक कैब",
  tripType: "ट्रिप का प्रकार",
  bookAirportTaxiDynamic: "{{airport}} टैक्सी बुक करें और 10% ऑफ पाएं",
  startsFrom: "शुरुआत ₹{{price}} से"
};
const tripTypes = {
  oneway: "एक तरफ़ आउटस्टेशन",
  round: "आउटस्टेशन राउंड ट्रिप",
  airport: "एयरपोर्ट ट्रांसफर",
  hourly: "घंटे के अनुसार किराया"
};
const booking = {
  title: "राइड बुक करें",
  pickup: "पिकअप स्थान",
  dropoff: "ड्रॉप-ऑफ स्थान",
  selectVehicle: "वाहन चुनें",
  estimatedFare: "अनुमानित किराया",
  bookNow: "अभी बुक करें",
  confirmBooking: "बुकिंग पुष्टि करें",
  myBookings: "मेरी बुकिंग",
  noBookings: "अभी तक कोई बुकिंग नहीं",
  bookingDetails: "बुकिंग विवरण",
  bookingId: "बुकिंग ID",
  orderId: "ऑर्डर ID",
  tripDetails: "यात्रा विवरण",
  paymentDetails: "भुगतान विवरण",
  driverDetails: "ड्राइवर विवरण",
  vehicleDetails: "वाहन विवरण",
  status: {
    pending: "लंबित",
    confirmed: "पुष्टि",
    inProgress: "चल रहा है",
    completed: "पूर्ण",
    cancelled: "रद्द",
    created: "बनाया गया",
    assigned: "सौंपा गया",
    arrived: "पहुँच गया"
  },
  pickupLocation: "पिकअप स्थान",
  dropLocation: "ड्रॉप स्थान",
  distance: "दूरी",
  duration: "अवधि",
  baseFare: "बेस किराया",
  taxes: "कर",
  totalFare: "कुल किराया",
  paidAmount: "भुगतान राशि",
  pendingAmount: "लंबित राशि",
  payNow: "अभी भुगतान करें",
  payLater: "बाद में भुगतान करें",
  cashOnDelivery: "नकद भुगतान",
  reviewYourBooking: "अपनी बुकिंग की समीक्षा करें",
  hurry: "जल्दी करें! सीमित कारें बची हैं",
  goodChoice: "आपने एक अच्छा विकल्प चुना है",
  cabOperator: "कैब ऑपरेटर",
  willBeAssigned: "सौंपा जाएगा",
  bookingComplete: "बुकिंग पूरी होने पर",
  detailsShared: "विवरण साझा किए जाएंगे",
  onRegisteredMobile: "आपके पंजीकृत मोबाइल नंबर पर",
  imagesOfVehicle: "चयनित वाहन श्रेणी की छवियां",
  imageDisclaimer: "यहाँ दिखाई गई कार की छवियां केवल प्रतिनिधित्व के लिए हैं।",
  inclusionsExclusions: "समावेशन और बहिष्करण",
  includedInFare: "आपके किराए में शामिल",
  stateTaxes: "राज्य कर",
  onePickupDrop: "केवल एक पिकअप और ड्रॉप",
  tollCharges: "टोल शुल्क",
  extraCharges: "अतिरिक्त शुल्क",
  fareBeyond: "किराया उससे परे",
  specialRequests: "विशेष अनुरोध",
  roofCarrier: "रूफ कैरियर",
  roofCarrierDesc: "अतिरिक्त सामान के लिए रूफ कैरियर वाली कार",
  pickupAddress: "पिकअप पता",
  enterPickup: "पिकअप स्थान दर्ज करें",
  selectPickup: "पिकअप स्थान चुनें",
  locationUpdateWarning: "सटीक स्थान अपडेट करने की आवश्यकता है",
  useAsBilling: "बिलिंग पते के रूप में उपयोग करें",
  travellerDetails: "यात्री विवरण",
  signInPrompt: "तेजी से बुकिंग के लिए साइन इन करें",
  emailDisclaimer: "(आपका ई-टिकट यहाँ भेजा जाएगा)",
  afterBookingConfirmed: "बुकिंग पुष्टि के बाद",
  afterTime: "के बाद",
  noRefund: "कोई रिफंड नहीं",
  otherInformation: "अन्य जानकारी",
  acOffHilly: "पहाड़ी क्षेत्रों में एसी बंद रहेगा",
  oneStopIncluded: "केवल एक स्टॉप शामिल है",
  tollStateTax: "टोल और राज्य कर",
  zoneExtraCharges: "जोन अतिरिक्त शुल्क",
  tripInformation: "यात्रा की जानकारी",
  scheduledTime: "निर्धारित समय",
  customerDetails: "ग्राहक विवरण",
  driverNotAssigned: "ड्राइवर अभी तक नहीं सौंपा गया",
  bookingTimeline: "बुकिंग समयरेखा",
  noTimelineEvents: "कोई घटना नहीं",
  date: "दिनांक",
  customer: "ग्राहक",
  invoice: "चालान",
  downloadInvoicePDF: "PDF डाउनलोड करें",
  invoiceNotAvailable: "चालान उपलब्ध नहीं",
  backToMyTrips: "मेरी यात्राओं पर वापस जाएं",
  airportPickup: "एयरपोर्ट पिकअप",
  airportDrop: "एयरपोर्ट ड्रॉप"
};
const cabSearch = {
  title: "कैब खोजें",
  searchResults: "खोज परिणाम",
  noCabs: "इस क्षेत्र में कोई कैब उपलब्ध नहीं",
  tryDifferent: "कृपया अलग स्थान आज़माएं",
  filters: "फ़िल्टर",
  sortBy: "क्रमबद्ध करें",
  priceLowest: "न्यूनतम कीमत",
  priceHighest: "अधिकतम कीमत",
  rating: "रेटिंग",
  seater: "सीटर",
  ac: "एसी",
  nonAc: "नॉन एसी",
  petrol: "पेट्रोल",
  diesel: "डीज़ल",
  cng: "सीएनजी",
  electric: "इलेक्ट्रिक",
  selectCab: "कैब चुनें",
  viewDetails: "विवरण देखें",
  perKm: "प्रति किमी",
  includedKm: "शामिल किमी",
  extraKmFare: "अतिरिक्त किमी किराया",
  availableCabsFor: "के लिए उपलब्ध कैब",
  searchingCabs: "उपलब्ध कैब खोजी जा रही हैं...",
  fixedFare: "निश्चित किराया",
  instantConfirmation: "तत्काल पुष्टि",
  economicalCarDesc: "सीमित सामान के साथ किफायती कार",
  comfortableRideDesc: "काफी जगह के साथ आरामदायक सवारी",
  spaciousCarDesc: "बड़े समूहों के लिए विशाल कार",
  kmsIncluded: "{{kms}} किमी शामिल। उसके बाद ₹{{rate}}/किमी",
  freeCancellationHour: "पिकअप से 1 घंटे पहले तक निःशुल्क रद्दीकरण",
  reserveAtOnly: "इस कैब को केवल ₹{{amount}} में आरक्षित करें",
  cngCar: "सीएनजी कार",
  petrolCar: "पेट्रोल कार",
  dieselCar: "डीजल कार",
  ratingsCount: "{{count}} रेटिंग्स",
  off: "की छूट",
  only: "मात्र",
  afterThat: "उसके बाद",
  reserve: "इस कैब को आरक्षित करें"
};
const cabInfo = {
  title: "ईज़ी राइड पर ऑनलाइन कैब बुकिंग",
  description: "अधिकांश भारतीय पर्यटक सड़क मार्ग से अपने पसंदीदा गंतव्यों की यात्रा करना पसंद करते हैं। ऐसा इसलिए है क्योंकि सड़क यात्रा आपको अपनी गति से प्राकृतिक सुंदरता का आनंद लेने की अनुमति देती है।",
  bookYourCab: "अपनी कैब ऑनलाइन बुक करें",
  premiumServices: "हम उच्च विश्वसनीयता के साथ प्रीमियम सेवाएं प्रदान करते हैं।",
  easyToUse: "ईज़ी राइड के उपयोग में आसान इंटरफ़ेस और त्वरित मेनू विकल्पों के कारण, ऑनलाइन कैब बुकिंग एक कठिन प्रक्रिया नहीं है। वास्तव में, कैब बुकिंग हमारे रोजमर्रा के जीवन का हिस्सा बन गई है। आप दूसरे शहरों की यात्रा के लिए इंटरसिटी कार रेंटल का विकल्प भी चुन सकते हैं।",
  premiumServicesText: "हम उच्च विश्वसनीयता के साथ प्रीमियम सेवाएं प्रदान करते हैं। ईज़ी राइड कार बुकिंग के लिए सबसे लोकप्रिय प्लेटफार्मों में से एक है। आप ट्रेन, फ्लाइट और बस टिकटों के लिए भी वेबसाइट का उपयोग कर सकते हैं। सबसे अच्छी बात यह है कि आपको अपने पसंदीदा गंतव्य के लिए बेहतरीन कारें मिलती हैं।",
  roadTrips: "सड़क यात्राएं देश भर में यात्रा करने के सबसे रोमांचक तरीकों में से एक हैं, और ईज़ी राइड यह सुनिश्चित करती है कि आपकी सड़क यात्रा सुखद हो।",
  cancellationPolicy: "रद्दीकरण नीति",
  freeCancellation: "निःशुल्क रद्दीकरण",
  sanitizers: "सैनिटाइज़र स्थापित",
  routeExpert: "मार्ग विशेषज्ञ"
};
const weekDays = {
  mon: "सोम",
  tue: "मंग",
  wed: "बुध",
  thu: "गुरु",
  fri: "शुक्र",
  sat: "शनि",
  sun: "रवि"
};
const payment = {
  title: "भुगतान",
  paymentMethod: "भुगतान विधि",
  online: "ऑनलाइन भुगतान",
  cash: "नकद भुगतान",
  wallet: "वॉलेट",
  upi: "UPI",
  card: "कार्ड",
  netBanking: "नेट बैंकिंग",
  payNow: "अभी भुगतान करें",
  processing: "प्रोसेसिंग...",
  success: "भुगतान सफल!",
  failed: "भुगतान विफल",
  tryAgain: "पुनः प्रयास करें",
  totalAmount: "कुल राशि",
  partialPayment: "आंशिक भुगतान",
  fullPayment: "पूर्ण भुगतान",
  payToConfirm: "बुकिंग पुष्टि करने के लिए भुगतान करें",
  timeLeft: "शेष समय",
  allPaymentOptions: "सभी भुगतान विकल्प",
  upiOptions: "UPI विकल्प",
  getCashback: "₹1000 तक कैशबैक पाएं*",
  creditDebit: "क्रेडिट/डेबिट/एटीएम कार्ड",
  cardProviders: "वीज़ा, मास्टरकार्ड, एमेक्स, रुपे और अधिक",
  bookNowPayLater: "अभी बुक करें बाद में भुगतान करें",
  bnplProviders: "लेज़ीपे, सिम्पल, एचडीएफसी, आईसीआईसीआई, आईडीएफसी",
  grandTotal: "कुल योग",
  cabDriverDetails: "कैब और ड्राइवर विवरण",
  includedBenefits: "शामिल लाभ",
  freeCancellation: "मुफ्त रद्दीकरण तक",
  freeWaiting: "45 मिनट तक मुफ्त प्रतीक्षा",
  waitingCharges: "30 मिनट के बाद प्रतीक्षा शुल्क ₹300/60 मिनट",
  scanToPay: "भुगतान के लिए स्कैन करें",
  instantRefund: "तत्काल रिफंड और उच्च सफलता दर",
  creatingBooking: "बुकिंग बनाई जा रही है...",
  initiatingPayment: "भुगतान शुरू हो रहा है...",
  waitingPayment: "भुगतान की प्रतीक्षा...",
  verifying: "सत्यापन हो रहा है...",
  payAndConfirm: "भुगतान करें और बुकिंग पुष्टि करें",
  verifyingPayment: "भुगतान सत्यापित हो रहा है...",
  doNotClose: "कृपया इस विंडो को बंद न करें",
  inclusiveGST: "GST समेत",
  distanceCharge: "दूरी शुल्क",
  nightCharge: "रात्रि शुल्क",
  airportSurcharge: "एयरपोर्ट सरचार्ज",
  stopsCharge: "स्टॉप शुल्क",
  gstTaxes: "GST और कर",
  discountApplied: "छूट लागू",
  fareBreakdown: "किराया ब्रेकडाउन",
  distanceFare: "दूरी किराया",
  pendingAmount: "लंबित राशि",
  paidAmount: "भुगतान राशि",
  totalFare: "कुल किराया",
  taxes: "कर",
  baseFare: "बेस किराया",
  driverDetails: "ड्राइवर विवरण",
  minimumBookingCharge: "न्यूनतम बुकिंग शुल्क",
  perKilometerCharges: "प्रति किलोमीटर शुल्क",
  additionalStops: "यात्रा के दौरान अतिरिक्त स्टॉप",
  lateNightSurcharge: "देर रात/सुबह सरचार्ज",
  zoneExtraCharge: "जोन अतिरिक्त शुल्क",
  additionalZoneCharges: "अतिरिक्त जोन-आधारित शुल्क",
  governmentTaxes: "सरकारी कर और सेवा शुल्क",
  subtotal: "उप-योग",
  promotionalDiscount: "प्रचारक छूट",
  finalAmountToPay: "भुगतान की जाने वाली अंतिम राशि",
  onlinePaymentReceived: "ऑनलाइन भुगतान प्राप्त",
  toBePaidToDriver: "ड्राइवर को भुगतान करना है",
  paymentStatus: "भुगतान स्थिति",
  fullyPaidOnline: "पूर्ण ऑनलाइन भुगतान",
  paid: "भुगतान हो गया",
  noFareInfo: "कोई किराया जानकारी उपलब्ध नहीं",
  fareCalculationNote: "किराया दूरी, समय और लागू शुल्कों के आधार पर गणना की जाती है। टोल, पार्किंग या मार्ग परिवर्तन के लिए अतिरिक्त शुल्क लागू हो सकते हैं।",
  additionalChargesNote: "मार्ग, समय और स्टॉप के आधार पर अतिरिक्त शुल्क लागू हो सकते हैं।",
  saved: "बचत"
};
const auth = {
  login: "लॉगिन",
  register: "रजिस्टर",
  phone: "फ़ोन नंबर",
  email: "ईमेल",
  password: "पासवर्ड",
  otp: "OTP दर्ज करें",
  sendOtp: "OTP भेजें",
  verifyOtp: "OTP सत्यापित करें",
  resendOtp: "OTP पुनः भेजें",
  forgotPassword: "पासवर्ड भूल गए?",
  loginWithGoogle: "Google से जारी रखें",
  createAccount: "खाता बनाएं",
  alreadyHaveAccount: "पहले से खाता है?",
  dontHaveAccount: "खाता नहीं है?",
  signUp: "साइन अप करें",
  signIn: "साइन इन करें",
  fullName: "पूरा नाम",
  enterPhone: "अपना फ़ोन नंबर दर्ज करें",
  enterEmail: "अपना ईमेल दर्ज करें",
  enterPassword: "अपना पासवर्ड दर्ज करें",
  enterName: "अपना नाम दर्ज करें",
  verifying: "सत्यापित हो रहा है...",
  loggingIn: "लॉगिन हो रहा है...",
  loginToContinue: "बुकिंग जारी रखने के लिए कृपया लॉगिन करें",
  userName: "उपयोगकर्ता नाम"
};
const profile = {
  title: "मेरी प्रोफ़ाइल",
  name: "पूरा नाम",
  email: "ईमेल",
  phone: "फ़ोन",
  updateProfile: "प्रोफ़ाइल अपडेट करें",
  changePassword: "पासवर्ड बदलें",
  savedAddresses: "सहेजे गए पते",
  addAddress: "पता जोड़ें",
  home: "घर",
  work: "कार्यस्थल",
  other: "अन्य",
  walletBalance: "वॉलेट बैलेंस",
  myTrips: "मेरी यात्राएं",
  helpCenter: "सहायता केंद्र",
  myAccount: "मेरा खाता",
  security: "सुरक्षा (पासवर्ड)",
  deleteAccount: "खाता हटाएं",
  generalInfo: "सामान्य जानकारी",
  address: "पता",
  streetAddress: "गली का पता",
  city: "शहर",
  state: "राज्य",
  pincode: "पिनकोड",
  gender: "लिंग",
  male: "पुरुष",
  female: "महिला",
  dob: "जन्म तिथि",
  nationality: "राष्ट्रीयता",
  maritalStatus: "वैवाहिक स्थिति",
  actionRequired: "कार्रवाई आवश्यक: अधूरी प्रोफ़ाइल",
  provideDetails: "सुचारू बुकिंग और संचार सुनिश्चित करने के लिए कृपया अपना आधिकारिक ईमेल और पूरा पता प्रदान करें।",
  profileComplete: "प्रोफ़ाइल पूर्ण",
  profileVerified: "आपकी प्रोफ़ाइल सत्यापित और अपडेट है। अब आप सभी सुविधाओं का पूर्ण उपयोग कर सकते हैं।",
  currentPassword: "वर्तमान पासवर्ड",
  newPassword: "नया पासवर्ड",
  confirmPassword: "नया पासवर्ड पुष्टि करें",
  passwordSecure: "सुनिश्चित करें कि आपका खाता एक लंबे, यादृच्छिक पासवर्ड का उपयोग कर रहा है।",
  deleteConfirm: "क्या आप वाकई अपना खाता स्थायी रूप से हटाना चाहते हैं? यह क्रिया पूर्ववत नहीं की जा सकती।",
  passwordMismatch: "नए पासवर्ड मेल नहीं खाते!",
  profileImage: "प्रोफ़ाइल चित्र"
};
const trips = {
  yourTrips: "आपकी यात्राएं",
  upcomingBookings: "आगामी बुकिंग",
  cancelledBookings: "रद्द बुकिंग",
  completedBookings: "पूर्ण बुकिंग",
  loadingTrips: "आपकी यात्राएं लोड हो रही हैं...",
  noTrips: "लगता है कि आपके पास कोई",
  bookingsWithEasyride: "बुकिंग ईज़ीराइड के साथ नहीं है",
  tripsWillShowHere: "जब आप बुक करेंगे, आपकी यात्राएं यहाँ दिखाई देंगी।",
  startBookingNow: "अभी बुकिंग शुरू करें",
  orderId: "ऑर्डर ID"
};
const support = {
  title: "सहायता",
  createTicket: "टिकट बनाएं",
  myTickets: "मेरी टिकट",
  subject: "विषय",
  message: "संदेश",
  priority: "प्राथमिकता",
  low: "कम",
  medium: "मध्यम",
  high: "उच्च",
  status: "स्थिति",
  open: "खुला",
  closed: "बंद",
  inProgress: "प्रगति में",
  contactUs: "हमसे संपर्क करें",
  faq: "अक्सर पूछे जाने वाले प्रश्न",
  helpAndSupport: "सहायता और समर्थन"
};
const faq = {
  title: "अक्सर पूछे जाने वाले प्रश्न",
  howToBook: "कैब कैसे बुक करें?",
  cancellationPolicy: "रद्दीकरण नीति क्या है?",
  paymentMethods: "कौन सी भुगतान विधियां उपलब्ध हैं?",
  driverContact: "मैं ड्राइवर से कैसे संपर्क करूं?",
  economicalCabQ: "{{airport}} पर सबसे किफायती कैब कौन सी उपलब्ध है?",
  economicalCabA: "{{airport}} पर वर्तमान में सबसे किफायती कैब सेडान है।",
  optionsQ: "{{airport}} पर कैब बुकिंग के लिए कौन से विकल्प उपलब्ध हैं?",
  optionsA: "आप {{airport}} से निम्नलिखित प्रकार की कैब बुक कर सकते हैं:"
};
const cities = {
  title: "शहर",
  popularCities: "लोकप्रिय शहर",
  allCities: "सभी शहर",
  selectCity: "शहर चुनें"
};
const routes = {
  title: "मार्ग",
  popularRoutes: "लोकप्रिय मार्ग",
  intercityRoutes: "अंतर-शहर मार्ग",
  airportRoutes: "एयरपोर्ट मार्ग"
};
const errors = {
  enterPickup: "कृपया पिकअप स्थान दर्ज करें",
  enterDrop: "कृपया ड्रॉप स्थान दर्ज करें",
  locationNotFound: "स्थान नहीं मिला",
  searchFailed: "खोज विफल। कृपया पुनः प्रयास करें।",
  bookingFailed: "बुकिंग विफल। कृपया पुनः प्रयास करें।",
  paymentFailed: "भुगतान विफल। कृपया पुनः प्रयास करें।",
  loginRequired: "कृपया जारी रखने के लिए लॉगिन करें",
  invalidOtp: "अमान्य OTP",
  razorpayFailed: "Razorpay SDK लोड करने में विफल। क्या आप ऑनलाइन हैं?",
  paymentVerifyFailed: "भुगतान सत्यापन विफल। कृपया सहायता से संपर्क करें।",
  paymentCancelled: "भुगतान रद्द। आप मेरी यात्राओं से पुनः प्रयास कर सकते हैं।"
};
const toasts = {
  findingCabs: "कैब ढूंढ रहे हैं...",
  bookingSuccess: "बुकिंग सफल!",
  paymentSuccess: "भुगतान सफल!",
  loginSuccess: "लॉगिन सफल!",
  logoutSuccess: "लॉगआउट सफल!",
  profileUpdated: "प्रोफ़ाइल अपडेट हो गई!",
  ticketCreated: "टिकट बनाई गई!",
  registerSuccess: "पंजीकरण सफल!"
};
const footer = {
  aboutUs: "हमारे बारे में",
  contactUs: "संपर्क करें",
  termsConditions: "नियम और शर्तें",
  privacyPolicy: "गोपनीयता नीति",
  refundPolicy: "रिफंड नीति",
  careers: "करियर",
  blog: "ब्लॉग",
  downloadApp: "ऐप डाउनलोड करें",
  followUs: "हमें फॉलो करें",
  copyright: "© 2025 ईज़ी राइड। सभी अधिकार सुरक्षित।"
};
const months = {
  jan: "जनवरी",
  feb: "फ़रवरी",
  mar: "मार्च",
  apr: "अप्रैल",
  may: "मई",
  jun: "जून",
  jul: "जुलाई",
  aug: "अगस्त",
  sep: "सितंबर",
  oct: "अक्टूबर",
  nov: "नवंबर",
  dec: "दिसंबर"
};
const hi = {
  common,
  nav,
  hero,
  tripTypes,
  booking,
  cabSearch,
  cabInfo,
  weekDays,
  payment,
  auth,
  profile,
  trips,
  support,
  faq,
  cities,
  routes,
  errors,
  toasts,
  footer,
  months
};
const isSSR$3 = typeof window === "undefined";
const LANGUAGE_STORAGE_KEY$1 = "app_language";
const API_BASE_URL = "http://localhost:5000";
const resources = {
  en: { translation: en },
  hi: { translation: hi }
};
instance.use(initReactI18next).init({
  resources,
  lng: !isSSR$3 && localStorage.getItem(LANGUAGE_STORAGE_KEY$1) || "en",
  fallbackLng: "en",
  interpolation: { escapeValue: false },
  react: { useSuspense: false },
  debug: !isSSR$3 && false
});
const loadAndApplyLanguage = async (code) => {
  var _a;
  try {
    if (resources[code]) {
      await instance.changeLanguage(code);
      if (!isSSR$3) localStorage.setItem(LANGUAGE_STORAGE_KEY$1, code);
      if (!isSSR$3) {
        document.documentElement.dir = code === "ar" ? "rtl" : "ltr";
        document.documentElement.lang = code;
      }
      console.log(`[i18n] Static language applied: ${code}`);
      return true;
    }
    console.log(`[i18n] Fetching dynamic language: ${code}`);
    const response = await fetch(`${API_BASE_URL}/api/v1/app-languages/${code}`);
    const data = await response.json();
    if (data.success && ((_a = data.data) == null ? void 0 : _a.content)) {
      const { content, isRTL } = data.data;
      let translationToApply = content;
      if (content.user || content.vendor || content.zone || content.driver) {
        translationToApply = content.user || {};
      }
      instance.addResourceBundle(code, "translation", translationToApply, true, true);
      await instance.changeLanguage(code);
      if (!isSSR$3) localStorage.setItem(LANGUAGE_STORAGE_KEY$1, code);
      if (!isSSR$3) {
        document.documentElement.dir = isRTL ? "rtl" : "ltr";
        document.documentElement.lang = code;
      }
      console.log(`[i18n] Dynamic language "${code}" applied (RTL: ${isRTL})`);
      return true;
    }
  } catch (error) {
    console.error(`[i18n] Error loading language ${code}:`, error);
  }
  return false;
};
const isSSR$2 = typeof window === "undefined";
const LANGUAGE_STORAGE_KEY = "app_language";
const fetchGlobalLanguage = createAsyncThunk(
  "language/fetchGlobal",
  async (_2, { rejectWithValue }) => {
    var _a, _b;
    try {
      const response = await api.get("/settings/language");
      const language = ((_b = (_a = response.data) == null ? void 0 : _a.data) == null ? void 0 : _b.language) || "en";
      await loadAndApplyLanguage(language);
      console.log("[LanguageSlice] Global language synced:", language);
      return language;
    } catch (error) {
      console.error("[LanguageSlice] Failed to fetch language:", error);
      const cached = !isSSR$2 && localStorage.getItem(LANGUAGE_STORAGE_KEY) || "en";
      loadAndApplyLanguage(cached);
      return rejectWithValue({ error: error.message, fallback: cached });
    }
  }
);
const getInitialLanguage = () => {
  if (isSSR$2) return "en";
  try {
    return localStorage.getItem(LANGUAGE_STORAGE_KEY) || "en";
  } catch {
    return "en";
  }
};
const languageSlice = createSlice({
  name: "language",
  initialState: {
    language: getInitialLanguage(),
    isLoading: false,
    error: null,
    isFetched: false
  },
  reducers: {
    clearLanguageState: (state) => {
      state.error = null;
    }
  },
  extraReducers: (builder) => {
    builder.addCase(fetchGlobalLanguage.pending, (state) => {
      state.isLoading = true;
      state.error = null;
    });
    builder.addCase(fetchGlobalLanguage.fulfilled, (state, action) => {
      state.isLoading = false;
      state.language = action.payload;
      state.isFetched = true;
    });
    builder.addCase(fetchGlobalLanguage.rejected, (state, action) => {
      var _a, _b;
      state.isLoading = false;
      state.isFetched = true;
      state.error = (_a = action.payload) == null ? void 0 : _a.error;
      if ((_b = action.payload) == null ? void 0 : _b.fallback) {
        state.language = action.payload.fallback;
      }
    });
  }
});
const { clearLanguageState } = languageSlice.actions;
const languageReducer = languageSlice.reducer;
const getAllFAQs = createAsyncThunk(
  "faq/getAllFAQs",
  async (params = {}, { rejectWithValue }) => {
    var _a;
    try {
      const { category, search, tags, sortBy, page, limit } = params;
      const queryParams = new URLSearchParams();
      if (category) queryParams.append("category", category);
      if (search) queryParams.append("search", search);
      if (tags) queryParams.append("tags", tags);
      if (sortBy) queryParams.append("sortBy", sortBy);
      if (page) queryParams.append("page", page);
      if (limit) queryParams.append("limit", limit);
      const response = await api.get(`/faq?${queryParams.toString()}`);
      return response.data;
    } catch (error) {
      return rejectWithValue(
        ((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch FAQs" }
      );
    }
  }
);
const getFAQsByCategory = createAsyncThunk(
  "faq/getFAQsByCategory",
  async (_2, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get("/faq/grouped");
      return response.data;
    } catch (error) {
      return rejectWithValue(
        ((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch FAQs" }
      );
    }
  }
);
const getFAQCategories = createAsyncThunk(
  "faq/getFAQCategories",
  async (_2, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get("/faq/categories");
      return response.data;
    } catch (error) {
      return rejectWithValue(
        ((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch categories" }
      );
    }
  }
);
const searchFAQs = createAsyncThunk(
  "faq/searchFAQs",
  async ({ query, limit }, { rejectWithValue }) => {
    var _a;
    try {
      const params = new URLSearchParams();
      params.append("q", query);
      if (limit) params.append("limit", limit);
      const response = await api.get(`/faq/search?${params.toString()}`);
      return response.data;
    } catch (error) {
      return rejectWithValue(
        ((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to search FAQs" }
      );
    }
  }
);
const getFAQById = createAsyncThunk(
  "faq/getFAQById",
  async (id, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.get(`/faq/${id}`);
      return response.data;
    } catch (error) {
      return rejectWithValue(
        ((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to fetch FAQ" }
      );
    }
  }
);
const markFAQHelpful = createAsyncThunk(
  "faq/markFAQHelpful",
  async ({ id, helpful }, { rejectWithValue }) => {
    var _a;
    try {
      const response = await api.post(`/faq/${id}/helpful`, { helpful });
      return { id, ...response.data };
    } catch (error) {
      return rejectWithValue(
        ((_a = error.response) == null ? void 0 : _a.data) || { message: "Failed to submit feedback" }
      );
    }
  }
);
const initialState = {
  // All FAQs
  faqs: [],
  faqsLoading: false,
  faqsError: null,
  pagination: null,
  // Grouped FAQs
  groupedFAQs: {},
  groupedLoading: false,
  groupedError: null,
  // Categories
  categories: [],
  categoriesLoading: false,
  categoriesError: null,
  // Search
  searchResults: [],
  searchLoading: false,
  searchError: null,
  // Single FAQ
  currentFAQ: null,
  currentLoading: false,
  currentError: null,
  // Feedback
  feedbackLoading: false,
  feedbackError: null
};
const faqSlice = createSlice({
  name: "faq",
  initialState,
  reducers: {
    resetFAQs: (state) => {
      state.faqs = [];
      state.faqsError = null;
      state.pagination = null;
    },
    resetSearchResults: (state) => {
      state.searchResults = [];
      state.searchError = null;
    },
    resetCurrentFAQ: (state) => {
      state.currentFAQ = null;
      state.currentError = null;
    },
    clearAllErrors: (state) => {
      state.faqsError = null;
      state.groupedError = null;
      state.categoriesError = null;
      state.searchError = null;
      state.currentError = null;
      state.feedbackError = null;
    }
  },
  extraReducers: (builder) => {
    builder.addCase(getAllFAQs.pending, (state) => {
      state.faqsLoading = true;
      state.faqsError = null;
    }).addCase(getAllFAQs.fulfilled, (state, action) => {
      state.faqsLoading = false;
      if (action.payload.success) {
        state.faqs = action.payload.data;
        state.pagination = action.payload.pagination;
      }
    }).addCase(getAllFAQs.rejected, (state, action) => {
      var _a;
      state.faqsLoading = false;
      state.faqsError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to fetch FAQs";
    });
    builder.addCase(getFAQsByCategory.pending, (state) => {
      state.groupedLoading = true;
      state.groupedError = null;
    }).addCase(getFAQsByCategory.fulfilled, (state, action) => {
      state.groupedLoading = false;
      if (action.payload.success) {
        state.groupedFAQs = action.payload.data;
      }
    }).addCase(getFAQsByCategory.rejected, (state, action) => {
      var _a;
      state.groupedLoading = false;
      state.groupedError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to fetch FAQs";
    });
    builder.addCase(getFAQCategories.pending, (state) => {
      state.categoriesLoading = true;
      state.categoriesError = null;
    }).addCase(getFAQCategories.fulfilled, (state, action) => {
      state.categoriesLoading = false;
      if (action.payload.success) {
        state.categories = action.payload.data;
      }
    }).addCase(getFAQCategories.rejected, (state, action) => {
      var _a;
      state.categoriesLoading = false;
      state.categoriesError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to fetch categories";
    });
    builder.addCase(searchFAQs.pending, (state) => {
      state.searchLoading = true;
      state.searchError = null;
    }).addCase(searchFAQs.fulfilled, (state, action) => {
      state.searchLoading = false;
      if (action.payload.success) {
        state.searchResults = action.payload.data;
      }
    }).addCase(searchFAQs.rejected, (state, action) => {
      var _a;
      state.searchLoading = false;
      state.searchError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to search FAQs";
    });
    builder.addCase(getFAQById.pending, (state) => {
      state.currentLoading = true;
      state.currentError = null;
    }).addCase(getFAQById.fulfilled, (state, action) => {
      state.currentLoading = false;
      if (action.payload.success) {
        state.currentFAQ = action.payload.data;
      }
    }).addCase(getFAQById.rejected, (state, action) => {
      var _a;
      state.currentLoading = false;
      state.currentError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to fetch FAQ";
    });
    builder.addCase(markFAQHelpful.pending, (state) => {
      state.feedbackLoading = true;
      state.feedbackError = null;
    }).addCase(markFAQHelpful.fulfilled, (state, action) => {
      state.feedbackLoading = false;
      const faqId = action.payload.id;
      const faqIndex = state.faqs.findIndex((f2) => f2._id === faqId);
      if (faqIndex !== -1 && action.payload.data) {
        state.faqs[faqIndex].helpfulCount = action.payload.data.helpfulCount;
        state.faqs[faqIndex].notHelpfulCount = action.payload.data.notHelpfulCount;
      }
    }).addCase(markFAQHelpful.rejected, (state, action) => {
      var _a;
      state.feedbackLoading = false;
      state.feedbackError = ((_a = action.payload) == null ? void 0 : _a.message) || "Failed to submit feedback";
    });
  }
});
const {
  resetFAQs,
  resetSearchResults,
  resetCurrentFAQ,
  clearAllErrors
} = faqSlice.actions;
const faqReducer = faqSlice.reducer;
const isSSR$1 = typeof window === "undefined";
const preloadedState$1 = !isSSR$1 && window.__PRELOADED_STATE__ ? window.__PRELOADED_STATE__ : void 0;
if (!isSSR$1 && window.__PRELOADED_STATE__) {
  delete window.__PRELOADED_STATE__;
}
const makeStore = (preloadedState2 = {}) => {
  return configureStore({
    reducer: {
      auth: authReducer,
      booking: bookingReducer,
      seo: seoReducer,
      support: supportReducer,
      payment: paymentReducer,
      setting: settingReducer,
      cms: cmsReducer,
      language: languageReducer,
      faq: faqReducer
    },
    preloadedState: preloadedState2,
    // Inject server data here
    middleware: (getDefaultMiddleware) => getDefaultMiddleware({ serializableCheck: false })
  });
};
makeStore(preloadedState$1);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
const toCamelCase = (string) => string.replace(
  /^([A-Z])|[\s-_]+(\w)/g,
  (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
);
const toPascalCase = (string) => {
  const camelCase = toCamelCase(string);
  return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
};
const mergeClasses = (...classes) => classes.filter((className, index2, array) => {
  return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index2;
}).join(" ").trim();
const hasA11yProp = (props) => {
  for (const prop in props) {
    if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
      return true;
    }
  }
};
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
var defaultAttributes = {
  xmlns: "http://www.w3.org/2000/svg",
  width: 24,
  height: 24,
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  strokeWidth: 2,
  strokeLinecap: "round",
  strokeLinejoin: "round"
};
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const Icon = reactExports.forwardRef(
  ({
    color = "currentColor",
    size = 24,
    strokeWidth = 2,
    absoluteStrokeWidth,
    className = "",
    children,
    iconNode,
    ...rest
  }, ref) => reactExports.createElement(
    "svg",
    {
      ref,
      ...defaultAttributes,
      width: size,
      height: size,
      stroke: color,
      strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
      className: mergeClasses("lucide", className),
      ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
      ...rest
    },
    [
      ...iconNode.map(([tag, attrs]) => reactExports.createElement(tag, attrs)),
      ...Array.isArray(children) ? children : [children]
    ]
  )
);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const createLucideIcon = (iconName, iconNode) => {
  const Component2 = reactExports.forwardRef(
    ({ className, ...props }, ref) => reactExports.createElement(Icon, {
      ref,
      iconNode,
      className: mergeClasses(
        `lucide-${toKebabCase(toPascalCase(iconName))}`,
        `lucide-${iconName}`,
        className
      ),
      ...props
    })
  );
  Component2.displayName = toPascalCase(iconName);
  return Component2;
};
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$s = [
  ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
  ["path", { d: "M19 12H5", key: "x3x0zl" }]
];
const ArrowLeft = createLucideIcon("arrow-left", __iconNode$s);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$r = [
  ["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
  ["path", { d: "M17 20V4", key: "1ejh1v" }],
  ["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
  ["path", { d: "M7 4v16", key: "1glfcx" }]
];
const ArrowUpDown = createLucideIcon("arrow-up-down", __iconNode$r);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$q = [
  [
    "path",
    { d: "M4 10a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v10a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z", key: "1ol0lm" }
  ],
  ["path", { d: "M8 10h8", key: "c7uz4u" }],
  ["path", { d: "M8 18h8", key: "1no2b1" }],
  ["path", { d: "M8 22v-6a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v6", key: "1fr6do" }],
  ["path", { d: "M9 6V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2", key: "donm21" }]
];
const Backpack = createLucideIcon("backpack", __iconNode$q);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$p = [
  [
    "path",
    {
      d: "M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",
      key: "3c2336"
    }
  ],
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
];
const BadgeCheck = createLucideIcon("badge-check", __iconNode$p);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$o = [
  ["path", { d: "M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16", key: "jecpp" }],
  ["rect", { width: "20", height: "14", x: "2", y: "6", rx: "2", key: "i6l2r4" }]
];
const Briefcase = createLucideIcon("briefcase", __iconNode$o);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$n = [
  [
    "path",
    {
      d: "M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",
      key: "18u6gg"
    }
  ],
  ["circle", { cx: "12", cy: "13", r: "3", key: "1vg3eu" }]
];
const Camera = createLucideIcon("camera", __iconNode$n);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$m = [
  ["path", { d: "M8 2v4", key: "1cmpym" }],
  ["path", { d: "M16 2v4", key: "4m81vk" }],
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
  ["path", { d: "M3 10h18", key: "8toen8" }]
];
const Calendar = createLucideIcon("calendar", __iconNode$m);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$l = [
  [
    "path",
    {
      d: "M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",
      key: "5owen"
    }
  ],
  ["circle", { cx: "7", cy: "17", r: "2", key: "u2ysq9" }],
  ["path", { d: "M9 17h6", key: "r8uit2" }],
  ["circle", { cx: "17", cy: "17", r: "2", key: "axvx0g" }]
];
const Car = createLucideIcon("car", __iconNode$l);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$k = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
const ChevronDown = createLucideIcon("chevron-down", __iconNode$k);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$j = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
const ChevronRight = createLucideIcon("chevron-right", __iconNode$j);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$i = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
const ChevronUp = createLucideIcon("chevron-up", __iconNode$i);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$h = [
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
];
const CircleAlert = createLucideIcon("circle-alert", __iconNode$h);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$g = [
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
];
const CircleCheck = createLucideIcon("circle-check", __iconNode$g);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$f = [
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
];
const CircleX = createLucideIcon("circle-x", __iconNode$f);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$e = [
  ["path", { d: "M12 6v6l4 2", key: "mmk7yg" }],
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
];
const Clock = createLucideIcon("clock", __iconNode$e);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$d = [
  ["rect", { x: "3", y: "8", width: "18", height: "4", rx: "1", key: "bkv52" }],
  ["path", { d: "M12 8v13", key: "1c76mn" }],
  ["path", { d: "M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7", key: "6wjy6b" }],
  [
    "path",
    {
      d: "M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",
      key: "1ihvrl"
    }
  ]
];
const Gift = createLucideIcon("gift", __iconNode$d);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$c = [
  [
    "path",
    {
      d: "M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",
      key: "1xhozi"
    }
  ]
];
const Headphones = createLucideIcon("headphones", __iconNode$c);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$b = [
  ["path", { d: "M12 2v4", key: "3427ic" }],
  ["path", { d: "m16.2 7.8 2.9-2.9", key: "r700ao" }],
  ["path", { d: "M18 12h4", key: "wj9ykh" }],
  ["path", { d: "m16.2 16.2 2.9 2.9", key: "1bxg5t" }],
  ["path", { d: "M12 18v4", key: "jadmvz" }],
  ["path", { d: "m4.9 19.1 2.9-2.9", key: "bwix9q" }],
  ["path", { d: "M2 12h4", key: "j09sii" }],
  ["path", { d: "m4.9 4.9 2.9 2.9", key: "giyufr" }]
];
const Loader = createLucideIcon("loader", __iconNode$b);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$a = [
  [
    "path",
    {
      d: "M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",
      key: "1r0f0z"
    }
  ],
  ["circle", { cx: "12", cy: "10", r: "3", key: "ilqhr7" }]
];
const MapPin = createLucideIcon("map-pin", __iconNode$a);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$9 = [
  ["path", { d: "M4 12h16", key: "1lakjw" }],
  ["path", { d: "M4 18h16", key: "19g7jn" }],
  ["path", { d: "M4 6h16", key: "1o0s65" }]
];
const Menu = createLucideIcon("menu", __iconNode$9);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$8 = [
  [
    "path",
    {
      d: "M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",
      key: "18887p"
    }
  ]
];
const MessageSquare = createLucideIcon("message-square", __iconNode$8);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$7 = [
  [
    "path",
    {
      d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
      key: "1miecu"
    }
  ]
];
const Paperclip = createLucideIcon("paperclip", __iconNode$7);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$6 = [
  [
    "path",
    {
      d: "M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",
      key: "9njp5v"
    }
  ]
];
const Phone = createLucideIcon("phone", __iconNode$6);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$5 = [
  ["path", { d: "M5 12h14", key: "1ays0h" }],
  ["path", { d: "M12 5v14", key: "s699le" }]
];
const Plus = createLucideIcon("plus", __iconNode$5);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$4 = [
  [
    "path",
    {
      d: "M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",
      key: "1ffxy3"
    }
  ],
  ["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
];
const Send = createLucideIcon("send", __iconNode$4);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$3 = [
  [
    "path",
    {
      d: "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",
      key: "r04s7s"
    }
  ]
];
const Star = createLucideIcon("star", __iconNode$3);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$2 = [
  [
    "path",
    {
      d: "M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",
      key: "vktsd0"
    }
  ],
  ["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }]
];
const Tag = createLucideIcon("tag", __iconNode$2);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode$1 = [
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
];
const User = createLucideIcon("user", __iconNode$1);
/**
 * @license lucide-react v0.542.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const __iconNode = [
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
];
const X = createLucideIcon("x", __iconNode);
var DefaultContext = {
  color: void 0,
  size: void 0,
  className: void 0,
  style: void 0,
  attr: void 0
};
var IconContext = React$4.createContext && /* @__PURE__ */ React$4.createContext(DefaultContext);
var _excluded = ["attr", "size", "title"];
function _objectWithoutProperties(source, excluded) {
  if (source == null) return {};
  var target = _objectWithoutPropertiesLoose(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0) continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose(source, excluded) {
  if (source == null) return {};
  var target = {};
  for (var key in source) {
    if (Object.prototype.hasOwnProperty.call(source, key)) {
      if (excluded.indexOf(key) >= 0) continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _extends() {
  _extends = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends.apply(this, arguments);
}
function ownKeys(e2, r) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o2 = Object.getOwnPropertySymbols(e2);
    r && (o2 = o2.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e2, r2).enumerable;
    })), t2.push.apply(t2, o2);
  }
  return t2;
}
function _objectSpread(e2) {
  for (var r = 1; r < arguments.length; r++) {
    var t2 = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys(Object(t2), true).forEach(function(r2) {
      _defineProperty(e2, r2, t2[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys(Object(t2)).forEach(function(r2) {
      Object.defineProperty(e2, r2, Object.getOwnPropertyDescriptor(t2, r2));
    });
  }
  return e2;
}
function _defineProperty(obj, key, value) {
  key = _toPropertyKey(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey(t2) {
  var i2 = _toPrimitive(t2, "string");
  return "symbol" == typeof i2 ? i2 : i2 + "";
}
function _toPrimitive(t2, r) {
  if ("object" != typeof t2 || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r);
    if ("object" != typeof i2) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t2);
}
function Tree2Element(tree) {
  return tree && tree.map((node, i2) => /* @__PURE__ */ React$4.createElement(node.tag, _objectSpread({
    key: i2
  }, node.attr), Tree2Element(node.child)));
}
function GenIcon(data) {
  return (props) => /* @__PURE__ */ React$4.createElement(IconBase, _extends({
    attr: _objectSpread({}, data.attr)
  }, props), Tree2Element(data.child));
}
function IconBase(props) {
  var elem = (conf) => {
    var {
      attr,
      size,
      title
    } = props, svgProps = _objectWithoutProperties(props, _excluded);
    var computedSize = size || conf.size || "1em";
    var className;
    if (conf.className) className = conf.className;
    if (props.className) className = (className ? className + " " : "") + props.className;
    return /* @__PURE__ */ React$4.createElement("svg", _extends({
      stroke: "currentColor",
      fill: "currentColor",
      strokeWidth: "0"
    }, conf.attr, attr, svgProps, {
      className,
      style: _objectSpread(_objectSpread({
        color: props.color || conf.color
      }, conf.style), props.style),
      height: computedSize,
      width: computedSize,
      xmlns: "http://www.w3.org/2000/svg"
    }), title && /* @__PURE__ */ React$4.createElement("title", null, title), props.children);
  };
  return IconContext !== void 0 ? /* @__PURE__ */ React$4.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
}
const Logo = "/assets/Logo-YbfM7pvu.png";
function useLoadGsiScript(options = {}) {
  const { nonce, locale, onScriptLoadSuccess, onScriptLoadError } = options;
  const [scriptLoadedSuccessfully, setScriptLoadedSuccessfully] = reactExports.useState(false);
  const onScriptLoadSuccessRef = reactExports.useRef(onScriptLoadSuccess);
  onScriptLoadSuccessRef.current = onScriptLoadSuccess;
  const onScriptLoadErrorRef = reactExports.useRef(onScriptLoadError);
  onScriptLoadErrorRef.current = onScriptLoadError;
  reactExports.useEffect(() => {
    const scriptTag = document.createElement("script");
    scriptTag.src = "https://accounts.google.com/gsi/client";
    if (locale)
      scriptTag.src += `?hl=${locale}`;
    scriptTag.async = true;
    scriptTag.defer = true;
    scriptTag.nonce = nonce;
    scriptTag.onload = () => {
      var _a;
      setScriptLoadedSuccessfully(true);
      (_a = onScriptLoadSuccessRef.current) === null || _a === void 0 ? void 0 : _a.call(onScriptLoadSuccessRef);
    };
    scriptTag.onerror = () => {
      var _a;
      setScriptLoadedSuccessfully(false);
      (_a = onScriptLoadErrorRef.current) === null || _a === void 0 ? void 0 : _a.call(onScriptLoadErrorRef);
    };
    document.body.appendChild(scriptTag);
    return () => {
      document.body.removeChild(scriptTag);
    };
  }, [nonce]);
  return scriptLoadedSuccessfully;
}
const GoogleOAuthContext = reactExports.createContext(null);
function GoogleOAuthProvider({ clientId, nonce, locale, onScriptLoadSuccess, onScriptLoadError, children }) {
  const scriptLoadedSuccessfully = useLoadGsiScript({
    nonce,
    onScriptLoadSuccess,
    onScriptLoadError,
    locale
  });
  const contextValue = reactExports.useMemo(() => ({
    locale,
    clientId,
    scriptLoadedSuccessfully
  }), [clientId, scriptLoadedSuccessfully]);
  return React$4.createElement(GoogleOAuthContext.Provider, { value: contextValue }, children);
}
function useGoogleOAuth() {
  const context = reactExports.useContext(GoogleOAuthContext);
  if (!context) {
    throw new Error("Google OAuth components must be used within GoogleOAuthProvider");
  }
  return context;
}
function extractClientId(credentialResponse) {
  var _a;
  const clientId = (_a = credentialResponse === null || credentialResponse === void 0 ? void 0 : credentialResponse.clientId) !== null && _a !== void 0 ? _a : credentialResponse === null || credentialResponse === void 0 ? void 0 : credentialResponse.client_id;
  return clientId;
}
const containerHeightMap = { large: 40, medium: 32, small: 20 };
function GoogleLogin({ onSuccess, onError, useOneTap, promptMomentNotification, type = "standard", theme = "outline", size = "large", text, shape, logo_alignment, width, click_listener, state, containerProps, ...props }) {
  const btnContainerRef = reactExports.useRef(null);
  const { clientId, locale, scriptLoadedSuccessfully } = useGoogleOAuth();
  const onSuccessRef = reactExports.useRef(onSuccess);
  onSuccessRef.current = onSuccess;
  const onErrorRef = reactExports.useRef(onError);
  onErrorRef.current = onError;
  const promptMomentNotificationRef = reactExports.useRef(promptMomentNotification);
  promptMomentNotificationRef.current = promptMomentNotification;
  reactExports.useEffect(() => {
    var _a, _b, _c, _d, _e, _f, _g, _h, _j;
    if (!scriptLoadedSuccessfully)
      return;
    (_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.google) === null || _a === void 0 ? void 0 : _a.accounts) === null || _b === void 0 ? void 0 : _b.id) === null || _c === void 0 ? void 0 : _c.initialize({
      client_id: clientId,
      callback: (credentialResponse) => {
        var _a2;
        if (!(credentialResponse === null || credentialResponse === void 0 ? void 0 : credentialResponse.credential)) {
          return (_a2 = onErrorRef.current) === null || _a2 === void 0 ? void 0 : _a2.call(onErrorRef);
        }
        const { credential, select_by } = credentialResponse;
        onSuccessRef.current({
          credential,
          clientId: extractClientId(credentialResponse),
          select_by
        });
      },
      ...props
    });
    (_f = (_e = (_d = window === null || window === void 0 ? void 0 : window.google) === null || _d === void 0 ? void 0 : _d.accounts) === null || _e === void 0 ? void 0 : _e.id) === null || _f === void 0 ? void 0 : _f.renderButton(btnContainerRef.current, {
      type,
      theme,
      size,
      text,
      shape,
      logo_alignment,
      width,
      locale,
      click_listener,
      state
    });
    if (useOneTap)
      (_j = (_h = (_g = window === null || window === void 0 ? void 0 : window.google) === null || _g === void 0 ? void 0 : _g.accounts) === null || _h === void 0 ? void 0 : _h.id) === null || _j === void 0 ? void 0 : _j.prompt(promptMomentNotificationRef.current);
    return () => {
      var _a2, _b2, _c2;
      if (useOneTap)
        (_c2 = (_b2 = (_a2 = window === null || window === void 0 ? void 0 : window.google) === null || _a2 === void 0 ? void 0 : _a2.accounts) === null || _b2 === void 0 ? void 0 : _b2.id) === null || _c2 === void 0 ? void 0 : _c2.cancel();
    };
  }, [
    clientId,
    scriptLoadedSuccessfully,
    useOneTap,
    type,
    theme,
    size,
    text,
    shape,
    logo_alignment,
    width,
    locale
  ]);
  return React$4.createElement("div", { ...containerProps, ref: btnContainerRef, style: { height: containerHeightMap[size], ...containerProps === null || containerProps === void 0 ? void 0 : containerProps.style } });
}
const Navbar = () => {
  var _a, _b;
  const { t: t2 } = useTranslation();
  const [isOpen, setIsOpen] = reactExports.useState(false);
  const [isLoginOpen, setIsLoginOpen] = reactExports.useState(false);
  const [showLoginDropdown, setShowLoginDropdown] = reactExports.useState(false);
  const [loginStep, setLoginStep] = reactExports.useState("phone");
  const [phoneNumber, setPhoneNumber] = reactExports.useState("");
  const [otp, setOtp] = reactExports.useState(["", "", "", "", "", ""]);
  const [countdown, setCountdown] = reactExports.useState(23);
  const dispatch = useDispatch();
  const { isAuthenticated: isLoggedIn, loading, error, user } = useSelector((state) => state.auth);
  const [showProfileMenu, setShowProfileMenu] = reactExports.useState(false);
  const otpInputs = reactExports.useRef([]);
  const navigate = useNavigate();
  const [showAutoPopup, setShowAutoPopup] = reactExports.useState(true);
  const profileMenuRef = reactExports.useRef(null);
  const [intendedRoute, setIntendedRoute] = reactExports.useState(null);
  const [showMyTripsTooltip, setShowMyTripsTooltip] = reactExports.useState(false);
  reactExports.useEffect(() => {
    const handleClickOutside = (event) => {
      if (profileMenuRef.current && !profileMenuRef.current.contains(event.target)) {
        setShowProfileMenu(false);
      }
    };
    if (showProfileMenu) {
      document.addEventListener("mousedown", handleClickOutside);
    }
    return () => {
      document.removeEventListener("mousedown", handleClickOutside);
    };
  }, [showProfileMenu]);
  const handlePhoneSubmit = async () => {
    if (phoneNumber.length >= 10) {
      try {
        await dispatch(sendOtp({ identifier: "+91" + phoneNumber, type: "phone" })).unwrap();
        setLoginStep("otp");
        setCountdown(23);
        setTimeout(() => {
          if (otpInputs.current[0]) {
            otpInputs.current[0].focus();
          }
        }, 100);
      } catch (err) {
        console.error("Failed to send OTP:", err);
      }
    }
  };
  reactExports.useEffect(() => {
    let timer;
    if (loginStep === "otp" && countdown > 0) {
      timer = setInterval(() => setCountdown((prev) => prev - 1), 1e3);
    }
    return () => clearInterval(timer);
  }, [loginStep, countdown]);
  const handleResendOtp = async () => {
    try {
      await dispatch(sendOtp({ identifier: "+91" + phoneNumber, type: "phone" })).unwrap();
      setCountdown(23);
    } catch (err) {
      console.error("Failed to resend OTP:", err);
    }
  };
  const resetModal = () => {
    setIsLoginOpen(false);
    setLoginStep("phone");
    setPhoneNumber("");
    setOtp(["", "", "", "", "", ""]);
    setCountdown(23);
  };
  const handleVerify = async () => {
    if (otp.join("").length === 6) {
      try {
        await dispatch(login({ phone: "+91" + phoneNumber, otp: otp.join("") })).unwrap();
        resetModal();
        if (intendedRoute) {
          navigate(intendedRoute);
          setIntendedRoute(null);
        } else {
          navigate("/profile");
        }
      } catch (err) {
        console.error("Login failed:", err);
      }
    }
  };
  reactExports.useEffect(() => {
    const timer = setTimeout(() => {
      setShowAutoPopup(false);
    }, 5e3);
    return () => clearTimeout(timer);
  }, []);
  const { settings } = useSelector((state) => state.setting || {});
  const { socialConfig } = useSelector((state) => state.auth);
  const logoUrl = ((_a = settings == null ? void 0 : settings.design) == null ? void 0 : _a.logo) || (!Logo.startsWith("http") && !Logo.startsWith("data:") ? Logo.startsWith("/") ? Logo : `/${Logo}` : Logo);
  const handleGoogleSuccess = async (credentialResponse) => {
    try {
      await dispatch(loginWithGoogle({ token: credentialResponse.credential })).unwrap();
      resetModal();
      if (intendedRoute) {
        navigate(intendedRoute);
        setIntendedRoute(null);
      } else {
        navigate("/profile");
      }
    } catch (err) {
      console.error("Google login failed:", err);
    }
  };
  const handleGoogleError = () => {
    toast.error("Google login failed. Please try again.");
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("nav", { className: "bg-white shadow-md fixed top-0 left-0 w-full h-[64px] z-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto flex items-center justify-between px-4 sm:px-6 py-3", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center h-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { to: "/", className: "flex items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: logoUrl, alt: "Logo", className: "max-h-[52px] w-auto max-w-[200px] object-contain" }) }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "hidden md:flex items-center space-x-8", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "button",
            {
              onClick: () => {
                if (isLoggedIn) navigate("/my-trips");
                else {
                  toast.error("Please login to view your trips");
                  setIntendedRoute("/my-trips");
                  setIsLoginOpen(true);
                }
              },
              onMouseEnter: () => setShowMyTripsTooltip(true),
              onMouseLeave: () => setShowMyTripsTooltip(false),
              className: "flex items-center space-x-2 text-gray-700 hover:text-orange-500",
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(Briefcase, { size: 22, className: "text-gray-500" }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-gray-600", children: t2("nav.manageBooking", "Manage Booking") }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold text-base -mt-1 mr-11", children: t2("nav.myTrips", "My Trips") })
                ] })
              ]
            }
          ),
          showMyTripsTooltip && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute top-16 left-1/2 -translate-x-1/2 w-80 p-4 bg-white rounded-xl shadow-2xl border z-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-3 h-3 bg-green-500 rounded-full mt-1" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-700", children: "Access your bookings, easy cancellation, date change and much more." })
          ] }) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "button",
          {
            onClick: () => navigate("/support"),
            className: "flex items-center space-x-2 text-gray-700 hover:text-orange-500",
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(Headphones, { size: 20, className: "text-gray-500" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium text-sm", children: t2("nav.support", "Support") })
            ]
          }
        ),
        isLoggedIn && /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            ref: profileMenuRef,
            className: "relative",
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs(
                "button",
                {
                  onClick: () => setShowProfileMenu(!showProfileMenu),
                  className: "flex items-center space-x-2 text-gray-700 hover:text-orange-500",
                  children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-9 h-9 bg-red-500 rounded-full flex items-center justify-center text-white font-bold", children: (user == null ? void 0 : user.fullName) ? user.fullName.charAt(0).toUpperCase() : "U" }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium text-sm", children: (user == null ? void 0 : user.fullName) || "User" })
                  ]
                }
              ),
              showProfileMenu && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "absolute right-0 top-full mt-2 w-64 bg-white shadow-2xl rounded-xl border z-50 overflow-hidden", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-gradient-to-r from-blue-500 to-blue-600 p-4 text-white", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-12 h-12 bg-white rounded-full flex items-center justify-center text-blue-600 font-bold text-lg", children: (user == null ? void 0 : user.fullName) ? user.fullName.charAt(0).toUpperCase() : "U" }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-base", children: (user == null ? void 0 : user.fullName) || "User" }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs opacity-90", children: (user == null ? void 0 : user.phone) || (user == null ? void 0 : user.email) || "Welcome" })
                  ] })
                ] }) }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "py-2", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs(
                    "button",
                    {
                      onClick: () => {
                        navigate("/profile");
                        setShowProfileMenu(false);
                      },
                      className: "w-full px-4 py-3 text-left hover:bg-gray-50 flex items-center gap-3 transition",
                      children: [
                        /* @__PURE__ */ jsxRuntimeExports.jsx(User, { size: 18, className: "text-gray-600" }),
                        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium text-gray-800", children: "My Profile" }),
                          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: "View and edit profile" })
                        ] })
                      ]
                    }
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border-t my-2" }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs(
                    "button",
                    {
                      onClick: async () => {
                        setShowProfileMenu(false);
                        try {
                          await dispatch(logoutUser()).unwrap();
                          navigate("/");
                        } catch (err) {
                          console.error("Logout error:", err);
                          navigate("/");
                        }
                      },
                      className: "w-full px-4 py-3 text-left hover:bg-red-50 flex items-center gap-3 transition text-red-600",
                      children: [
                        /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }),
                          /* @__PURE__ */ jsxRuntimeExports.jsx("polyline", { points: "16 17 21 12 16 7" }),
                          /* @__PURE__ */ jsxRuntimeExports.jsx("line", { x1: "21", y1: "12", x2: "9", y2: "12" })
                        ] }),
                        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium", children: "Logout" }),
                          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs opacity-75", children: "Sign out of account" })
                        ] })
                      ]
                    }
                  )
                ] })
              ] })
            ]
          }
        ),
        !isLoggedIn ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: "relative",
            onMouseEnter: () => setShowLoginDropdown(true),
            onMouseLeave: () => setShowLoginDropdown(false),
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs(
                "button",
                {
                  onClick: () => {
                    setIntendedRoute("/profile");
                    setIsLoginOpen(true);
                  },
                  className: "flex items-center space-x-2 px-3 py-2 mr-6 border border-blue-500 text-blue-500 rounded-md font-medium hover:bg-blue-500 hover:text-white transition",
                  children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(User, { size: 18 }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("nav.loginSignup", "Login / Signup") })
                  ]
                }
              ),
              showLoginDropdown && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "absolute right-0 top-full mt-0 w-80 bg-white shadow-2xl rounded-2xl p-5 border z-50", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-lg font-semibold text-gray-900", children: "Hey Traveller" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500 mt-1 mb-4", children: "Get exclusive deals & Manage your trips" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "button",
                  {
                    onClick: () => {
                      setIntendedRoute("/profile");
                      setIsLoginOpen(true);
                    },
                    className: "w-full bg-blue-600 text-white py-2.5 rounded-lg font-semibold hover:bg-blue-700 mb-4",
                    children: "Login/Sign Up"
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "space-y-4", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex gap-3 cursor-pointer", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(Tag, { size: 18, className: "text-gray-500" }),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-semibold text-gray-600", children: "Offers" }),
                      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500 -mt-0.5", children: "Handpicked best deals" })
                    ] })
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex gap-3 cursor-pointer", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(Briefcase, { size: 18, className: "text-gray-500" }),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-semibold text-gray-700 ", children: "My Trips" }),
                      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500 -mt-0.5", children: "Manage your bookings" })
                    ] })
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex gap-3 cursor-pointer", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(Gift, { size: 18, className: "text-gray-500" }),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-semibold text-gray-700", children: "Gift Cards" }),
                      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500 -mt-0.5", children: "Claim your gift cards" })
                    ] })
                  ] })
                ] })
              ] })
            ]
          }
        ) : null
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "md:hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setIsOpen(!isOpen), children: isOpen ? /* @__PURE__ */ jsxRuntimeExports.jsx(X, { size: 26 }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Menu, { size: 26 }) }) })
    ] }) }),
    showAutoPopup && !isLoggedIn && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "fixed top-16 right-44 bg-white shadow-2xl rounded-2xl p-4 w-64 z-[9999] border", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          className: "w-full bg-blue-600 text-white text-center py-2 rounded-lg font-semibold text-sm",
          onClick: () => {
            setIsLoginOpen(true);
            setShowAutoPopup(false);
          },
          children: "LOGIN/SIGNUP"
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-3 bg-green-50 mt-3 p-3 rounded-lg", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "img",
          {
            src: "https://img.icons8.com/color/48/gift.png",
            alt: "gift",
            className: "w-8 h-8"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-green-700 text-sm", children: "Upto 10% OFF*" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-600 -mt-0.5", children: "on your first Cab booking" })
        ] })
      ] })
    ] }),
    isLoginOpen && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-0", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "hidden md:flex flex-col justify-between w-[40%] h-[420px] p-8 text-white bg-gradient-to-b from-[#c1d3ff] via-[#faf0ff] to-[#eaf3f3] rounded-2xl shadow-xl relative left-6", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-xs font-semibold mb-6 tracking-wider text-black", children: "UNLOCK THESE BENEFITS" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "space-y-6 text-sm", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-start space-x-3", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "img",
                {
                  src: "https://img.icons8.com/color/48/000000/money-bag.png",
                  alt: "",
                  className: "w-7 h-7"
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-lg text-black", children: "Earn goCash" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "opacity-90 text-black", children: "Earn 100 goCash on Sign Up & Cashback on Bookings" })
              ] })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-start space-x-3", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "img",
                {
                  src: "https://img.icons8.com/color/48/000000/loyalty-card.png",
                  alt: "",
                  className: "w-7 h-7"
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-lg text-black", children: "Loyalty Benefits" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "opacity-90 text-black", children: "Extra Discounts, Free Seat Selection etc." })
              ] })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-start space-x-3", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "img",
                {
                  src: "https://img.icons8.com/color/48/000000/gift.png",
                  alt: "",
                  className: "w-7 h-7"
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-lg text-black", children: "Exclusive Offers" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "opacity-90 text-black", children: "Daily Steal Deals & Special Discounts" })
              ] })
            ] })
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-8 bg-white rounded-lg shadow p-4 text-left", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-bold text-indigo-600 text-sm", children: "Upto 10% OFF*" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-600", children: "on your first Cab booking" })
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-[40%] h-[460px] bg-white p-8 relative rounded-2xl shadow-xl", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            onClick: resetModal,
            className: "absolute top-4 right-4 text-gray-500 hover:text-black",
            children: "X"
          }
        ),
        loginStep === "phone" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-2xl font-bold mb-6 text-black", children: "Login/Signup" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-sm font-medium mb-2 text-green-600", children: "Enter your Mobile Number" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center border-2 border-green-500 rounded-lg px-3 py-2 mb-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "img",
              {
                src: "https://flagcdn.com/w20/in.png",
                alt: "India",
                className: "w-5 h-5 mr-2"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "mr-2 text-black", children: "+91" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "input",
              {
                type: "text",
                value: phoneNumber,
                onChange: (e2) => {
                  const value = e2.target.value.replace(/\D/g, "");
                  if (value.length <= 10) setPhoneNumber(value);
                },
                maxLength: 10,
                className: "flex-1 outline-none text-black font-bold",
                placeholder: "0000**0000"
              }
            ),
            phoneNumber.length === 10 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-green-600 font-bold text-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(BadgeCheck, {}) })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              onClick: handlePhoneSubmit,
              className: "w-full bg-orange-500 text-white py-3 rounded-md font-semibold mt-8",
              disabled: phoneNumber.length < 10,
              children: "Continue"
            }
          ),
          ((_b = socialConfig == null ? void 0 : socialConfig.google) == null ? void 0 : _b.enabled) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3 my-4", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 h-px bg-gray-300" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs text-gray-500 font-medium", children: "OR" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 h-px bg-gray-300" })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              GoogleLogin,
              {
                onSuccess: handleGoogleSuccess,
                onError: handleGoogleError,
                useOneTap: false,
                theme: "outline",
                size: "large",
                text: "signin_with",
                shape: "rectangular",
                width: "100%"
              }
            ) })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-700 mt-8", children: [
            "By proceeding, you agree to EasyRide's",
            " ",
            /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "#", className: "text-blue-500 underline", children: "Privacy Policy" }),
            ",",
            " ",
            /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "#", className: "text-blue-500 underline", children: "User Agreement" }),
            " ",
            "and",
            " ",
            /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "#", className: "text-blue-500 underline", children: "Terms of Service" }),
            "."
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-6 text-center border-t pt-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm font-medium text-gray-600", children: [
            "New to EasyRide?",
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "span",
              {
                className: "text-orange-600 font-bold ml-1 cursor-pointer hover:underline",
                onClick: () => {
                  resetModal();
                  navigate("/register");
                },
                children: "Create an Account"
              }
            )
          ] }) })
        ] }),
        loginStep === "otp" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-2xl font-bold mb-4 text-black", children: "Verify OTP" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mb-3 text-sm text-black", children: [
            "Enter 6 digit OTP sent to",
            " ",
            /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "font-semibold", children: [
              "+91-",
              phoneNumber
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                className: "ml-2 text-blue-500 hover:underline text-xs",
                onClick: () => setLoginStep("phone"),
                children: "Edit"
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex space-x-2 justify-center mb-6 text-black", children: otp.map((digit, i2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
            "input",
            {
              ref: (el) => otpInputs.current[i2] = el,
              type: "text",
              maxLength: 1,
              value: digit,
              onChange: (e2) => {
                const val = e2.target.value;
                if (/^[0-9]$/.test(val) || val === "") {
                  const newOtp = [...otp];
                  newOtp[i2] = val;
                  setOtp(newOtp);
                  if (val !== "" && i2 < 5) {
                    otpInputs.current[i2 + 1].focus();
                  }
                }
              },
              onKeyDown: (e2) => {
                if (e2.key === "Backspace" && !otp[i2] && i2 > 0) {
                  otpInputs.current[i2 - 1].focus();
                }
              },
              className: "w-10 h-10 md:w-12 md:h-12 text-center border-2 border-blue-400 rounded-md text-lg font-semibold focus:border-blue-500 focus:ring-1 focus:ring-blue-500 outline-none"
            },
            i2
          )) }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-sm mb-4 text-gray-700", children: [
            "Didn't get the OTP?",
            " ",
            countdown > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
              "Resend in",
              " ",
              /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "font-semibold", children: [
                "00:",
                countdown.toString().padStart(2, "0")
              ] })
            ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold text-green-600", children: "You can resend now" })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3 mb-5", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "button",
              {
                className: `flex items-center gap-2 px-4 py-2 text-sm border rounded-md ${countdown > 0 ? "text-gray-400 border-gray-300 cursor-not-allowed" : "text-green-600 border-green-500 hover:bg-green-50"}`,
                disabled: countdown > 0,
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "img",
                    {
                      src: "https://img.icons8.com/color/20/whatsapp.png",
                      alt: "WhatsApp"
                    }
                  ),
                  "WhatsApp"
                ]
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "button",
              {
                onClick: handleResendOtp,
                className: `flex items-center gap-2 px-4 py-2 text-sm border rounded-md ${countdown > 0 ? "text-gray-400 border-gray-300 cursor-not-allowed" : "text-blue-600 border-blue-500 hover:bg-blue-50"}`,
                disabled: countdown > 0,
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "img",
                    {
                      src: "https://img.icons8.com/ios-filled/20/1E90FF/sms.png",
                      alt: "SMS"
                    }
                  ),
                  "SMS"
                ]
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              onClick: handleVerify,
              className: "w-full bg-green-500 hover:bg-green-600 text-white py-3 rounded-md font-semibold mb-4",
              children: "Verify & Login"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-800 text-center", children: "I agree to receive critical messages such as OTP, booking details on WhatsApp." })
        ] })
      ] })
    ] }) })
  ] });
};
const Footer = () => {
  useDispatch();
  const { footer: footer2 } = useSelector((state) => state.cms);
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-white py-10", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 md:px-12 lg:px-20", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-8 mb-12 text-center sm:text-left", children: footer2.map((section) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-black font-semibold text-base mb-4", children: section.title }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2", children: section.links.map((link, index2) => link.url.startsWith("http") ? /* @__PURE__ */ jsxRuntimeExports.jsx(
        "a",
        {
          href: link.url,
          className: "block text-gray-600 text-sm hover:text-gray-800",
          target: "_blank",
          rel: "noopener noreferrer",
          children: link.label
        },
        index2
      ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
        Link,
        {
          to: link.url,
          className: "block text-gray-600 text-sm hover:text-gray-800",
          children: link.label
        },
        index2
      )) })
    ] }, section._id || section.order)) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col sm:flex-row justify-between items-center pt-6 border-t border-gray-200 gap-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col sm:flex-row items-center sm:space-x-4 space-y-3 sm:space-y-0", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-black font-medium text-sm", children: "FOLLOW US ON" }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex space-x-3", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-8 h-8 bg-black rounded-full flex items-center justify-center cursor-pointer hover:bg-gray-700 transition", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white text-sm font-bold", children: "f" }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-8 h-8 bg-black rounded-full flex items-center justify-center cursor-pointer hover:bg-gray-700 transition", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white text-sm font-bold", children: "t" }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-8 h-8 bg-black rounded-full flex items-center justify-center cursor-pointer hover:bg-gray-700 transition", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white text-sm font-bold", children: "▶" }) })
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center sm:text-right", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-black text-sm", children: [
        "© ",
        (/* @__PURE__ */ new Date()).getFullYear(),
        " Easy Ride"
      ] }) })
    ] })
  ] }) });
};
function FaWhatsapp(props) {
  return GenIcon({ "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z" }, "child": [] }] })(props);
}
function FaArrowDown(props) {
  return GenIcon({ "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z" }, "child": [] }] })(props);
}
function FaArrowRight(props) {
  return GenIcon({ "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z" }, "child": [] }] })(props);
}
function FaCarSide(props) {
  return GenIcon({ "attr": { "viewBox": "0 0 640 512" }, "child": [{ "tag": "path", "attr": { "d": "M544 192h-16L419.22 56.02A64.025 64.025 0 0 0 369.24 32H155.33c-26.17 0-49.7 15.93-59.42 40.23L48 194.26C20.44 201.4 0 226.21 0 256v112c0 8.84 7.16 16 16 16h48c0 53.02 42.98 96 96 96s96-42.98 96-96h128c0 53.02 42.98 96 96 96s96-42.98 96-96h48c8.84 0 16-7.16 16-16v-80c0-53.02-42.98-96-96-96zM160 432c-26.47 0-48-21.53-48-48s21.53-48 48-48 48 21.53 48 48-21.53 48-48 48zm72-240H116.93l38.4-96H232v96zm48 0V96h89.24l76.8 96H280zm200 240c-26.47 0-48-21.53-48-48s21.53-48 48-48 48 21.53 48 48-21.53 48-48 48z" }, "child": [] }] })(props);
}
function FaChevronLeft(props) {
  return GenIcon({ "attr": { "viewBox": "0 0 320 512" }, "child": [{ "tag": "path", "attr": { "d": "M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z" }, "child": [] }] })(props);
}
function FaChevronRight(props) {
  return GenIcon({ "attr": { "viewBox": "0 0 320 512" }, "child": [{ "tag": "path", "attr": { "d": "M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z" }, "child": [] }] })(props);
}
function FaClock(props) {
  return GenIcon({ "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M256,8C119,8,8,119,8,256S119,504,256,504,504,393,504,256,393,8,256,8Zm92.49,313h0l-20,25a16,16,0,0,1-22.49,2.5h0l-67-49.72a40,40,0,0,1-15-31.23V112a16,16,0,0,1,16-16h32a16,16,0,0,1,16,16V256l58,42.5A16,16,0,0,1,348.49,321Z" }, "child": [] }] })(props);
}
function FaLocationArrow(props) {
  return GenIcon({ "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M444.52 3.52L28.74 195.42c-47.97 22.39-31.98 92.75 19.19 92.75h175.91v175.91c0 51.17 70.36 67.17 92.75 19.19l191.9-415.78c15.99-38.39-25.59-79.97-63.97-63.97z" }, "child": [] }] })(props);
}
function FaPhoneAlt(props) {
  return GenIcon({ "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M497.39 361.8l-112-48a24 24 0 0 0-28 6.9l-49.6 60.6A370.66 370.66 0 0 1 130.6 204.11l60.6-49.6a23.94 23.94 0 0 0 6.9-28l-48-112A24.16 24.16 0 0 0 122.6.61l-104 24A24 24 0 0 0 0 48c0 256.5 207.9 464 464 464a24 24 0 0 0 23.4-18.6l24-104a24.29 24.29 0 0 0-14.01-27.6z" }, "child": [] }] })(props);
}
function FaSearch(props) {
  return GenIcon({ "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z" }, "child": [] }] })(props);
}
function FaShieldAlt(props) {
  return GenIcon({ "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M466.5 83.7l-192-80a48.15 48.15 0 0 0-36.9 0l-192 80C27.7 91.1 16 108.6 16 128c0 198.5 114.5 335.7 221.5 380.3 11.8 4.9 25.1 4.9 36.9 0C360.1 472.6 496 349.3 496 128c0-19.4-11.7-36.9-29.5-44.3zM256.1 446.3l-.1-381 175.9 73.3c-3.3 151.4-82.1 261.1-175.8 307.7z" }, "child": [] }] })(props);
}
function FaStar(props) {
  return GenIcon({ "attr": { "viewBox": "0 0 576 512" }, "child": [{ "tag": "path", "attr": { "d": "M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z" }, "child": [] }] })(props);
}
function FaThumbsUp(props) {
  return GenIcon({ "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M104 224H24c-13.255 0-24 10.745-24 24v240c0 13.255 10.745 24 24 24h80c13.255 0 24-10.745 24-24V248c0-13.255-10.745-24-24-24zM64 472c-13.255 0-24-10.745-24-24s10.745-24 24-24 24 10.745 24 24-10.745 24-24 24zM384 81.452c0 42.416-25.97 66.208-33.277 94.548h101.723c33.397 0 59.397 27.746 59.553 58.098.084 17.938-7.546 37.249-19.439 49.197l-.11.11c9.836 23.337 8.237 56.037-9.308 79.469 8.681 25.895-.069 57.704-16.382 74.757 4.298 17.598 2.244 32.575-6.148 44.632C440.202 511.587 389.616 512 346.839 512l-2.845-.001c-48.287-.017-87.806-17.598-119.56-31.725-15.957-7.099-36.821-15.887-52.651-16.178-6.54-.12-11.783-5.457-11.783-11.998v-213.77c0-3.2 1.282-6.271 3.558-8.521 39.614-39.144 56.648-80.587 89.117-113.111 14.804-14.832 20.188-37.236 25.393-58.902C282.515 39.293 291.817 0 312 0c24 0 72 8 72 81.452z" }, "child": [] }] })(props);
}
function FaTimes(props) {
  return GenIcon({ "attr": { "viewBox": "0 0 352 512" }, "child": [{ "tag": "path", "attr": { "d": "M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z" }, "child": [] }] })(props);
}
function FaTrophy(props) {
  return GenIcon({ "attr": { "viewBox": "0 0 576 512" }, "child": [{ "tag": "path", "attr": { "d": "M552 64H448V24c0-13.3-10.7-24-24-24H152c-13.3 0-24 10.7-24 24v40H24C10.7 64 0 74.7 0 88v56c0 35.7 22.5 72.4 61.9 100.7 31.5 22.7 69.8 37.1 110 41.7C203.3 338.5 240 360 240 360v72h-48c-35.3 0-64 20.7-64 56v12c0 6.6 5.4 12 12 12h296c6.6 0 12-5.4 12-12v-12c0-35.3-28.7-56-64-56h-48v-72s36.7-21.5 68.1-73.6c40.3-4.6 78.6-19 110-41.7 39.3-28.3 61.9-65 61.9-100.7V88c0-13.3-10.7-24-24-24zM99.3 192.8C74.9 175.2 64 155.6 64 144v-16h64.2c1 32.6 5.8 61.2 12.8 86.2-15.1-5.2-29.2-12.4-41.7-21.4zM512 144c0 16.1-17.7 36.1-35.3 48.8-12.5 9-26.7 16.2-41.8 21.4 7-25 11.8-53.6 12.8-86.2H512v16z" }, "child": [] }] })(props);
}
const geocodeLocation = async (locationName) => {
  if (!locationName) return null;
  const apiKey = "AIzaSyApScjr-d4tWLaUijMEzlnGSUIc46MlrZs";
  try {
    const response = await fetch(
      `https://maps.googleapis.com/maps/api/geocode/json?address=${encodeURIComponent(locationName)}&key=${apiKey}`
    );
    const data = await response.json();
    if (data.status === "OK" && data.results && data.results.length > 0) {
      const result = data.results[0];
      const { lat, lng } = result.geometry.location;
      console.log(`Geocoded "${locationName}" via Google Maps:`, result.formatted_address);
      return {
        lat,
        lng,
        displayName: result.formatted_address
      };
    } else {
      console.error("Google Maps Geocoding failed:", data.status, data.error_message || "");
    }
  } catch (error) {
    console.error("Google Maps API error:", error);
  }
  console.warn(`Geocoding failed for "${locationName}".`);
  return null;
};
const calculateDistance = (lat1, lon1, lat2, lon2) => {
  if (!lat1 || !lon1 || !lat2 || !lon2) return 0;
  const R = 6371;
  const dLat = (lat2 - lat1) * Math.PI / 180;
  const dLon = (lon2 - lon1) * Math.PI / 180;
  const a2 = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) * Math.sin(dLon / 2) * Math.sin(dLon / 2);
  const c2 = 2 * Math.atan2(Math.sqrt(a2), Math.sqrt(1 - a2));
  return Math.round(R * c2);
};
const LocationAutocomplete = ({
  value,
  onChange,
  placeholder = "Enter location",
  label,
  className = "",
  onLocationSelect
}) => {
  const [suggestions, setSuggestions] = reactExports.useState([]);
  const [showSuggestions, setShowSuggestions] = reactExports.useState(false);
  const [loading, setLoading] = reactExports.useState(false);
  const [recentSearches, setRecentSearches] = reactExports.useState([]);
  const [gettingLocation, setGettingLocation] = reactExports.useState(false);
  const wrapperRef = reactExports.useRef(null);
  const autocompleteService = reactExports.useRef(null);
  const placesService = reactExports.useRef(null);
  const geocoder = reactExports.useRef(null);
  reactExports.useEffect(() => {
    if (window.google && window.google.maps) {
      autocompleteService.current = new window.google.maps.places.AutocompleteService();
      geocoder.current = new window.google.maps.Geocoder();
      const dummyDiv = document.createElement("div");
      placesService.current = new window.google.maps.places.PlacesService(dummyDiv);
    }
  }, []);
  reactExports.useEffect(() => {
    const saved = localStorage.getItem("recentLocationSearches");
    if (saved) {
      try {
        setRecentSearches(JSON.parse(saved));
      } catch (e2) {
        setRecentSearches([]);
      }
    }
  }, []);
  reactExports.useEffect(() => {
    const handleClickOutside = (event) => {
      if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
        setShowSuggestions(false);
      }
    };
    document.addEventListener("mousedown", handleClickOutside);
    return () => document.removeEventListener("mousedown", handleClickOutside);
  }, []);
  const saveToRecent = (location) => {
    const newRecent = [
      location,
      ...recentSearches.filter((item) => item.display_name !== location.display_name)
    ].slice(0, 5);
    setRecentSearches(newRecent);
    localStorage.setItem("recentLocationSearches", JSON.stringify(newRecent));
  };
  const getCurrentLocation = () => {
    if (!navigator.geolocation) {
      alert("Geolocation is not supported by your browser");
      return;
    }
    setGettingLocation(true);
    navigator.geolocation.getCurrentPosition(
      async (position) => {
        const { latitude, longitude } = position.coords;
        if (!geocoder.current) {
          alert("Google Maps not loaded");
          setGettingLocation(false);
          return;
        }
        try {
          geocoder.current.geocode(
            { location: { lat: latitude, lng: longitude } },
            (results, status) => {
              setGettingLocation(false);
              if (status === "OK" && results[0]) {
                const locationData = {
                  display_name: results[0].formatted_address,
                  lat: latitude,
                  lon: longitude,
                  type: "current_location",
                  place_id: results[0].place_id
                };
                onChange(results[0].formatted_address);
                saveToRecent(locationData);
                setShowSuggestions(false);
              } else {
                alert("Could not get your location address");
              }
            }
          );
        } catch (error) {
          setGettingLocation(false);
          console.error("Error getting location name:", error);
          alert("Could not get your location address");
        }
      },
      (error) => {
        setGettingLocation(false);
        console.error("Error getting location:", error);
        alert("Could not access your location. Please enable location services.");
      },
      {
        enableHighAccuracy: true,
        timeout: 1e4,
        maximumAge: 0
      }
    );
  };
  const fetchSuggestions = async (query) => {
    if (!query || query.length < 2) {
      setSuggestions([]);
      return;
    }
    if (!autocompleteService.current) {
      console.error("Google Maps AutocompleteService not initialized");
      return;
    }
    setLoading(true);
    try {
      autocompleteService.current.getPlacePredictions(
        {
          input: query,
          componentRestrictions: { country: "in" },
          // Restrict to India
          types: ["geocode", "establishment"]
          // Include cities, addresses, and places
        },
        (predictions, status) => {
          setLoading(false);
          if (status === window.google.maps.places.PlacesServiceStatus.OK && predictions) {
            const formattedSuggestions = predictions.map((prediction) => ({
              display_name: prediction.description,
              place_id: prediction.place_id,
              main_text: prediction.structured_formatting.main_text,
              secondary_text: prediction.structured_formatting.secondary_text,
              types: prediction.types
            }));
            setSuggestions(formattedSuggestions);
            setShowSuggestions(true);
          } else {
            setSuggestions([]);
          }
        }
      );
    } catch (error) {
      setLoading(false);
      console.error("Error fetching suggestions:", error);
      setSuggestions([]);
    }
  };
  reactExports.useEffect(() => {
    const timer = setTimeout(() => {
      if (value && value.length >= 2) {
        fetchSuggestions(value);
      }
    }, 300);
    return () => clearTimeout(timer);
  }, [value]);
  const handleSelect = (suggestion) => {
    onChange(suggestion.display_name);
    if (onLocationSelect) {
      onLocationSelect(suggestion.display_name);
    }
    if (placesService.current && suggestion.place_id) {
      placesService.current.getDetails(
        { placeId: suggestion.place_id },
        (place, status) => {
          if (status === window.google.maps.places.PlacesServiceStatus.OK && place) {
            const locationData = {
              display_name: suggestion.display_name,
              lat: place.geometry.location.lat(),
              lon: place.geometry.location.lng(),
              place_id: suggestion.place_id,
              types: suggestion.types
            };
            saveToRecent(locationData);
          }
        }
      );
    } else {
      saveToRecent(suggestion);
    }
    setShowSuggestions(false);
    setSuggestions([]);
  };
  const getLocationIcon = (types) => {
    if (!types) return "📍";
    if (types.includes("airport")) return "✈️";
    if (types.includes("locality") || types.includes("administrative_area_level_2")) return "🏙️";
    if (types.includes("train_station") || types.includes("transit_station")) return "🚉";
    if (types.includes("bus_station")) return "🚌";
    if (types.includes("point_of_interest")) return "📌";
    return "📍";
  };
  const handleFocus = () => {
    if (!value || value.length < 2) {
      if (recentSearches.length > 0) {
        setShowSuggestions(true);
      }
    } else if (suggestions.length > 0) {
      setShowSuggestions(true);
    }
  };
  const handleKeyDown = (e2) => {
    if (e2.key === "Enter") {
      e2.preventDefault();
      if (showSuggestions && suggestions.length > 0) {
        handleSelect(suggestions[0]);
      } else {
        setShowSuggestions(false);
      }
    }
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: wrapperRef, className: "relative", children: [
    label && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 mb-1 ml-3", children: label }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "input",
        {
          type: "text",
          placeholder,
          value,
          onChange: (e2) => {
            onChange(e2.target.value);
            if (e2.target.value.length >= 2) {
              setShowSuggestions(true);
            }
          },
          onFocus: handleFocus,
          onKeyDown: handleKeyDown,
          className: `w-full text-base font-semibold p-3 pr-10 focus:outline-none border-b text-gray-900 placeholder-gray-500 ${className}`
        }
      ),
      loading && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-spin h-4 w-4 border-2 border-blue-500 border-t-transparent rounded-full" }) }),
      !loading && value && /* @__PURE__ */ jsxRuntimeExports.jsx(FaSearch, { className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm" })
    ] }),
    showSuggestions && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "absolute z-50 w-full mt-1 bg-white border border-gray-200 rounded-lg shadow-lg max-h-80 overflow-y-auto", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "div",
        {
          onClick: getCurrentLocation,
          className: "px-4 py-3 hover:bg-blue-50 cursor-pointer border-b border-gray-100 transition-colors flex items-center gap-3",
          children: [
            gettingLocation ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-spin h-4 w-4 border-2 border-blue-500 border-t-transparent rounded-full" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(FaLocationArrow, { className: "text-blue-500 text-lg" }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-blue-600 text-sm", children: gettingLocation ? "Getting your location..." : "Use Current Location" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-gray-500 mt-0.5", children: "GPS enabled location" })
            ] })
          ]
        }
      ),
      recentSearches.length > 0 && (!value || value.length < 2) && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-4 py-2 bg-gray-50 border-b border-gray-100", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-xs font-semibold text-gray-500 uppercase flex items-center gap-2", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(FaClock, { className: "text-gray-400" }),
          "Recent Searches"
        ] }) }),
        recentSearches.map((suggestion, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            onClick: () => handleSelect(suggestion),
            className: "px-4 py-3 hover:bg-gray-50 cursor-pointer border-b border-gray-100 last:border-b-0 transition-colors",
            children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-3", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xl mt-0.5", children: suggestion.type === "current_location" ? "📍" : getLocationIcon(suggestion.types) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-medium text-gray-900 text-sm line-clamp-1", children: suggestion.display_name }) })
            ] })
          },
          `recent-${index2}`
        ))
      ] }),
      value && value.length >= 2 && suggestions.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        recentSearches.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-4 py-2 bg-gray-50 border-b border-gray-100", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-xs font-semibold text-gray-500 uppercase flex items-center gap-2", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(FaSearch, { className: "text-gray-400" }),
          "Search Results"
        ] }) }),
        suggestions.map((suggestion, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            onClick: () => handleSelect(suggestion),
            className: "px-4 py-3 hover:bg-gray-50 cursor-pointer border-b border-gray-100 last:border-b-0 transition-colors",
            children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-3", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xl mt-0.5", children: getLocationIcon(suggestion.types) }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-medium text-gray-900 text-sm", children: suggestion.main_text }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-gray-500 mt-0.5 line-clamp-1", children: suggestion.secondary_text })
              ] })
            ] })
          },
          `suggestion-${index2}`
        ))
      ] }),
      value && value.length >= 2 && !loading && suggestions.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 text-center text-gray-500 text-sm", children: [
        'No locations found for "',
        value,
        '". Try a different search term.'
      ] })
    ] })
  ] });
};
const BACKEND_URL = API_BASE_URL$1.replace("/api/v1", "");
const iconMap = {
  trophy: FaTrophy,
  car: FaCarSide,
  shield: FaShieldAlt,
  star: FaStar,
  clock: FaClock,
  thumbsup: FaThumbsUp
};
const iconColorMap = {
  trophy: "text-yellow-500",
  car: "text-orange-500",
  shield: "text-green-500",
  star: "text-amber-500",
  clock: "text-blue-500",
  thumbsup: "text-indigo-500"
};
const HeroSection = ({ onSearch }) => {
  var _a, _b, _c, _d, _e;
  const { t: t2 } = useTranslation();
  const [tripType, setTripType] = reactExports.useState("oneway");
  const [stops, setStops] = reactExports.useState([]);
  const formatDate = (date) => {
    const d2 = new Date(date);
    const day = d2.getDate();
    const months2 = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
    const month = months2[d2.getMonth()];
    const year = d2.getFullYear().toString().slice(-2);
    return `${day} ${month}' ${year}`;
  };
  const [pickupDate, setPickupDate] = reactExports.useState(formatDate(/* @__PURE__ */ new Date()));
  const [pickupTime, setPickupTime] = reactExports.useState("10:00 AM");
  const [returnDate, setReturnDate] = reactExports.useState(formatDate(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() + 1))));
  const [returnTime, setReturnTime] = reactExports.useState("10:00 AM");
  const [from, setFrom] = reactExports.useState("Bhopal, Madhya Pradesh, India");
  const [to, setTo] = reactExports.useState("Ujjain mahakal mandir, Mahakal Lok Corridor Road, Bagamb...");
  const [selectedDuration, setSelectedDuration] = reactExports.useState({ hours: 4, km: 40, label: "4hrs 40km" });
  const [expanded, setExpanded] = reactExports.useState(false);
  const [showDatePicker, setShowDatePicker] = reactExports.useState(false);
  const [showTimePicker, setShowTimePicker] = reactExports.useState(false);
  const [selectedDateType, setSelectedDateType] = reactExports.useState("");
  const [viewYear, setViewYear] = reactExports.useState((/* @__PURE__ */ new Date()).getFullYear());
  const [viewMonth, setViewMonth] = reactExports.useState((/* @__PURE__ */ new Date()).getMonth());
  const dispatch = useDispatch();
  const { banners } = useSelector((state) => state.cms);
  const { settings } = useSelector((state) => state.setting);
  const heroSection = (_a = settings == null ? void 0 : settings.design) == null ? void 0 : _a.heroSection;
  reactExports.useEffect(() => {
    dispatch(getBanners());
  }, [dispatch]);
  const hourlyBanner = banners.find((b) => b.type === "hourly");
  const offerBanners = banners.filter((b) => b.type === "offer");
  const heroTitle = (heroSection == null ? void 0 : heroSection.heroTitle) || (tripType === "hourly" ? t2("hero.hourlyCarRental") : tripType === "airport" ? t2("hero.bookAirportTaxi") : t2("hero.bookOnlineCab"));
  const promoBanner = ((_b = heroSection == null ? void 0 : heroSection.promoBanner) == null ? void 0 : _b.image) ? heroSection.promoBanner : hourlyBanner ? { image: hourlyBanner.imageUrl, title: hourlyBanner.title, description: hourlyBanner.description } : null;
  const adminOfferBanners = ((_c = heroSection == null ? void 0 : heroSection.offerBanners) == null ? void 0 : _c.length) > 0 ? heroSection.offerBanners : offerBanners.map((b) => ({ image: b.imageUrl, title: b.title, description: b.description }));
  const featureCards = ((_d = heroSection == null ? void 0 : heroSection.featureCards) == null ? void 0 : _d.length) > 0 ? heroSection.featureCards : [
    { icon: "trophy", text: t2("hero.experiencedDrivers") },
    { icon: "car", text: t2("hero.cleanCabs") }
  ];
  const [offerIndex, setOfferIndex] = reactExports.useState(0);
  const visibleOffers = 2;
  const [featureIndex, setFeatureIndex] = reactExports.useState(0);
  const visibleFeatures = 2;
  const cabInfoRef = reactExports.useRef(null);
  const handleExploreClick = () => {
    cabInfoRef.current.scrollIntoView({ behavior: "smooth" });
  };
  const tripOptions = [
    { value: "oneway", label: t2("tripTypes.oneway") },
    { value: "round", label: t2("tripTypes.round") },
    { value: "airport", label: t2("tripTypes.airport") },
    { value: "hourly", label: t2("tripTypes.hourly") }
  ];
  const generateCalendarDays = (year, month) => {
    const firstDay = new Date(year, month, 1).getDay();
    const startDayIndex = (firstDay + 6) % 7;
    const daysInMonth = new Date(year, month + 1, 0).getDate();
    const days = [];
    for (let i2 = 0; i2 < startDayIndex; i2++) {
      days.push({ day: "", otherMonth: true });
    }
    const today = /* @__PURE__ */ new Date();
    today.setHours(0, 0, 0, 0);
    for (let i2 = 1; i2 <= daysInMonth; i2++) {
      const current2 = new Date(year, month, i2);
      const isPast = current2 < today;
      days.push({ day: i2, otherMonth: false, isPast });
    }
    return days;
  };
  const calendarDays = generateCalendarDays(viewYear, viewMonth);
  const monthsList = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
  const currentYearVal = (/* @__PURE__ */ new Date()).getFullYear();
  const yearsList = Array.from({ length: 6 }, (_2, i2) => currentYearVal + i2);
  const generateTimeSlots = () => {
    const times = [];
    for (let hour = 0; hour < 24; hour++) {
      for (let minute = 0; minute < 60; minute += 15) {
        const period = hour >= 12 ? "PM" : "AM";
        const displayHour = hour % 12 || 12;
        const timeString = `${displayHour}:${minute.toString().padStart(2, "0")} ${period}`;
        times.push(timeString);
      }
    }
    return times;
  };
  const timeSlots = generateTimeSlots();
  const addStop = () => {
    setStops([...stops, { id: Date.now(), value: "" }]);
  };
  const removeStop = (id) => {
    setStops(stops.filter((stop) => stop.id !== id));
  };
  const handleStopChange = (id, newValue) => {
    setStops(
      stops.map(
        (stop) => stop.id === id ? { ...stop, value: newValue } : stop
      )
    );
  };
  const handleSwap = () => {
    setFrom((prevFrom) => {
      const oldFrom = prevFrom;
      setTo(oldFrom);
      return to;
    });
  };
  const handleDateSelect = (dayObj) => {
    if (dayObj && !dayObj.otherMonth && !dayObj.isPast) {
      const selectedDate = new Date(viewYear, viewMonth, dayObj.day);
      const formatted = formatDate(selectedDate);
      if (selectedDateType === "pickup") {
        setPickupDate(formatted);
      } else if (selectedDateType === "return") {
        setReturnDate(formatted);
      }
      setShowDatePicker(false);
    }
  };
  const handleTimeSelect = (time, type) => {
    if (type === "pickup") {
      setPickupTime(time);
    } else if (type === "return") {
      setReturnTime(time);
    }
    setShowTimePicker(false);
  };
  const openDatePicker = (type) => {
    setSelectedDateType(type);
    setShowDatePicker(true);
  };
  const openTimePicker = (type) => {
    setSelectedDateType(type);
    setShowTimePicker(true);
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "w-full bg-[#eff3f8] pb-10 font-bold", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full h-80 bg-[#da6702] rounded-b-[80%] pt-8 px-4 md:px-36 text-black relative font-bold", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "absolute text-white font-extrabold text-2xl ml-10", children: tripType === "hourly" ? t2("hero.hourlyCarRental") : tripType === "airport" ? t2("hero.bookAirportTaxi") : heroTitle }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "div",
        {
          className: "absolute top-1/2 left-1/2 -translate-x-1/2 \r\n                w-full max-w-7xl px-4 sm:px-6 \r\n                flex flex-col lg:flex-row gap-6 m-auto \r\n                justify-center font-bold",
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "div",
              {
                className: "bg-white shadow-xl rounded-xl p-4 sm:p-6 \r\n                  w-full sm:w-[550px] -mt-20 border \r\n                  transform transition-all duration-300 \r\n                  hover:shadow-2xl hover:-translate-y-1 flex flex-col",
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex gap-6 mb-6 font-extrabold", children: tripOptions.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
                    "label",
                    {
                      className: "flex items-center gap-2 cursor-pointer",
                      children: [
                        /* @__PURE__ */ jsxRuntimeExports.jsx(
                          "input",
                          {
                            type: "radio",
                            name: "tripType",
                            checked: tripType === option.value,
                            onChange: () => setTripType(option.value),
                            className: "text-blue-900 focus:ring-blue-900"
                          }
                        ),
                        /* @__PURE__ */ jsxRuntimeExports.jsx(
                          "h3",
                          {
                            className: `text-lg sm:text-xl ${tripType === option.value ? "text-blue-600 font-bold" : "text-gray-700 font-bold"}`,
                            children: option.label
                          }
                        )
                      ]
                    },
                    option.value
                  )) }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-3 relative", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      LocationAutocomplete,
                      {
                        value: from,
                        onChange: setFrom,
                        placeholder: t2("hero.enterPickup"),
                        label: t2("hero.from")
                      }
                    ),
                    tripType !== "hourly" && /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "button",
                      {
                        type: "button",
                        onClick: handleSwap,
                        className: "absolute right-3 top-9 rounded-full p-2 transition h-10 w-10 mt-2 z-10",
                        "aria-label": "Swap from and to",
                        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                          "svg",
                          {
                            xmlns: "https://www.w3.org/2000/svg",
                            viewBox: "0 0 28 28",
                            fill: "#647a97",
                            width: "3.2rem",
                            height: "3.2rem",
                            className: "SwapIcon-sc-1lqocom-0 jykNmC",
                            children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                              "path",
                              {
                                d: "M28 14c0-7.732-6.268-14-14-14S0 6.268 0 14s6.268 14 14 14c7.729-.008 13.992-6.271 14-14zm-14.11-3.589c-.192.41-.604.672-1.057.672h-1.458a.292.292 0 00-.292.292v4.375a1.167 1.167 0 11-2.333 0v-4.375a.292.292 0 00-.292-.292H7a1.166 1.166 0 01-.896-1.913l2.917-3.5a1.166 1.166 0 011.793 0l2.916 3.5c.29.348.352.832.16 1.241zm.11 7.672c0-.644.522-1.166 1.167-1.166h1.458c.161 0 .292-.13.292-.292V12.25a1.167 1.167 0 112.333 0v4.375c0 .161.13.292.292.292H21a1.166 1.166 0 01.897 1.913l-2.916 3.5a1.168 1.168 0 01-1.794 0l-2.916-3.5a1.172 1.172 0 01-.271-.747z",
                                fill: "#647A97",
                                fillRule: "nonzero"
                              }
                            )
                          }
                        )
                      }
                    ),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "mt-2" })
                  ] }),
                  tripType !== "hourly" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-3", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      LocationAutocomplete,
                      {
                        value: to,
                        onChange: setTo,
                        placeholder: t2("hero.enterDrop"),
                        label: t2("hero.to")
                      }
                    ),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("hr", {})
                  ] }),
                  tripType !== "airport" && tripType !== "hourly" && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
                    stops.map((stop, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative mb-3", children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx(
                        LocationAutocomplete,
                        {
                          value: stop.value,
                          onChange: (newValue) => handleStopChange(stop.id, newValue),
                          placeholder: `${t2("tripDetails.stop")} ${index2 + 1}`,
                          label: `${t2("tripDetails.stop")} ${index2 + 1}`
                        }
                      ),
                      /* @__PURE__ */ jsxRuntimeExports.jsx(
                        "button",
                        {
                          type: "button",
                          onClick: () => removeStop(stop.id),
                          className: "absolute right-3 top-9 text-gray-400 hover:text-red-500 text-lg z-10",
                          children: "X"
                        }
                      ),
                      /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "mt-2" })
                    ] }, stop.id)),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs(
                      "p",
                      {
                        onClick: addStop,
                        className: "text-blue-700 text-sm font-medium cursor-pointer mb-4",
                        children: [
                          t2("hero.addStops"),
                          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-1 bg-pink-600 text-white text-[10px] px-1.5 py-0.5 rounded", children: t2("hero.new") })
                        ]
                      }
                    )
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mt-2", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cursor-pointer", onClick: () => openDatePicker("pickup"), children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: t2("hero.pickupDate") }),
                      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-bold text-base", children: pickupDate })
                    ] }),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cursor-pointer", onClick: () => openTimePicker("pickup"), children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: t2("hero.pickupTime") }),
                      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-bold text-base flex items-center", children: [
                        pickupTime,
                        /* @__PURE__ */ jsxRuntimeExports.jsx(FaArrowDown, { className: "w-3 h-3 ml-1" })
                      ] })
                    ] })
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("hr", {}),
                  tripType === "round" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mt-4", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cursor-pointer", onClick: () => openDatePicker("return"), children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: t2("hero.returnDate") }),
                      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-bold text-base", children: returnDate })
                    ] }),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cursor-pointer", onClick: () => openTimePicker("return"), children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: t2("hero.returnTime") }),
                      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-bold text-base flex items-center", children: [
                        returnTime,
                        /* @__PURE__ */ jsxRuntimeExports.jsx(FaArrowDown, { className: "w-3 h-3 ml-1" })
                      ] })
                    ] })
                  ] }),
                  tripType === "hourly" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500 mb-2", children: t2("hero.selectPackage") || "Select Package" }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-3 flex-wrap", children: [
                      { hours: 2, km: 20, label: "2hrs 20km" },
                      { hours: 4, km: 40, label: "4hrs 40km" },
                      { hours: 8, km: 80, label: "8hrs 80km" },
                      { hours: 12, km: 120, label: "12hrs 120km" },
                      { hours: 24, km: 300, label: "24hrs 300km" }
                    ].map((pkg) => /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "button",
                      {
                        onClick: () => setSelectedDuration(pkg),
                        className: `px-4 py-2 rounded-lg font-bold text-sm border transition-all ${(selectedDuration == null ? void 0 : selectedDuration.hours) === pkg.hours ? "border-2 border-blue-500 text-blue-600 bg-blue-50" : "border-gray-200 text-gray-700 hover:border-gray-300"}`,
                        children: pkg.label
                      },
                      pkg.label
                    )) })
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-center mt-auto -mb-12 pt-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "button",
                    {
                      onClick: async () => {
                        if (!from || from.trim() === "") {
                          n.error("Please enter pickup location");
                          return;
                        }
                        if (tripType !== "hourly" && (!to || to.trim() === "")) {
                          n.error("Please enter drop location");
                          return;
                        }
                        if (tripType === "hourly" && !selectedDuration) {
                          n.error("Please select a rental package");
                          return;
                        }
                        n.loading("Finding cabs...", { id: "search-loading" });
                        try {
                          const sourceCoords = await geocodeLocation(from);
                          if (!sourceCoords) {
                            n.dismiss("search-loading");
                            n.error(`Could not find location: ${from}`);
                            return;
                          }
                          let destCoords = null;
                          let distance = 0;
                          if (tripType !== "hourly") {
                            destCoords = await geocodeLocation(to);
                            if (!destCoords) {
                              n.dismiss("search-loading");
                              n.error(`Could not find location: ${to}`);
                              return;
                            }
                            distance = 0;
                          }
                          n.dismiss("search-loading");
                          onSearch({
                            from,
                            to: tripType === "hourly" ? from : to,
                            // For hourly rental, same city as source
                            tripType: tripType === "oneway" ? "oneWay" : tripType === "round" ? "roundTrip" : tripType === "hourly" ? "rental" : tripType,
                            pickupDate,
                            pickupTime,
                            returnDate: tripType === "round" ? returnDate : void 0,
                            sourceLat: sourceCoords.lat,
                            sourceLong: sourceCoords.lng,
                            destLat: (destCoords == null ? void 0 : destCoords.lat) || sourceCoords.lat,
                            destLong: (destCoords == null ? void 0 : destCoords.lng) || sourceCoords.lng,
                            distance: 0,
                            // Let backend calculate actual road distance
                            fuelType: "petrol",
                            isAc: true,
                            startTime: (/* @__PURE__ */ new Date()).toISOString(),
                            rentalPackage: tripType === "hourly" ? {
                              hours: selectedDuration.hours,
                              distance: selectedDuration.km
                            } : void 0
                          });
                        } catch (error) {
                          n.dismiss("search-loading");
                          n.error("Search failed. Please try again.");
                          console.error("Search error:", error);
                        }
                      },
                      className: "w-full sm:w-52 font-h4 bg-orange-500 hover:bg-orange-600 text-white font-bold py-4 rounded-full transition-all duration-300 flex items-center justify-center gap-2 shadow-md hover:shadow-lg",
                      children: t2("hero.searchCabs")
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full lg:w-[600px] flex flex-col gap-4 mt-4 lg:-mt-20", children: [
              promoBanner && promoBanner.image && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative rounded-xl shadow-lg overflow-hidden", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "img",
                  {
                    className: "h-[200px] w-full object-cover",
                    src: ((_e = promoBanner.image) == null ? void 0 : _e.startsWith("http")) ? promoBanner.image : `${BACKEND_URL}/${promoBanner.image}`,
                    alt: promoBanner.title || "Promotional Banner"
                  }
                ),
                (promoBanner.title || promoBanner.description) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "absolute inset-0 bg-gradient-to-r from-black/50 to-transparent flex flex-col justify-center p-6", children: [
                  promoBanner.title && /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-white font-bold text-lg mb-1", children: promoBanner.title }),
                  promoBanner.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white/80 text-sm", children: promoBanner.description })
                ] })
              ] }),
              adminOfferBanners.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4 w-full", children: adminOfferBanners.slice(offerIndex, offerIndex + visibleOffers).map((offer, idx) => {
                  var _a2;
                  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white shadow-md rounded-lg overflow-hidden hover:shadow-lg transition", children: [
                    offer.image && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-24 bg-blue-100 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "img",
                      {
                        src: ((_a2 = offer.image) == null ? void 0 : _a2.startsWith("http")) ? offer.image : `${BACKEND_URL}/${offer.image}`,
                        alt: offer.title || "Offer",
                        className: "h-full w-full object-cover"
                      }
                    ) }),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-3", children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-bold text-gray-800 mt-1", children: offer.title }),
                      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500 mt-1", children: offer.description })
                    ] })
                  ] }, idx);
                }) }),
                adminOfferBanners.length > visibleOffers && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mt-2", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "button",
                    {
                      type: "button",
                      onClick: () => setOfferIndex(Math.max(0, offerIndex - 1)),
                      disabled: offerIndex === 0,
                      className: "w-8 h-8 rounded-full bg-white shadow flex items-center justify-center disabled:opacity-30 hover:bg-gray-50 transition",
                      children: /* @__PURE__ */ jsxRuntimeExports.jsx(FaChevronLeft, { size: 12 })
                    }
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "button",
                    {
                      type: "button",
                      onClick: () => setOfferIndex(Math.min(adminOfferBanners.length - visibleOffers, offerIndex + 1)),
                      disabled: offerIndex >= adminOfferBanners.length - visibleOffers,
                      className: "w-8 h-8 rounded-full bg-white shadow flex items-center justify-center disabled:opacity-30 hover:bg-gray-50 transition",
                      children: /* @__PURE__ */ jsxRuntimeExports.jsx(FaChevronRight, { size: 12 })
                    }
                  )
                ] })
              ] }),
              featureCards.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4 w-full", children: featureCards.slice(featureIndex, featureIndex + visibleFeatures).map((card, idx) => {
                  const IconComp = iconMap[card.icon] || FaTrophy;
                  const colorClass = iconColorMap[card.icon] || "text-yellow-500";
                  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-base bg-white text-black shadow-md font-bold rounded-md px-5 py-2", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(IconComp, { className: colorClass }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: card.text })
                  ] }, idx);
                }) }),
                featureCards.length > visibleFeatures && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mt-2", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "button",
                    {
                      type: "button",
                      onClick: () => setFeatureIndex(Math.max(0, featureIndex - 1)),
                      disabled: featureIndex === 0,
                      className: "w-8 h-8 rounded-full bg-white shadow flex items-center justify-center disabled:opacity-30 hover:bg-gray-50 transition",
                      children: /* @__PURE__ */ jsxRuntimeExports.jsx(FaChevronLeft, { size: 12 })
                    }
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "button",
                    {
                      type: "button",
                      onClick: () => setFeatureIndex(Math.min(featureCards.length - visibleFeatures, featureIndex + 1)),
                      disabled: featureIndex >= featureCards.length - visibleFeatures,
                      className: "w-8 h-8 rounded-full bg-white shadow flex items-center justify-center disabled:opacity-30 hover:bg-gray-50 transition",
                      children: /* @__PURE__ */ jsxRuntimeExports.jsx(FaChevronRight, { size: 12 })
                    }
                  )
                ] })
              ] })
            ] })
          ]
        }
      )
    ] }),
    showDatePicker && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-2", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "select",
            {
              value: viewMonth,
              onChange: (e2) => setViewMonth(parseInt(e2.target.value)),
              className: "border border-gray-300 rounded p-1 text-sm font-bold text-gray-700 focus:outline-none focus:ring-2 focus:ring-orange-500",
              children: monthsList.map((m2, idx) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: idx, children: m2 }, idx))
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "select",
            {
              value: viewYear,
              onChange: (e2) => setViewYear(parseInt(e2.target.value)),
              className: "border border-gray-300 rounded p-1 text-sm font-bold text-gray-700 focus:outline-none focus:ring-2 focus:ring-orange-500",
              children: yearsList.map((y) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: y, children: y }, y))
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            onClick: () => setShowDatePicker(false),
            className: "p-1 text-gray-500 hover:text-gray-700",
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(FaTimes, { className: "w-5 h-5" })
          }
        )
      ] }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-7 gap-1 p-4", children: [
        [t2("weekDays.mon"), t2("weekDays.tue"), t2("weekDays.wed"), t2("weekDays.thu"), t2("weekDays.fri"), t2("weekDays.sat"), t2("weekDays.sun")].map((day) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center text-xs text-gray-500 font-medium py-2", children: day }, day)),
        calendarDays.map((dayObj, index2) => {
          const dayDate = new Date(viewYear, viewMonth, dayObj.day);
          const formatted = formatDate(dayDate);
          const isSelected = !dayObj.otherMonth && (selectedDateType === "pickup" && pickupDate === formatted || selectedDateType === "return" && returnDate === formatted);
          return /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              disabled: dayObj.isPast || dayObj.otherMonth,
              className: `h-10 flex items-center justify-center rounded-full text-sm font-medium 
                      ${!dayObj.day || dayObj.otherMonth ? "text-transparent cursor-default" : ""}
                      ${dayObj.isPast ? "text-gray-300 cursor-not-allowed" : "cursor-pointer hover:bg-gray-100"}
                      ${isSelected ? "bg-orange-500 text-white hover:bg-orange-600" : dayObj.isPast ? "" : "text-gray-700"}
                    `,
              onClick: () => handleDateSelect(dayObj),
              children: dayObj.day
            },
            index2
          );
        })
      ] })
    ] }) }),
    showTimePicker && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-end justify-center z-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white w-full max-w-md rounded-t-2xl max-h-[70vh] overflow-hidden", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: t2("hero.pickupTime") }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            onClick: () => setShowTimePicker(false),
            className: "p-1 text-gray-500 hover:text-gray-700",
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(FaTimes, { className: "w-5 h-5" })
          }
        )
      ] }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-h-[60vh] overflow-y-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 gap-2 p-4", children: timeSlots.map((time) => /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          onClick: () => handleTimeSelect(time, selectedDateType),
          className: `p-3 text-center border rounded-lg text-sm font-medium transition-colors
                      ${selectedDateType === "pickup" && pickupTime === time || selectedDateType === "return" && returnTime === time ? "border-orange-500 bg-orange-50 text-orange-500" : "border-gray-200 text-gray-700 hover:border-gray-300"}`,
          children: time
        },
        time
      )) }) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto mt-[420px] sm:mt-[380px] px-4 sm:px-6", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "button",
        {
          onClick: handleExploreClick,
          className: "bg-gradient-to-r from-blue-500 to-blue-400 text-white px-6 sm:px-8 py-3 rounded-full font-bold hover:from-blue-600 hover:to-blue-500 transition-all shadow-md text-sm sm:text-base flex items-center gap-2",
          children: [
            t2("common.exploreMore"),
            " ",
            /* @__PURE__ */ jsxRuntimeExports.jsx(FaArrowDown, { className: "bg-white rounded-3xl h-6 w-6 text-base text-blue-500 " })
          ]
        }
      ) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "div",
        {
          ref: cabInfoRef,
          className: "max-w-6xl mx-auto bg-white p-4 sm:p-6 mt-6 shadow-md rounded-lg",
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "font-extrabold text-xl text-gray-800", children: t2("cabInfo.title") }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm sm:text-base text-gray-600 mt-2 font-light", children: [
              t2("cabInfo.description"),
              !expanded ? " ..." : ""
            ] }),
            expanded && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-sm sm:text-base text-gray-600 mt-4 space-y-4", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-extralight", children: t2("cabInfo.easyToUse") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "font-extrabold text-lg text-gray-800", children: t2("cabInfo.bookYourCab") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-extralight", children: t2("cabInfo.premiumServicesText") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-extralight", children: t2("cabInfo.roadTrips") })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                onClick: () => setExpanded(!expanded),
                className: "text-blue-600 text-sm font-bold inline-flex items-center gap-1 hover:text-blue-800 mt-2",
                children: expanded ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
                  t2("common.readLess"),
                  " ",
                  /* @__PURE__ */ jsxRuntimeExports.jsx(FaArrowRight, { className: "text-xs rotate-180" })
                ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
                  t2("common.readMore"),
                  " ",
                  /* @__PURE__ */ jsxRuntimeExports.jsx(FaArrowRight, { className: "text-xs" })
                ] })
              }
            )
          ]
        }
      )
    ] })
  ] });
};
const CabFaq = () => {
  const dispatch = useDispatch();
  const { faqs } = useSelector((state) => state.cms);
  reactExports.useEffect(() => {
    dispatch(getFAQs());
  }, [dispatch]);
  const faqArray = React$4.useMemo(() => {
    if (!faqs) return [];
    if (Array.isArray(faqs)) return faqs;
    if (typeof faqs === "object") {
      return Object.values(faqs).flat();
    }
    return [];
  }, [faqs]);
  return /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "w-full min-h-screen bg-[#eff3f8] py-12 px-4 ", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-6xl mx-auto", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "font-bold text-2xl text-gray-800 mb-3  relative ", children: "Cabs Booking FAQ" }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-white rounded-xl shadow-md px-6 py-7 space-y-6", children: faqArray.map((faq2, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-extrabold text-base text-[#333333] mb-2", children: faq2.question }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-[450] text-sm  text-[#333333] leading-relaxed", children: faq2.answer })
    ] }, faq2._id || index2)) })
  ] }) });
};
const FAQMobile = () => {
  const [showMore, setShowMore] = reactExports.useState(false);
  const carImages = [
    "https://gos3.ibcdn.com/cab-offer-1762537952.jpg",
    "https://gos3.ibcdn.com/img-1759216228.jpg",
    "https://gos3.ibcdn.com/img-1750849890.jpg",
    "https://gos3.ibcdn.com/img-1751978199.jpg",
    "https://gos3.ibcdn.com/img-1755589446.jpg",
    "https://gos3.ibcdn.com/img-1751013438.jpg",
    "https://gos3.ibcdn.com/img-1736155565.jpg",
    "https://gos3.ibcdn.com/offers-1726049519.jpg"
  ];
  const longText = `
You can opt for online cab booking that will make your journey hassle-free. You simply have to visit the GoIbibo portal and select a cab.

Due to the easy-to-use interface and quick menu options of GoIbibo, online cab booking is not a difficult process. In fact, cab booking is something which has become a part of our everyday life. You can also opt for intercity car rentals in order to visit other cities.

The online taxi booking process on GoIbibo can be completed within a couple of minutes. So, if you wish to customize your cab booking package, GoIbibo is your go-to website. All the car booking services available on GoIbibo are geared towards giving you the best-possible experience when it comes to cab booking.

Book Your Cab Online
When you choose us for your cab booking requirements, we offer you premium services, and most importantly, high reliability. GoIbibo is considered one of the most popular car booking platforms. Besides that, you can also visit the website for train, flight, and bus tickets. The best part is you can get top-notch cars for your preferred destination.

Road trips are one of the most exciting ways to travel all across the country. There is so much to experience and explore. GoIbibo ensures that your road trip is an enjoyable experience.

The process of booking a cab on GoIbibo is pretty simple. You just need to log in to GoIbibo's official website and provide all the required details. In order to book your cab, you have to fill in the city of your origin, the destination, your departure date and timings. Once all the details are filled, simply click on the ‘Search’ option.

On the portal, you will get a wide range of cab options available at different prices. The prices depend on a lot of factors such as the type of cab you are choosing, the in-car facilities provided, the route you are taking to travel as well as your date of journey. You can select a cab which meets your travel requirements.

Book a Cab for an Exciting Road Trip
Tourists enjoy the scenic beauty of nature, the smooth highway roads, studying the diverse cultures and tasting the lip-smacking local food once when you are on holiday. There is a lot you can explore on a road trip, and GoIbibo is there to be your travel companion.

You can book outstation cab to visit popular tourist destinations such as Delhi, Manali, Mumbai and Naintal or the unexplored gems such as Khajuraho, Alleppey, Alibag and Tranquebar simply by booking an online cab booking. Planning a trip can be quite a hassle, but choose to make your online cab booking on GoIbibo for an easier process. You can choose from a wide range of cabs such as hatchbacks, sedans, SUVs, MPVs, and more. You can also book an outstation cab for a one-way trip as well as a round trip.

In case you have any booking-related queries, you can reach out to the 24/7 customer service of GoIbibo and talk to the experts regarding your travel. While booking your outstation cab with us, you can also get assistance in discussing the itinerary and planning your trip. Moreover, the option of using the mobile app will further reduce the hassle of booking a cab. All the services offered by GoIbibo are available on a single click. Moreover, you can also get exciting discounts and offers if you make your bookings via GoIbibo.

Choose GoIbibo for Online Cab Booking
GoIbibo can make the process of online cab booking hassle-free. Below, we are mentioning some of the reasons why people choose us over and over again:

Clean cars
Hygiene is the top-most priority for GoIbibo. That’s why, they ensure that the cab you book is absolutely clean. Considering the Covid-19 situation, we ensure that every car is sanitized before the journey and all the safety protocols are followed thoroughly. The temperature of drivers is checked before every trip, and wearing masks is mandatory for the passengers as well as drivers.

Transparent billing
Be assured, when you choose GoIbibo for your cab booking requirements, the services offered are at the most reasonable rates. Besides that, GoIbibo also maintains 100% billing transparency. So, there are zero hidden charges involved from the beginning to end of your journey. You can choose from your preferred payment methods. Some of the payment options available on GoIbibo include debit card, credit card, net banking and UPI.

Reliable services
Every person is looking for a reliable experience that prioritizes their needs and concerns. That’s why, GoIbibo offers an unparalleled experience to users when they are making cab booking online. You can connect with the 24/7 customer support service of GoIbibo and resolve all your booking-related queries. From providing the best services to ensuring a safe trip, GoIbibo makes sure that your trip is enjoyable.

Courteous chauffeurs
Dealing with impolite people is difficult. An encounter with a rude person can ruin our entire trip. That’s why, GoIbibo makes sure that the chauffeur you get is polite and cooperative. You can find the top-rated drivers on GoIbibo who will make your journey smooth and your trip memorable.

Road trip experts
GoIbibo turns you into an expert in planning road trips. The easy access to all the travel services can help you plan your travel accurately. You can reach out to the customer centre of GoIbibo. Our team comprises experts who offer the best solutions for your queries. Therefore, cab booking with GoIbibo is always a hassle-free experience. Whether it is for outstation trips or an airport taxi, GoIbibo can meet all your travel requirements so that you can reach your desired destination safely. GoIbibo believes in assuring safety, reliability, and affordability to travelers.`;
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-gray-200 min-h-screen p-4 space-y-6", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-black font-semibold mt-", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { children: "Offers for you" }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex overflow-x-auto gap-4 snap-x snap-mandatory", children: carImages.map((img, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "div",
      {
        className: "min-w-[230px] max-w-[230px] bg-white rounded-xl shadow-sm snap-center",
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full h-[150px]  overflow-hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            "img",
            {
              src: img,
              alt: `car-${index2}`,
              className: "w-full h-full object-cover"
            }
          ) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[14px] font-semibold text-black mt-2 leading-snug p-1", children: "Get up to ₹500 OFF* on top outstation cab routes!" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[12px] text-gray-500 mt-1 p-1", children: "Limited Period Offer" })
        ]
      },
      index2
    )) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white text-black p-4 rounded-lg shadow-sm space-y-3", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "font-semibold text-base", children: "Online Cab Booking on Goibibo" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900 leading-relaxed", children: "Most of the Indian tourists prefer travelling to their preferred destination via road. It is due to the fact that a road trip allows you to enjoy the scenic beauty at your own pace. Moreover, the comfort of travelling in a vehicle with your family and friends is unparalleled." }),
      showMore && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900 leading-relaxed whitespace-pre-line", children: longText }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          className: "text-blue-600 text-sm font-medium",
          onClick: () => setShowMore(!showMore),
          children: showMore ? "Read Less" : "Read More"
        }
      )
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-semibold text-black mt-3", children: "Cabs Booking FAQ" }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-white p-4 rounded-lg shadow-sm space-y-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. How can I book cheap cabs online?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "Goibibo helps you with online cab booking at the best prices, comparatively much lower than the local vendors. Also you can use promo codes and offers on the Goibibo website & app on online cab booking to get extra discounts." })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. What are the advantages of online taxi booking?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "Online taxi booking not only helps you with best prices but also helps you with the convenience of paying through multiple payment options (like Debit Card, Credit Card, eWallets etc.). You can easily compare prices and choose various categories of cabs like Hatchback cars, Sedan and SUV." })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. Why you should book cabs from Goibibo?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "From Goibibo you can get confirmed cheap cabs of your choice and budget. Expert and verified drivers will be taken care of your ride. Easy interface of booking with different payment modes available at Goibibo and finally with no hidden charges, Goibibo is the best option for online taxi booking." })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. What are the best options available for cab booking?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "While booking cabs online through Goibibo, you can choose the car based on your requirement and preferences. You can book Hatchback like Indica, Swift, Sedan like Dzire, Etios and SUV like Innova, Ertiga." })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. What kind of cabs you can book from Goibibo?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "You can book following kinds of cabs from Goibibo: airport cabs and intercity cabs / outstation cabs. You can book outstation cabs for both one-way transfers & round-trip transfers." })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. What are the popular outstation cab booking routes?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "Some of the popular outstation cab booking routes are Pune to Mumbai cabs, Delhi to Jaipur cabs, Delhi to Agra cabs, Pondicherry to Chennai cabs, Ahmedabad to Vadodara cabs, Bangalore to Mysore cabs and Mumbai to Pune cabs." })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. How can I book cheap cabs online?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "Goibibo helps you with online cab booking at the best prices from various cab service providers. Also, you can use promo codes and offers on the Goibibo website & app for online cab booking to get extra discounts." })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. What are the advantages of online taxi booking?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "Online taxi booking not only helps you find the best prices from different service providers but also offers the convenience of paying through multiple payment options (like Debit Card, Credit Card, eWallets, etc.). You can easily compare prices and choose various categories of cabs like Hatchback cars, Sedan, and SUV." })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. Why should you book cabs from Goibibo?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "Goibibo has a large number of service providers who list their cabs on Goibibo, increasing your chances of obtaining the most competitive prices for your cabs. You also have the added advantage of access to Goibibo's customer care and an easy interface for booking with different payment modes and no hidden charges. While booking cabs online through Goibibo, you can choose the car based on your requirement and preferences, depending on the cars available with the relevant service providers. You can book Hatchback like Indica, Swift, Sedan like Dzire, Etios, and SUV like Innova, Ertiga." })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. What kind of cabs can you book from Goibibo?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "You can book the following kinds of cabs from Goibibo: airport cabs and rentals / outstation cabs. You can book outstation cabs for both one-way transfers & round-trip transfers." })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. Do I need to register on Goibibo to book a cab online?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "No, you can successfully book the cab without registering on our website." })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. What if the cab doesn't show up?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "If the vehicle you booked does not arrive, we will immediately issue a complete refund." })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. What happens if the vehicle breaks down?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "Since we work with established service providers, the vehicles are usually reliable. In case of a breakdown, it is the service provider's responsibility to replace the vehicle during the journey. In case of any persisting issue, you may reach out to the helpline number provided by Goibibo, and we shall reach out to our vendor to arrange an alternate cab for you." })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. How are the Kilometers calculated?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "The 'Kilometers' are calculated based on the return trip distance between the boarding point and the destination." })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. Can I book a cab without a credit card or net banking option?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "Yes, other payment options available are UPI (gpay, phonepay), wallets (Paytm, Amazon Pay), and debit cards." })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. How is the total cab fare calculated for an intercity cab service?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "For outstation trips (intercity), mostly x kms are included in the fare. Route-wise charges will vary. Sometimes tolls and state taxes might be included in the fare. In certain cases, these won't be part of the original fare, and the user would have to pay extra charges at the trip’s end, if applicable. Extra charges can include waiting charges, extra kilometers, extra hours, night charges, airport entry fee, airport parking charges, toll charges, state taxes, driver charges, parking charges, etc." })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. How is the total cab fare/price calculated for a local cab service?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "Four packages are available (4hrs & 40 kms, 8hrs & 80 kms, 12hrs & 120 kms, 24hrs & 300 kms). Extra kilometers & extra hour charges are applicable if usage exceeds the package taken." })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. What are the payment terms?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "You can confirm your reservation by paying a small booking fee, typically up to 25% of the base fare. The balance can be paid directly to us through online modes until two days before the start of the journey or to the operator in cash at the time of trip completion." })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. What if I need to cancel my trip?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "The cancellation policy is specific to each service provider and is listed against the quotes on the quotations page." })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm mb-1 text-black", children: "Q. How are tolls & taxes calculated?" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-900", children: "Tolls and interstate taxes are best estimates only. If these amounts are included in the fare, you'll be charged/reimbursed for any difference between the actuals and estimates, as applicable." })
      ] })
    ] }) })
  ] });
};
const CabRoutes = () => {
  const dispatch = useDispatch();
  const {
    intercityRoutes,
    intercityLoading,
    cityServices,
    cityLoading,
    airportRoutes,
    airportLoading
  } = useSelector((state) => state.seo);
  reactExports.useEffect(() => {
    dispatch(getIntercityRoutes({ limit: 30 }));
    dispatch(getCityServices({ limit: 20 }));
    dispatch(getAirportRoutes({ limit: 20 }));
  }, [dispatch]);
  const distributeInColumns = (items, columnsCount = 5) => {
    const columns = Array.from({ length: columnsCount }, () => []);
    items.forEach((item, index2) => {
      columns[index2 % columnsCount].push(item);
    });
    return columns;
  };
  const intercityColumns = distributeInColumns(intercityRoutes, 5);
  const cityColumns = distributeInColumns(cityServices, 5);
  const airportColumns = distributeInColumns(airportRoutes, 5);
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-[#e8f4fc] py-8 px-4 sm:px-6 lg:px-8", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl w-full mx-auto", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-10", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-xl font-bold text-gray-900 mb-5", children: "Top Cab Routes" }),
      intercityLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center py-4 text-gray-500", children: "Loading routes..." }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-x-8 gap-y-0", children: intercityColumns.map((column, colIndex) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2", children: column.map((route) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
        Link,
        {
          to: `/top/${route.slug}`,
          state: { route },
          className: "block text-[#0770e3] hover:text-[#0557b5] hover:underline text-sm py-0.5",
          children: [
            route.originCity,
            " To ",
            route.destinationCity,
            " Cab"
          ]
        },
        route._id || route.slug
      )) }, colIndex)) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-10", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-xl font-bold text-gray-900 mb-5", children: "Cab from Top Cities" }),
      cityLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center py-4 text-gray-500", children: "Loading city services..." }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-x-8 gap-y-0", children: cityColumns.map((column, colIndex) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2", children: column.map((service) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
        Link,
        {
          to: `/cities/${service.slug}`,
          state: { service },
          className: "block text-[#0770e3] hover:text-[#0557b5] hover:underline text-sm py-0.5",
          children: [
            service.cityName,
            " Taxi Services"
          ]
        },
        service._id || service.slug
      )) }, colIndex)) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-6", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-xl font-bold text-gray-900 mb-5", children: "Top Airport Cab Routes" }),
      airportLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center py-4 text-gray-500", children: "Loading airport routes..." }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-x-8 gap-y-0", children: airportColumns.map((column, colIndex) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2", children: column.map((route) => /* @__PURE__ */ jsxRuntimeExports.jsx(
        Link,
        {
          to: `/airport/${route.slug}`,
          state: { route },
          className: "block text-[#0770e3] hover:text-[#0557b5] hover:underline text-sm py-0.5",
          children: route.routeType === "from_airport" ? `Cab From ${route.airportName}` : `Cab To ${route.airportName}`
        },
        route._id || route.slug
      )) }, colIndex)) })
    ] })
  ] }) });
};
const RoutesMobile = () => {
  const navigate = useNavigate();
  const dispatch = useDispatch();
  const {
    intercityRoutes,
    intercityLoading,
    cityServices,
    cityLoading,
    airportRoutes,
    airportLoading
  } = useSelector((state) => state.seo);
  reactExports.useEffect(() => {
    dispatch(getIntercityRoutes({ limit: 25 }));
    dispatch(getCityServices({ limit: 20 }));
    dispatch(getAirportRoutes({ limit: 20 }));
  }, [dispatch]);
  const handleTopCabClick = (route) => {
    navigate(`/top/${route.slug}`, { state: { route } });
  };
  const handleCityCabClick = (service) => {
    navigate(`/cities/${service.slug}`, { state: { service } });
  };
  const handleAirportClick = (route) => {
    navigate(`/airport/${route.slug}`, { state: { route } });
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 text-gray-700", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "font-semibold text-lg mb-4", children: "Top Cab Routes" }),
    intercityLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500 text-sm", children: "Loading routes..." }) : /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "space-y-0.5", children: intercityRoutes.map((route) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "button",
      {
        onClick: () => handleTopCabClick(route),
        className: "text-blue-600 hover:underline text-sm",
        children: [
          route.originCity,
          " To ",
          route.destinationCity,
          " Cab"
        ]
      }
    ) }, route._id || route.slug)) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "font-semibold text-lg mt-8 mb-4", children: "Cab from Top Cities" }),
    cityLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500 text-sm", children: "Loading city services..." }) : /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "space-y-0.5", children: cityServices.map((service) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "button",
      {
        onClick: () => handleCityCabClick(service),
        className: "text-blue-600 hover:underline text-sm",
        children: [
          service.cityName,
          " Taxi Services"
        ]
      }
    ) }, service._id || service.slug)) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "font-semibold text-lg mt-8 mb-4", children: "Top Airport Cab Routes" }),
    airportLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500 text-sm", children: "Loading airport routes..." }) : /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "space-y-0.5", children: airportRoutes.map((route) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      "button",
      {
        onClick: () => handleAirportClick(route),
        className: "text-blue-600 hover:underline text-sm",
        children: route.routeType === "from_airport" ? `Cab From ${route.airportName}` : `Cab To ${route.airportName}`
      }
    ) }, route._id || route.slug)) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "border border-gray-300 mt-4 mb-6" })
  ] });
};
const CabResults = () => {
  var _a, _b;
  const dispatch = useDispatch();
  const { t: t2 } = useTranslation();
  const [showKnowMore, setShowKnowMore] = reactExports.useState(false);
  const [priceRange, setPriceRange] = reactExports.useState([2057, 8457]);
  const navigate = useNavigate();
  const location = useLocation();
  (_a = location.state) == null ? void 0 : _a.route;
  const { isAuthenticated: isLoggedIn } = useSelector((state) => state.auth);
  const { searchResults, searchLoading, searchError } = useSelector(
    (state) => state.booking
  );
  reactExports.useEffect(() => {
    var _a2, _b2;
    console.log("CabResults - searchResults updated:", searchResults);
    console.log("CabResults - searchResults.cabs length:", (_a2 = searchResults.cabs) == null ? void 0 : _a2.length);
    console.log("CabResults - searchResults.vehicles length:", (_b2 = searchResults.vehicles) == null ? void 0 : _b2.length);
  }, [searchResults]);
  const [tripType, setTripType] = reactExports.useState("oneway");
  const [fromLocation, setFromLocation] = reactExports.useState("MP Nagar, Bhopal");
  const [toLocation, setToLocation] = reactExports.useState("Indore, MP");
  const [pickupDate, setPickupDate] = reactExports.useState(
    (/* @__PURE__ */ new Date()).toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric" })
  );
  const [returnDate, setReturnDate] = reactExports.useState(null);
  const [pickupTime, setPickupTime] = reactExports.useState("10:00 AM");
  const [stops, setStops] = reactExports.useState([]);
  const [currentUserLocation, setCurrentUserLocation] = reactExports.useState(null);
  const [selectedRentalPackage, setSelectedRentalPackage] = reactExports.useState(null);
  const rentalPackages = [
    { hours: 2, distance: 20, label: "2 hrs 20 km" },
    { hours: 4, distance: 40, label: "4 hrs 40 km" },
    { hours: 8, distance: 80, label: "8 hrs 80 km" },
    { hours: 12, distance: 120, label: "12 hrs 120 km" },
    { hours: 24, distance: 300, label: "24 hrs 300 km" }
  ];
  const [searchCoordinates, setSearchCoordinates] = reactExports.useState({
    source: null,
    dest: null,
    distance: 0,
    duration: 0
  });
  const [showTripTypeDropdown, setShowTripTypeDropdown] = reactExports.useState(false);
  const [showRentalPackageDropdown, setShowRentalPackageDropdown] = reactExports.useState(false);
  const [showLocationModal, setShowLocationModal] = reactExports.useState(false);
  const [showStopsModal, setShowStopsModal] = reactExports.useState(false);
  const [showDateModal, setShowDateModal] = reactExports.useState(false);
  const [showTimeModal, setShowTimeModal] = reactExports.useState(false);
  const [locationType, setLocationType] = reactExports.useState("");
  const [dateType, setDateType] = reactExports.useState("pickup");
  const staticCabs = [
    {
      id: 1,
      name: "Indica, Wagon R",
      type: "HATCHBACK",
      ac: true,
      seats: 4,
      description: t2("cabSearch.economicalCarDesc"),
      kms: t2("cabSearch.kmsIncluded", { kms: 197, rate: 8.5 }),
      cancel: t2("cabSearch.freeCancellationHour"),
      reserve: t2("cabSearch.reserveAtOnly", { amount: 458 }),
      carType: t2("cabSearch.cngCar"),
      price: "₹1589",
      originalPrice: "₹1889",
      discount: `16% ${t2("cabSearch.off")}`,
      rating: "4.5/5",
      ratingsCount: t2("cabSearch.ratingsCount", { count: 811 }),
      options: 2,
      optionButtons: [
        { type: "DIESEL", price: "₹2315" },
        { type: "PETROL", price: "₹2599" }
      ],
      image: "https://gos3.ibcdn.com/hatchback_v_5_copy-1576142454.png"
    },
    {
      id: 2,
      name: "Swift Dzire, Etios",
      type: "SEDAN",
      ac: true,
      seats: 4,
      description: t2("cabSearch.comfortableRideDesc"),
      kms: t2("cabSearch.kmsIncluded", { kms: 197, rate: 9 }),
      cancel: t2("cabSearch.freeCancellationHour"),
      carType: t2("cabSearch.petrolCar"),
      price: "₹1789",
      originalPrice: "₹1989",
      discount: `10% ${t2("cabSearch.off")}`,
      rating: "4.2/5",
      ratingsCount: t2("cabSearch.ratingsCount", { count: 512 }),
      options: 1,
      optionButtons: [{ type: "AUTO", price: "₹2899" }],
      image: "https://gos3.ibcdn.com/sedan_v_2_copy_2-1576142484.png"
    },
    {
      id: 3,
      name: "Innova, Ertiga",
      type: "SUV",
      ac: true,
      seats: 6,
      description: t2("cabSearch.spaciousCarDesc"),
      kms: t2("cabSearch.kmsIncluded", { kms: 197, rate: 12 }),
      cancel: t2("cabSearch.freeCancellationHour"),
      carType: t2("cabSearch.dieselCar"),
      price: "₹2499",
      originalPrice: "₹2999",
      discount: `15% ${t2("cabSearch.off")}`,
      rating: "4.7/5",
      ratingsCount: t2("cabSearch.ratingsCount", { count: 315 }),
      options: 1,
      optionButtons: [{ type: "PREMIUM", price: "₹3499" }],
      image: "https://gos3.ibcdn.com/suv_v_1_copy-1576142510.png"
    }
  ];
  const transformApiCabs = (apiCabs) => {
    if (!apiCabs || apiCabs.length === 0) return [];
    return apiCabs.map((cab, index2) => {
      var _a2, _b2, _c;
      const getImage = () => {
        var _a3, _b3, _c2, _d;
        if (cab.primaryImage) return cab.primaryImage;
        if (cab.images && Array.isArray(cab.images) && cab.images.length > 0) {
          const front = cab.images.find((img) => img.view === "front");
          return (front == null ? void 0 : front.url) || ((_a3 = cab.images[0]) == null ? void 0 : _a3.url);
        }
        if ((_b3 = cab.images) == null ? void 0 : _b3.frontView) return cab.images.frontView;
        if ((_d = (_c2 = cab.vehicleDetails) == null ? void 0 : _c2.images) == null ? void 0 : _d.frontView) return cab.vehicleDetails.images.frontView;
        return "https://gos3.ibcdn.com/sedan_v_2_copy_2-1576142484.png";
      };
      return {
        id: cab.groupId || cab.vehicleId || index2 + 1,
        // NEW: Store groupId and modelId for booking
        groupId: cab.groupId,
        modelId: cab.modelId,
        vehicleId: cab.vehicleId || null,
        // May be null in grouped results
        // Display name: use modelNames array or vehicleName
        name: ((_a2 = cab.modelNames) == null ? void 0 : _a2.join(", ")) || cab.vehicleName || "Unknown Vehicle",
        orSimilar: cab.orSimilar || false,
        // Show "Or Similar" badge
        type: (cab.category || "SEDAN").toUpperCase(),
        ac: cab.isAc !== false,
        seats: cab.seats || 4,
        description: cab.description || "Comfortable ride",
        kms: `${cab.includedKm || 10} kms included. After that ₹${cab.extraKmRate || 10}/km`,
        cancel: cab.cancellationPolicy || "Free cancellation until 1 hour before pickup",
        reserve: cab.reserveAmount ? `Reserve this cab at ₹${cab.reserveAmount} only` : null,
        carType: `${cab.tier || "Standard"} Car`,
        price: `₹${cab.finalPrice !== void 0 ? cab.finalPrice : ((_b2 = cab.fare) == null ? void 0 : _b2.total) || 0}`,
        originalPrice: cab.originalPrice ? `₹${cab.originalPrice}` : null,
        discount: ((_c = cab.discount) == null ? void 0 : _c.hasDiscount) ? `${cab.discount.discountValue}% off` : null,
        rating: "4.5/5",
        ratingsCount: `${Math.floor(Math.random() * 500) + 100} ratings`,
        // Availability info (new)
        vendorCount: cab.vendorCount || 0,
        vehicleCount: cab.vehicleCount || 0,
        options: 0,
        optionButtons: [],
        image: getImage(),
        // Store original data for booking
        _original: cab,
        // Rental details (if rental trip)
        rentalDetails: cab.rentalDetails || null
      };
    });
  };
  const cabs = reactExports.useMemo(() => {
    if (searchResults.cabs) {
      if (searchResults.cabs.length > 0) {
        const transformed = transformApiCabs(searchResults.cabs);
        return transformed;
      }
      console.log("API returned 0 cabs");
      return [];
    }
    console.log("Falling back to static cabs (Initial Load)");
    return staticCabs;
  }, [searchResults.cabs]);
  const [selectedModels, setSelectedModels] = reactExports.useState([]);
  const [selectedSeats, setSelectedSeats] = reactExports.useState([]);
  const filterOptions = reactExports.useMemo(() => {
    if (!cabs || cabs.length === 0) {
      return { models: [], seats: [], minPrice: 0, maxPrice: 1e5 };
    }
    const models = /* @__PURE__ */ new Set();
    const seats = /* @__PURE__ */ new Set();
    let minP = Infinity;
    let maxP = -Infinity;
    cabs.forEach((cab) => {
      if (cab.name) {
        const names = cab.name.replace(/ or similar/gi, "").split(",");
        names.forEach((n2) => models.add(n2.trim()));
      }
      if (cab.seats) seats.add(cab.seats);
      const priceVal = typeof cab.price === "string" ? parseInt(cab.price.replace(/[^\d]/g, "")) : cab.price;
      if (!isNaN(priceVal)) {
        if (priceVal < minP) minP = priceVal;
        if (priceVal > maxP) maxP = priceVal;
      }
    });
    return {
      models: Array.from(models).sort(),
      seats: Array.from(seats).sort((a2, b) => a2 - b),
      minPrice: minP === Infinity ? 0 : minP,
      maxPrice: maxP === -Infinity ? 1e4 : maxP
    };
  }, [cabs]);
  reactExports.useEffect(() => {
    if (filterOptions.minPrice !== 0 && filterOptions.maxPrice !== 1e4) {
      setPriceRange([filterOptions.minPrice, filterOptions.maxPrice]);
    }
  }, [filterOptions.minPrice, filterOptions.maxPrice]);
  const filteredCabs = reactExports.useMemo(() => {
    if (!cabs) return [];
    return cabs.filter((cab) => {
      const priceVal = typeof cab.price === "string" ? parseInt(cab.price.replace(/[^\d]/g, "")) : cab.price;
      if (!isNaN(priceVal)) {
        if (priceVal < priceRange[0] || priceVal > priceRange[1]) return false;
      }
      if (selectedModels.length > 0) {
        let hasMatch = false;
        if (cab.name) {
          const names = cab.name.replace(/ or similar/gi, "").split(",").map((n2) => n2.trim());
          if (names.some((n2) => selectedModels.includes(n2))) hasMatch = true;
        }
        if (!hasMatch) return false;
      }
      if (selectedSeats.length > 0) {
        if (!selectedSeats.includes(cab.seats)) return false;
      }
      return true;
    });
  }, [cabs, priceRange, selectedModels, selectedSeats]);
  const toggleModel = (model) => {
    setSelectedModels(
      (prev) => prev.includes(model) ? prev.filter((m2) => m2 !== model) : [...prev, model]
    );
  };
  const toggleSeat = (seat) => {
    setSelectedSeats(
      (prev) => prev.includes(seat) ? prev.filter((s2) => s2 !== seat) : [...prev, seat]
    );
  };
  const resetFilters = () => {
    setSelectedModels([]);
    setSelectedSeats([]);
    setPriceRange([filterOptions.minPrice, filterOptions.maxPrice]);
  };
  reactExports.useEffect(() => {
    var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;
    if (searchResults.distance && searchResults.distance > 0) {
      setSearchCoordinates((prev) => ({
        ...prev,
        distance: searchResults.distance,
        duration: searchResults.estimatedDuration || prev.duration
      }));
      return;
    }
    if (searchResults.cabs && searchResults.cabs.length > 0) {
      const firstCab = searchResults.cabs[0];
      const apiDistance = ((_a2 = firstCab == null ? void 0 : firstCab.tripDetails) == null ? void 0 : _a2.distance) || ((_b2 = firstCab == null ? void 0 : firstCab.tripDetails) == null ? void 0 : _b2.totalDistance) || ((_d = (_c = firstCab == null ? void 0 : firstCab._original) == null ? void 0 : _c.tripDetails) == null ? void 0 : _d.distance) || ((_f = (_e = firstCab == null ? void 0 : firstCab._original) == null ? void 0 : _e.tripDetails) == null ? void 0 : _f.totalDistance) || 0;
      const apiDuration = ((_g = firstCab == null ? void 0 : firstCab.tripDetails) == null ? void 0 : _g.estimatedDuration) || ((_i = (_h = firstCab == null ? void 0 : firstCab._original) == null ? void 0 : _h.tripDetails) == null ? void 0 : _i.estimatedDuration) || 0;
      if (apiDistance > 0) {
        setSearchCoordinates((prev) => ({
          ...prev,
          distance: apiDistance,
          duration: apiDuration
        }));
        console.log(`Using API distance: ${apiDistance} km, duration: ${apiDuration} mins`);
      }
    }
  }, [searchResults.cabs, searchResults.distance]);
  const formatDuration = (minutes) => {
    if (!minutes || minutes === 0) return "Calculating...";
    const hours = Math.floor(minutes / 60);
    const mins = minutes % 60;
    if (hours > 0) {
      return `${hours}h ${mins}m`;
    }
    return `${mins}m`;
  };
  ({
    totalDistance: searchCoordinates.distance || 0,
    estimatedDuration: formatDuration(searchCoordinates.duration)
  });
  const [currentDisplayDate, setCurrentDisplayDate] = reactExports.useState(/* @__PURE__ */ new Date());
  const getDaysInMonth = (date) => {
    return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
  };
  const getFirstDayOfMonth = (date) => {
    return new Date(date.getFullYear(), date.getMonth(), 1).getDay();
  };
  const generateCalendarDays = () => {
    const daysInMonth = getDaysInMonth(currentDisplayDate);
    const firstDay = getFirstDayOfMonth(currentDisplayDate);
    const days = [];
    const startOffset = firstDay === 0 ? 6 : firstDay - 1;
    for (let i2 = 0; i2 < startOffset; i2++) {
      days.push({ day: "", otherMonth: true });
    }
    for (let i2 = 1; i2 <= daysInMonth; i2++) {
      days.push({
        day: i2.toString(),
        date: new Date(currentDisplayDate.getFullYear(), currentDisplayDate.getMonth(), i2)
      });
    }
    return days;
  };
  const calendarDays = generateCalendarDays();
  const changeMonth = (offset) => {
    const newDate = new Date(currentDisplayDate);
    newDate.setMonth(newDate.getMonth() + offset);
    setCurrentDisplayDate(newDate);
  };
  const generateTimeSlots = () => {
    const times = [];
    for (let hour = 0; hour < 24; hour++) {
      for (let minute = 0; minute < 60; minute += 15) {
        const period = hour >= 12 ? "PM" : "AM";
        const displayHour = hour % 12 || 12;
        const timeString = `${displayHour}:${minute.toString().padStart(2, "0")} ${period}`;
        times.push(timeString);
      }
    }
    return times;
  };
  const timeSlots = generateTimeSlots();
  const recentSearches = [
    { location: "Bhopal, Madhya Pradesh, India", query: "bhopal" },
    {
      location: "Ujjain Mahakal Mandir, Mahakal Lok Corridor Road, Bagambag Colony, Ujjain, Madhya Pradesh, India",
      query: "ujjain"
    },
    { location: "Bhopal, Madhya Pradesh, India", query: "bhopal" }
  ];
  const tripTypeOptions = [
    { value: "oneway", label: t2("tripTypes.oneway") },
    { value: "round", label: t2("tripTypes.round") },
    { value: "airport", label: t2("tripTypes.airport") },
    { value: "rental", label: t2("tripTypes.hourly") }
  ];
  const handleLocationSelect = (location2) => {
    if (locationType === "from") {
      setFromLocation(location2);
    } else if (locationType === "to") {
      setToLocation(location2);
    }
    setShowLocationModal(false);
  };
  const handleDateSelect = (dayObj) => {
    if (dayObj && !dayObj.otherMonth && dayObj.date) {
      const dateStr = dayObj.date.toLocaleDateString("en-GB", {
        day: "numeric",
        month: "short",
        year: "numeric"
      });
      if (dateType === "return") {
        setReturnDate(dateStr);
      } else {
        setPickupDate(dateStr);
      }
      setShowDateModal(false);
    }
  };
  const handleTimeSelect = (time) => {
    setPickupTime(time);
    setShowTimeModal(false);
  };
  const addStop = () => {
    setStops([...stops, { id: Date.now(), value: "" }]);
  };
  const removeStop = (id) => {
    setStops(stops.filter((stop) => stop.id !== id));
  };
  const handleStopChange = (id, value) => {
    setStops(stops.map((stop) => stop.id === id ? { ...stop, value } : stop));
  };
  const handleUpdateSearch = async () => {
    if ((tripType === "round" || tripType === "roundTrip") && !returnDate) {
      zt.error("Please select a return date for round trip");
      return;
    }
    let sourceCoords;
    if (fromLocation === "Current Location" && currentUserLocation) {
      sourceCoords = currentUserLocation;
    } else {
      sourceCoords = await geocodeLocation(fromLocation);
    }
    if (!sourceCoords) {
      zt.error(`Could not find location: ${fromLocation}`);
      return;
    }
    let destCoords = null;
    if (tripType !== "rental") {
      if (toLocation === "Current Location" && currentUserLocation) {
        destCoords = currentUserLocation;
      } else {
        destCoords = await geocodeLocation(toLocation);
      }
      if (!destCoords) {
        zt.error(`Could not find drop location: ${toLocation}`);
        return;
      }
    } else {
      if (!selectedRentalPackage) {
        zt.error("Please select a rental package");
        return;
      }
    }
    const validStops = [];
    if (stops.length > 0) {
      for (const stop of stops) {
        if (!stop.value || stop.value.trim() === "") continue;
        const stopCoords = await geocodeLocation(stop.value);
        if (stopCoords) {
          validStops.push({
            address: stop.value,
            coordinates: [stopCoords.lng, stopCoords.lat],
            // GeoJSON order: [lng, lat]
            stopOrder: validStops.length + 1
          });
        }
      }
    }
    setSearchCoordinates({
      source: sourceCoords,
      dest: destCoords,
      distance: 0,
      // Will be updated from API response
      duration: 0
    });
    const searchParams = {
      sourceLat: sourceCoords.lat,
      sourceLong: sourceCoords.lng,
      destLat: destCoords == null ? void 0 : destCoords.lat,
      destLong: destCoords == null ? void 0 : destCoords.lng,
      tripType: tripType === "oneway" ? "oneWay" : tripType === "round" ? "roundTrip" : tripType,
      // distance: distanceParam,
      fuelType: "petrol",
      // Search uses petrol as default, actual fuelType from vehicle not needed for search
      isAc: true,
      pickupDate,
      pickupTime,
      returnDate,
      startTime: (/* @__PURE__ */ new Date()).toISOString(),
      rentalPackage: tripType === "rental" ? selectedRentalPackage : void 0,
      stops: validStops.length > 0 ? validStops : void 0,
      page: 1,
      limit: 10
    };
    dispatch(searchCabs(searchParams));
  };
  reactExports.useEffect(() => {
    const initSearch = async () => {
      var _a2;
      if ((_a2 = location.state) == null ? void 0 : _a2.searchParams) {
        const params = location.state.searchParams;
        console.log("=== SEARCH PARAMS (Checking Coordinates) ===");
        console.log("Source:", params.from, "Lat:", params.sourceLat, "Lng:", params.sourceLong);
        console.log("Dest:", params.to, "Lat:", params.destLat, "Lng:", params.destLong);
        let finalParams = { ...params };
        let sourceCoords = { lat: params.sourceLat, lng: params.sourceLong };
        let destCoords = { lat: params.destLat, lng: params.destLong };
        if (params.from) setFromLocation(params.from);
        if (params.to) setToLocation(params.to);
        if (params.tripType) {
          const uiTripType = params.tripType === "oneWay" ? "oneway" : params.tripType === "roundTrip" ? "round" : params.tripType;
          setTripType(uiTripType);
        }
        if (params.pickupDate) setPickupDate(params.pickupDate);
        if (params.returnDate) setReturnDate(params.returnDate);
        if (params.pickupTime) setPickupTime(params.pickupTime);
        if (params.rentalPackage) {
          setSelectedRentalPackage(params.rentalPackage);
        }
        if (!params.sourceLat || !params.sourceLong) {
          if (params.from) {
            const coords = await geocodeLocation(params.from);
            if (coords) {
              finalParams.sourceLat = coords.lat;
              finalParams.sourceLong = coords.lng;
              sourceCoords = coords;
            }
          }
        }
        if ((!params.destLat || !params.destLong) && params.to) {
          const coords = await geocodeLocation(params.to);
          if (coords) {
            finalParams.destLat = coords.lat;
            finalParams.destLong = coords.lng;
            destCoords = coords;
          }
        }
        setSearchCoordinates({
          source: sourceCoords,
          dest: destCoords,
          distance: params.distance || 0,
          // Will be updated from API response
          duration: 0
        });
        if (finalParams.sourceLat && finalParams.sourceLong) {
          dispatch(searchCabs(finalParams));
        }
      }
    };
    initSearch();
    return () => {
      dispatch(resetSearchResults$1());
    };
  }, [dispatch, location.state]);
  const [expandedCabId, setExpandedCabId] = reactExports.useState(null);
  const handleBookingSelect = (cab) => {
    var _a2, _b2, _c, _d, _e, _f, _g;
    if (!isLoggedIn) {
      zt.error("Please login to proceed with booking");
      return;
    }
    navigate(`/details/${cab.id}`, {
      state: {
        // NEW: Pass groupId and modelId for new booking system
        groupId: cab.groupId,
        modelId: cab.modelId,
        vehicleId: cab.vehicleId || null,
        // May be null in grouped results
        zoneId: (_b2 = (_a2 = cab._original) == null ? void 0 : _a2.zone) == null ? void 0 : _b2.id,
        // Pass addresses from state
        pickupAddress: fromLocation,
        dropAddress: toLocation,
        picklat: (_c = searchCoordinates.source) == null ? void 0 : _c.lat,
        picklng: (_d = searchCoordinates.source) == null ? void 0 : _d.lng,
        droplat: (_e = searchCoordinates.dest) == null ? void 0 : _e.lat,
        droplng: (_f = searchCoordinates.dest) == null ? void 0 : _f.lng,
        distance: searchCoordinates.distance,
        duration: searchCoordinates.duration,
        tripType: tripType === "oneway" ? "oneWay" : tripType === "round" ? "roundTrip" : tripType,
        pickupDate,
        pickupTime,
        returnDate,
        fuelType: cab.fuelType || ((_g = cab._original) == null ? void 0 : _g.fuelType) || "petrol",
        isAc: cab.isAc !== void 0 ? cab.isAc : true,
        scheduledTime: (/* @__PURE__ */ new Date()).toISOString(),
        vehicleData: cab._original,
        rentalPackage: tripType === "rental" ? selectedRentalPackage : void 0,
        stops: stops.length > 0 ? stops.filter((s2) => s2.value).map((s2, i2) => ({
          address: s2.value,
          stopOrder: i2 + 1
        })) : void 0
      }
    });
  };
  const KnowMoreModal = () => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-8", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-3xl max-w-2xl w-full h-[650px] p-6 text-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-2xl font-bold text-black", children: t2("cabSearch.title") }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "img",
        {
          src: "https://gos3.ibcdn.com/cabsOs-1653903067.png",
          alt: "Outstation Cabs",
          className: "mx-auto mb-4  mt-24 object-contain"
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "space-y-3 text-left mb-6 text-black px-8", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-start", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "mr-2 text-3xl text-gray-500", children: "•" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("cabInfo.description") })
      ] }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          onClick: () => setShowKnowMore(false),
          className: "bg-blue-100 hover:bg-blue-200 text-blue-700 font-medium px-6 py-2 rounded-full transition-all duration-300 shadow-md hover:shadow-lg",
          children: t2("common.ok")
        }
      )
    ] }) });
  };
  const LocationModal = () => {
    const [searchText, setSearchText] = reactExports.useState("");
    const handleCurrentLocation = () => {
      if ("geolocation" in navigator) {
        navigator.geolocation.getCurrentPosition(
          (position) => {
            setCurrentUserLocation({
              lat: position.coords.latitude,
              lng: position.coords.longitude
            });
            handleLocationSelect("Current Location");
          },
          (error) => {
            console.error("Error getting location:", error);
            zt.error(t2("errors.locationError"));
          }
        );
      } else {
        zt.error(t2("errors.geolocationNotSupported"));
      }
    };
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 border-b border-gray-200", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: locationType === "from" ? t2("hero.from").toUpperCase() : t2("hero.to").toUpperCase() }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              onClick: () => setShowLocationModal(false),
              className: "p-1 text-gray-500 hover:text-gray-700",
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" })
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          LocationAutocomplete,
          {
            value: searchText,
            onChange: (newValue) => {
              setSearchText(newValue);
            },
            onLocationSelect: handleLocationSelect,
            placeholder: `${t2("common.search")} ${locationType === "from" ? t2("hero.from") : t2("hero.to")}...`,
            label: `${t2("common.enter")} ${locationType === "from" ? t2("hero.from") : t2("hero.to")} ${t2("common.location")}`
          }
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "button",
          {
            onClick: handleCurrentLocation,
            className: "flex items-center gap-2 text-blue-600 text-sm font-medium mb-4 hover:bg-blue-50 p-2 rounded w-full transition-colors",
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(MapPin, { className: "w-4 h-4" }),
              t2("common.useCurrentLocation")
            ]
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border-t border-gray-200 pt-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "text-sm font-medium text-gray-700 mb-3", children: t2("common.recentSearches") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-3", children: recentSearches.map((search, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "div",
            {
              className: "flex flex-col cursor-pointer hover:bg-gray-50 p-2 rounded",
              onClick: () => handleLocationSelect(search.location),
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-medium text-gray-900", children: search.location }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs text-gray-500", children: search.query })
              ]
            },
            index2
          )) })
        ] })
      ] })
    ] }) });
  };
  const StopsModal = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: t2("hero.addStops") }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          onClick: () => setShowStopsModal(false),
          className: "p-1 text-gray-500 hover:text-gray-700",
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" })
        }
      )
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
      stops.map((stop, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600 mb-2", children: [
          t2("tripDetails.stop"),
          " ",
          index2 + 1
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "input",
            {
              type: "text",
              value: stop.value,
              onChange: (e2) => handleStopChange(stop.id, e2.target.value),
              className: "flex-1 border text-black border-gray-300 rounded-lg px-3 py-2 text-sm",
              placeholder: t2("hero.enterStop")
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              onClick: () => removeStop(stop.id),
              className: "text-gray-500 hover:text-red-500",
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" })
            }
          )
        ] })
      ] }, stop.id)),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "button",
        {
          onClick: addStop,
          className: "flex items-center gap-2 text-blue-600 text-sm font-medium mt-4",
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(Plus, { className: "w-4 h-4" }),
            t2("hero.addStops"),
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-1 bg-pink-600 text-white text-[10px] px-1.5 py-0.5 rounded", children: t2("hero.new") })
          ]
        }
      )
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-t border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      "button",
      {
        onClick: () => setShowStopsModal(false),
        className: "w-full bg-blue-600 text-white py-3 rounded-lg font-semibold",
        children: t2("common.done") || "DONE"
      }
    ) })
  ] }) });
  const DateModal = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: dateType === "return" ? "RETURN DATE" : "PICKUP DATE" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          onClick: () => setShowDateModal(false),
          className: "p-1 text-gray-500 hover:text-gray-700",
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" })
        }
      )
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-4 text-gray-900", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => changeMonth(-1), className: "p-2 hover:bg-gray-100 rounded-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 rotate-90" }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-bold uppercase", children: currentDisplayDate.toLocaleDateString("en-US", { month: "long", year: "numeric" }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => changeMonth(1), className: "p-2 hover:bg-gray-100 rounded-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 -rotate-90" }) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"].map((day) => /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          className: "text-center text-xs text-gray-500 font-medium py-2",
          children: day
        },
        day
      )) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-1", children: calendarDays.map((dayObj, index2) => {
        var _a2;
        const currentDateStr = (_a2 = dayObj.date) == null ? void 0 : _a2.toLocaleDateString("en-GB", {
          day: "numeric",
          month: "short",
          year: "numeric"
        });
        const isSelected = currentDateStr === (dateType === "return" ? returnDate : pickupDate);
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: `h-10 flex items-center justify-center rounded-full text-sm font-medium cursor-pointer
                  ${!dayObj.day || dayObj.otherMonth ? "text-transparent pointer-events-none" : "text-gray-700 hover:bg-gray-100"}
                  ${isSelected ? "bg-orange-500 text-white hover:bg-orange-600" : ""}
                `,
            onClick: () => handleDateSelect(dayObj),
            children: dayObj.day
          },
          index2
        );
      }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mt-4 text-sm font-bold", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "¥2051" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "¥1733" })
      ] })
    ] })
  ] }) });
  const TimeModal = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: "PICKUP TIME" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          onClick: () => setShowTimeModal(false),
          className: "p-1 text-gray-500 hover:text-gray-700",
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" })
        }
      )
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-h-96 overflow-y-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children: timeSlots.map((time, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      {
        className: `py-3 border-b text-black border-gray-100 cursor-pointer hover:bg-gray-50 ${pickupTime === time ? "bg-blue-50" : ""}`,
        onClick: () => handleTimeSelect(time),
        children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-medium", children: time })
      },
      index2
    )) }) })
  ] }) });
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col min-h-screen bg-gray-50", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
    showKnowMore && /* @__PURE__ */ jsxRuntimeExports.jsx(KnowMoreModal, {}),
    showLocationModal && /* @__PURE__ */ jsxRuntimeExports.jsx(LocationModal, {}),
    showStopsModal && /* @__PURE__ */ jsxRuntimeExports.jsx(StopsModal, {}),
    showDateModal && /* @__PURE__ */ jsxRuntimeExports.jsx(DateModal, {}),
    showTimeModal && /* @__PURE__ */ jsxRuntimeExports.jsx(TimeModal, {}),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full bg-orange-500 py-4 px-4 mt-16", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto flex flex-wrap items-center justify-between gap-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-8 ml-8", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "TRIP TYPE" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md flex items-center gap-1 text-black min-w-[180px]",
              onClick: () => setShowTripTypeDropdown(!showTripTypeDropdown),
              children: [
                (_b = tripTypeOptions.find((opt) => opt.value === tripType)) == null ? void 0 : _b.label,
                /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4" })
              ]
            }
          ),
          showTripTypeDropdown && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute top-full left-0 mt-1 bg-white text-black border border-gray-200 rounded-md shadow-lg z-10 min-w-[180px]", children: tripTypeOptions.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: `px-4 py-2 cursor-pointer hover:bg-gray-100 ${tripType === option.value ? "bg-blue-50 text-blue-600" : ""}`,
              onClick: () => {
                setTripType(option.value);
                setShowTripTypeDropdown(false);
              },
              children: option.label
            },
            option.value
          )) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "FROM" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => {
                setLocationType("from");
                setShowLocationModal(true);
              },
              children: fromLocation
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-5 relative inline-block", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "span",
            {
              className: "absolute -top-3 right-2 text-[11px] px-1.5 py-[1px] \r\n                bg-white text-purple-600 border border-black rounded-md \r\n               font-semibold shadow-sm",
              children: "new"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-[#2276e3] shadow",
              onClick: () => setShowStopsModal(true),
              children: "+ Add Stops"
            }
          )
        ] }),
        tripType === "rental" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "PACKAGE" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[150px] flex items-center justify-between",
              onClick: () => setShowRentalPackageDropdown(!showRentalPackageDropdown),
              children: [
                selectedRentalPackage ? selectedRentalPackage.label : "Select Package",
                /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4" })
              ]
            }
          ),
          showRentalPackageDropdown && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute top-full left-0 mt-1 bg-white text-black border border-gray-200 rounded-md shadow-lg z-10 min-w-[180px] max-h-60 overflow-y-auto", children: rentalPackages.map((pkg, idx) => /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: `px-4 py-2 cursor-pointer hover:bg-gray-100 ${selectedRentalPackage === pkg ? "bg-blue-50 text-blue-600" : ""}`,
              onClick: () => {
                setSelectedRentalPackage(pkg);
                setShowRentalPackageDropdown(false);
              },
              children: pkg.label
            },
            idx
          )) })
        ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "TO" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => {
                setLocationType("to");
                setShowLocationModal(true);
              },
              children: toLocation
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "PICKUP DATE" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => {
                setShowDateModal(true);
                setDateType("pickup");
              },
              children: pickupDate
            }
          )
        ] }),
        (tripType === "round" || tripType === "roundTrip") && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "RETURN DATE" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => {
                setShowDateModal(true);
                setDateType("return");
              },
              children: returnDate || "Select Date"
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "PICKUP TIME" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => setShowTimeModal(true),
              children: pickupTime
            }
          )
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          onClick: handleUpdateSearch,
          disabled: searchLoading,
          className: `text-lg font-semibold bg-white px-4 py-2 rounded-md ${searchLoading ? "text-gray-400" : "text-[#2276e3]"}`,
          children: searchLoading ? "SEARCHING..." : "UPDATE SEARCH"
        }
      ) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-8xl mx-auto flex flex-col lg:flex-row gap-6 mt-6 px-4 sm:px-6 pb-10", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("aside", { className: "w-full lg:w-1/4 bg-white p-5 shadow-sm rounded-lg h-fit sticky top-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-6", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-bold mb-3 text-black", children: "Why book one-way trip with us?" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "text-sm text-black font-normal space-y-2", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-start gap-2", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[#2276e3] p-1 bg-[#ddeafb] rounded-3xl", children: "✔" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Only one-side fare for your doorstep pickup & drop to destination" })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-start gap-2", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[#2276e3] p-1 bg-[#ddeafb] rounded-3xl", children: "✔" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "No hidden charges - Pay nothing extra than what's mentioned" })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-start gap-2", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[#2276e3] p-1 bg-[#ddeafb] rounded-3xl", children: "✔" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Experienced & polite drivers with clean & comfortable cabs" })
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              onClick: () => setShowKnowMore(true),
              className: "text-blue-600 text-sm mt-4 font-normal ml-16 cursor-pointer",
              children: "know more"
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border-t border-gray-200 pt-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-800", children: "Filters" }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-gray-500", children: [
              "Showing ",
              filteredCabs.length,
              " Car variation"
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              onClick: resetFilters,
              className: "text-red-500 text-sm font-medium mb-4 hover:underline",
              children: "CLEAR"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-6 border-b border-gray-200 pb-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-2", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-medium text-gray-700", children: "Price Filter" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "button",
                {
                  onClick: () => setPriceRange([filterOptions.minPrice, filterOptions.maxPrice]),
                  className: "text-blue-600 text-sm font-medium hover:underline",
                  children: "RESET"
                }
              )
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "input",
              {
                type: "range",
                min: filterOptions.minPrice,
                max: filterOptions.maxPrice,
                value: priceRange[1],
                onChange: (e2) => setPriceRange([priceRange[0], +e2.target.value]),
                className: "w-full accent-blue-600 -mt-2"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between text-sm mt-2 text-black", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
                "₹",
                priceRange[0]
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
                "₹",
                priceRange[1]
              ] })
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-6 border-b border-gray-200 pb-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-2", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-medium text-gray-700", children: "Car model" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "button",
                {
                  onClick: () => setSelectedModels([]),
                  className: "text-blue-600 text-sm font-medium hover:underline",
                  children: "RESET"
                }
              )
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2 text-sm text-black max-h-48 overflow-y-auto", children: filterOptions.models.length > 0 ? filterOptions.models.map((model, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "label",
              {
                className: "flex items-center gap-2 cursor-pointer hover:bg-gray-50 p-1 rounded",
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "input",
                    {
                      type: "checkbox",
                      className: "accent-blue-600",
                      checked: selectedModels.includes(model),
                      onChange: () => toggleModel(model)
                    }
                  ),
                  model
                ]
              },
              idx
            )) : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-400 text-xs text-center p-2", children: "No models available" }) })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-6 border-b border-gray-200 pb-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-2", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-medium text-gray-700", children: "Passenger capacity" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "button",
                {
                  onClick: () => setSelectedSeats([]),
                  className: "text-blue-600 text-sm font-medium hover:underline",
                  children: "RESET"
                }
              )
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2 text-sm", children: filterOptions.seats.length > 0 ? filterOptions.seats.map((seat, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "label",
              {
                className: "flex items-center gap-2 cursor-pointer text-black hover:bg-gray-50 p-1 rounded",
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "input",
                    {
                      type: "checkbox",
                      className: "accent-blue-600",
                      checked: selectedSeats.includes(seat),
                      onChange: () => toggleSeat(seat)
                    }
                  ),
                  seat,
                  " passenger seats"
                ]
              },
              idx
            )) : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-400 text-xs text-center p-2", children: "No options" }) })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "button",
            {
              onClick: () => window.scrollTo({ top: 0, behavior: "smooth" }),
              className: "w-full bg-[#f4f6fb] text-black font-medium py-3 rounded-lg mt-4 flex justify-center items-center gap-2",
              children: [
                "Back to Top ",
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-600", children: "↑" })
              ]
            }
          )
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("main", { className: "w-full lg:w-3/4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-semibold text-gray-800 mb-4", children: tripType === "rental" ? `Hourly Rental | ${selectedRentalPackage ? `${selectedRentalPackage.hours} hrs ${selectedRentalPackage.distance} km package` : "Select a package"} | Pickup & Drop in same city` : `${tripType === "oneway" ? "One-way" : tripType === "round" || tripType === "roundTrip" ? "Round" : tripType === "airport" ? "Airport" : "One-way"} trip | Estimated distance: ${searchCoordinates.distance} kms | 1 pickup & 1 drop included` }),
        searchLoading && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-blue-50 p-8 rounded-lg mb-6 border border-blue-100 text-center", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-spin rounded-full h-10 w-10 border-b-2 border-blue-600 mx-auto mb-4" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-blue-600 font-medium", children: "Searching for available cabs..." })
        ] }),
        searchError && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-red-50 p-4 rounded-lg mb-6 border border-red-200", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-red-600 font-medium", children: [
            "Error: ",
            searchError
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              onClick: handleUpdateSearch,
              className: "mt-2 text-sm text-blue-600 underline",
              children: "Try again"
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-blue-50 p-4 rounded-lg mb-6 border border-blue-100", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 mb-1", children: "Our Top Rated Partner" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-wrap items-baseline gap-2", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-700 font-semibold", children: "India's Leading Outstation Cab Rentals Since 2006" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-600 font-bold", children: "SAVAARI" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "a",
              {
                href: "https://www.savaari.com",
                className: "text-blue-600 text-sm",
                children: "gosavaari.com"
              }
            )
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-5", children: !searchLoading && filteredCabs.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white p-10 rounded-lg shadow-md text-center border border-gray-200", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-5xl mb-4", children: "🚖" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-xl font-bold text-gray-800", children: "No cabs available" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-600 mt-2", children: cabs.length > 0 ? "No cabs match your selected filters. Please try resetting filters." : "We couldn't find any vehicles for your selected route and time." }),
          cabs.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              onClick: resetFilters,
              className: "mt-4 px-4 py-2 bg-blue-600 text-white rounded font-medium hover:bg-blue-700 transition",
              children: "Reset Filters"
            }
          )
        ] }) : filteredCabs.map((cab) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: "bg-white rounded-lg shadow-md p-5 border border-gray-200 text-black",
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-start mb-4", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-xl font-bold text-gray-900", children: cab.name }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 mt-1", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-medium bg-gray-100 px-2 py-1 rounded", children: cab.type }),
                    cab.ac && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-medium bg-gray-100 px-2 py-1 rounded", children: "AC" }),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-xs font-medium bg-gray-100 px-2 py-1 rounded", children: [
                      cab.seats,
                      " seats"
                    ] })
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 mt-2", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-gray-600", children: cab.ratingsCount }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "bg-green-600 text-white text-xs px-2 py-1 rounded", children: cab.rating })
                  ] })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-42 h-20 flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "img",
                  {
                    src: cab.image,
                    alt: cab.name,
                    className: "w-full h-full object-cover rounded"
                  }
                ) })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4 mb-4", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "md:col-span-2", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: " text-black font-bold mb-2", children: cab.description }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "text-semibold text-black space-y-1", children: [
                    cab.rentalDetails ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
                        "• ",
                        cab.rentalDetails.packageHours,
                        " hrs & ",
                        cab.rentalDetails.packageKm,
                        " km included"
                      ] }),
                      /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
                        "• Extra km charges: ₹",
                        cab.rentalDetails.extraFarePerKm,
                        "/km"
                      ] })
                    ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
                      "• ",
                      cab.kms
                    ] }),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
                      "• ",
                      cab.cancel
                    ] }),
                    cab.reserve && /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
                      "• ",
                      cab.reserve
                    ] }),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
                      "• ",
                      cab.carType
                    ] })
                  ] })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-end", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500 text-sm font-medium mb-1", children: cab.discount }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-500 line-through text-sm", children: cab.originalPrice }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-2xl font-bold text-orange-600", children: cab.price })
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "button",
                    {
                      onClick: () => handleBookingSelect(cab),
                      className: "bg-orange-500 hover:bg-orange-600 text-white font-medium px-6 py-2 rounded-md mt-2",
                      children: "SELECT"
                    }
                  )
                ] })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border-t border-gray-200 pt-4 flex justify-between items-center", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-gray-600", children: [
                    cab.options,
                    " more options available"
                  ] }),
                  cab.optionButtons.map((option, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
                    "button",
                    {
                      className: "text-xs border border-gray-300 px-3 py-1 rounded-md bg-white",
                      children: [
                        option.type,
                        " @ ",
                        option.price
                      ]
                    },
                    index2
                  ))
                ] }),
                expandedCabId === cab.id ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "button",
                  {
                    onClick: () => setExpandedCabId(null),
                    className: ""
                  }
                ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "button",
                  {
                    onClick: () => setExpandedCabId(cab.id),
                    className: "text-sm text-blue-600 font-medium border border-blue-600 px-3 py-1 rounded-md",
                    children: "SHOW ALL"
                  }
                )
              ] }),
              expandedCabId === cab.id && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 space-y-0", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white border border-gray-200 rounded-lg overflow-hidden", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-[#e6faff] text-sm text-[#007baf] font-medium px-4 py-2 border-b border-[#b8eaff]", children: "✨ Roof Carrier available with this car starting @ INR 157" }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between p-5", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-2/3", children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xl font-bold text-gray-900 mb-3 flex items-center gap-2", children: [
                        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "w-1 h-6 bg-blue-600 rounded-sm" }),
                        "Comfortable car"
                      ] }),
                      /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "text-[15px] text-gray-800 space-y-3", children: [
                        /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-center gap-3", children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-600 text-lg", children: "✔" }),
                          "193 kms included. After that ₹18.5/km"
                        ] }),
                        /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-center gap-3", children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-600 text-lg", children: "✔" }),
                          "Free cancellation until 1 hour before pickup"
                        ] }),
                        /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-center gap-3", children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-600 text-lg", children: "✔" }),
                          "Reserve this cab at ₹797 only"
                        ] }),
                        /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-center gap-3", children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-700 text-2xl", children: "⛽" }),
                          "Diesel Car"
                        ] })
                      ] })
                    ] }),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-1/3 flex flex-col items-end justify-between", children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-600 mb-4", children: [
                        "9 ratings",
                        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "bg-green-600 text-white text-xs px-2 py-1 rounded", children: "4.1 / 5" })
                      ] }),
                      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right", children: [
                        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500 text-xs font-bold bg-red-100 px-2 py-0.5 rounded", children: "15% off" }),
                        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-gray-500 line-through text-sm", children: "₹3068" }),
                        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-3xl font-bold text-gray-900", children: "₹2603" }),
                        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-gray-500 text-xs", children: "+ ₹559 taxes & fees" }),
                        /* @__PURE__ */ jsxRuntimeExports.jsx(
                          "button",
                          {
                            onClick: () => handleBookingSelect(cab),
                            className: "bg-orange-500 hover:bg-orange-600 text-white font-semibold px-8 py-2 rounded-md mt-3",
                            children: "SELECT"
                          }
                        )
                      ] })
                    ] })
                  ] })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white border border-gray-200 rounded-lg overflow-hidden", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-[#e6faff] text-sm text-[#007baf] font-medium px-4 py-2 border-b border-[#b8eaff]", children: "✨ Roof Carrier available with this car starting @ INR 158" }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between p-5", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-2/3", children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xl font-bold text-gray-900 mb-3 flex items-center gap-2", children: [
                        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "w-1 h-6 bg-blue-600 rounded-sm" }),
                        "Comfortable car"
                      ] }),
                      /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "text-[15px] text-gray-800 space-y-3", children: [
                        /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-center gap-3", children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-600 text-lg", children: "✔" }),
                          "193 kms included. After that ₹15.0/km"
                        ] }),
                        /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-center gap-3", children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-600 text-lg", children: "✔" }),
                          "Free cancellation until 1 hour before pickup"
                        ] }),
                        /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-center gap-3", children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-600 text-lg", children: "✔" }),
                          "Reserve this cab at ₹813 only"
                        ] }),
                        /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-center gap-3", children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-700 text-2xl", children: "⛽" }),
                          "Petrol Car"
                        ] })
                      ] })
                    ] }),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-1/3 flex flex-col items-end justify-between", children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-600 mb-4", children: [
                        "35 ratings",
                        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "bg-green-600 text-white text-xs px-2 py-1 rounded", children: "4.6 / 5" })
                      ] }),
                      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right", children: [
                        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500 text-xs font-bold bg-red-100 px-2 py-0.5 rounded", children: "15% off" }),
                        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-gray-500 line-through text-sm", children: "₹3163" }),
                        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-3xl font-bold text-gray-900", children: "₹2686" }),
                        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-gray-500 text-xs", children: "+ ₹556 taxes & fees" }),
                        /* @__PURE__ */ jsxRuntimeExports.jsx(
                          "button",
                          {
                            onClick: () => handleBookingSelect(cab),
                            className: "bg-orange-500 hover:bg-orange-600 text-white font-semibold px-8 py-2 rounded-md mt-3",
                            children: "SELECT"
                          }
                        )
                      ] })
                    ] })
                  ] })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-end py-4 pr-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
                  "button",
                  {
                    onClick: () => setExpandedCabId(null),
                    className: "text-lg font-semibold text-blue-600 flex items-center gap-1",
                    children: [
                      "HIDE ALL ",
                      /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 rotate-180" })
                    ]
                  }
                ) })
              ] })
            ]
          },
          cab.id
        )) })
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Footer, {})
  ] });
};
function ChevronDownIcon({
  title,
  titleId,
  ...props
}, svgRef) {
  return /* @__PURE__ */ reactExports.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24",
    fill: "currentColor",
    "aria-hidden": "true",
    "data-slot": "icon",
    ref: svgRef,
    "aria-labelledby": titleId
  }, props), title ? /* @__PURE__ */ reactExports.createElement("title", {
    id: titleId
  }, title) : null, /* @__PURE__ */ reactExports.createElement("path", {
    fillRule: "evenodd",
    d: "M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z",
    clipRule: "evenodd"
  }));
}
const ForwardRef$1 = /* @__PURE__ */ reactExports.forwardRef(ChevronDownIcon);
function ChevronUpIcon({
  title,
  titleId,
  ...props
}, svgRef) {
  return /* @__PURE__ */ reactExports.createElement("svg", Object.assign({
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24",
    fill: "currentColor",
    "aria-hidden": "true",
    "data-slot": "icon",
    ref: svgRef,
    "aria-labelledby": titleId
  }, props), title ? /* @__PURE__ */ reactExports.createElement("title", {
    id: titleId
  }, title) : null, /* @__PURE__ */ reactExports.createElement("path", {
    fillRule: "evenodd",
    d: "M11.47 7.72a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 1 1-1.06 1.06L12 9.31l-6.97 6.97a.75.75 0 0 1-1.06-1.06l7.5-7.5Z",
    clipRule: "evenodd"
  }));
}
const ForwardRef = /* @__PURE__ */ reactExports.forwardRef(ChevronUpIcon);
const DetailPage = () => {
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z;
  const { id } = useParams();
  const navigate = useNavigate();
  const location = useLocation();
  const dispatch = useDispatch();
  const { t: t2 } = useTranslation();
  const { bookingReview, reviewLoading, reviewError } = useSelector(
    (state) => state.booking
  );
  const [activeTab, setActiveTab] = reactExports.useState("ALL");
  const [showFareBreakdown, setShowFareBreakdown] = reactExports.useState(false);
  const [showCabDetails, setShowCabDetails] = reactExports.useState(true);
  const [showCancel, setShowCancel] = reactExports.useState(false);
  const [showOther, setShowOther] = reactExports.useState(false);
  const [currentAmount, setCurrentAmount] = reactExports.useState("");
  const [paymentType, setPaymentType] = reactExports.useState("partial");
  const [showTraveller, setShowTraveller] = reactExports.useState(false);
  reactExports.useEffect(() => {
    const searchParams = location.state;
    if (searchParams && (searchParams.vehicleId || searchParams.groupId)) {
      dispatch(getBookingReview({
        // Pass vehicleId if available, otherwise pass groupId (backend handles groupId fallback)
        vehicleId: searchParams.vehicleId || searchParams.groupId,
        picklat: searchParams.picklat,
        picklng: searchParams.picklng,
        pickupAddress: searchParams.pickupAddress,
        pickupCity: searchParams.pickupCity,
        pickupState: searchParams.pickupState,
        droplat: searchParams.droplat,
        droplng: searchParams.droplng,
        dropAddress: searchParams.dropAddress,
        dropCity: searchParams.dropCity,
        dropState: searchParams.dropState,
        distance: searchParams.distance,
        tripType: searchParams.tripType || "oneWay",
        fuelType: searchParams.fuelType || "petrol",
        isAc: searchParams.isAc !== void 0 ? searchParams.isAc : true,
        scheduledTime: searchParams.scheduledTime,
        promoCode: searchParams.promoCode,
        rentalPackage: searchParams.rentalPackage
      }));
    }
    return () => {
      dispatch(resetBookingReview());
    };
  }, [dispatch, location.state]);
  const cabData = [
    {
      id: 1,
      name: "Indica, Wagon R",
      type: "HATCHBACK",
      ac: true,
      seats: 4,
      kms: "191 kms included. After that ₹18.0/km",
      cancel: "Free cancellation until 1 hour before pickup",
      carType: "CNG Car",
      price: "₹3204",
      partialPayment: "₹688",
      image: "https://gos3.ibcdn.com/hatchback_v_5_copy-1576142454.png"
    },
    {
      id: 2,
      name: "Swift Dzire, Etios",
      type: "SEDAN",
      ac: true,
      seats: 4,
      kms: "197 kms included. After that ₹9/km",
      cancel: "Free cancellation until 1 hour before pickup",
      carType: "Petrol Car",
      price: "₹2789",
      partialPayment: "₹556",
      image: "https://gos3.ibcdn.com/sedan_v_2_copy_2-1576142484.png"
    },
    {
      id: 3,
      name: "Innova, Ertiga",
      type: "SUV",
      ac: true,
      seats: 6,
      kms: "197 kms included. After that ₹12/km",
      cancel: "Free cancellation until 1 hour before pickup",
      carType: "Diesel Car",
      price: "₹3499",
      partialPayment: "₹700",
      image: "https://gos3.ibcdn.com/hatchback_v_5_copy-1576142454.png"
    }
  ];
  const imageData = {
    ALL: [
      "https://go-assets.ibcdn.com/u/MMT/images/1732607472482-hatchback_Unknown_Unknown_EXTERIOR_Front_view_.jpeg",
      "https://go-assets.ibcdn.com/u/MMT/images/1732607474462-hatchback_Unknown_Unknown_EXTERIOR_Side_View.jpeg"
    ],
    BOOT: [
      "https://go-assets.ibcdn.com/u/MMT/images/1732607480576-hatchback_Unknown_Unknown_BOOT_Sufficient_boot_space_for_2_bags.jpeg"
    ],
    EXTERIOR: [
      "https://go-assets.ibcdn.com/u/MMT/images/1732607472482-hatchback_Unknown_Unknown_EXTERIOR_Front_view_.jpeg",
      "https://go-assets.ibcdn.com/u/MMT/images/1732607474462-hatchback_Unknown_Unknown_EXTERIOR_Side_View.jpeg"
    ],
    INTERIOR: [
      "https://go-assets.ibcdn.com/u/MMT/images/1732607476045-hatchback_Unknown_Unknown_INTERIOR_Dashboard,_leg_space_in_front_seat.jpeg",
      "https://go-assets.ibcdn.com/u/MMT/images/1732607478924-hatchback_Unknown_Unknown_INTERIOR_Ample_leg_space_in_back_seat.jpeg"
    ]
  };
  let cab = null;
  if (bookingReview && bookingReview.vehicle) {
    const { vehicle, pricing } = bookingReview;
    const partialOption = (_a = bookingReview.paymentOptions) == null ? void 0 : _a.find((p2) => p2.type === "partial");
    cab = {
      id: vehicle.id,
      registrationNumber: vehicle.registrationNumber,
      name: vehicle.name,
      type: vehicle.category,
      ac: vehicle.isAc,
      seats: vehicle.seats,
      kms: `${vehicle.includedKm} ${t2("cabSearch.includedKm") || "included"}. ${t2("cabSearch.afterThat")} ₹${vehicle.extraKmRate}/${t2("cabSearch.perKm")}`,
      cancel: vehicle.cancellationPolicy,
      carType: `${vehicle.fuelType} Car`,
      price: `₹${pricing.finalTotal}`,
      partialPayment: `₹${(partialOption == null ? void 0 : partialOption.amount) || Math.round(pricing.finalTotal * 0.2)}`,
      image: vehicle.image || ((_c = (_b = bookingReview.categoryImages) == null ? void 0 : _b.images) == null ? void 0 : _c.front) || "https://gos3.ibcdn.com/hatchback_v_5_copy-1576142454.png"
    };
    if ((_d = bookingReview.categoryImages) == null ? void 0 : _d.images) {
      const apiImages = bookingReview.categoryImages.images;
      imageData.ALL = apiImages.all || imageData.ALL;
      imageData.EXTERIOR = [apiImages.front, apiImages.exterior].filter(Boolean);
      imageData.INTERIOR = [apiImages.interior].filter(Boolean);
      imageData.BOOT = [apiImages.boot].filter(Boolean);
    }
  } else {
    cab = cabData.find((c2) => c2.id.toString() === id);
  }
  reactExports.useEffect(() => {
    if (cab) {
      setCurrentAmount(paymentType === "partial" ? cab.partialPayment : cab.price);
    }
  }, [cab, paymentType]);
  if (reviewLoading) {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center min-h-screen bg-gray-50", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-orange-500 mb-4" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-gray-600 font-medium", children: "Loading booking details..." })
    ] });
  }
  if (reviewError) {
    const isNoVehicle = reviewError.includes("No vehicles available") || reviewError.includes("Vehicle not found");
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col min-h-screen bg-gray-50", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col items-center justify-center flex-1 px-4 pt-20", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg shadow-lg p-8 max-w-md w-full text-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-16 h-16 mx-auto mb-4 bg-orange-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-8 h-8 text-orange-500", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-xl font-bold text-gray-800 mb-2", children: isNoVehicle ? "No Vehicles Available" : "Error Loading Details" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-600 mb-6", children: isNoVehicle ? "All vehicles in this category are currently booked or unavailable. Please try a different category or check back later." : reviewError }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-3", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              onClick: () => navigate(-1),
              className: "bg-orange-500 hover:bg-orange-600 text-white px-6 py-3 rounded-lg font-semibold transition",
              children: "Go Back to Search"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              onClick: () => navigate("/"),
              className: "text-blue-600 hover:text-blue-700 font-medium",
              children: "Return to Home"
            }
          )
        ] })
      ] }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Footer, {})
    ] });
  }
  if (!cab) {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center min-h-screen bg-gray-50", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-gray-800 font-bold text-xl mb-2", children: "Cab not found" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-600 mb-4", children: "We couldn't find the details for this cab." }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => navigate(-1), className: "bg-orange-500 text-white px-6 py-2 rounded", children: "Go Back" })
    ] });
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col min-h-screen text-black bg-[#eef4fd] font-['Rubik']", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full h-80 bg-[#da6702] rounded-b-[80%] pt-8 px-36 text-white", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-8", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-2xl text-white mt-12 font-bold", children: t2("booking.reviewYourBooking") }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-xl font-medium", children: [
        (_f = (_e = location.state) == null ? void 0 : _e.pickupAddress) == null ? void 0 : _f.split(",")[0],
        " - ",
        (_h = (_g = location.state) == null ? void 0 : _g.dropAddress) == null ? void 0 : _h.split(",")[0]
      ] }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-xl font-medium", children: [
            (() => {
              var _a2;
              const type = (_a2 = location.state) == null ? void 0 : _a2.tripType;
              if (type === "round" || type === "roundTrip") return t2("tripTypes.round");
              if (type === "airport") return t2("tripTypes.airport");
              if (type === "rental") return t2("tripTypes.hourly");
              return t2("tripTypes.oneway");
            })(),
            " |"
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "border-white my-2" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-xl font-medium", children: [
            t2("booking.pickup"),
            " : ",
            (_i = location.state) == null ? void 0 : _i.pickupDate,
            " - ",
            (_j = location.state) == null ? void 0 : _j.pickupTime
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-medium mr-44", children: t2("booking.hurry") }) })
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-w-7xl mx-auto w-full px-4 -mt-24", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-8", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-8/12", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-white rounded-lg p-6 mb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-8", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-1/4", children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: cab.image, alt: cab.name, className: "w-full" }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-3/4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-2xl font-bold mb-4", children: cab.name }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-5 mb-6", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "ri-hand-sanitizer-line mr-2" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "text-base", children: t2("cabInfo.sanitizers") })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "img",
                  {
                    src: "https://gos3.ibcdn.com/SRP_Premium_Driver_Amenities-1628058339.png",
                    alt: "Route expert",
                    className: "w-5 h-5 mr-2"
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "text-base", children: t2("cabInfo.routeExpert") })
              ] })
            ] }),
            showCabDetails && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-6", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("h5", { className: "text-sm font-light", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "ri-checkbox-circle-line mr-2 text-green-500" }),
                cab.kms
              ] }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("h5", { className: "text-sm font-light", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "ri-checkbox-circle-line mr-2 text-green-500" }),
                cab.cancel
              ] }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("h4", { className: "text-base font-light flex items-center", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "img",
                  {
                    src: "https://gos3.ibcdn.com/Cab_SRP_SKU_FuelType-1628160479.png",
                    alt: "CNG Car",
                    className: "w-5 h-5 mr-2"
                  }
                ),
                cab.carType
              ] }) })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "button",
              {
                className: "text-blue-500 text-sm font-light mb-6 flex items-center gap-1",
                onClick: () => setShowCabDetails(!showCabDetails),
                children: [
                  showCabDetails ? t2("common.hideDetails") : t2("common.showDetails"),
                  showCabDetails ? /* @__PURE__ */ jsxRuntimeExports.jsx(ForwardRef, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ForwardRef$1, { className: "h-4 w-4" })
                ]
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-green-600 mb-2", children: t2("booking.goodChoice") }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3  ", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "bg-green-600 text-white text-sm px-3 py-1 rounded", children: t2("payment.freeWaiting") || "Free waiting upto 30 minutes" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "bg-green-600 text-white text-sm px-3 py-1 rounded", children: t2("payment.freeCancellation") || "Free cancellation until 1hr before pickup" })
              ] })
            ] })
          ] })
        ] }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg p-6 mb-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-5 mb-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "img",
              {
                src: "https://gos3.ibcdn.com/CabDriverReviewPageIconMweb-1625479893.png",
                alt: "Cab driver",
                className: "w-20 h-20"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-xl font-bold mb-2", children: t2("payment.cabDriverDetails") }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-700", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: t2("booking.cabOperator") }),
                " ",
                t2("booking.willBeAssigned"),
                " ",
                t2("booking.bookingComplete"),
                ". ",
                t2("booking.detailsShared"),
                " ",
                /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Whatsapp & SMS" }),
                " ",
                t2("booking.onRegisteredMobile"),
                " ",
                /* @__PURE__ */ jsxRuntimeExports.jsxs("strong", { children: [
                  (_k = location.state) == null ? void 0 : _k.pickupDate,
                  " ",
                  t2("common.at"),
                  " ",
                  (_l = location.state) == null ? void 0 : _l.pickupTime
                ] })
              ] })
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "my-4" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-light mb-2", children: t2("booking.imagesOfVehicle") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 bg-amber-100 p-2 rounded mb-4", children: t2("booking.imageDisclaimer") }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3 mb-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                className: `px-3 py-1 rounded-full text-sm ${activeTab === "ALL" ? "bg-gray-200 font-medium" : "bg-white"}`,
                onClick: () => setActiveTab("ALL"),
                children: "ALL (5)"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                className: `px-3 py-1 rounded-full text-sm ${activeTab === "BOOT" ? "bg-gray-200 font-medium" : "bg-white"}`,
                onClick: () => setActiveTab("BOOT"),
                children: "BOOT (1)"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                className: `px-3 py-1 rounded-full text-sm ${activeTab === "EXTERIOR" ? "bg-gray-200 font-medium" : "bg-white"}`,
                onClick: () => setActiveTab("EXTERIOR"),
                children: "EXTERIOR (2)"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                className: `px-3 py-1 rounded-full text-sm ${activeTab === "INTERIOR" ? "bg-gray-200 font-medium" : "bg-white"}`,
                onClick: () => setActiveTab("INTERIOR"),
                children: "INTERIOR (2)"
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-center gap-4", children: imageData[activeTab].map((src, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
            "img",
            {
              src,
              alt: `${activeTab} view`,
              className: "w-72 h-56 rounded-lg border border-gray-200"
            },
            index2
          )) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg p-6 mb-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-xl font-bold mb-4", children: t2("booking.inclusionsExclusions") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "mb-4" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold mb-4 ml-10", children: t2("booking.includedInFare") }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-4", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ml-10", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("h4", { className: "text-sm font-light mb-2 flex items-center", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "ri-check-line text-green-500 mr-2" }),
                  ((_m = location.state) == null ? void 0 : _m.distance) || 190,
                  " ",
                  t2("common.kms")
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("h4", { className: "text-sm font-light flex items-center", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "ri-check-line text-green-500 mr-2" }),
                  t2("booking.stateTaxes")
                ] })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mr-20", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("h4", { className: "text-sm font-light mb-2 flex items-center", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "ri-check-line text-green-500 mr-2" }),
                  t2("booking.onePickupDrop")
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("h4", { className: "text-sm font-light flex items-center", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "ri-check-line text-green-500 mr-2" }),
                  t2("booking.tollCharges")
                ] })
              ] })
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "my-4" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ml-10", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold mb-2", children: t2("booking.extraCharges") }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("h4", { className: "text-sm font-light mb-1", children: [
              t2("booking.fareBeyond"),
              " ",
              ((_n = location.state) == null ? void 0 : _n.distance) || 190,
              " ",
              t2("common.kms"),
              ": Rs 18.0/",
              t2("common.km")
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "text-sm font-light", children: t2("payment.waitingCharges") || "Waiting charges ₹300/60 mins after 30 minutes" })
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg p-6 mb-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-xl font-bold mb-4", children: t2("booking.specialRequests") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "mb-4" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center ml-10", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-lg font-medium flex items-center", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "ri-checkbox-blank-line mr-2" }),
                t2("booking.roofCarrier")
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "text-sm font-light", children: t2("booking.roofCarrierDesc") })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-lg font-medium flex items-center", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "ri-money-rupee-circle-line mr-2" }),
              "315"
            ] }) })
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg p-6 mb-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-xl font-bold mb-2", children: t2("booking.pickupAddress") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg mb-2", children: ((_p = (_o = location.state) == null ? void 0 : _o.pickupAddress) == null ? void 0 : _p.split(",")[0]) || t2("booking.enterPickup") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-light mb-2", children: t2("booking.enterPickup") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "w-full border border-gray-300 rounded-md py-2 text-center", children: ((_q = location.state) == null ? void 0 : _q.pickupAddress) || t2("booking.selectPickup") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-sm font-semibold text-red-600 mt-2", children: t2("booking.locationUpdateWarning") })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-base font-light flex items-center ml-2", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "ri-checkbox-blank-line mr-2" }),
            t2("booking.useAsBilling")
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg p-6 mb-4 shadow-sm", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "button",
            {
              onClick: () => setShowTraveller(!showTraveller),
              className: "w-full flex items-center justify-between",
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-4", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-xl font-bold", children: t2("booking.travellerDetails") }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-green-50 border border-green-100 rounded px-3 py-1 ml-44", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-600 text-sm font-medium", children: t2("booking.signInPrompt") }) })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-8 h-8 bg-gray-100 rounded-full flex items-center justify-center", children: showTraveller ? /* @__PURE__ */ jsxRuntimeExports.jsx(ForwardRef, { className: "w-5 h-5 text-gray-500" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ForwardRef$1, { className: "w-5 h-5 text-gray-500" }) })
              ]
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "div",
            {
              className: `transition-all duration-300 overflow-hidden ${showTraveller ? "max-h-[900px] mt-4 border-t pt-4" : "max-h-0"}`,
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-4", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-sm mb-2", children: t2("profile.gender") }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("select", { className: "border border-gray-300 rounded-md px-3 py-2 w-full", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx("option", { children: t2("profile.male") }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("option", { children: t2("profile.female") }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("option", { children: t2("profile.other") })
                  ] })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-4", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-sm mb-2", children: t2("profile.name") }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "input",
                    {
                      type: "text",
                      placeholder: t2("profile.enterName"),
                      className: "border border-gray-300 rounded-md px-3 py-2 w-full"
                    }
                  )
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-4", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-sm mb-2", children: t2("profile.phone") }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx("select", { className: "border border-gray-300 rounded-l-md px-3 py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("option", { children: "91" }) }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "input",
                      {
                        type: "text",
                        placeholder: t2("profile.enterPhone"),
                        className: "border border-gray-300 rounded-r-md px-3 py-2 w-full"
                      }
                    )
                  ] })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-sm mb-2", children: t2("profile.email") }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "input",
                    {
                      type: "email",
                      placeholder: t2("profile.enterEmail"),
                      className: "border border-gray-300 rounded-md px-3 py-2 w-full"
                    }
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500 mt-1", children: t2("booking.emailDisclaimer") })
                ] })
              ]
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg p-5 mb-4 shadow-sm", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "button",
            {
              onClick: () => setShowCancel(!showCancel),
              className: "w-full flex justify-between items-center",
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-xl font-bold", children: t2("cabInfo.cancellationPolicy") }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-8 h-8 bg-gray-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-600 text-xl", children: showTraveller ? /* @__PURE__ */ jsxRuntimeExports.jsx(ForwardRef, { className: "w-5 h-5 text-gray-500" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ForwardRef$1, { className: "w-5 h-5 text-gray-500" }) }) })
              ]
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "div",
            {
              className: `transition-all duration-300 overflow-hidden ${showCancel ? "max-h-[500px] mt-4 pt-4 border-t" : "max-h-0"}`,
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-3 mb-5", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-10 h-10 bg-green-600 text-white rounded-full flex items-center justify-center text-xl font-bold", children: "₹" }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-[2px] bg-green-500 h-10" })
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-black", children: t2("booking.afterBookingConfirmed") }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: t2("cabInfo.freeCancellation") })
                  ] })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-3", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-10 h-10 bg-red-600 text-white rounded-full flex items-center justify-center text-xl", children: "🚗" }) }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold text-black", children: [
                      t2("booking.afterTime"),
                      " 21 Nov 9:00 am"
                    ] }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: t2("booking.noRefund") })
                  ] })
                ] })
              ]
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg p-5 mb-4 shadow-sm", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "button",
            {
              onClick: () => setShowOther(!showOther),
              className: "w-full flex justify-between items-center",
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-xl font-bold", children: t2("booking.otherInformation") }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-8 h-8 bg-gray-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-600 text-xl", children: showTraveller ? /* @__PURE__ */ jsxRuntimeExports.jsx(ForwardRef, { className: "w-5 h-5 text-gray-500" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ForwardRef$1, { className: "w-5 h-5 text-gray-500" }) }) })
              ]
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: `transition-all duration-300 overflow-hidden ${showOther ? "max-h-[500px] mt-4 border-t pt-4" : "max-h-0"}`,
              children: /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "text-gray-700 space-y-3", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-start gap-3", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-500 text-xl", children: "•" }),
                  t2("booking.acOffHilly")
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-start gap-3", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-500 text-xl", children: "•" }),
                  t2("booking.oneStopIncluded")
                ] })
              ] })
            }
          )
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-4/12 sticky top-20 h-fit ", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg shadow p-6 mb-6", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-6", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-bold", children: t2("payment.totalAmount") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: t2("payment.inclusiveGST") })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right relative", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-2xl font-bold", children: cab.price }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs(
                "div",
                {
                  className: "text-right relative inline-block",
                  onMouseEnter: () => setShowFareBreakdown(true),
                  onMouseLeave: () => setShowFareBreakdown(false),
                  children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-blue-400 hover:text-orange-500 cursor-pointer font-medium", children: t2("common.viewDetails") }),
                    showFareBreakdown && /* @__PURE__ */ jsxRuntimeExports.jsxs(
                      "div",
                      {
                        className: "absolute right-0 top-full mt-2 w-[350px] bg-white \r\n                                     border-blue-400 shadow-sm p-5 border-[2px] rounded-[2px] z-20",
                        children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-3", children: [
                            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[12px] text-gray-500 mr-[180px]", children: t2("payment.baseFare") }),
                              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[12px] text-gray-500 mr-20", children: [
                                t2("common.for"),
                                " ",
                                ((_r = bookingReview == null ? void 0 : bookingReview.route) == null ? void 0 : _r.distance) || ((_s = location.state) == null ? void 0 : _s.distance) || 190,
                                " ",
                                t2("common.kms")
                              ] })
                            ] }),
                            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[15px] font-semibold", children: [
                              "₹",
                              ((_u = (_t = bookingReview == null ? void 0 : bookingReview.pricing) == null ? void 0 : _t.fare) == null ? void 0 : _u.base) || 0
                            ] })
                          ] }),
                          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-3", children: [
                            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[12px] text-gray-500 mr-28", children: t2("payment.distanceCharge") }),
                              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[12px] text-gray-500", children: [
                                "@₹",
                                ((_v = bookingReview == null ? void 0 : bookingReview.vehicle) == null ? void 0 : _v.extraKmRate) || 0,
                                "/",
                                t2("common.km"),
                                " ",
                                t2("booking.after"),
                                " ",
                                ((_w = bookingReview == null ? void 0 : bookingReview.vehicle) == null ? void 0 : _w.includedKm) || 0,
                                " ",
                                t2("common.kms")
                              ] })
                            ] }),
                            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[15px] font-semibold", children: [
                              "₹",
                              ((_y = (_x = bookingReview == null ? void 0 : bookingReview.pricing) == null ? void 0 : _x.fare) == null ? void 0 : _y.distance) || 0
                            ] })
                          ] }),
                          ((_A = (_z = bookingReview == null ? void 0 : bookingReview.pricing) == null ? void 0 : _z.fare) == null ? void 0 : _A.nightCharge) > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-3", children: [
                            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[12px] text-gray-500 mr-28", children: t2("payment.nightCharge") }),
                            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[15px] font-semibold", children: [
                              "₹",
                              (_C = (_B = bookingReview == null ? void 0 : bookingReview.pricing) == null ? void 0 : _B.fare) == null ? void 0 : _C.nightCharge
                            ] })
                          ] }),
                          ((_E = (_D = bookingReview == null ? void 0 : bookingReview.pricing) == null ? void 0 : _D.fare) == null ? void 0 : _E.zoneExtraCharge) > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-3", children: [
                            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[12px] text-gray-500 mr-28", children: t2("booking.tollStateTax") }),
                              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[12px] text-gray-500", children: t2("booking.zoneExtraCharges") })
                            ] }),
                            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[15px] font-semibold", children: [
                              "₹",
                              (_G = (_F = bookingReview == null ? void 0 : bookingReview.pricing) == null ? void 0 : _F.fare) == null ? void 0 : _G.zoneExtraCharge
                            ] })
                          ] }),
                          ((_I = (_H = bookingReview == null ? void 0 : bookingReview.pricing) == null ? void 0 : _H.fare) == null ? void 0 : _I.airportCharge) > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-3", children: [
                            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[12px] text-gray-500 mr-28", children: t2("payment.airportSurcharge") }),
                              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[12px] text-gray-500 opacity-0", children: "." })
                            ] }),
                            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[15px] font-semibold", children: [
                              "₹",
                              (_K = (_J = bookingReview == null ? void 0 : bookingReview.pricing) == null ? void 0 : _J.fare) == null ? void 0 : _K.airportCharge
                            ] })
                          ] }),
                          ((_M = (_L = bookingReview == null ? void 0 : bookingReview.pricing) == null ? void 0 : _L.fare) == null ? void 0 : _M.stops) > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-3", children: [
                            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[12px] text-gray-500 mr-28", children: t2("payment.stopsCharge") }),
                            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[15px] font-semibold", children: [
                              "₹",
                              (_O = (_N = bookingReview == null ? void 0 : bookingReview.pricing) == null ? void 0 : _N.fare) == null ? void 0 : _O.stops
                            ] })
                          ] }),
                          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-3", children: [
                            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[15px] text-gray-500", children: t2("payment.gstTaxes") }),
                              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[12px] text-gray-500", children: "@5%" })
                            ] }),
                            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[15px] font-semibold", children: [
                              "₹",
                              ((_Q = (_P = bookingReview == null ? void 0 : bookingReview.pricing) == null ? void 0 : _P.fare) == null ? void 0 : _Q.taxes) || 0
                            ] })
                          ] }),
                          ((_S = (_R = bookingReview == null ? void 0 : bookingReview.pricing) == null ? void 0 : _R.discount) == null ? void 0 : _S.discountAmount) > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between mb-3", children: [
                            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[12px] text-green-600 mr-28", children: t2("payment.discountApplied") }),
                              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[12px] text-green-600", children: ((_U = (_T = bookingReview == null ? void 0 : bookingReview.pricing) == null ? void 0 : _T.discount) == null ? void 0 : _U.description) || "Promo discount" })
                            ] }),
                            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[15px] font-semibold text-green-600", children: [
                              "-₹",
                              (_W = (_V = bookingReview == null ? void 0 : bookingReview.pricing) == null ? void 0 : _V.discount) == null ? void 0 : _W.discountAmount
                            ] })
                          ] }),
                          /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "my-3 border-gray-200" }),
                          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between", children: [
                            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[14px] font-semibold text-gray-700", children: "Total Amount" }),
                            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[16px] font-bold text-black", children: [
                              "₹",
                              ((_X = bookingReview == null ? void 0 : bookingReview.pricing) == null ? void 0 : _X.finalTotal) || ((_Z = (_Y = bookingReview == null ? void 0 : bookingReview.pricing) == null ? void 0 : _Y.fare) == null ? void 0 : _Z.total) || 0
                            ] })
                          ] })
                        ]
                      }
                    )
                  ]
                }
              )
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "label",
              {
                onClick: () => {
                  setPaymentType("partial");
                  setCurrentAmount(cab.partialPayment);
                },
                className: `flex items-start gap-2 p-3 rounded cursor-pointer ${paymentType === "partial" ? "bg-orange-50 " : "bg-gray-50"}`,
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "input",
                    {
                      type: "radio",
                      name: "payment",
                      checked: paymentType === "partial",
                      readOnly: true
                    }
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold", children: [
                      "Pay ",
                      cab.partialPayment,
                      " Now"
                    ] }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-600", children: "Remaining to driver" })
                  ] })
                ]
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "label",
              {
                onClick: () => {
                  setPaymentType("full");
                  setCurrentAmount(cab.price);
                },
                className: `flex items-start gap-2 p-3 rounded cursor-pointer 
      ${paymentType === "full" ? "bg-orange-50 b" : "bg-gray-50"}`,
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "input",
                    {
                      type: "radio",
                      name: "payment",
                      checked: paymentType === "full",
                      readOnly: true
                    }
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold", children: [
                      "Pay ",
                      cab.price,
                      " Now"
                    ] }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-600", children: "Full payment" })
                  ] })
                ]
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "button",
            {
              onClick: () => {
                var _a2;
                const searchParams = location.state || {};
                const amountValue = currentAmount ? currentAmount.replace(/[^0-9.]/g, "") : "0";
                const totalValue = cab.price ? cab.price.replace(/[^0-9.]/g, "") : "0";
                navigate(`/payment/${cab.id}`, {
                  state: {
                    // Forward search params
                    ...searchParams,
                    // Vehicle details override
                    vehicleId: cab.id,
                    registrationNumber: cab.registrationNumber,
                    vehicleName: cab.name,
                    category: cab.type,
                    isAc: cab.ac,
                    fuelType: ((_a2 = cab.carType) == null ? void 0 : _a2.split(" ")[0].toLowerCase()) || "petrol",
                    // Payment specifics
                    amount: amountValue,
                    totalFare: totalValue,
                    paymentType,
                    // Ensure these exist if not in searchParams
                    // Format date as YYYY-MM-DD for backend
                    pickupDate: searchParams.scheduledTime ? new Date(searchParams.scheduledTime).toISOString().split("T")[0] : (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
                    pickupTime: "10:00 AM",
                    // Default if not in params
                    returnDate: searchParams.returnDate,
                    distance: searchParams.distance || 190
                  }
                });
              },
              className: "mt-5 w-full bg-[#ff6200] text-white py-2 rounded-lg",
              children: [
                "Pay ",
                currentAmount,
                " & confirm now"
              ]
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg shadow p-6 mb-5", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-xl font-bold mb-4", children: "Offers" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-green-50 border border-green-100 rounded-md px-4 py-3 flex items-center gap-2 mb-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-yellow-500 text-xl font-bold", children: "go" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-green-700 font-medium", children: "Sign in and use your goCash" })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "flex items-start gap-3 border rounded-lg px-4 py-3 mb-4 cursor-pointer", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "input",
              {
                type: "radio",
                name: "offer",
                className: "mt-1 h-4 w-4 accent-blue-600"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-[15px]", children: "GODEAL" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: "Get up-to Rs.200 Off" })
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 mb-2 font-bold text-[15px]", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-600 text-xl", children: "🏷️" }),
            "ENTER PROMO CODE"
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border rounded-lg flex items-center overflow-hidden", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "input",
              {
                type: "text",
                placeholder: "Got A Promocode? Enter",
                className: "px-3 py-3 w-full text-sm outline-none"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "bg-gray-200 px-4 py-3 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-600 text-lg", children: ">" }) })
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", {})
      ] })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Footer, {})
  ] });
};
const PaymentPage = () => {
  var _a, _b, _c, _d, _e;
  const navigate = useNavigate();
  const location = useLocation();
  const { id } = useParams();
  const dispatch = useDispatch();
  const { t: t2 } = useTranslation();
  const { createLoading, createError } = useSelector((state) => state.booking);
  const { loading: paymentLoading } = useSelector((state) => state.payment);
  const { isAuthenticated, user } = useSelector((state) => state.auth);
  const [timeLeft, setTimeLeft] = reactExports.useState(20 * 60);
  const [showDetails, setShowDetails] = reactExports.useState(false);
  const [processingStep, setProcessingStep] = reactExports.useState("");
  const bookingData = location.state || {};
  const displayAmount = bookingData.amount || ((_a = bookingData.fare) == null ? void 0 : _a.total) || 465;
  const pickupLocation = bookingData.pickupAddress || ((_b = bookingData.pickupLocation) == null ? void 0 : _b.address) || "Bhopal";
  const dropLocation = bookingData.dropAddress || ((_c = bookingData.dropLocation) == null ? void 0 : _c.address) || "Ujjain";
  const distance = bookingData.distance || 201;
  const pickupDateDisplay = bookingData.pickupDate || "4 Sep 2025";
  const pickupTimeDisplay = bookingData.pickupTime || "10:00 AM";
  const vehicleName = bookingData.vehicleName || "Indica, Wagon R Or Similar";
  const customerName = (user == null ? void 0 : user.fullName) || bookingData.customerName || "Guest User";
  const customerEmail = (user == null ? void 0 : user.email) || bookingData.customerEmail || "xyz@gmail.com";
  const customerPhone = (user == null ? void 0 : user.phone) || bookingData.customerPhone || "+91**********";
  reactExports.useEffect(() => {
    const timer = setInterval(() => {
      setTimeLeft((prev) => prev > 0 ? prev - 1 : 0);
    }, 1e3);
    return () => clearInterval(timer);
  }, []);
  reactExports.useEffect(() => {
    return () => {
      dispatch(resetCreateBooking());
      if (typeof resetPaymentState === "function") {
        dispatch(resetPaymentState());
      }
    };
  }, [dispatch]);
  const loadRazorpay = () => {
    return new Promise((resolve) => {
      const script = document.createElement("script");
      script.src = "https://checkout.razorpay.com/v1/checkout.js";
      script.onload = () => resolve(true);
      script.onerror = () => resolve(false);
      document.body.appendChild(script);
    });
  };
  const formatTime = (seconds) => {
    const m2 = Math.floor(seconds / 60);
    const s2 = seconds % 60;
    return `${m2.toString().padStart(2, "0")}:${s2.toString().padStart(2, "0")}`;
  };
  const handlePayment = async () => {
    var _a2;
    if (!isAuthenticated) {
      alert(t2("errors.loginRequired"));
      navigate("/login", { state: { from: location } });
      return;
    }
    const isScriptLoaded = await loadRazorpay();
    if (!isScriptLoaded) {
      alert(t2("errors.razorpayFailed"));
      return;
    }
    setProcessingStep("booking");
    const bookingPayload = {
      pickupLocation: bookingData.pickupLocation || {
        address: bookingData.pickupAddress || "Bhopal, Madhya Pradesh",
        coordinates: [bookingData.picklng || 77.4126, bookingData.picklat || 23.2599]
      },
      dropLocation: bookingData.dropLocation || {
        address: bookingData.dropAddress || "Ujjain, Madhya Pradesh",
        coordinates: [bookingData.droplng || 75.7885, bookingData.droplat || 23.1765]
      },
      // NEW: Pass groupId and modelId for new booking system
      groupId: bookingData.groupId,
      modelId: bookingData.modelId,
      vehicleId: bookingData.vehicleId || id || void 0,
      // Optional for backward compatibility
      zoneId: bookingData.zoneId,
      tripType: bookingData.tripType || "oneWay",
      pickupDate: bookingData.pickupDate ? new Date(bookingData.pickupDate).toISOString().split("T")[0] : (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
      pickupTime: bookingData.pickupTime || "10:00 AM",
      distance: bookingData.distance || 200,
      duration: bookingData.duration || 180,
      paymentMode: "online",
      fuelType: bookingData.fuelType || "petrol",
      isAc: bookingData.isAc !== void 0 ? bookingData.isAc : true
    };
    if (bookingData.stops && bookingData.stops.length > 0) {
      bookingPayload.stops = bookingData.stops.map((stop) => ({
        address: stop.address || stop.value,
        stopOrder: stop.stopOrder || 1,
        coordinates: stop.coordinates || []
      }));
    }
    if (bookingData.returnDate) {
      bookingPayload.returnDate = bookingData.returnDate;
    }
    if (bookingData.rentalPackage) {
      bookingPayload.rentalPackage = bookingData.rentalPackage;
    }
    try {
      const bookingAction = await dispatch(createBooking(bookingPayload)).unwrap();
      const bookingId = bookingAction.data._id;
      console.log("Booking created:", bookingId);
      setProcessingStep("order");
      const orderAction = await dispatch(createPaymentOrder({
        bookingId,
        amount: displayAmount,
        paymentType: bookingData.paymentType || (displayAmount < (((_a2 = bookingData.fare) == null ? void 0 : _a2.total) || Infinity) ? "partial" : "full")
      })).unwrap();
      const { data: orderData } = orderAction;
      console.log("Payment order created:", orderData);
      setProcessingStep("payment");
      const options = {
        key: orderData.keyId,
        amount: orderData.amount,
        currency: orderData.currency,
        name: "Cab Booking",
        description: `Booking for ${vehicleName}`,
        order_id: orderData.orderId,
        handler: async function(response) {
          setProcessingStep("verifying");
          try {
            await dispatch(verifyPayment({
              razorpay_order_id: response.razorpay_order_id,
              razorpay_payment_id: response.razorpay_payment_id,
              razorpay_signature: response.razorpay_signature
            })).unwrap();
            navigate("/my-trips", {
              state: {
                bookingConfirmed: true,
                orderId: bookingAction.data.orderId
              }
            });
          } catch (verifyError) {
            console.error("Verification failed:", verifyError);
            alert(t2("errors.paymentVerifyFailed"));
            setProcessingStep("failed");
          }
        },
        prefill: {
          name: customerName,
          email: customerEmail,
          contact: customerPhone
        },
        theme: {
          color: "#ea580c"
        },
        modal: {
          ondismiss: function() {
            setProcessingStep("");
            alert(t2("errors.paymentCancelled"));
          }
        }
      };
      const rzp1 = new window.Razorpay(options);
      rzp1.open();
    } catch (error) {
      console.error("Process failed:", error);
      setProcessingStep("failed");
    }
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col min-h-screen text-black font-semibold bg-white", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-grow max-w-6xl mx-auto p-6", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-6 mt-24", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h1", { className: "text-2xl font-semibold", children: [
          t2("payment.payToConfirm").split(" ")[0],
          " ",
          /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-orange-600 font-bold", children: [
            "₹ ",
            displayAmount
          ] }),
          " ",
          t2("payment.payToConfirm").substring(t2("payment.payToConfirm").indexOf(" "))
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center text-orange-600 font-medium text-lg", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Clock, { size: 18, className: "mr-1" }),
          t2("payment.timeLeft"),
          ": ",
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-1", children: formatTime(timeLeft) })
        ] })
      ] }),
      createError && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4", children: createError }),
      processingStep === "verifying" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white p-6 rounded-lg shadow-xl flex flex-col items-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-orange-500 mb-4" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-lg font-semibold", children: t2("payment.verifyingPayment") }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: t2("payment.doNotClose") })
      ] }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "md:col-span-2 space-y-6", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-white rounded-2xl shadow p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-lg font-medium", children: [
                pickupLocation,
                " ",
                bookingData.tripType === "rental" ? "" : `→ ${dropLocation}`,
                /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-black font-normal ml-1", children: [
                  "(",
                  t2(`tripTypes.${bookingData.tripType === "rental" ? "hourly" : bookingData.tripType === "round" ? "round" : "oneway"}`),
                  ")",
                  bookingData.tripType === "rental" ? ` - ${((_d = bookingData.rentalPackage) == null ? void 0 : _d.label) || ""}` : ` ${distance} Km`
                ] })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-black font-normal", children: [
                t2("booking.pickupLocation"),
                ": ",
                pickupDateDisplay,
                ", ",
                pickupTimeDisplay
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-black font-normal", children: [
                vehicleName,
                " (",
                t2("cabSearch.ac"),
                ", 4 passengers allowed)"
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mt-2 text-sm", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold", children: customerName }),
                " · ",
                customerEmail,
                " · ",
                customerPhone
              ] }),
              showDetails && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 text-sm text-gray-600 space-y-1", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
                  "Vehicle ID: ",
                  bookingData.registrationNumber
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
                  "Trip Type: ",
                  bookingData.tripType || "oneWay"
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
                  "Pickup Address: ",
                  pickupLocation
                ] }),
                bookingData.tripType !== "rental" && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
                  "Drop Address: ",
                  dropLocation
                ] }),
                bookingData.tripType === "rental" && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
                  "Package: ",
                  (_e = bookingData.rentalPackage) == null ? void 0 : _e.label
                ] })
              ] })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "button",
              {
                className: "flex items-center text-blue-600 font-medium",
                onClick: () => setShowDetails(!showDetails),
                children: [
                  showDetails ? t2("common.hideDetails") : t2("common.showDetails"),
                  " ",
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    ChevronDown,
                    {
                      size: 18,
                      className: `ml-1 transition-transform duration-200 ${showDetails ? "rotate-180" : ""}`
                    }
                  )
                ]
              }
            )
          ] }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-2xl shadow p-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-semibold mb-4", children: t2("payment.allPaymentOptions") }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "space-y-3", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "border-b pb-2", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-medium", children: t2("payment.upiOptions") }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-green-600", children: t2("payment.getCashback") })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "border-b pb-2", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-medium", children: t2("payment.creditDebit") }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: t2("payment.cardProviders") })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "border-b pb-2", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-medium", children: t2("payment.bookNowPayLater") }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: t2("payment.bnplProviders") })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-medium", children: t2("payment.netBanking") }) })
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              onClick: handlePayment,
              disabled: createLoading || paymentLoading || processingStep !== "",
              className: `w-full py-4 rounded-xl text-white font-bold text-lg ${createLoading || paymentLoading || processingStep !== "" ? "bg-gray-400 cursor-not-allowed" : "bg-orange-500 hover:bg-orange-600"}`,
              children: processingStep === "booking" ? t2("payment.creatingBooking") : processingStep === "order" ? t2("payment.initiatingPayment") : processingStep === "payment" ? t2("payment.waitingPayment") : processingStep === "verifying" ? t2("payment.verifying") : `${t2("payment.payAndConfirm")} ₹${displayAmount}`
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-6", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-2xl shadow p-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-semibold", children: t2("payment.grandTotal") }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-2xl font-bold text-green-600 mt-2", children: [
              "₹",
              displayAmount
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-orange-50 border border-orange-200 rounded-2xl p-4 text-sm text-gray-700", children: [
            t2("payment.cabDriverDetails"),
            " ",
            /* @__PURE__ */ jsxRuntimeExports.jsxs("b", { children: [
              pickupDateDisplay,
              " at 9:30 AM"
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-2xl shadow p-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-semibold mb-3", children: t2("payment.includedBenefits") }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "space-y-2 text-sm", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
                "✅ ",
                t2("payment.freeCancellation"),
                " ",
                pickupDateDisplay,
                ", 9:00 AM"
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
                "✅ ",
                t2("payment.freeWaiting")
              ] })
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-2xl shadow p-4 text-center flex flex-col items-center", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-semibold mb-2", children: t2("payment.scanToPay") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 mb-3", children: t2("payment.instantRefund") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "img",
              {
                src: "https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=DummyQR",
                alt: "QR Code",
                className: "w-40 h-40 object-contain"
              }
            )
          ] })
        ] })
      ] })
    ] })
  ] });
};
const CancelBookingModal = ({ booking: booking2, onClose, onSuccess }) => {
  const dispatch = useDispatch();
  const [reason, setReason] = reactExports.useState("");
  const [showConfirmation, setShowConfirmation] = reactExports.useState(false);
  const {
    cancellationPreview,
    previewCancellationLoading,
    previewCancellationError,
    cancelLoading,
    cancelError,
    cancelSuccess,
    cancellationResult
  } = useSelector((state) => state.booking);
  const bookingId = booking2 == null ? void 0 : booking2._id;
  reactExports.useEffect(() => {
    console.log("CancelBookingModal mounted/updated");
    console.log("Booking:", booking2);
    console.log("Booking ID:", bookingId);
    if (bookingId) {
      console.log("Dispatching previewCancellation for:", bookingId);
      dispatch(previewCancellation(bookingId));
    }
    return () => {
      dispatch(resetCancellationPreview());
      dispatch(resetCancelBooking());
      setReason("");
      setShowConfirmation(false);
    };
  }, [bookingId, dispatch]);
  reactExports.useEffect(() => {
    if (cancelSuccess && cancellationResult) {
      setTimeout(() => {
        if (onSuccess) {
          onSuccess(cancellationResult);
        }
        handleClose();
      }, 2e3);
    }
  }, [cancelSuccess, cancellationResult]);
  const handleClose = () => {
    setReason("");
    setShowConfirmation(false);
    dispatch(resetCancellationPreview());
    dispatch(resetCancelBooking());
    onClose();
  };
  const handlePreviewCancel = () => {
    if (!reason.trim()) {
      alert("Please provide a reason for cancellation");
      return;
    }
    setShowConfirmation(true);
  };
  const handleConfirmCancel = () => {
    dispatch(cancelBooking({ bookingId, reason }));
  };
  const handleBackToForm = () => {
    setShowConfirmation(false);
  };
  if (!booking2) return null;
  const formatCurrency = (amount) => {
    return new Intl.NumberFormat("en-IN", {
      style: "currency",
      currency: "INR",
      maximumFractionDigits: 0
    }).format(amount);
  };
  const formatTimeRemaining = (hours) => {
    if (hours < 0) return "Pickup time has passed";
    if (hours < 1) return `${Math.round(hours * 60)} minutes`;
    if (hours < 24) return `${Math.round(hours * 10) / 10} hours`;
    const days = Math.floor(hours / 24);
    const remainingHours = Math.round(hours % 24);
    return `${days} day${days > 1 ? "s" : ""} ${remainingHours > 0 ? `${remainingHours} hour${remainingHours > 1 ? "s" : ""}` : ""}`;
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cancel-modal-overlay", onClick: handleClose, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cancel-modal-content", onClick: (e2) => e2.stopPropagation(), children: [
    previewCancellationLoading && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cancel-modal-loading", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "spinner" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Loading cancellation details..." })
    ] }),
    previewCancellationError && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cancel-modal-error", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { children: "Error" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: previewCancellationError }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: handleClose, className: "btn-close-error", children: "Close" })
    ] }),
    cancelSuccess && cancellationResult && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cancel-modal-success", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "success-icon", children: "✓" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { children: "Booking Cancelled Successfully" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "success-details", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Order ID:" }),
          " ",
          cancellationResult.orderId
        ] }),
        cancellationResult.cancellation.refundAmount > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "refund-amount", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Refund Amount:" }),
            " ",
            formatCurrency(cancellationResult.cancellation.refundAmount)
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "refund-status", children: [
            "Refund Status: ",
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "status-badge", children: cancellationResult.cancellation.refundStatus })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "refund-note", children: "The refund will be processed within 5-7 business days" })
        ] }),
        cancellationResult.cancellation.cancellationCharges > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "cancellation-charges", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Cancellation Charges:" }),
          " ",
          formatCurrency(cancellationResult.cancellation.cancellationCharges)
        ] })
      ] })
    ] }),
    !previewCancellationLoading && !previewCancellationError && !cancelSuccess && cancellationPreview && /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !showConfirmation ? (
      // Step 1: Show preview and collect reason
      /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cancel-modal-header", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { children: "Cancel Booking" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: handleClose, className: "btn-close", children: "×" })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cancel-modal-body", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "booking-info", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { children: "Booking Details" }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Order ID:" }),
              " ",
              cancellationPreview.orderId
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Status:" }),
              " ",
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "status-badge", children: cancellationPreview.currentStatus })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Scheduled Pickup:" }),
              " ",
              new Date(cancellationPreview.scheduledPickup).toLocaleString("en-IN", {
                dateStyle: "medium",
                timeStyle: "short"
              })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Time Until Pickup:" }),
              " ",
              formatTimeRemaining(cancellationPreview.hoursUntilPickup)
            ] })
          ] }),
          cancellationPreview.canCancel ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cancellation-policy", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { children: "Cancellation Policy" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "policy-rule", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "rule-text", children: cancellationPreview.refund.appliedRule }) }),
            cancellationPreview.hoursUntilPickup < 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "warning-message", style: {
              backgroundColor: "#FEF3C7",
              border: "1px solid #F59E0B",
              padding: "12px",
              borderRadius: "8px",
              marginBottom: "16px"
            }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { style: { color: "#92400E", fontSize: "14px", margin: 0 }, children: [
              "⚠️ ",
              /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Note:" }),
              " The scheduled pickup time for this booking has already passed. You can still cancel, but no refund will be processed as per the cancellation policy."
            ] }) }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "refund-breakdown", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "refund-row", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Total Paid:" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "amount", children: formatCurrency(cancellationPreview.payment.totalPaid) })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "refund-row highlight", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
                  "Refund Amount (",
                  cancellationPreview.refund.refundPercentage,
                  "%):"
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "amount refund", children: formatCurrency(cancellationPreview.refund.refundAmount) })
              ] }),
              cancellationPreview.refund.cancellationCharges > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "refund-row", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Cancellation Charges:" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "amount charges", children: formatCurrency(cancellationPreview.refund.cancellationCharges) })
              ] })
            ] })
          ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cannot-cancel", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "warning-text", children: "This booking cannot be cancelled at this time." }) }),
          cancellationPreview.canCancel && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "reason-section", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { htmlFor: "cancel-reason", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Reason for Cancellation" }),
              " ",
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "required", children: "*" })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "textarea",
              {
                id: "cancel-reason",
                value: reason,
                onChange: (e2) => setReason(e2.target.value),
                placeholder: "Please provide a reason for cancelling this booking...",
                rows: "4",
                maxLength: "500",
                required: true
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("small", { children: [
              reason.length,
              "/500 characters"
            ] })
          ] }),
          cancelError && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "error-message", children: cancelError })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cancel-modal-footer", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: handleClose, className: "btn-secondary", disabled: cancelLoading, children: "Keep Booking" }),
          cancellationPreview.canCancel && /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              onClick: handlePreviewCancel,
              className: "btn-danger",
              disabled: cancelLoading || !reason.trim(),
              children: cancelLoading ? "Processing..." : "Continue to Cancel"
            }
          )
        ] })
      ] })
    ) : (
      // Step 2: Confirmation
      /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cancel-modal-header", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { children: "Confirm Cancellation" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: handleClose, className: "btn-close", children: "×" })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cancel-modal-body", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "confirmation-warning", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "warning-icon", children: "⚠️" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { children: "Are you sure you want to cancel this booking?" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "This action cannot be undone." })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "confirmation-summary", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Order ID:" }),
              " ",
              cancellationPreview.orderId
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Refund Amount:" }),
              " ",
              formatCurrency(cancellationPreview.refund.refundAmount)
            ] }),
            cancellationPreview.refund.cancellationCharges > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Cancellation Charges:" }),
              " ",
              formatCurrency(cancellationPreview.refund.cancellationCharges)
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Reason:" }),
              " ",
              reason
            ] })
          ] }),
          cancelError && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "error-message", children: cancelError })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cancel-modal-footer", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: handleBackToForm, className: "btn-secondary", disabled: cancelLoading, children: "Go Back" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              onClick: handleConfirmCancel,
              className: "btn-danger",
              disabled: cancelLoading,
              children: cancelLoading ? "Cancelling..." : "Yes, Cancel Booking"
            }
          )
        ] })
      ] })
    ) })
  ] }) });
};
const MyTrips = () => {
  const [activeTab, setActiveTab] = reactExports.useState("upcoming");
  const [showCancelModal, setShowCancelModal] = reactExports.useState(false);
  const [selectedBooking, setSelectedBooking] = reactExports.useState(null);
  const navigate = useNavigate();
  const dispatch = useDispatch();
  const { t: t2 } = useTranslation();
  const { bookings, bookingsLoading, bookingsError, bookingsPagination } = useSelector(
    (state) => state.booking
  );
  const { isAuthenticated } = useSelector((state) => state.auth);
  const getStatusForTab = (tab) => {
    switch (tab) {
      case "upcoming":
        return "created,assigned,arrived";
      case "cancelled":
        return "cancelled";
      case "completed":
        return "completed";
      default:
        return "";
    }
  };
  reactExports.useEffect(() => {
    if (isAuthenticated) {
      const status = getStatusForTab(activeTab);
      dispatch(getAllBookings({ status, page: 1, limit: 10 }));
    }
  }, [activeTab, isAuthenticated, dispatch]);
  const filteredBookings = bookings.filter((booking2) => {
    if (activeTab === "upcoming") {
      return ["created", "assigned", "arrived", "inProgress"].includes(booking2.status);
    } else if (activeTab === "cancelled") {
      return booking2.status === "cancelled";
    } else if (activeTab === "completed") {
      return booking2.status === "completed";
    }
    return true;
  });
  const formatDate = (dateString) => {
    if (!dateString) return "";
    const date = new Date(dateString);
    return date.toLocaleDateString("en-IN", {
      day: "numeric",
      month: "short",
      year: "2-digit"
    });
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-[#f0f6ff] min-h-screen pt-16", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-[#fc6325] h-[120px] flex items-center p-4 text-xl font-bold", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "ml-[170px] font-semibold text-2xl text-white", children: t2("trips.yourTrips") }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex ml-[170px] gap-20 mt-6", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "button",
          {
            onClick: () => setActiveTab("upcoming"),
            className: `flex items-center gap-2 pb-2 ${activeTab === "upcoming" ? "border-b-2 border-[#fc6325] font-semibold text-black" : "text-gray-500"}`,
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(Briefcase, { size: 18 }),
              " ",
              t2("trips.upcomingBookings")
            ]
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "button",
          {
            onClick: () => setActiveTab("cancelled"),
            className: `flex items-center gap-2 pb-2 ${activeTab === "cancelled" ? "border-b-2 border-[#fc6325] font-semibold text-black" : "text-gray-500"}`,
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(CircleX, { size: 18 }),
              " ",
              t2("trips.cancelledBookings")
            ]
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "button",
          {
            onClick: () => setActiveTab("completed"),
            className: `flex items-center gap-2 pb-2 ${activeTab === "completed" ? "border-b-2 border-[#fc6325] font-semibold text-black" : "text-gray-500"}`,
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(Backpack, { size: 18 }),
              " ",
              t2("trips.completedBookings")
            ]
          }
        )
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ml-[170px] mt-10", children: [
        bookingsLoading && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-white shadow-md rounded-lg p-8 w-[700px] flex justify-center items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-600", children: t2("trips.loadingTrips") }) }),
        bookingsError && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-white shadow-md rounded-lg p-8 w-[700px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-red-500", children: bookingsError }) }),
        !bookingsLoading && !bookingsError && filteredBookings.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white shadow-md rounded-lg p-8 w-[700px] flex gap-6 items-center", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "img",
            {
              src: "https://cdn-icons-png.flaticon.com/512/201/201623.png",
              alt: "Trips",
              className: "w-36 h-36"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-gray-700 font-medium", children: [
              t2("trips.noTrips"),
              " ",
              activeTab,
              " ",
              t2("trips.bookingsWithEasyride")
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-bold text-black mt-1", children: t2("trips.tripsWillShowHere") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                onClick: () => navigate("/"),
                className: "mt-5 px-6 py-2 bg-[#fc6325] text-white rounded-md shadow hover:bg-[#fc6325] transition",
                children: t2("trips.startBookingNow")
              }
            )
          ] })
        ] }),
        !bookingsLoading && !bookingsError && filteredBookings.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-4 w-[700px]", children: filteredBookings.map((booking2) => {
          var _a, _b, _c;
          const canCancel = ["created", "assigned", "arrived", "enRoute"].includes(booking2.status);
          return /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: "bg-white shadow-md rounded-lg p-6 hover:shadow-lg transition",
              children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-start", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", onClick: () => navigate(`/booking/${booking2._id}`), style: { cursor: "pointer" }, children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-lg font-semibold text-gray-800", children: [
                    ((_a = booking2.pickupLocation) == null ? void 0 : _a.address) || "Pickup",
                    " → ",
                    ((_b = booking2.dropLocation) == null ? void 0 : _b.address) || "Drop"
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600 mt-1", children: [
                    t2("trips.orderId"),
                    ": ",
                    booking2.orderId
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600", children: [
                    formatDate(booking2.scheduledTime || booking2.createdAt),
                    " | ",
                    t2(`tripTypes.${booking2.tripType}`) || booking2.tripType
                  ] })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-lg font-bold text-orange-600", children: [
                    "₹",
                    ((_c = booking2.fare) == null ? void 0 : _c.total) || 0
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "span",
                    {
                      className: `text-xs px-2 py-1 rounded ${booking2.status === "completed" ? "bg-green-100 text-green-700" : booking2.status === "cancelled" ? "bg-red-100 text-red-700" : "bg-blue-100 text-blue-700"}`,
                      children: t2(`booking.status.${booking2.status}`) || booking2.status
                    }
                  ),
                  canCancel && /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "button",
                    {
                      onClick: (e2) => {
                        e2.stopPropagation();
                        console.log("Cancel button clicked for booking:", booking2._id);
                        console.log("Booking data:", booking2);
                        setSelectedBooking(booking2);
                        setShowCancelModal(true);
                      },
                      className: "mt-2 px-3 py-1 bg-red-500 text-white text-xs rounded hover:bg-red-600 transition",
                      children: "Cancel Booking"
                    }
                  ),
                  !canCancel && booking2.status !== "cancelled" && booking2.status !== "completed" && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-2 text-xs text-gray-500 italic", children: "Cannot cancel this booking" })
                ] })
              ] })
            },
            booking2._id
          );
        }) })
      ] })
    ] }),
    showCancelModal && selectedBooking && /* @__PURE__ */ jsxRuntimeExports.jsx(
      CancelBookingModal,
      {
        booking: selectedBooking,
        onClose: () => {
          setShowCancelModal(false);
          setSelectedBooking(null);
        },
        onSuccess: () => {
          setShowCancelModal(false);
          setSelectedBooking(null);
          dispatch(getAllBookings({ status: getStatusForTab(activeTab), page: 1, limit: 10 }));
        }
      }
    )
  ] });
};
const InputField = ({ label, name, value, placeholder, type = "text", onChange, disabled = false }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-4", children: [
  /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-xs font-medium text-gray-700 mb-1 uppercase tracking-wide", children: label }),
  /* @__PURE__ */ jsxRuntimeExports.jsx(
    "input",
    {
      name,
      type,
      value,
      placeholder,
      onChange,
      disabled,
      className: `w-full p-3 border border-gray-300 rounded focus:outline-none focus:border-orange-500 text-gray-900 ${disabled ? "bg-gray-100 cursor-not-allowed" : ""}`
    }
  )
] });
const SelectField = ({ label, name, value, options, placeholder, onChange }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-4", children: [
  /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-xs font-medium text-gray-700 mb-1 uppercase tracking-wide", children: label }),
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "select",
      {
        name,
        value,
        onChange,
        className: "w-full p-3 border border-gray-300 rounded bg-white text-gray-900 font-normal appearance-none focus:outline-none focus:border-orange-500",
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: placeholder || "Select" }),
          options && options.map((option, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: option, children: option }, index2))
        ]
      }
    ),
    /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "absolute right-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-black pointer-events-none" })
  ] })
] });
const Profile = () => {
  const dispatch = useDispatch();
  const navigate = useNavigate();
  const { t: t2 } = useTranslation();
  const { user, profileLoading, loading, error, message, isAuthenticated } = useSelector((state) => state.auth);
  const [formData, setFormData] = reactExports.useState({
    fullName: "",
    email: "",
    phone: "",
    address: "",
    city: "",
    state: "",
    pincode: "",
    // Additional fields if supported
    gender: "",
    dob: "",
    nationality: "",
    maritalStatus: "",
    anniversaryDate: ""
  });
  const [passwordData, setPasswordData] = reactExports.useState({
    currentPassword: "",
    newPassword: "",
    confirmPassword: ""
  });
  const [activeTab, setActiveTab] = reactExports.useState("profile");
  const [showDeleteConfirm, setShowDeleteConfirm] = reactExports.useState(false);
  reactExports.useEffect(() => {
    if (!isAuthenticated) {
      navigate("/");
    } else {
      dispatch(getProfile());
    }
  }, [isAuthenticated, dispatch, navigate]);
  reactExports.useEffect(() => {
    var _a, _b, _c, _d;
    if (user) {
      setFormData({
        fullName: user.fullName || "",
        email: user.email || "",
        phone: user.phone || "",
        // Handle nested address safely or if flattened
        address: ((_a = user.fullAddress) == null ? void 0 : _a.address) || "",
        city: ((_b = user.fullAddress) == null ? void 0 : _b.city) || "",
        state: ((_c = user.fullAddress) == null ? void 0 : _c.state) || "",
        pincode: ((_d = user.fullAddress) == null ? void 0 : _d.pincode) || "",
        gender: user.gender || "",
        dob: user.dob ? new Date(user.dob).toISOString().split("T")[0] : "",
        nationality: user.nationality || "",
        maritalStatus: user.maritalStatus || "",
        anniversaryDate: user.anniversaryDate ? new Date(user.anniversaryDate).toISOString().split("T")[0] : ""
      });
    }
  }, [user]);
  const handleInputChange = (e2) => {
    setFormData({ ...formData, [e2.target.name]: e2.target.value });
  };
  const handlePasswordChange = (e2) => {
    setPasswordData({ ...passwordData, [e2.target.name]: e2.target.value });
  };
  const onSaveProfile = () => {
    const updatePayload = {
      fullName: formData.fullName,
      email: formData.email,
      phone: formData.phone,
      fullAddress: {
        address: formData.address,
        city: formData.city,
        state: formData.state,
        pincode: formData.pincode
      },
      gender: formData.gender,
      dob: formData.dob,
      nationality: formData.nationality,
      maritalStatus: formData.maritalStatus,
      anniversaryDate: formData.anniversaryDate
    };
    dispatch(updateProfile(updatePayload)).then(() => {
      dispatch(getProfile());
    });
  };
  const onStartChangePassword = () => {
    if (passwordData.newPassword !== passwordData.confirmPassword) {
      zt.error(t2("profile.passwordMismatch"));
      return;
    }
    dispatch(changePassword({
      currentPassword: passwordData.currentPassword,
      newPassword: passwordData.newPassword
    }));
    setPasswordData({ currentPassword: "", newPassword: "", confirmPassword: "" });
  };
  const onLogout = async () => {
    await dispatch(logoutUser());
    navigate("/");
  };
  const onDeleteAccount = async () => {
    if (window.confirm(t2("profile.deleteConfirm"))) {
      await dispatch(deleteAccount());
      navigate("/");
    }
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen flex flex-col", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-orange-500 h-[200px] relative", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "absolute left-4 md:left-[150px] top-[50px] flex items-center space-x-6", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative mt-11", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-20 h-20 rounded-full bg-gray-200 border-2 border-white overflow-hidden", children: (user == null ? void 0 : user.profileImageUrl) ? /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: user.profileImageUrl, alt: "Profile", className: "w-full h-full object-cover" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full h-full flex items-center justify-center text-gray-400", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Camera, { size: 24 }) }) }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-white mt-11", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "font-semibold text-xl", children: formData.fullName || "User" }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm", children: [
          formData.phone,
          " · ",
          formData.email
        ] })
      ] })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col md:flex-row flex-1", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full md:w-64 bg-white md:min-h-screen shadow-sm md:border-r", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-6 md:ml-10 mt-6", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-sm font-medium text-black mb-4", children: t2("profile.myAccount") }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("nav", { className: "space-y-2", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "button",
            {
              onClick: () => setActiveTab("profile"),
              className: `flex w-full items-center text-sm py-2 ${activeTab === "profile" ? "text-orange-600 font-bold" : "text-gray-800 hover:text-orange-600"}`,
              children: [
                "👤 ",
                t2("profile.title")
              ]
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "button",
            {
              onClick: () => setActiveTab("password"),
              className: `flex w-full items-center text-sm py-2 ${activeTab === "password" ? "text-orange-600 font-bold" : "text-gray-800 hover:text-orange-600"}`,
              children: [
                "🔒 ",
                t2("profile.security")
              ]
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border-t my-4 pt-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { onClick: onLogout, className: "flex w-full items-center text-sm text-gray-800 hover:text-red-600 py-2", children: [
              "🚪 ",
              t2("nav.logout")
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { onClick: onDeleteAccount, className: "flex w-full items-center text-sm text-red-600 hover:text-red-800 py-2 mt-2 font-semibold", children: [
              "⚠️ ",
              t2("profile.deleteAccount")
            ] })
          ] })
        ] })
      ] }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 p-6 bg-gray-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-4xl mx-auto", children: [
        activeTab === "profile" && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-6 mt-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-2xl font-semibold text-gray-800", children: t2("profile.title") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                onClick: onSaveProfile,
                disabled: profileLoading,
                className: "px-6 py-2 bg-orange-500 text-white rounded font-medium hover:bg-orange-600 transition disabled:bg-gray-400",
                children: profileLoading ? t2("common.saving") : t2("common.save")
              }
            )
          ] }),
          !formData.email || formData.email.startsWith("user_") || !formData.address ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-red-50 border border-red-200 rounded-xl p-5 mb-8 flex items-start space-x-4 shadow-sm animate-pulse", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-red-500 text-white p-2 rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { size: 20 }) }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-red-800 font-bold text-sm uppercase tracking-wider", children: t2("profile.actionRequired") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-red-600 text-sm mt-1", children: t2("profile.provideDetails") })
            ] })
          ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-emerald-50 border border-emerald-200 rounded-xl p-5 mb-8 flex items-start space-x-4 shadow-sm", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-emerald-500 text-white p-2 rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CircleCheck, { size: 20 }) }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-emerald-800 font-bold text-sm uppercase tracking-wider", children: t2("profile.profileComplete") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-emerald-600 text-sm mt-1", children: t2("profile.profileVerified") })
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg shadow-sm p-6 mb-6", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-semibold text-gray-800 mb-4", children: t2("profile.generalInfo") }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(InputField, { label: t2("profile.name"), name: "fullName", value: formData.fullName, onChange: handleInputChange }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(InputField, { label: t2("profile.email"), name: "email", value: formData.email, onChange: handleInputChange, disabled: false }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(InputField, { label: t2("profile.phone"), name: "phone", value: formData.phone, onChange: handleInputChange }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(SelectField, { label: t2("profile.gender"), name: "gender", value: formData.gender, onChange: handleInputChange, options: ["FEMALE", "MALE", "OTHER"] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(InputField, { label: t2("profile.dob"), name: "dob", value: formData.dob, onChange: handleInputChange, type: "date" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(InputField, { label: t2("profile.nationality"), name: "nationality", value: formData.nationality, onChange: handleInputChange, placeholder: "Enter Nationality" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(SelectField, { label: t2("profile.maritalStatus"), name: "maritalStatus", value: formData.maritalStatus, onChange: handleInputChange, options: ["Single", "Married"] })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-semibold text-gray-800 mt-8 mb-4", children: t2("profile.address") }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "md:col-span-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(InputField, { label: t2("profile.streetAddress"), name: "address", value: formData.address, onChange: handleInputChange }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(InputField, { label: t2("profile.city"), name: "city", value: formData.city, onChange: handleInputChange }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(InputField, { label: t2("profile.state"), name: "state", value: formData.state, onChange: handleInputChange }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(InputField, { label: t2("profile.pincode"), name: "pincode", value: formData.pincode, onChange: handleInputChange })
            ] })
          ] })
        ] }),
        activeTab === "password" && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-between items-center mb-6 mt-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-2xl font-semibold text-gray-800", children: t2("profile.changePassword") }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg shadow-sm p-6 mb-6 max-w-lg", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600 mb-6", children: [
              " ",
              t2("profile.passwordSecure")
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              InputField,
              {
                label: t2("profile.currentPassword"),
                name: "currentPassword",
                type: "password",
                value: passwordData.currentPassword,
                onChange: handlePasswordChange
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              InputField,
              {
                label: t2("profile.newPassword"),
                name: "newPassword",
                type: "password",
                value: passwordData.newPassword,
                onChange: handlePasswordChange
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              InputField,
              {
                label: t2("profile.confirmPassword"),
                name: "confirmPassword",
                type: "password",
                value: passwordData.confirmPassword,
                onChange: handlePasswordChange
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                onClick: onStartChangePassword,
                disabled: loading,
                className: "w-full mt-4 px-6 py-3 bg-orange-500 text-white rounded font-medium hover:bg-orange-600 transition disabled:bg-gray-400",
                children: loading ? t2("common.updating") : t2("profile.changePassword").toUpperCase()
              }
            )
          ] })
        ] })
      ] }) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Footer, {})
  ] });
};
const Top = () => {
  var _a, _b;
  const dispatch = useDispatch();
  const navigate = useNavigate();
  const location = useLocation();
  const { slug } = useParams();
  const { t: t2 } = useTranslation();
  const {
    currentIntercityRoute,
    currentIntercityLoading
  } = useSelector((state) => state.seo);
  const [showKnowMore, setShowKnowMore] = reactExports.useState(false);
  const [tripType, setTripType] = reactExports.useState("oneway");
  const [fromLocation, setFromLocation] = reactExports.useState("");
  const [toLocation, setToLocation] = reactExports.useState("");
  const [pickupDate, setPickupDate] = reactExports.useState("");
  const [returnDate, setReturnDate] = reactExports.useState("");
  const [pickupTime, setPickupTime] = reactExports.useState("10:00 AM");
  const [stops, setStops] = reactExports.useState([]);
  const [showTripTypeDropdown, setShowTripTypeDropdown] = reactExports.useState(false);
  const [showLocationModal, setShowLocationModal] = reactExports.useState(false);
  const [showStopsModal, setShowStopsModal] = reactExports.useState(false);
  const [showDateModal, setShowDateModal] = reactExports.useState(false);
  const [showTimeModal, setShowTimeModal] = reactExports.useState(false);
  const [locationType, setLocationType] = reactExports.useState("");
  const [dateType, setDateType] = reactExports.useState("pickup");
  const [showReviewsModal, setShowReviewsModal] = reactExports.useState(false);
  const [openFAQ, setOpenFAQ] = reactExports.useState(null);
  const [currentUserLocation, setCurrentUserLocation] = reactExports.useState(null);
  const [searchLoading, setSearchLoading] = reactExports.useState(false);
  const routeFromState = (_a = location.state) == null ? void 0 : _a.route;
  const parseSlugToCities = (slug2) => {
    if (!slug2) return { origin: "", destination: "" };
    const match = slug2.match(/^(.+)-to-(.+)-cab$/i);
    if (match) {
      const capitalize = (str) => str.split("-").map(
        (word) => word.charAt(0).toUpperCase() + word.slice(1)
      ).join(" ");
      return {
        origin: capitalize(match[1]),
        destination: capitalize(match[2])
      };
    }
    return { origin: "", destination: "" };
  };
  const parsedCities = parseSlugToCities(slug);
  reactExports.useEffect(() => {
    if (slug) {
      dispatch(getIntercityRouteBySlug(slug));
    }
  }, [dispatch, slug]);
  reactExports.useEffect(() => {
    const route2 = currentIntercityRoute || routeFromState;
    if (route2) {
      setFromLocation(route2.originCity || "");
      setToLocation(route2.destinationCity || "");
    } else if (parsedCities.origin) {
      setFromLocation(parsedCities.origin);
      setToLocation(parsedCities.destination);
    }
    const tomorrow = /* @__PURE__ */ new Date();
    tomorrow.setDate(tomorrow.getDate() + 1);
    setPickupDate(tomorrow.toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric" }));
  }, [currentIntercityRoute, routeFromState, parsedCities.origin, parsedCities.destination]);
  const route = currentIntercityRoute || routeFromState;
  const vehicleOptions = (route == null ? void 0 : route.vehicleOptions) || [];
  const faqs = (route == null ? void 0 : route.faqs) || [];
  const nearbyRoutes = (route == null ? void 0 : route.nearbyRoutes) || [];
  const inwardRoutes = (route == null ? void 0 : route.inwardRoutes) || [];
  const routesToOrigin = (route == null ? void 0 : route.routesToOriginRaw) || [];
  const routesFromDestination = (route == null ? void 0 : route.routesFromDestinationRaw) || [];
  const displayOrigin = (route == null ? void 0 : route.originCity) || parsedCities.origin || fromLocation;
  const displayDestination = (route == null ? void 0 : route.destinationCity) || parsedCities.destination || toLocation;
  const routeNotFound = !currentIntercityLoading && !route && slug;
  const [currentDisplayDate, setCurrentDisplayDate] = reactExports.useState(/* @__PURE__ */ new Date());
  const getDaysInMonth = (date) => {
    return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
  };
  const getFirstDayOfMonth = (date) => {
    return new Date(date.getFullYear(), date.getMonth(), 1).getDay();
  };
  const generateCalendarDays = () => {
    const daysInMonth = getDaysInMonth(currentDisplayDate);
    const firstDay = getFirstDayOfMonth(currentDisplayDate);
    const days = [];
    const startOffset = firstDay === 0 ? 6 : firstDay - 1;
    for (let i2 = 0; i2 < startOffset; i2++) {
      days.push({ day: "", otherMonth: true });
    }
    for (let i2 = 1; i2 <= daysInMonth; i2++) {
      days.push({
        day: i2.toString(),
        date: new Date(currentDisplayDate.getFullYear(), currentDisplayDate.getMonth(), i2)
      });
    }
    return days;
  };
  const calendarDays = generateCalendarDays();
  const changeMonth = (offset) => {
    const newDate = new Date(currentDisplayDate);
    newDate.setMonth(newDate.getMonth() + offset);
    setCurrentDisplayDate(newDate);
  };
  const generateTimeSlots = () => {
    const times = [];
    for (let hour = 0; hour < 24; hour++) {
      for (let minute = 0; minute < 60; minute += 15) {
        const period = hour >= 12 ? "PM" : "AM";
        const displayHour = hour % 12 || 12;
        const timeString = `${displayHour}:${minute.toString().padStart(2, "0")} ${period}`;
        times.push(timeString);
      }
    }
    return times;
  };
  const timeSlots = generateTimeSlots();
  const tripTypeOptions = [
    { value: "oneway", label: t2("tripTypes.oneway") },
    { value: "round", label: t2("tripTypes.round") }
  ];
  const handleLocationSelect = (location2) => {
    if (locationType === "from") {
      setFromLocation(location2);
    } else if (locationType === "to") {
      setToLocation(location2);
    }
    setShowLocationModal(false);
  };
  const handleDateSelect = (dayObj) => {
    if (dayObj && !dayObj.otherMonth && dayObj.date) {
      const dateStr = dayObj.date.toLocaleDateString("en-GB", {
        day: "numeric",
        month: "short",
        year: "numeric"
      });
      if (dateType === "return") {
        setReturnDate(dateStr);
      } else {
        setPickupDate(dateStr);
      }
      setShowDateModal(false);
    }
  };
  const handleTimeSelect = (time) => {
    setPickupTime(time);
    setShowTimeModal(false);
  };
  const addStop = () => setStops([...stops, { id: Date.now(), value: "" }]);
  const removeStop = (id) => setStops(stops.filter((stop) => stop.id !== id));
  const handleStopChange = (id, value) => {
    setStops(stops.map((stop) => stop.id === id ? { ...stop, value } : stop));
  };
  const handleUpdateSearch = async () => {
    setSearchLoading(true);
    try {
      if (!fromLocation) {
        zt.error("Please enter a pickup location");
        setSearchLoading(false);
        return;
      }
      if (!toLocation) {
        zt.error("Please enter a drop location");
        setSearchLoading(false);
        return;
      }
      if (tripType === "round" && !returnDate) {
        zt.error("Please select a return date for round trip");
        setSearchLoading(false);
        return;
      }
      let sourceCoords;
      if (fromLocation === "Current Location" && currentUserLocation) {
        sourceCoords = currentUserLocation;
      } else {
        sourceCoords = await geocodeLocation(fromLocation);
      }
      if (!sourceCoords) {
        zt.error(`Could not find location: ${fromLocation}`);
        setSearchLoading(false);
        return;
      }
      let destCoords = await geocodeLocation(toLocation);
      if (!destCoords) {
        zt.error(`Could not find location: ${toLocation}`);
        setSearchLoading(false);
        return;
      }
      const validStops = [];
      if (stops.length > 0) {
        for (const stop of stops) {
          if (!stop.value || stop.value.trim() === "") continue;
          const stopCoords = await geocodeLocation(stop.value);
          if (stopCoords) {
            validStops.push({
              address: stop.value,
              coordinates: [stopCoords.lng, stopCoords.lat],
              stopOrder: validStops.length + 1
            });
          }
        }
      }
      const searchParams = {
        from: fromLocation,
        to: toLocation,
        sourceLat: sourceCoords.lat,
        sourceLong: sourceCoords.lng,
        destLat: destCoords.lat,
        destLong: destCoords.lng,
        tripType: tripType === "oneway" ? "oneWay" : "roundTrip",
        fuelType: "petrol",
        isAc: true,
        pickupDate,
        pickupTime,
        returnDate,
        startTime: (/* @__PURE__ */ new Date()).toISOString(),
        stops: validStops.length > 0 ? validStops : void 0
      };
      navigate("/results", { state: { searchParams } });
    } catch (error) {
      console.error("Search error:", error);
      zt.error("Something went wrong with the search");
    } finally {
      setSearchLoading(false);
    }
  };
  const handleSelectVehicle = (vehicle) => {
    const originCoords = (route == null ? void 0 : route.originCoords) || { lat: 0, lng: 0 };
    const destCoords = (route == null ? void 0 : route.destCoords) || { lat: 0, lng: 0 };
    const vehicleId = vehicle._id || vehicle.vehicleId || vehicle.groupId;
    navigate(`/details/${vehicleId}`, {
      state: {
        vehicleId,
        picklat: originCoords.lat,
        picklng: originCoords.lng,
        pickupAddress: fromLocation || (route == null ? void 0 : route.originCity),
        pickupCity: (route == null ? void 0 : route.originCity) || fromLocation,
        pickupState: "",
        droplat: destCoords.lat,
        droplng: destCoords.lng,
        dropAddress: toLocation || (route == null ? void 0 : route.destinationCity),
        dropCity: (route == null ? void 0 : route.destinationCity) || toLocation,
        dropState: "",
        distance: (route == null ? void 0 : route.distance) || 0,
        tripType: tripType === "round" ? "roundTrip" : "oneWay",
        fuelType: vehicle.fuelType || "petrol",
        isAc: true,
        scheduledTime: (/* @__PURE__ */ new Date()).toISOString(),
        vehicle,
        route,
        tripDetails: {
          from: fromLocation,
          to: toLocation,
          date: pickupDate,
          time: pickupTime,
          tripType,
          stops
        }
      }
    });
  };
  const LocationModal = () => {
    const [searchText, setSearchText] = reactExports.useState("");
    const handleCurrentLocation = () => {
      if ("geolocation" in navigator) {
        navigator.geolocation.getCurrentPosition(
          (position) => {
            const coords = {
              lat: position.coords.latitude,
              lng: position.coords.longitude
            };
            setCurrentUserLocation(coords);
            handleLocationSelect("Current Location");
          },
          (error) => {
            console.error("Error getting location:", error);
            zt.error(t2("errors.locationError") || "Could not get location");
          }
        );
      } else {
        zt.error(t2("errors.geolocationNotSupported") || "Geolocation not supported");
      }
    };
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 border-b border-gray-200", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: locationType === "from" ? t2("hero.from").toUpperCase() : t2("hero.to").toUpperCase() }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowLocationModal(false), className: "p-1 text-gray-500 hover:text-gray-700", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          LocationAutocomplete,
          {
            value: searchText,
            onChange: setSearchText,
            onLocationSelect: handleLocationSelect,
            placeholder: `${t2("common.search")} ${locationType === "from" ? t2("hero.from") : t2("hero.to")}...`
          }
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "button",
        {
          onClick: handleCurrentLocation,
          className: "flex items-center gap-2 text-blue-600 text-sm font-medium mb-4 hover:bg-blue-50 p-2 rounded w-full transition-colors",
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(MapPin, { className: "w-4 h-4" }),
            " ",
            t2("common.useCurrentLocation")
          ]
        }
      ) })
    ] }) });
  };
  const StopsModal = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: t2("hero.addStops").replace("+ ", "") }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowStopsModal(false), className: "p-1 text-gray-500 hover:text-gray-700", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
      stops.map((stop, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600 mb-2", children: [
          t2("tripDetails.stop"),
          " ",
          index2 + 1
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            LocationAutocomplete,
            {
              value: stop.value,
              onChange: (val) => handleStopChange(stop.id, val),
              onLocationSelect: (val) => handleStopChange(stop.id, val),
              placeholder: t2("tripDetails.stop"),
              className: "flex-1"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => removeStop(stop.id), className: "text-gray-500 hover:text-red-500", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
        ] })
      ] }, stop.id)),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { onClick: addStop, className: "flex items-center gap-2 text-blue-600 text-sm font-medium mt-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(Plus, { className: "w-4 h-4" }),
        " ",
        t2("hero.addStops")
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-t border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowStopsModal(false), className: "w-full bg-blue-600 text-white py-3 rounded-lg font-semibold", children: t2("common.done").toUpperCase() }) })
  ] }) });
  const DateModal = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: dateType === "return" ? "RETURN DATE" : t2("hero.pickupDate").toUpperCase() }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowDateModal(false), className: "p-1 text-gray-500 hover:text-gray-700", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-4 text-gray-900", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => changeMonth(-1), className: "p-2 hover:bg-gray-100 rounded-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 rotate-90" }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-bold uppercase", children: currentDisplayDate.toLocaleDateString("en-US", { month: "long", year: "numeric" }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => changeMonth(1), className: "p-2 hover:bg-gray-100 rounded-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 -rotate-90" }) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-1 mb-2", children: [t2("weekDays.mon"), t2("weekDays.tue"), t2("weekDays.wed"), t2("weekDays.thu"), t2("weekDays.fri"), t2("weekDays.sat"), t2("weekDays.sun")].map((day) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center text-xs text-gray-500 font-medium py-2", children: day }, day)) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-1", children: calendarDays.map((dayObj, index2) => {
        var _a2;
        const currentDateStr = (_a2 = dayObj.date) == null ? void 0 : _a2.toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric" });
        const isSelected = currentDateStr === (dateType === "return" ? returnDate : pickupDate);
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: `h-10 flex items-center justify-center rounded-full text-sm font-medium cursor-pointer
                    ${!dayObj.day || dayObj.otherMonth ? "text-transparent pointer-events-none" : "text-gray-700 hover:bg-gray-100"}
                    ${isSelected ? "bg-orange-500 text-white hover:bg-orange-600" : ""}
                  `,
            onClick: () => handleDateSelect(dayObj),
            children: dayObj.day
          },
          index2
        );
      }) })
    ] })
  ] }) });
  const TimeModal = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: t2("hero.pickupTime").toUpperCase() }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowTimeModal(false), className: "p-1 text-gray-500 hover:text-gray-700", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-h-96 overflow-y-auto p-4", children: timeSlots.map((time, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      {
        className: `py-3 border-b text-black border-gray-100 cursor-pointer hover:bg-gray-50 ${pickupTime === time ? "bg-blue-50" : ""}`,
        onClick: () => handleTimeSelect(time),
        children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-medium", children: time })
      },
      index2
    )) })
  ] }) });
  if (currentIntercityLoading) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-screen bg-white flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-orange-500 mx-auto" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-4 text-gray-600", children: "Loading route details..." })
    ] }) });
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen bg-white", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
    showLocationModal && /* @__PURE__ */ jsxRuntimeExports.jsx(LocationModal, {}),
    showStopsModal && /* @__PURE__ */ jsxRuntimeExports.jsx(StopsModal, {}),
    showDateModal && /* @__PURE__ */ jsxRuntimeExports.jsx(DateModal, {}),
    showTimeModal && /* @__PURE__ */ jsxRuntimeExports.jsx(TimeModal, {}),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full bg-orange-500 py-4 px-4 mt-16", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto flex flex-wrap items-center justify-between gap-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-8 ml-8", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: t2("hero.tripType").toUpperCase() }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md flex items-center gap-1 text-black min-w-[180px]",
              onClick: () => setShowTripTypeDropdown(!showTripTypeDropdown),
              children: [
                (_b = tripTypeOptions.find((opt) => opt.value === tripType)) == null ? void 0 : _b.label,
                /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4" })
              ]
            }
          ),
          showTripTypeDropdown && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute top-full left-0 mt-1 bg-white text-black border border-gray-200 rounded-md shadow-lg z-10 min-w-[180px]", children: tripTypeOptions.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: `px-4 py-2 cursor-pointer hover:bg-gray-100 ${tripType === option.value ? "bg-blue-50 text-blue-600" : ""}`,
              onClick: () => {
                setTripType(option.value);
                setShowTripTypeDropdown(false);
              },
              children: option.label
            },
            option.value
          )) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: t2("hero.from").toUpperCase() }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => {
                setLocationType("from");
                setShowLocationModal(true);
              },
              children: fromLocation || t2("common.select")
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-5 relative inline-block", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "absolute -top-3 right-2 text-[11px] px-1.5 py-[1px] bg-white text-purple-600 border border-black rounded-md font-semibold shadow-sm", children: t2("hero.new") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-[#2276e3] shadow",
              onClick: () => setShowStopsModal(true),
              children: t2("hero.addStops")
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: t2("hero.to").toUpperCase() }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => {
                setLocationType("to");
                setShowLocationModal(true);
              },
              children: toLocation || t2("common.select")
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: t2("hero.pickupDate").toUpperCase() }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => {
                setDateType("pickup");
                setShowDateModal(true);
              },
              children: pickupDate || t2("common.selectDate")
            }
          )
        ] }),
        tripType === "round" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "RETURN DATE" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => {
                setDateType("return");
                setShowDateModal(true);
              },
              children: returnDate || "Select Date"
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: t2("hero.pickupTime").toUpperCase() }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => setShowTimeModal(true),
              children: pickupTime
            }
          )
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          className: "text-lg font-semibold bg-white px-4 py-2 rounded-md text-[#2276e3]",
          onClick: handleUpdateSearch,
          disabled: searchLoading,
          children: searchLoading ? "SEARCHING..." : t2("common.updateSearch").toUpperCase()
        }
      ) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-[#f4f4f4] px-6 py-6", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-6xl mx-auto", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-sm text-gray-500 mb-3", children: [
        t2("nav.home"),
        " › ",
        t2("nav.cabBooking"),
        " › ",
        displayOrigin,
        " ",
        t2("hero.to"),
        " ",
        displayDestination,
        " ",
        t2("nav.cabBooking")
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("h1", { className: "text-2xl font-bold text-gray-900", children: [
        displayOrigin,
        " ",
        t2("hero.to"),
        " ",
        displayDestination,
        " Cabs",
        " ",
        (route == null ? void 0 : route.startsFrom) && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-gray-500 text-lg font-normal ml-2", children: [
          "Starts @ ₹",
          route.startsFrom
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500 text-sm mt-1", children: 'Use "GOCAB" & get upto Rs 500 off' }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-4 mt-2 text-sm text-gray-600", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-yellow-500", children: "★ 4.7" }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
          (route == null ? void 0 : route.distance) || 0,
          " ",
          t2("common.km"),
          " • ",
          (route == null ? void 0 : route.durationText) || `${Math.round(((route == null ? void 0 : route.duration) || 0) / 60)} hrs`
        ] }),
        (route == null ? void 0 : route.startsFrom) && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-green-600 font-semibold", children: t2("hero.startsFrom", { price: route.startsFrom }) })
      ] }),
      routeNotFound && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-2 text-orange-600 text-sm", children: "This route is not yet configured. Please contact admin to add this route or search manually using the search bar above." })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-[#f4f4f4] py-6", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-w-6xl mx-auto space-y-5", children: currentIntercityLoading ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center py-10", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-spin rounded-full h-10 w-10 border-b-2 border-orange-500 mx-auto" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-4 text-gray-600", children: t2("cabSearch.searchingCabs") })
    ] }) : vehicleOptions.length > 0 ? (
      // Show vehicle options from route data (grouped by category)
      vehicleOptions.map((vehicle, idx) => {
        var _a2;
        return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 flex flex-col sm:flex-row items-center justify-between gap-6 hover:shadow-md transition-shadow", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-5", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "img",
                {
                  src: vehicle.image || "https://go-assets.ibcdn.com/u/GI/images/1731502913771-sedan-2.png",
                  alt: vehicle.displayName || vehicle.groupName,
                  className: "w-36 h-20 object-contain rounded-lg bg-gray-50 shadow-xl border border-gray-300"
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `mt-2 px-10 py-2 rounded-md text-sm font-medium ${vehicle.fuelType === "cng" ? "bg-blue-100 text-blue-700" : vehicle.fuelType === "electric" ? "bg-green-100 text-green-700" : "bg-orange-100 text-orange-700"}`, children: ((_a2 = vehicle.fuelType) == null ? void 0 : _a2.toUpperCase()) || "PETROL" })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: vehicle.displayName || vehicle.groupName }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-gray-500", children: vehicle.tier || "Standard" })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-3 mt-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-gray-600", children: [
                vehicle.category,
                " • ",
                vehicle.seats || "4",
                " ",
                t2("cabSearch.seater"),
                " • AC"
              ] }) })
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm font-medium text-gray-900", children: [
              vehicle.includedKm || (route == null ? void 0 : route.distance) || 0,
              " ",
              t2("common.km"),
              " included"
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-500 mt-1", children: [
              "Extra fare ₹",
              vehicle.extraFarePerKm || 15,
              "/km"
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-2xl font-bold text-gray-900", children: [
              "₹",
              vehicle.price || 0
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-500", children: [
              "+ ₹",
              vehicle.estimatedTax || Math.round((vehicle.price || 0) * 0.05),
              " ",
              t2("payment.taxes")
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                className: "mt-3 px-10 py-2.5 bg-blue-600 text-white font-semibold rounded-lg hover:bg-blue-700",
                onClick: () => handleSelectVehicle(vehicle),
                children: t2("common.select")
              }
            )
          ] })
        ] }, vehicle.groupId || idx);
      })
    ) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center py-10", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500", children: t2("cabSearch.noCabs") }) }) }) }),
    nearbyRoutes.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-[rgb(244,244,244)] py-8 border-t border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-6xl mx-auto px-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-xl font-bold text-gray-900 mb-2", children: [
        "Top Cab Routes from ",
        displayOrigin
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500 mb-6", children: [
        "Based on the most booked routes from ",
        displayOrigin
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-4", children: nearbyRoutes.map((route2, idx) => {
        var _a2;
        return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border border-gray-200 rounded-xl p-5 hover:shadow-md transition-shadow bg-white", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col md:flex-row justify-between items-center gap-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-lg font-bold text-gray-900", children: [
              route2.originCity,
              " to ",
              route2.destinationCity
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-gray-500 text-sm mt-1", children: [
              route2.distance || "0",
              " Kms | ",
              route2.durationText || "N/A",
              " (approx.)"
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 text-center md:text-left", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-bold text-gray-900", children: [
              route2.distance,
              " km included"
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-gray-500 text-sm mt-1", children: [
              "Extra fare ₹",
              route2.extraFarePerKm || "13.5",
              "/km after ",
              route2.distance,
              " kms"
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-end gap-2", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-green-600 text-xs font-bold", children: "16% off" }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-gray-400 text-xs line-through", children: [
                "₹",
                Math.round((route2.startsFrom || 2e3) * 1.19)
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-xl font-bold text-gray-900", children: [
                "₹",
                ((_a2 = route2.startsFrom) == null ? void 0 : _a2.toLocaleString()) || "N/A"
              ] })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-400 mb-2", children: [
              "+ ₹",
              route2.estimatedTax || Math.round((route2.startsFrom || 0) * 0.05),
              " Taxes & fees"
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "a",
              {
                href: `/top/${route2.slug}`,
                className: "inline-block bg-blue-600 text-white px-6 py-2 rounded-lg font-semibold text-sm hover:bg-blue-700 transition",
                children: "View Cabs"
              }
            )
          ] })
        ] }) }, idx);
      }) })
    ] }) }),
    inwardRoutes.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-[rgb(244,244,244)] py-8 border-t border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-6xl mx-auto px-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-xl font-bold text-gray-900 mb-2", children: [
        "Top Cab Routes to ",
        displayDestination
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500 mb-6", children: [
        "Popular routes ending at ",
        displayDestination
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-4", children: inwardRoutes.map((route2, idx) => {
        var _a2;
        return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border border-gray-200 rounded-xl p-5 hover:shadow-md transition-shadow bg-white", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col md:flex-row justify-between items-center gap-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-lg font-bold text-gray-900", children: [
              route2.originCity,
              " to ",
              route2.destinationCity
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-gray-500 text-sm mt-1", children: [
              route2.distance || "0",
              " Kms | ",
              route2.durationText || "N/A",
              " (approx.)"
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 text-center md:text-left", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-bold text-gray-900", children: [
              route2.distance,
              " km included"
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-gray-500 text-sm mt-1", children: [
              "Extra fare ₹",
              route2.extraFarePerKm || "13.5",
              "/km after ",
              route2.distance,
              " kms"
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-end gap-2", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-green-600 text-xs font-bold", children: "16% off" }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-gray-400 text-xs line-through", children: [
                "₹",
                Math.round((route2.startsFrom || 2e3) * 1.19)
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-xl font-bold text-gray-900", children: [
                "₹",
                ((_a2 = route2.startsFrom) == null ? void 0 : _a2.toLocaleString()) || "N/A"
              ] })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-400 mb-2", children: [
              "+ ₹",
              route2.estimatedTax || Math.round((route2.startsFrom || 0) * 0.05),
              " Taxes & fees"
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "a",
              {
                href: `/top/${route2.slug}`,
                className: "inline-block bg-blue-600 text-white px-6 py-2 rounded-lg font-semibold text-sm hover:bg-blue-700 transition",
                children: "View Cabs"
              }
            )
          ] })
        ] }) }, idx);
      }) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-[rgb(244,244,244)] py-10 border-t border-gray-100", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-6xl mx-auto px-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-2xl font-bold text-gray-900 mb-6", children: [
        displayOrigin,
        " to ",
        displayDestination,
        " Cab Services Highlights"
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "overflow-x-auto rounded-lg border border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("table", { className: "w-full text-left bg-white", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("thead", { className: "bg-gray-50 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("tr", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("th", { className: "py-4 px-6 font-semibold text-gray-700", children: "Route" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("th", { className: "py-4 px-6 font-semibold text-gray-700", children: "Distance" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("th", { className: "py-4 px-6 font-semibold text-gray-700", children: "Duration" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("th", { className: "py-4 px-6 font-semibold text-gray-700", children: "Start Price" })
        ] }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("tbody", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("tr", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("td", { className: "py-4 px-6 text-gray-600 border-b border-gray-100", children: [
            displayOrigin,
            " to ",
            displayDestination,
            " Cab"
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("td", { className: "py-4 px-6 text-gray-600 border-b border-gray-100", children: [
            (route == null ? void 0 : route.distance) || "N/A",
            " km"
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "py-4 px-6 text-gray-600 border-b border-gray-100", children: (route == null ? void 0 : route.durationText) || "N/A" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("td", { className: "py-4 px-6 font-medium text-green-600 border-b border-gray-100", children: [
            "£",
            (route == null ? void 0 : route.startsFrom) || "N/A"
          ] })
        ] }) })
      ] }) })
    ] }) }),
    faqs.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-[#f4f4f4] py-10", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-6xl mx-auto px-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-xl font-semibold text-gray-800 mb-6", children: [
        t2("faq.title"),
        " ",
        displayOrigin,
        " ",
        t2("hero.to"),
        " ",
        displayDestination,
        " Cabs"
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-white rounded-lg shadow-sm p-6 space-y-4", children: faqs.map((faq2, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border-b border-gray-100 pb-4 last:border-0", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "button",
          {
            className: "w-full text-left flex justify-between items-center",
            onClick: () => setOpenFAQ(openFAQ === index2 ? null : index2),
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium text-gray-900", children: faq2.question }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: `w-5 h-5 text-gray-500 transition-transform ${openFAQ === index2 ? "rotate-180" : ""}` })
            ]
          }
        ),
        openFAQ === index2 && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-2 text-gray-600 text-sm", children: faq2.answer })
      ] }, index2)) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-[rgb(244,244,244)] py-10 border-t border-gray-200 mb-8", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-6xl mx-auto px-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8", children: [
      nearbyRoutes.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-1 md:col-span-2 lg:col-span-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-lg font-bold text-gray-900 mb-4", children: [
          "Cabs from ",
          displayOrigin
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-y-3 gap-x-6", children: nearbyRoutes.map((r, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs("a", { href: `/top/${r.slug}`, className: "text-blue-500 hover:underline text-sm truncate block", children: [
          r.originCity,
          " To ",
          r.destinationCity,
          " Cabs"
        ] }, idx)) })
      ] }),
      routesToOrigin.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-1 md:col-span-2 lg:col-span-4 mt-6", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-lg font-bold text-gray-900 mb-4", children: [
          "Cabs to ",
          displayOrigin
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-y-3 gap-x-6", children: routesToOrigin.map((r, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs("a", { href: `/top/${r.slug}`, className: "text-blue-500 hover:underline text-sm truncate block", children: [
          r.originCity,
          " To ",
          r.destinationCity,
          " Cabs"
        ] }, idx)) })
      ] }),
      routesFromDestination.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-1 md:col-span-2 lg:col-span-4 mt-6", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-lg font-bold text-gray-900 mb-4", children: [
          "Cabs from ",
          displayDestination
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-y-3 gap-x-6", children: routesFromDestination.map((r, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs("a", { href: `/top/${r.slug}`, className: "text-blue-500 hover:underline text-sm truncate block", children: [
          r.originCity,
          " To ",
          r.destinationCity,
          " Cabs"
        ] }, idx)) })
      ] }),
      inwardRoutes.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-1 md:col-span-2 lg:col-span-4 mt-6", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-lg font-bold text-gray-900 mb-4", children: [
          "Cabs to ",
          displayDestination
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-y-3 gap-x-6", children: inwardRoutes.map((r, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs("a", { href: `/top/${r.slug}`, className: "text-blue-500 hover:underline text-sm truncate block", children: [
          r.originCity,
          " To ",
          r.destinationCity,
          " Cabs"
        ] }, idx)) })
      ] })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Footer, {})
  ] });
};
const TopMobile = () => {
  var _a, _b, _c, _d, _e;
  const dispatch = useDispatch();
  const navigate = useNavigate();
  const location = useLocation();
  const { slug } = useParams();
  const {
    currentIntercityRoute,
    currentIntercityLoading
  } = useSelector((state) => state.seo);
  ((_a = location.state) == null ? void 0 : _a.routeName) || ((_b = location.state) == null ? void 0 : _b.route);
  const parseSlugToCities = (slug2) => {
    if (!slug2) return { origin: "Delhi", destination: "Jaipur" };
    const match = slug2.match(/^(.+)-to-(.+)-cab$/i);
    if (match) {
      const capitalize = (str) => str.split("-").map(
        (word) => word.charAt(0).toUpperCase() + word.slice(1)
      ).join(" ");
      return {
        origin: capitalize(match[1]),
        destination: capitalize(match[2])
      };
    }
    return { origin: "Delhi", destination: "Jaipur" };
  };
  const parsedCities = parseSlugToCities(slug);
  const [fromCity, setFromCity] = reactExports.useState(parsedCities.origin);
  const [toCity, setToCity] = reactExports.useState(parsedCities.destination);
  const [tripType, setTripType] = reactExports.useState("oneway");
  const [pickupDate, setPickupDate] = reactExports.useState("");
  reactExports.useEffect(() => {
    const tomorrow = /* @__PURE__ */ new Date();
    tomorrow.setDate(tomorrow.getDate() + 1);
    const formatted = tomorrow.toLocaleDateString("en-IN", { day: "2-digit", month: "short", year: "numeric" });
    setPickupDate(formatted);
  }, []);
  reactExports.useEffect(() => {
    if (slug) {
      dispatch(getIntercityRouteBySlug(slug));
    }
  }, [dispatch, slug]);
  reactExports.useEffect(() => {
    const route2 = currentIntercityRoute;
    if (route2) {
      setFromCity(route2.originCity || parsedCities.origin);
      setToCity(route2.destinationCity || parsedCities.destination);
    }
  }, [currentIntercityRoute, parsedCities.origin, parsedCities.destination]);
  const route = currentIntercityRoute;
  const vehicleOptions = (route == null ? void 0 : route.vehicleOptions) || [];
  const handleSwap = () => {
    setFromCity(toCity);
    setToCity(fromCity);
  };
  const handleUpdateSearch = () => {
    if (slug) {
      dispatch(getIntercityRouteBySlug(slug));
    }
  };
  const handleSelectCab = (cab) => {
    const originCoords = (route == null ? void 0 : route.originCoords) || { lat: 0, lng: 0 };
    const destCoords = (route == null ? void 0 : route.destCoords) || { lat: 0, lng: 0 };
    const vehicleId = cab._id || cab.vehicleId || cab.groupId;
    navigate(`/details/${vehicleId}`, {
      state: {
        vehicleId,
        picklat: originCoords.lat,
        picklng: originCoords.lng,
        pickupAddress: fromCity,
        pickupCity: fromCity,
        droplat: destCoords.lat,
        droplng: destCoords.lng,
        dropAddress: toCity,
        dropCity: toCity,
        distance: (route == null ? void 0 : route.distance) || 0,
        tripType: tripType === "round" ? "roundTrip" : "oneWay",
        fuelType: cab.fuelType || "petrol",
        isAc: true,
        scheduledTime: (/* @__PURE__ */ new Date()).toISOString(),
        vehicle: cab,
        route
      }
    });
  };
  if (currentIntercityLoading) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-screen bg-[#fff7f2] flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { className: "w-10 h-10 text-[#f97316] animate-spin mx-auto" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-4 text-gray-600", children: "Loading route details..." })
    ] }) });
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen bg-[#fff7f2] text-gray-900 px-4 py-4", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-[#fff0e6] rounded-xl p-3 text-center mb-4 shadow-sm", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center gap-2 font-semibold text-[#f97316] text-sm", children: "Guaranteed On-time Cabs" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500 mt-1", children: "Clean cabs • Trusted drivers • 24x7 Support" })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-500 mb-2", children: [
      "Home › Cab Booking › ",
      /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "font-semibold", children: [
        fromCity,
        " to ",
        toCity,
        " Cab"
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl p-4 shadow", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex mb-3 border-b border-gray-200", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            onClick: () => setTripType("oneway"),
            className: `flex-1 text-center py-2 font-semibold ${tripType === "oneway" ? "border-b-2 border-[#f97316] text-[#f97316]" : "text-gray-500"}`,
            children: "One Way"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            onClick: () => setTripType("round"),
            className: `flex-1 text-center py-2 font-semibold ${tripType === "round" ? "border-b-2 border-[#f97316] text-[#f97316]" : "text-gray-500"}`,
            children: "Round Trip"
          }
        )
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-xs text-gray-500", children: "From (Area, Street or Landmark)" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between bg-gray-100 rounded-lg p-2 mt-1", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold", children: fromCity }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: handleSwap, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowUpDown, { size: 16, className: "text-gray-400" }) })
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-xs text-gray-500", children: "To (Area, Street or Landmark)" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-gray-100 rounded-lg p-2 mt-1 font-semibold", children: toCity })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-[#f97316] font-semibold", children: [
          "+ Add Stops",
          " ",
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[10px] bg-[#fee2e2] text-red-500 px-1 rounded", children: "new" })
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 mb-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: "TRIP START" }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 mt-1 font-semibold", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Calendar, { size: 16, className: "text-gray-500" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: pickupDate || "Select Date" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-400 text-sm", children: "10:00 AM" })
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          onClick: handleUpdateSearch,
          className: "w-52 ml-12 absolute -mt-2 bg-[#f97316] text-white py-3 rounded-3xl font-semibold text-sm",
          children: "Update Search"
        }
      )
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-8 bg-white rounded-xl p-4 shadow mb-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "font-semibold text-gray-800", children: [
        fromCity,
        " to ",
        toCity,
        " Cabs"
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-500 mt-1", children: [
        "Use ",
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold", children: '"GOCAB"' }),
        " & get upto ₹500 off"
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-600 mt-2", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "⭐ 4.4" }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
          "• ",
          (route == null ? void 0 : route.reviewCount) || 0,
          " reviews"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
          "• ",
          (route == null ? void 0 : route.tripCount) || 0,
          " trips"
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-500 mt-1", children: [
        (route == null ? void 0 : route.distance) || 0,
        " Km • ",
        (route == null ? void 0 : route.durationText) || `${Math.round(((route == null ? void 0 : route.duration) || 0) / 60)} hrs`
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-3", children: currentIntercityLoading ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center py-10", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { className: "w-8 h-8 text-[#f97316] animate-spin mx-auto" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-4 text-gray-600 text-sm", children: "Loading vehicles..." })
    ] }) : vehicleOptions.length > 0 ? (
      // Show vehicle options from route data
      vehicleOptions.map((vehicle, i2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "div",
        {
          onClick: () => handleSelectCab(vehicle),
          className: "flex items-center justify-between bg-white p-3 rounded-lg shadow-sm active:scale-[0.98] transition cursor-pointer",
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "img",
                {
                  src: vehicle.image || "https://gos3.ibcdn.com/sedan_v_2_copy_2-1576142484.png",
                  alt: vehicle.displayName || vehicle.groupName,
                  className: "w-16 h-10 object-contain"
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm", children: vehicle.displayName || vehicle.groupName }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-500", children: [
                  vehicle.category,
                  " • ",
                  vehicle.seats || 4,
                  " seats • AC"
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-2 text-xs mt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "span",
                  {
                    className: `px-1.5 py-0.5 rounded text-[10px] ${vehicle.fuelType === "diesel" ? "bg-orange-100 text-orange-600" : vehicle.fuelType === "cng" ? "bg-blue-100 text-blue-600" : "bg-red-100 text-red-600"}`,
                    children: (vehicle.fuelType || "Petrol").toUpperCase()
                  }
                ) })
              ] })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold text-sm", children: [
                "₹",
                vehicle.price || 0
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[10px] text-gray-400", children: [
                "+ ₹",
                vehicle.estimatedTax || Math.round((vehicle.price || 0) * 0.05),
                " Taxes"
              ] })
            ] })
          ]
        },
        vehicle.groupId || i2
      ))
    ) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center py-10 bg-white rounded-xl p-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500", children: "No vehicles available for this route." }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-400 text-sm mt-1", children: "Please try again later." })
    ] }) }),
    (route == null ? void 0 : route.reviews) && route.reviews.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-5 bg-white rounded-xl p-4 shadow", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-2", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "font-semibold text-gray-800 text-sm", children: [
          route.reviews.length,
          " reviews on this route"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "text-[#2563eb] text-xs font-semibold", children: "View all" })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-gray-50 p-3 rounded-lg", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex text-yellow-500 mb-1", children: [...Array(5)].map((_2, i2) => /* @__PURE__ */ jsxRuntimeExports.jsx(Star, { size: 14, fill: "currentColor" }, i2)) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-700", children: ((_c = route.reviews[0]) == null ? void 0 : _c.comment) || "Great service!" }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between text-xs text-gray-600 mt-2", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold", children: ((_d = route.reviews[0]) == null ? void 0 : _d.userName) || "Customer" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: ((_e = route.reviews[0]) == null ? void 0 : _e.cabType) || "sedan" })
        ] })
      ] })
    ] }),
    (route == null ? void 0 : route.vehicleCategories) && route.vehicleCategories.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-5 bg-white rounded-xl p-4 shadow", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-3", children: "Available Cabs on the Route" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 gap-3", children: route.vehicleCategories.slice(0, 2).map((cat, i2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border rounded-xl p-3 text-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: cat.image || "/hatchback.png", alt: cat.name, className: "w-20 mx-auto mb-2" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm", children: cat.name }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-500 mb-2", children: [
          "Starting From ",
          /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "font-semibold", children: [
            "₹",
            cat.startsFrom || 2480
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "border border-blue-500 text-blue-600 text-xs rounded-md px-3 py-1 font-semibold", children: "View Cabs" })
      ] }, i2)) })
    ] }),
    (route == null ? void 0 : route.relatedRoutes) && route.relatedRoutes.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-5 bg-white rounded-xl p-4 shadow mb-8", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "font-semibold text-gray-800 text-sm mb-1", children: [
        "Top Cab Routes from ",
        fromCity
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-500 mb-3", children: [
        "💡 Based on most booked routes from ",
        fromCity
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 gap-3", children: route.relatedRoutes.slice(0, 2).map((rel, i2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border rounded-xl p-3 text-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold text-sm", children: [
          rel.origin,
          " → ",
          rel.destination
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-500", children: [
          rel.distance,
          " kms | ",
          rel.duration
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs mt-1", children: [
          "Starting From ",
          /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "font-semibold", children: [
            "₹",
            rel.startsFrom
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            onClick: () => navigate(`/top/${rel.slug}`),
            className: "mt-2 border border-blue-500 text-blue-600 text-xs rounded-md px-3 py-1 font-semibold",
            children: "View Cabs"
          }
        )
      ] }, i2)) })
    ] }),
    (route == null ? void 0 : route.faqs) && route.faqs.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "px-4 py-6 bg-white rounded-2xl shadow-sm mt-6 mb-8", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("details", { className: "border-t border-gray-200 pt-3", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("summary", { className: "font-semibold text-gray-800 cursor-pointer", children: [
        "FAQs about ",
        fromCity,
        " to ",
        toCity
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "mt-3 space-y-3 text-gray-700 text-sm", children: route.faqs.map((faq2, i2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Q." }),
        " ",
        faq2.question,
        faq2.answer && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-1 text-gray-600", children: faq2.answer })
      ] }, i2)) })
    ] }) })
  ] });
};
const Airport = () => {
  var _a, _b;
  const { t: t2 } = useTranslation();
  const dispatch = useDispatch();
  const navigate = useNavigate();
  const location = useLocation();
  const { slug } = useParams();
  const {
    currentAirportRoute,
    currentAirportLoading,
    searchResults,
    searchLoading: reduxSearchLoading
  } = useSelector((state) => state.seo);
  const [tripType, setTripType] = reactExports.useState("oneway");
  const [airportTripType, setAirportTripType] = reactExports.useState("pickup");
  const [fromLocation, setFromLocation] = reactExports.useState("");
  const [toLocation, setToLocation] = reactExports.useState("");
  const [pickupDate, setPickupDate] = reactExports.useState("");
  const [returnDate, setReturnDate] = reactExports.useState("");
  const [pickupTime, setPickupTime] = reactExports.useState("10:00 AM");
  const [stops, setStops] = reactExports.useState([]);
  const [sourceCoords, setSourceCoords] = reactExports.useState({ lat: 0, lng: 0 });
  const [destCoords, setDestCoords] = reactExports.useState({ lat: 0, lng: 0 });
  const [currentUserLocation, setCurrentUserLocation] = reactExports.useState(null);
  const [showTripTypeDropdown, setShowTripTypeDropdown] = reactExports.useState(false);
  const [showLocationModal, setShowLocationModal] = reactExports.useState(false);
  const [showStopsModal, setShowStopsModal] = reactExports.useState(false);
  const [showDateModal, setShowDateModal] = reactExports.useState(false);
  const [showTimeModal, setShowTimeModal] = reactExports.useState(false);
  const [locationType, setLocationType] = reactExports.useState("");
  const [dateType, setDateType] = reactExports.useState("pickup");
  const [localSearchLoading, setLocalSearchLoading] = reactExports.useState(false);
  const [currentDisplayDate, setCurrentDisplayDate] = reactExports.useState(/* @__PURE__ */ new Date());
  const routeFromState = (_a = location.state) == null ? void 0 : _a.route;
  reactExports.useEffect(() => {
    if (slug) {
      dispatch(getAirportRouteBySlug(slug));
    }
  }, [dispatch, slug]);
  reactExports.useEffect(() => {
    var _a2, _b2, _c, _d, _e, _f, _g, _h;
    const route2 = currentAirportRoute || routeFromState;
    if (route2) {
      let airportLat = ((_b2 = (_a2 = route2.coordinates) == null ? void 0 : _a2.coordinates) == null ? void 0 : _b2[1]) || 0;
      let airportLng = ((_d = (_c = route2.coordinates) == null ? void 0 : _c.coordinates) == null ? void 0 : _d[0]) || 0;
      let cityLat = ((_f = (_e = route2.cityCoordinates) == null ? void 0 : _e.coordinates) == null ? void 0 : _f[1]) || 0;
      let cityLng = ((_h = (_g = route2.cityCoordinates) == null ? void 0 : _g.coordinates) == null ? void 0 : _h[0]) || 0;
      const initializeCoords = async () => {
        if (airportLat === 0 && route2.airportName) {
          const aCoords = await geocodeLocation(route2.airportName);
          if (aCoords) {
            airportLat = aCoords.lat;
            airportLng = aCoords.lng;
          }
        }
        if (cityLat === 0 && route2.cityName) {
          const cCoords = await geocodeLocation(route2.cityName);
          if (cCoords) {
            cityLat = cCoords.lat;
            cityLng = cCoords.lng;
          }
        }
        if (route2.routeType === "from_airport") {
          setFromLocation(route2.airportName || "");
          setToLocation(route2.cityName || "");
          setAirportTripType("pickup");
          setSourceCoords({ lat: airportLat, lng: airportLng });
          setDestCoords({ lat: cityLat, lng: cityLng });
        } else {
          setFromLocation(route2.cityName || "");
          setToLocation(route2.airportName || "");
          setAirportTripType("drop");
          setSourceCoords({ lat: cityLat, lng: cityLng });
          setDestCoords({ lat: airportLat, lng: airportLng });
        }
      };
      initializeCoords();
      const tomorrow = /* @__PURE__ */ new Date();
      tomorrow.setDate(tomorrow.getDate() + 1);
      setPickupDate(tomorrow.toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric" }));
    }
  }, [currentAirportRoute, routeFromState]);
  reactExports.useEffect(() => {
    if (slug && currentAirportRoute) {
      dispatch(searchAirportCabs({
        slug,
        params: {
          startTime: (/* @__PURE__ */ new Date()).toISOString(),
          isAc: true
        }
      }));
    }
  }, [dispatch, slug, currentAirportRoute]);
  const route = currentAirportRoute || routeFromState;
  const vehicleOptions = (route == null ? void 0 : route.vehicleOptions) || [];
  const cabs = (searchResults == null ? void 0 : searchResults.cabs) || [];
  const faqs = (route == null ? void 0 : route.faqs) || [];
  const tripTypeOptions = [
    { value: "oneway", label: t2("tripTypes.oneway") },
    { value: "round", label: t2("tripTypes.round") }
  ];
  const handleTripTypeChange = (newType) => {
    if (newType === airportTripType) return;
    setAirportTripType(newType);
    const tempLoc = fromLocation;
    setFromLocation(toLocation);
    setToLocation(tempLoc);
    const tempCoords = sourceCoords;
    setSourceCoords(destCoords);
    setDestCoords(tempCoords);
  };
  const handleLocationSelect = (location2) => {
    if (locationType === "from") {
      setFromLocation(location2);
    } else if (locationType === "to") {
      setToLocation(location2);
    }
    setShowLocationModal(false);
  };
  const handleDateSelect = (dayObj) => {
    if (dayObj && !dayObj.otherMonth && dayObj.date) {
      const dateStr = dayObj.date.toLocaleDateString("en-GB", {
        day: "numeric",
        month: "short",
        year: "numeric"
      });
      if (dateType === "return") {
        setReturnDate(dateStr);
      } else {
        setPickupDate(dateStr);
      }
      setShowDateModal(false);
    }
  };
  const handleTimeSelect = (time) => {
    setPickupTime(time);
    setShowTimeModal(false);
  };
  const addStop = () => setStops([...stops, { id: Date.now(), value: "" }]);
  const removeStop = (id) => setStops(stops.filter((stop) => stop.id !== id));
  const handleStopChange = (id, value) => {
    setStops(stops.map((stop) => stop.id === id ? { ...stop, value } : stop));
  };
  const handleUpdateSearch = async () => {
    setLocalSearchLoading(true);
    try {
      if (!fromLocation || !toLocation) {
        zt.error("Please select both locations");
        setLocalSearchLoading(false);
        return;
      }
      if (tripType === "round" && !returnDate) {
        zt.error("Please select a return date");
        setLocalSearchLoading(false);
        return;
      }
      let sCoords = { ...sourceCoords };
      if (fromLocation === "Current Location" && currentUserLocation) {
        sCoords = currentUserLocation;
      } else if (!sCoords.lat || !sCoords.lng || fromLocation !== (airportTripType === "pickup" ? route == null ? void 0 : route.airportName : route == null ? void 0 : route.cityName)) {
        const c2 = await geocodeLocation(fromLocation);
        if (c2) sCoords = c2;
      }
      if (!sCoords.lat) {
        const c2 = await geocodeLocation(fromLocation);
        if (c2) sCoords = c2;
        else {
          zt.error(`Could not find location: ${fromLocation}`);
          setLocalSearchLoading(false);
          return;
        }
      }
      let dCoords = { ...destCoords };
      if (!dCoords.lat || !dCoords.lng || toLocation !== (airportTripType === "drop" ? route == null ? void 0 : route.airportName : route == null ? void 0 : route.cityName)) {
        const c2 = await geocodeLocation(toLocation);
        if (c2) dCoords = c2;
      }
      if (!dCoords.lat) {
        const c2 = await geocodeLocation(toLocation);
        if (c2) dCoords = c2;
        else {
          zt.error(`Could not find location: ${toLocation}`);
          setLocalSearchLoading(false);
          return;
        }
      }
      const validStops = [];
      if (stops.length > 0) {
        for (const stop of stops) {
          if (!stop.value || stop.value.trim() === "") continue;
          const stopCoords = await geocodeLocation(stop.value);
          if (stopCoords) {
            validStops.push({
              address: stop.value,
              coordinates: [stopCoords.lng, stopCoords.lat],
              stopOrder: validStops.length + 1
            });
          }
        }
      }
      const searchParams = {
        from: fromLocation,
        to: toLocation,
        sourceLat: sCoords.lat,
        sourceLong: sCoords.lng,
        destLat: dCoords.lat,
        destLong: dCoords.lng,
        tripType: tripType === "oneway" ? "oneWay" : "roundTrip",
        // Using "oneWay" format for backend
        fuelType: "petrol",
        isAc: true,
        pickupDate,
        pickupTime,
        returnDate,
        startTime: (/* @__PURE__ */ new Date()).toISOString(),
        stops: validStops.length > 0 ? validStops : void 0
      };
      navigate("/results", { state: { searchParams } });
    } catch (error) {
      console.error("Search error", error);
      zt.error("Search failed");
    } finally {
      setLocalSearchLoading(false);
    }
  };
  const handleSelectVehicle = (vehicle) => {
    var _a2;
    const vehicleId = vehicle.vehicleId || vehicle._id || vehicle.groupId;
    navigate(`/details/${vehicleId}`, {
      state: {
        vehicleId,
        picklat: sourceCoords.lat,
        picklng: sourceCoords.lng,
        pickupAddress: fromLocation,
        pickupCity: fromLocation,
        pickupState: "",
        droplat: destCoords.lat,
        droplng: destCoords.lng,
        dropAddress: toLocation,
        dropCity: toLocation,
        dropState: "",
        distance: ((_a2 = vehicle.tripDetails) == null ? void 0 : _a2.totalDistance) || (route == null ? void 0 : route.distance) || 40,
        tripType: "airport",
        fuelType: vehicle.fuelType || "petrol",
        isAc: true,
        scheduledTime: (/* @__PURE__ */ new Date()).toISOString(),
        vehicle,
        route,
        tripDetails: {
          from: fromLocation,
          to: toLocation,
          date: pickupDate,
          time: pickupTime,
          tripType: "airport",
          stops
        }
      }
    });
  };
  const getDaysInMonth = (date) => new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
  const getFirstDayOfMonth = (date) => new Date(date.getFullYear(), date.getMonth(), 1).getDay();
  const generateCalendarDays = () => {
    const daysInMonth = getDaysInMonth(currentDisplayDate);
    const firstDay = getFirstDayOfMonth(currentDisplayDate);
    const days = [];
    const startOffset = firstDay === 0 ? 6 : firstDay - 1;
    for (let i2 = 0; i2 < startOffset; i2++) {
      days.push({ day: "", otherMonth: true });
    }
    for (let i2 = 1; i2 <= daysInMonth; i2++) {
      days.push({
        day: i2.toString(),
        date: new Date(currentDisplayDate.getFullYear(), currentDisplayDate.getMonth(), i2)
      });
    }
    return days;
  };
  const calendarDays = generateCalendarDays();
  const changeMonth = (offset) => {
    const newDate = new Date(currentDisplayDate);
    newDate.setMonth(newDate.getMonth() + offset);
    setCurrentDisplayDate(newDate);
  };
  const generateTimeSlots = () => {
    const times = [];
    for (let hour = 0; hour < 24; hour++) {
      for (let minute = 0; minute < 60; minute += 15) {
        const period = hour >= 12 ? "PM" : "AM";
        const displayHour = hour % 12 || 12;
        const timeString = `${displayHour}:${minute.toString().padStart(2, "0")} ${period}`;
        times.push(timeString);
      }
    }
    return times;
  };
  const timeSlots = generateTimeSlots();
  const LocationModal = () => {
    const [searchText, setSearchText] = reactExports.useState("");
    const handleCurrentLocation = () => {
      if ("geolocation" in navigator) {
        navigator.geolocation.getCurrentPosition(
          (position) => {
            const coords = {
              lat: position.coords.latitude,
              lng: position.coords.longitude
            };
            setCurrentUserLocation(coords);
            handleLocationSelect("Current Location");
          },
          (error) => {
            console.error("Error getting location:", error);
            zt.error("Could not get location");
          }
        );
      } else {
        zt.error("Geolocation not supported");
      }
    };
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 border-b border-gray-200", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: locationType === "from" ? t2("hero.from").toUpperCase() : t2("hero.to").toUpperCase() }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowLocationModal(false), className: "p-1 text-gray-500 hover:text-gray-700", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          LocationAutocomplete,
          {
            value: searchText,
            onChange: setSearchText,
            onLocationSelect: handleLocationSelect,
            placeholder: `Search ${locationType === "from" ? "Pickup" : "Drop"}...`
          }
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "button",
        {
          onClick: handleCurrentLocation,
          className: "flex items-center gap-2 text-blue-600 text-sm font-medium mb-4 hover:bg-blue-50 p-2 rounded w-full transition-colors",
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(MapPin, { className: "w-4 h-4" }),
            " ",
            t2("common.useCurrentLocation")
          ]
        }
      ) })
    ] }) });
  };
  const StopsModal = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: t2("hero.addStops") }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowStopsModal(false), className: "p-1 text-gray-500 hover:text-gray-700", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
      stops.map((stop, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600 mb-2", children: [
          t2("tripDetails.stop"),
          " ",
          index2 + 1
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            LocationAutocomplete,
            {
              value: stop.value,
              onChange: (val) => handleStopChange(stop.id, val),
              onLocationSelect: (val) => handleStopChange(stop.id, val),
              placeholder: "Enter stop location",
              className: "flex-1"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => removeStop(stop.id), className: "text-gray-500 hover:text-red-500", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
        ] })
      ] }, stop.id)),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { onClick: addStop, className: "flex items-center gap-2 text-blue-600 text-sm font-medium mt-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(Plus, { className: "w-4 h-4" }),
        " ",
        t2("hero.addStops")
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-t border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowStopsModal(false), className: "w-full bg-blue-600 text-white py-3 rounded-lg font-semibold", children: t2("common.done").toUpperCase() }) })
  ] }) });
  const DateModal = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: dateType === "return" ? "RETURN DATE" : t2("hero.pickupDate").toUpperCase() }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowDateModal(false), className: "p-1 text-gray-500 hover:text-gray-700", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-4 text-gray-900", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => changeMonth(-1), className: "p-2 hover:bg-gray-100 rounded-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 rotate-90" }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-bold uppercase", children: currentDisplayDate.toLocaleDateString("en-US", { month: "long", year: "numeric" }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => changeMonth(1), className: "p-2 hover:bg-gray-100 rounded-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 -rotate-90" }) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-1 mb-2", children: [t2("weekDays.mon"), t2("weekDays.tue"), t2("weekDays.wed"), t2("weekDays.thu"), t2("weekDays.fri"), t2("weekDays.sat"), t2("weekDays.sun")].map((day) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center text-xs text-gray-500 font-medium py-2", children: day }, day)) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-1", children: calendarDays.map((dayObj, index2) => {
        var _a2;
        const currentDateStr = (_a2 = dayObj.date) == null ? void 0 : _a2.toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric" });
        const isSelected = currentDateStr === (dateType === "return" ? returnDate : pickupDate);
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: `h-10 flex items-center justify-center rounded-full text-sm font-medium cursor-pointer
                    ${!dayObj.day || dayObj.otherMonth ? "text-transparent pointer-events-none" : "text-gray-700 hover:bg-gray-100"}
                    ${isSelected ? "bg-orange-500 text-white hover:bg-orange-600" : ""}
                  `,
            onClick: () => handleDateSelect(dayObj),
            children: dayObj.day
          },
          index2
        );
      }) })
    ] })
  ] }) });
  const TimeModal = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: t2("hero.pickupTime").toUpperCase() }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowTimeModal(false), className: "p-1 text-gray-500 hover:text-gray-700", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-h-96 overflow-y-auto p-4", children: timeSlots.map((time, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      {
        className: `py-3 border-b text-black border-gray-100 cursor-pointer hover:bg-gray-50 ${pickupTime === time ? "bg-blue-50" : ""}`,
        onClick: () => handleTimeSelect(time),
        children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-medium", children: time })
      },
      index2
    )) })
  ] }) });
  if (currentAirportLoading) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-screen bg-white flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-orange-500 mx-auto" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-4 text-gray-600", children: "Loading airport route details..." })
    ] }) });
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen flex flex-col", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
    showLocationModal && /* @__PURE__ */ jsxRuntimeExports.jsx(LocationModal, {}),
    showStopsModal && /* @__PURE__ */ jsxRuntimeExports.jsx(StopsModal, {}),
    showDateModal && /* @__PURE__ */ jsxRuntimeExports.jsx(DateModal, {}),
    showTimeModal && /* @__PURE__ */ jsxRuntimeExports.jsx(TimeModal, {}),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full bg-orange-500 py-4 px-4 mt-16", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto flex flex-wrap items-center justify-between gap-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-8 ml-8", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: t2("hero.tripType").toUpperCase() }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md flex items-center gap-1 text-black min-w-[180px]",
              onClick: () => setShowTripTypeDropdown(!showTripTypeDropdown),
              children: [
                (_b = tripTypeOptions.find((opt) => opt.value === tripType)) == null ? void 0 : _b.label,
                /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4" })
              ]
            }
          ),
          showTripTypeDropdown && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute top-full left-0 mt-1 bg-white text-black border border-gray-200 rounded-md shadow-lg z-10 min-w-[180px]", children: tripTypeOptions.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: `px-4 py-2 cursor-pointer hover:bg-gray-100 ${tripType === option.value ? "bg-blue-50 text-blue-600" : ""}`,
              onClick: () => {
                setTripType(option.value);
                setShowTripTypeDropdown(false);
              },
              children: option.label
            },
            option.value
          )) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: t2("hero.from").toUpperCase() }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => {
                setLocationType("from");
                setShowLocationModal(true);
              },
              children: fromLocation || t2("common.select")
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-5 relative inline-block", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "absolute -top-3 right-2 text-[11px] px-1.5 py-[1px] bg-white text-purple-600 border border-black rounded-md font-semibold shadow-sm", children: t2("hero.new") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-[#2276e3] shadow",
              onClick: () => setShowStopsModal(true),
              children: t2("hero.addStops")
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: t2("hero.to").toUpperCase() }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => {
                setLocationType("to");
                setShowLocationModal(true);
              },
              children: toLocation || t2("common.select")
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: t2("hero.pickupDate").toUpperCase() }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => {
                setDateType("pickup");
                setShowDateModal(true);
              },
              children: pickupDate || t2("common.selectDate")
            }
          )
        ] }),
        tripType === "round" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "RETURN DATE" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => {
                setDateType("return");
                setShowDateModal(true);
              },
              children: returnDate || "Select Date"
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: t2("hero.pickupTime").toUpperCase() }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => setShowTimeModal(true),
              children: pickupTime
            }
          )
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          className: "text-lg font-semibold bg-white px-4 py-2 rounded-md text-[#2276e3]",
          onClick: handleUpdateSearch,
          disabled: localSearchLoading,
          children: localSearchLoading ? "SEARCHING..." : t2("common.updateSearch").toUpperCase()
        }
      ) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-gray-100 flex-1", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-6xl mx-auto px-4 py-8", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500", children: [
        t2("nav.home"),
        " > ",
        t2("nav.cabBooking"),
        " >",
        " ",
        /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-gray-900 font-medium", children: [
          route == null ? void 0 : route.airportName,
          " ",
          t2("nav.cabBooking")
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-2xl font-bold text-gray-900 mt-3", children: t2("hero.bookAirportTaxiDynamic", { airport: route == null ? void 0 : route.airportName }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-700 mt-2 text-sm max-w-4xl", children: (route == null ? void 0 : route.metaDescription) || `Book sanitized ${route == null ? void 0 : route.airportName} taxi services for hassle-free experience. Book all type of cabs for Airport transfer.` }),
      (route == null ? void 0 : route.startsFrom) && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-green-600 font-semibold mt-2", children: t2("hero.startsFrom", { price: route.startsFrom }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-6 mt-6", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold text-gray-700", children: [
          t2("common.select"),
          " ",
          t2("hero.tripType")
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: "To update price, included kms & extra fare" })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-4 mt-4 flex-wrap", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "button",
          {
            onClick: () => handleTripTypeChange("pickup"),
            className: `border px-6 py-3 rounded-lg flex items-center gap-2 shadow-sm font-medium ${airportTripType === "pickup" ? "border-blue-500 bg-blue-50 text-blue-600" : "border-gray-300 bg-white text-gray-900"}`,
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `w-3 h-3 rounded-full border-2 flex items-center justify-center ${airportTripType === "pickup" ? "border-blue-500" : "border-gray-400"}`, children: airportTripType === "pickup" && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "w-2 h-2 bg-blue-500 rounded-full" }) }),
              t2("booking.airportPickup")
            ]
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "button",
          {
            onClick: () => handleTripTypeChange("drop"),
            className: `border px-6 py-3 rounded-lg flex items-center gap-2 shadow-sm font-medium ${airportTripType === "drop" ? "border-blue-500 bg-blue-50 text-blue-600" : "border-gray-300 bg-white text-gray-900"}`,
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `w-3 h-3 rounded-full border-2 flex items-center justify-center ${airportTripType === "drop" ? "border-blue-500" : "border-gray-400"}`, children: airportTripType === "drop" && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "w-2 h-2 bg-blue-500 rounded-full" }) }),
              t2("booking.airportDrop")
            ]
          }
        )
      ] }),
      (cabs.length > 0 || vehicleOptions.length > 0) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-8", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-lg font-semibold text-gray-900 mb-4", children: [
          t2("cabSearch.availableCabsFor"),
          " ",
          route == null ? void 0 : route.airportName
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-4", children: reduxSearchLoading ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center py-10", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-spin rounded-full h-10 w-10 border-b-2 border-orange-500 mx-auto" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-4 text-gray-600", children: t2("cabSearch.searchingCabs") })
        ] }) : cabs.length > 0 ? cabs.map((cab, idx) => {
          var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
          const vehicleName = cab.modelName || ((_a2 = cab.group) == null ? void 0 : _a2.groupName) || "Cab";
          const seats = cab.seats || ((_b2 = cab.group) == null ? void 0 : _b2.seats) || 4;
          const isAc = cab.isAc !== void 0 ? cab.isAc : ((_c = cab.group) == null ? void 0 : _c.isAc) || true;
          const fuelType = cab.fuelType || ((_d = cab.group) == null ? void 0 : _d.fuelType) || "Petrol";
          const image = cab.image || ((_f = (_e = cab.group) == null ? void 0 : _e.vehicleImages) == null ? void 0 : _f.frontView) || "https://go-assets.ibcdn.com/u/GI/images/1731502913771-sedan-2.png";
          const category = ((_g = cab.category) == null ? void 0 : _g.categoryName) || ((_i = (_h = cab.group) == null ? void 0 : _h.category) == null ? void 0 : _i.categoryName) || "Standard";
          return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg shadow-md p-4 flex flex-col sm:flex-row items-center justify-between gap-4 border border-gray-100 hover:shadow-lg transition-shadow", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-6 flex-1", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-24 h-16 flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                "img",
                {
                  src: image,
                  alt: vehicleName,
                  className: "w-full h-full object-contain"
                }
              ) }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-bold text-lg text-gray-900", children: vehicleName }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1 mt-1 text-sm text-gray-500", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "bg-gray-100 px-2 py-0.5 rounded text-xs font-medium uppercase tracking-wide", children: category }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex items-center gap-1", children: [
                    "• ",
                    seats,
                    " ",
                    t2("cabSearch.seater")
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex items-center gap-1", children: [
                    "• ",
                    isAc ? t2("cabSearch.ac") : t2("cabSearch.nonAc")
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex items-center gap-1", children: [
                    "• ",
                    fuelType
                  ] }),
                  ((_j = cab.group) == null ? void 0 : _j.luggageCapacity) > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex items-center gap-1", children: [
                    "• ",
                    cab.group.luggageCapacity,
                    " Bags"
                  ] })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 text-xs text-green-600 font-medium flex items-center gap-1", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-3 h-3", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M5 13l4 4L19 7" }) }),
                  t2("payment.freeCancellation"),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-400 mx-1", children: "|" }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-3 h-3", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
                  t2("cabSearch.instantConfirmation")
                ] })
              ] })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right min-w-[120px]", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-end", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-2xl font-bold text-gray-900", children: [
                  "₹",
                  Math.round(((_k = cab.fare) == null ? void 0 : _k.total) || cab.price)
                ] }),
                ((_l = cab.fare) == null ? void 0 : _l.baseFare) && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-400 line-through", children: [
                  "₹",
                  Math.round((((_m = cab.fare) == null ? void 0 : _m.total) || cab.price) * 1.1)
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[10px] text-gray-500 mt-1 uppercase font-semibold tracking-wider", children: t2("cabSearch.fixedFare") })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "button",
                {
                  className: "mt-3 w-full bg-blue-600 hover:bg-blue-700 text-white px-6 py-2.5 rounded-full font-bold text-sm transition-colors shadow-sm",
                  onClick: () => handleSelectVehicle(cab),
                  children: t2("common.select").toUpperCase()
                }
              )
            ] })
          ] }, cab._id || idx);
        }) : vehicleOptions.map((vehicle, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg shadow-md p-4 flex items-center justify-between", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "img",
              {
                src: vehicle.image || "https://go-assets.ibcdn.com/u/GI/images/1731502913771-sedan-2.png",
                alt: vehicle.groupName,
                className: "w-24 h-16 object-contain"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold text-gray-900", children: vehicle.displayName || vehicle.groupName }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500", children: [
                vehicle.category,
                " • ",
                vehicle.seats,
                " ",
                t2("cabSearch.seater"),
                " • ",
                vehicle.fuelType
              ] })
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xl font-bold text-gray-900", children: [
              "₹",
              vehicle.price
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                className: "mt-2 bg-blue-600 text-white px-6 py-2 rounded-lg font-semibold",
                onClick: () => handleSelectVehicle(vehicle),
                children: t2("common.select")
              }
            )
          ] })
        ] }, vehicle.groupId || idx)) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-10", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-lg font-semibold text-gray-900 mb-4", children: [
          t2("faq.title"),
          " ",
          route == null ? void 0 : route.airportName
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-white shadow-md rounded-lg p-6 space-y-4", children: faqs.length > 0 ? faqs.map((faq2, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold text-gray-900", children: [
            "Q: ",
            faq2.question
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-gray-700 mt-1", children: [
            "A: ",
            faq2.answer
          ] })
        ] }, index2)) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold text-gray-900", children: [
              "Q: ",
              t2("faq.economicalCabQ", { airport: route == null ? void 0 : route.airportName })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-gray-700 mt-1", children: [
              "A: ",
              t2("faq.economicalCabA", { airport: route == null ? void 0 : route.airportName }),
              " ",
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-600 cursor-pointer", children: t2("hero.bookOnlineCab") })
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold text-gray-900", children: [
              "Q: ",
              t2("faq.optionsQ", { airport: route == null ? void 0 : route.airportName })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-gray-700 mt-1", children: [
              "A: ",
              t2("faq.optionsA", { airport: route == null ? void 0 : route.airportName }),
              " ",
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-600 cursor-pointer", children: t2("hero.bookOnlineCab") }),
              ":- ",
              t2("tripTypes.oneway"),
              ", ",
              t2("hero.hourlyCarRental"),
              ", ",
              t2("tripTypes.airport"),
              " ",
              t2("booking.drop")
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-gray-900", children: "Q: What are the advantages of online cab booking?" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-700 mt-1", children: "A: Online cab booking not only helps you with best prices but also helps you with the convenience of paying through multiple payment options (like Debit Card, Credit Card, eWallets etc.). You can easily compare prices and choose various categories of cabs like Hatchback cars, Sedan and SUV." })
          ] })
        ] }) })
      ] }),
      (route == null ? void 0 : route.routesFromAirport) && route.routesFromAirport.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-10", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-lg font-semibold text-gray-900 mb-4", children: [
          "Cabs from ",
          route.airportName
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-white shadow-md rounded-lg p-6", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4", children: route.routesFromAirport.map((relatedRoute, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "a",
          {
            href: `/airport/${relatedRoute.slug}`,
            className: "text-blue-600 hover:text-blue-800 hover:underline text-sm",
            children: [
              relatedRoute.airportName,
              " To ",
              relatedRoute.cityName,
              " Cabs"
            ]
          },
          index2
        )) }) })
      ] }),
      (route == null ? void 0 : route.routesToAirport) && route.routesToAirport.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-10", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-lg font-semibold text-gray-900 mb-4", children: [
          "Cabs to ",
          route.airportName
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-white shadow-md rounded-lg p-6", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4", children: route.routesToAirport.map((relatedRoute, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "a",
          {
            href: `/airport/${relatedRoute.slug}`,
            className: "text-blue-600 hover:text-blue-800 hover:underline text-sm",
            children: [
              relatedRoute.cityName,
              " To ",
              relatedRoute.airportName,
              " Cabs"
            ]
          },
          index2
        )) }) })
      ] })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Footer, {})
  ] });
};
const Cities = () => {
  var _a, _b, _c, _d, _e, _f;
  const dispatch = useDispatch();
  const navigate = useNavigate();
  const location = useLocation();
  const { slug } = useParams();
  const {
    currentCityService,
    currentCityLoading,
    searchResults
  } = useSelector((state) => state.seo);
  const [tripType, setTripType] = reactExports.useState("oneway");
  const [fromLocation, setFromLocation] = reactExports.useState("");
  const [toLocation, setToLocation] = reactExports.useState("");
  const [pickupDate, setPickupDate] = reactExports.useState("");
  const [returnDate, setReturnDate] = reactExports.useState("");
  const [pickupTime, setPickupTime] = reactExports.useState("10:00 AM");
  const [stops, setStops] = reactExports.useState([]);
  const [showTripTypeDropdown, setShowTripTypeDropdown] = reactExports.useState(false);
  const [showLocationModal, setShowLocationModal] = reactExports.useState(false);
  const [showStopsModal, setShowStopsModal] = reactExports.useState(false);
  const [showDateModal, setShowDateModal] = reactExports.useState(false);
  const [showTimeModal, setShowTimeModal] = reactExports.useState(false);
  const [locationType, setLocationType] = reactExports.useState("");
  const [dateType, setDateType] = reactExports.useState("pickup");
  const [currentUserLocation, setCurrentUserLocation] = reactExports.useState(null);
  const [searchLoading, setSearchLoading] = reactExports.useState(false);
  const [currentDisplayDate, setCurrentDisplayDate] = reactExports.useState(/* @__PURE__ */ new Date());
  const serviceFromState = (_a = location.state) == null ? void 0 : _a.service;
  reactExports.useEffect(() => {
    if (slug) {
      if ((currentCityService == null ? void 0 : currentCityService.slug) === slug) {
        return;
      }
      dispatch(getCityServiceBySlug(slug));
    }
  }, [dispatch, slug, currentCityService]);
  reactExports.useEffect(() => {
    const service2 = currentCityService || serviceFromState;
    if (service2) {
      setFromLocation(service2.cityName || "");
      const tomorrow = /* @__PURE__ */ new Date();
      tomorrow.setDate(tomorrow.getDate() + 1);
      setPickupDate(tomorrow.toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric" }));
    }
  }, [currentCityService, serviceFromState]);
  const service = currentCityService || serviceFromState;
  (service == null ? void 0 : service.popularRoutes) || [];
  const faqs = (service == null ? void 0 : service.faqs) || [];
  (service == null ? void 0 : service.vehicleOptions) || [];
  const tripTypeOptions = [
    { value: "oneway", label: "One Way" },
    { value: "round", label: "Round Trip" }
  ];
  const handleLocationSelect = (location2) => {
    if (locationType === "from") {
      setFromLocation(location2);
    } else if (locationType === "to") {
      setToLocation(location2);
    }
    setShowLocationModal(false);
  };
  const handleDateSelect = (dayObj) => {
    if (dayObj && !dayObj.otherMonth && dayObj.date) {
      const dateStr = dayObj.date.toLocaleDateString("en-GB", {
        day: "numeric",
        month: "short",
        year: "numeric"
      });
      if (dateType === "return") {
        setReturnDate(dateStr);
      } else {
        setPickupDate(dateStr);
      }
      setShowDateModal(false);
    }
  };
  const handleTimeSelect = (time) => {
    setPickupTime(time);
    setShowTimeModal(false);
  };
  const addStop = () => setStops([...stops, { id: Date.now(), value: "" }]);
  const removeStop = (id) => setStops(stops.filter((stop) => stop.id !== id));
  const handleStopChange = (id, value) => {
    setStops(stops.map((stop) => stop.id === id ? { ...stop, value } : stop));
  };
  const handleUpdateSearch = async () => {
    setSearchLoading(true);
    try {
      if (!fromLocation) {
        zt.error("Please enter a pickup location");
        setSearchLoading(false);
        return;
      }
      if (!toLocation) {
        zt.error("Please enter a drop location");
        setSearchLoading(false);
        return;
      }
      if (tripType === "round" && !returnDate) {
        zt.error("Please select a return date for round trip");
        setSearchLoading(false);
        return;
      }
      let sourceCoords;
      if (fromLocation === "Current Location" && currentUserLocation) {
        sourceCoords = currentUserLocation;
      } else {
        sourceCoords = await geocodeLocation(fromLocation);
      }
      if (!sourceCoords) {
        zt.error(`Could not find location: ${fromLocation}`);
        setSearchLoading(false);
        return;
      }
      let destCoords = await geocodeLocation(toLocation);
      if (!destCoords) {
        zt.error(`Could not find location: ${toLocation}`);
        setSearchLoading(false);
        return;
      }
      const validStops = [];
      if (stops.length > 0) {
        for (const stop of stops) {
          if (!stop.value || stop.value.trim() === "") continue;
          const stopCoords = await geocodeLocation(stop.value);
          if (stopCoords) {
            validStops.push({
              address: stop.value,
              coordinates: [stopCoords.lng, stopCoords.lat],
              stopOrder: validStops.length + 1
            });
          }
        }
      }
      const searchParams = {
        from: fromLocation,
        to: toLocation,
        sourceLat: sourceCoords.lat,
        sourceLong: sourceCoords.lng,
        destLat: destCoords.lat,
        destLong: destCoords.lng,
        tripType: tripType === "oneway" ? "oneWay" : "roundTrip",
        fuelType: "petrol",
        isAc: true,
        pickupDate,
        pickupTime,
        returnDate,
        startTime: (/* @__PURE__ */ new Date()).toISOString(),
        stops: validStops.length > 0 ? validStops : void 0
      };
      navigate("/results", { state: { searchParams } });
    } catch (error) {
      console.error("Search error:", error);
      zt.error("Something went wrong with the search");
    } finally {
      setSearchLoading(false);
    }
  };
  const handleRouteClick = (route) => {
    navigate(`/top/${route.slug}`, { state: { route } });
  };
  const handleSelectVehicle = (vehicle) => {
    const cityCoords = (service == null ? void 0 : service.coordinates) || { lat: 0, lng: 0 };
    navigate(`/details/${vehicle.vehicleId || vehicle._id || vehicle.groupId}`, {
      state: {
        // Required fields for booking review API
        vehicleId: vehicle.vehicleId || vehicle._id || vehicle.groupId,
        picklat: cityCoords.lat,
        picklng: cityCoords.lng,
        pickupAddress: fromLocation || (service == null ? void 0 : service.cityName),
        pickupCity: (service == null ? void 0 : service.cityName) || fromLocation,
        pickupState: "",
        droplat: cityCoords.lat,
        droplng: cityCoords.lng,
        dropAddress: toLocation || (service == null ? void 0 : service.cityName),
        dropCity: (service == null ? void 0 : service.cityName) || toLocation,
        dropState: "",
        distance: 10,
        // Default local distance
        tripType: tripType === "round" ? "roundTrip" : "oneWay",
        fuelType: vehicle.fuelType || "petrol",
        isAc: true,
        scheduledTime: (/* @__PURE__ */ new Date()).toISOString(),
        // Additional data for display
        vehicle,
        service,
        tripDetails: {
          from: fromLocation,
          to: toLocation,
          date: pickupDate,
          time: pickupTime,
          tripType,
          stops
        }
      }
    });
  };
  const getDaysInMonth = (date) => new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
  const getFirstDayOfMonth = (date) => new Date(date.getFullYear(), date.getMonth(), 1).getDay();
  const generateCalendarDays = () => {
    const daysInMonth = getDaysInMonth(currentDisplayDate);
    const firstDay = getFirstDayOfMonth(currentDisplayDate);
    const days = [];
    const startOffset = firstDay === 0 ? 6 : firstDay - 1;
    for (let i2 = 0; i2 < startOffset; i2++) {
      days.push({ day: "", otherMonth: true });
    }
    for (let i2 = 1; i2 <= daysInMonth; i2++) {
      days.push({
        day: i2.toString(),
        date: new Date(currentDisplayDate.getFullYear(), currentDisplayDate.getMonth(), i2)
      });
    }
    return days;
  };
  const calendarDays = generateCalendarDays();
  const changeMonth = (offset) => {
    const newDate = new Date(currentDisplayDate);
    newDate.setMonth(newDate.getMonth() + offset);
    setCurrentDisplayDate(newDate);
  };
  const generateTimeSlots = () => {
    const times = [];
    for (let hour = 0; hour < 24; hour++) {
      for (let minute = 0; minute < 60; minute += 15) {
        const period = hour >= 12 ? "PM" : "AM";
        const displayHour = hour % 12 || 12;
        const timeString = `${displayHour}:${minute.toString().padStart(2, "0")} ${period}`;
        times.push(timeString);
      }
    }
    return times;
  };
  const timeSlots = generateTimeSlots();
  const LocationModal = () => {
    const [searchText, setSearchText] = reactExports.useState("");
    const handleCurrentLocation = () => {
      if ("geolocation" in navigator) {
        navigator.geolocation.getCurrentPosition(
          (position) => {
            const coords = {
              lat: position.coords.latitude,
              lng: position.coords.longitude
            };
            setCurrentUserLocation(coords);
            handleLocationSelect("Current Location");
          },
          (error) => {
            console.error("Error getting location:", error);
            zt.error("Could not get location");
          }
        );
      } else {
        zt.error("Geolocation not supported");
      }
    };
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 border-b border-gray-200", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: locationType === "from" ? "PICKUP" : "DROP" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowLocationModal(false), className: "p-1 text-gray-500 hover:text-gray-700", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          LocationAutocomplete,
          {
            value: searchText,
            onChange: setSearchText,
            onLocationSelect: handleLocationSelect,
            placeholder: `Search ${locationType === "from" ? "Pickup" : "Drop"}...`
          }
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "button",
        {
          onClick: handleCurrentLocation,
          className: "flex items-center gap-2 text-blue-600 text-sm font-medium mb-4 hover:bg-blue-50 p-2 rounded w-full transition-colors",
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(MapPin, { className: "w-4 h-4" }),
            " Use Current Location"
          ]
        }
      ) })
    ] }) });
  };
  const StopsModal = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: "Add Stops" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowStopsModal(false), className: "p-1 text-gray-500 hover:text-gray-700", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
      stops.map((stop, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600 mb-2", children: [
          "Stop ",
          index2 + 1
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            LocationAutocomplete,
            {
              value: stop.value,
              onChange: (val) => handleStopChange(stop.id, val),
              onLocationSelect: (val) => handleStopChange(stop.id, val),
              placeholder: "Enter stop location",
              className: "flex-1"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => removeStop(stop.id), className: "text-gray-500 hover:text-red-500", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
        ] })
      ] }, stop.id)),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { onClick: addStop, className: "flex items-center gap-2 text-blue-600 text-sm font-medium mt-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(Plus, { className: "w-4 h-4" }),
        " Add Stops"
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-t border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowStopsModal(false), className: "w-full bg-blue-600 text-white py-3 rounded-lg font-semibold", children: "DONE" }) })
  ] }) });
  const DateModal = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: dateType === "return" ? "RETURN DATE" : "PICKUP DATE" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowDateModal(false), className: "p-1 text-gray-500 hover:text-gray-700", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-4 text-gray-900", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => changeMonth(-1), className: "p-2 hover:bg-gray-100 rounded-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 rotate-90" }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-bold uppercase", children: currentDisplayDate.toLocaleDateString("en-US", { month: "long", year: "numeric" }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => changeMonth(1), className: "p-2 hover:bg-gray-100 rounded-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 -rotate-90" }) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"].map((day) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center text-xs text-gray-500 font-medium py-2", children: day }, day)) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-1", children: calendarDays.map((dayObj, index2) => {
        var _a2;
        const currentDateStr = (_a2 = dayObj.date) == null ? void 0 : _a2.toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric" });
        const isSelected = currentDateStr === (dateType === "return" ? returnDate : pickupDate);
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: `h-10 flex items-center justify-center rounded-full text-sm font-medium cursor-pointer
                    ${!dayObj.day || dayObj.otherMonth ? "text-transparent pointer-events-none" : "text-gray-700 hover:bg-gray-100"}
                    ${isSelected ? "bg-orange-500 text-white hover:bg-orange-600" : ""}
                  `,
            onClick: () => handleDateSelect(dayObj),
            children: dayObj.day
          },
          index2
        );
      }) })
    ] })
  ] }) });
  const TimeModal = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: "PICKUP TIME" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowTimeModal(false), className: "p-1 text-gray-500 hover:text-gray-700", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-h-96 overflow-y-auto p-4", children: timeSlots.map((time, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      {
        className: `py-3 border-b text-black border-gray-100 cursor-pointer hover:bg-gray-50 ${pickupTime === time ? "bg-blue-50" : ""}`,
        onClick: () => handleTimeSelect(time),
        children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-medium", children: time })
      },
      index2
    )) })
  ] }) });
  if (currentCityLoading) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-screen bg-white flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-orange-500 mx-auto" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-4 text-gray-600", children: "Loading city service details..." })
    ] }) });
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
    showLocationModal && /* @__PURE__ */ jsxRuntimeExports.jsx(LocationModal, {}),
    showStopsModal && /* @__PURE__ */ jsxRuntimeExports.jsx(StopsModal, {}),
    showDateModal && /* @__PURE__ */ jsxRuntimeExports.jsx(DateModal, {}),
    showTimeModal && /* @__PURE__ */ jsxRuntimeExports.jsx(TimeModal, {}),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full bg-orange-500 py-4 px-4 mt-16", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto flex flex-wrap items-center justify-between gap-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-8 ml-8", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "TRIP TYPE" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md flex items-center gap-1 text-black min-w-[180px]",
              onClick: () => setShowTripTypeDropdown(!showTripTypeDropdown),
              children: [
                (_b = tripTypeOptions.find((opt) => opt.value === tripType)) == null ? void 0 : _b.label,
                /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4" })
              ]
            }
          ),
          showTripTypeDropdown && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute top-full left-0 mt-1 bg-white text-black border border-gray-200 rounded-md shadow-lg z-10 min-w-[180px]", children: tripTypeOptions.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: `px-4 py-2 cursor-pointer hover:bg-gray-100 ${tripType === option.value ? "bg-blue-50 text-blue-600" : ""}`,
              onClick: () => {
                setTripType(option.value);
                setShowTripTypeDropdown(false);
              },
              children: option.label
            },
            option.value
          )) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "FROM" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => {
                setLocationType("from");
                setShowLocationModal(true);
              },
              children: fromLocation || "Select"
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-5 relative inline-block", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "absolute -top-3 right-2 text-[11px] px-1.5 py-[1px] bg-white text-purple-600 border border-black rounded-md font-semibold shadow-sm", children: "new" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-[#2276e3] shadow",
              onClick: () => setShowStopsModal(true),
              children: "+ Add Stops"
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "TO" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => {
                setLocationType("to");
                setShowLocationModal(true);
              },
              children: toLocation || "Select"
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "PICKUP DATE" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => {
                setDateType("pickup");
                setShowDateModal(true);
              },
              children: pickupDate || "Select Date"
            }
          )
        ] }),
        tripType === "round" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "RETURN DATE" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => {
                setDateType("return");
                setShowDateModal(true);
              },
              children: returnDate || "Select Date"
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "PICKUP TIME" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
              onClick: () => setShowTimeModal(true),
              children: pickupTime
            }
          )
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          className: "text-lg font-semibold bg-white px-4 py-2 rounded-md text-[#2276e3]",
          onClick: handleUpdateSearch,
          disabled: searchLoading,
          children: searchLoading ? "SEARCHING..." : "UPDATE SEARCH"
        }
      ) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white min-h-screen text-gray-800", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-16 py-4 text-sm text-blue-600 max-w-full mx-auto", children: [
        "Home > Cab Booking > ",
        (service == null ? void 0 : service.cityName) ? `${service.cityName} Cab Services` : "Cab Services"
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-16 max-w-full mx-auto", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h1", { className: "text-3xl font-bold mb-3 text-gray-900", children: [
          service == null ? void 0 : service.cityName,
          " Taxi Services"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-600 max-w-4xl mb-4 text-base", children: (service == null ? void 0 : service.metaDescription) || `Book taxi services in ${service == null ? void 0 : service.cityName} for comfort & safety. Book your taxi now.` }),
        (service == null ? void 0 : service.startsFrom) && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-green-600 font-bold text-lg", children: [
          "Starts from ₹",
          service.startsFrom
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col lg:flex-row gap-8 px-16 mt-8 max-w-full mx-auto", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "lg:w-80 flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-gray-50 p-6 rounded-lg border border-gray-200 h-fit sticky top-24", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-base font-bold text-gray-900 mb-4", children: "Why book one-way trip with us?" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "space-y-3 text-sm text-gray-700", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-start gap-2", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-600 font-bold mt-0.5 flex-shrink-0", children: "✓" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "leading-snug", children: "Special one-way fares to just get dropped off to your destination" })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-start gap-2", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-600 font-bold mt-0.5 flex-shrink-0", children: "✓" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "leading-snug", children: "Experienced and polite drivers with well-serviced, comfortable cabs" })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-start gap-2", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-600 font-bold mt-0.5 flex-shrink-0", children: "✓" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "leading-snug", children: "Prices inclusive of GST, state taxes and tolls on majority of the routes" })
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "text-blue-600 text-sm font-medium hover:underline", children: "know more" }) })
        ] }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-2xl font-bold text-gray-900 mb-6", children: [
            "Top Cabs Routes from ",
            service == null ? void 0 : service.cityName
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-12 gap-4 bg-blue-100 p-4 font-bold text-gray-700 text-sm", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-5", children: [
                "Cab from ",
                service == null ? void 0 : service.cityName
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "col-span-4", children: "Included kms & Extra fare" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "col-span-3 text-right pr-8", children: "Cab Price" })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "divide-y divide-gray-100", children: (service == null ? void 0 : service.routesFromCity) && service.routesFromCity.length > 0 || (service == null ? void 0 : service.popularRoutes) && service.popularRoutes.length > 0 ? (((_c = service.routesFromCity) == null ? void 0 : _c.length) > 0 ? service.routesFromCity : service.popularRoutes).map((route, i2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-12 gap-4 p-4 items-center hover:bg-gray-50 transition-colors", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-5", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "font-bold text-gray-900 text-base cursor-pointer hover:text-blue-600", onClick: () => handleRouteClick(route), children: [
                  service == null ? void 0 : service.cityName,
                  " to ",
                  route.destinationCity,
                  " cabs"
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-gray-500 text-xs mt-1", children: [
                  route.distance,
                  " kms | ",
                  Math.round(route.duration / 60),
                  "h ",
                  route.duration % 60,
                  "m (appx.)"
                ] })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-4 text-sm", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-green-600 font-medium mb-1", children: [
                  route.distance,
                  " kms included"
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-gray-500 text-xs", children: [
                  "Extra fare ₹",
                  route.extraKmRate || 15,
                  "/km after ",
                  route.distance,
                  " kms"
                ] })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-3 flex items-center justify-end gap-6", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "font-bold text-xl text-gray-900", children: [
                    "₹",
                    route.startsFrom
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-gray-500", children: "onwards" })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "button",
                  {
                    className: "bg-orange-500 hover:bg-orange-600 text-white font-bold py-2 px-6 rounded text-sm transition-colors",
                    onClick: () => handleRouteClick(route),
                    children: "VIEW CABS"
                  }
                )
              ] })
            ] }, i2)) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-8 text-center text-gray-500", children: [
              "No top routes available from ",
              service == null ? void 0 : service.cityName,
              " at the moment."
            ] }) })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-12", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-2xl font-bold text-gray-900 mb-6", children: [
              "Top Cabs Routes to ",
              service == null ? void 0 : service.cityName
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-12 gap-4 bg-blue-100 p-4 font-bold text-gray-700 text-sm", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-5", children: [
                  "Cab to ",
                  service == null ? void 0 : service.cityName
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "col-span-4", children: "Included kms & Extra fare" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "col-span-3 text-right pr-8", children: "Cab Price" })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "divide-y divide-gray-100", children: (service == null ? void 0 : service.routesToCity) && service.routesToCity.length > 0 ? service.routesToCity.map((route, i2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-12 gap-4 p-4 items-center hover:bg-gray-50 transition-colors", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-5", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "font-bold text-gray-900 text-base cursor-pointer hover:text-blue-600", onClick: () => handleRouteClick(route), children: [
                    route.originCity,
                    " to ",
                    service == null ? void 0 : service.cityName,
                    " cabs"
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-gray-500 text-xs mt-1", children: [
                    route.distance,
                    " kms | ",
                    Math.round(route.duration / 60),
                    "h ",
                    route.duration % 60,
                    "m (appx.)"
                  ] })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-4 text-sm", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-green-600 font-medium mb-1", children: [
                    route.distance,
                    " kms included"
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-gray-500 text-xs", children: [
                    "Extra fare ₹",
                    route.extraKmRate || 15,
                    "/km after ",
                    route.distance,
                    " kms"
                  ] })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-3 flex items-center justify-end gap-6", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "font-bold text-xl text-gray-900", children: [
                      "₹",
                      route.startsFrom
                    ] }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-gray-500", children: "onwards" })
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "button",
                    {
                      className: "bg-orange-500 hover:bg-orange-600 text-white font-bold py-2 px-6 rounded text-sm transition-colors",
                      onClick: () => handleRouteClick(route),
                      children: "VIEW CABS"
                    }
                  )
                ] })
              ] }, i2)) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-8 text-center text-gray-500", children: [
                "No top routes available to ",
                service == null ? void 0 : service.cityName,
                " at the moment."
              ] }) })
            ] })
          ] })
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "py-12 bg-gray-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-4xl mx-auto px-4 sm:px-6 lg:px-8", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-2xl font-bold text-gray-900 mb-6", children: [
          "Available Rental Cab in ",
          service == null ? void 0 : service.cityName
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-12 gap-4 bg-gray-100 p-4 font-bold text-gray-700 text-sm border-b", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "col-span-5", children: "Cab Model" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "col-span-4", children: "Included kms & Extra fare" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "col-span-3 text-right pr-4", children: "Cab Price" })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "divide-y divide-gray-100", children: (service == null ? void 0 : service.vehicleOptions) && service.vehicleOptions.length > 0 ? service.vehicleOptions.map((pkg, i2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-12 gap-4 p-4 items-center hover:bg-gray-50", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-5 flex items-center gap-3", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(Car, { className: "w-5 h-5 text-gray-400" }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-bold text-gray-900", children: pkg.groupName }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-gray-500", children: pkg.modelNames && pkg.modelNames.length > 0 ? pkg.modelNames.join(", ") : "Or Similar" })
              ] })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-4 text-sm", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-gray-900 font-medium", children: [
                pkg.includedKm,
                " kms included"
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-xs text-gray-500", children: [
                "Extra fare ₹",
                pkg.extraFarePerKm,
                "/km"
              ] })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-3 flex items-center justify-end gap-4", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "font-bold text-xl text-gray-900", children: [
                  "₹",
                  pkg.price
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-gray-500", children: "flat rate" })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "button",
                {
                  className: "bg-white border border-blue-600 text-blue-600 font-bold py-1.5 px-4 rounded hover:bg-blue-50 transition-colors text-sm",
                  onClick: () => handleSelectVehicle(pkg),
                  children: "BOOK"
                }
              )
            ] })
          ] }, i2)) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-8 text-center text-gray-500", children: [
            "No rental packages available in ",
            service == null ? void 0 : service.cityName,
            " at the moment."
          ] }) })
        ] })
      ] }) }),
      faqs.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "py-12 bg-gray-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-4xl mx-auto px-4 sm:px-6 lg:px-8", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-2xl font-bold text-gray-900 mb-6", children: [
          "FAQs About ",
          service == null ? void 0 : service.cityName,
          " Cabs Services"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-white rounded-lg border border-gray-200 p-6 space-y-6", children: faqs.map((faq2, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-bold text-gray-900 text-base mb-2", children: [
            "Q: ",
            faq2.question
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-gray-700 text-sm leading-relaxed", children: [
            "A: ",
            faq2.answer
          ] })
        ] }, index2)) })
      ] }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "py-8 bg-white border-t border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col lg:flex-row gap-8 px-16 max-w-full mx-auto", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "lg:w-40 flex-shrink-0 hidden lg:block" }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 space-y-8", children: [
          ((_d = service == null ? void 0 : service.routesFromCitySlugsOnly) == null ? void 0 : _d.length) > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-sm font-bold text-gray-900 mb-3 uppercase tracking-wide", children: [
              "Cabs from ",
              service == null ? void 0 : service.cityName
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-wrap gap-x-2 gap-y-2 text-xs text-gray-500 leading-relaxed", children: service.routesFromCitySlugsOnly.map((route, i2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(React$4.Fragment, { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs(Link, { to: `/top/${route.slug}`, className: "hover:text-blue-600 hover:underline transition-colors", children: [
                route.originCity,
                " To ",
                route.destinationCity,
                " Cabs"
              ] }),
              i2 < service.routesFromCitySlugsOnly.length - 1 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-300", children: "|" })
            ] }, i2)) })
          ] }),
          ((_e = service == null ? void 0 : service.routesToCitySlugsOnly) == null ? void 0 : _e.length) > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-sm font-bold text-gray-900 mb-3 uppercase tracking-wide", children: [
              "Cabs to ",
              service == null ? void 0 : service.cityName
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-wrap gap-x-2 gap-y-2 text-xs text-gray-500 leading-relaxed", children: service.routesToCitySlugsOnly.map((route, i2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(React$4.Fragment, { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs(Link, { to: `/top/${route.slug}`, className: "hover:text-blue-600 hover:underline transition-colors", children: [
                route.originCity,
                " To ",
                route.destinationCity,
                " Cabs"
              ] }),
              i2 < service.routesToCitySlugsOnly.length - 1 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-300", children: "|" })
            ] }, i2)) })
          ] }),
          ((_f = service == null ? void 0 : service.airportRoutesFrom) == null ? void 0 : _f.length) > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-sm font-bold text-gray-900 mb-3 uppercase tracking-wide", children: "Airport Taxi" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-wrap gap-x-2 gap-y-2 text-xs text-gray-500 leading-relaxed", children: service.airportRoutesFrom.map((route, i2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(React$4.Fragment, { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs(Link, { to: `/airport/${route.slug}`, className: "hover:text-blue-600 hover:underline transition-colors", children: [
                route.airportName,
                " Taxi Services"
              ] }),
              i2 < service.airportRoutesFrom.length - 1 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-300", children: "|" })
            ] }, i2)) })
          ] })
        ] })
      ] }) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Footer, {})
  ] });
};
const CityTaxiService = () => {
  var _a, _b, _c;
  const dispatch = useDispatch();
  const navigate = useNavigate();
  useLocation();
  const { slug } = useParams();
  const {
    currentCityService,
    currentCityLoading,
    currentCityError
  } = useSelector((state) => state.seo);
  const [tripType, setTripType] = reactExports.useState("oneway");
  const [fromLocation, setFromLocation] = reactExports.useState("");
  const [toLocation, setToLocation] = reactExports.useState("");
  const [pickupDate, setPickupDate] = reactExports.useState("");
  const [returnDate, setReturnDate] = reactExports.useState("");
  const [pickupTime, setPickupTime] = reactExports.useState("10:00 AM");
  const [stops, setStops] = reactExports.useState([]);
  const [showTripTypeDropdown, setShowTripTypeDropdown] = reactExports.useState(false);
  const [showLocationModal, setShowLocationModal] = reactExports.useState(false);
  const [showStopsModal, setShowStopsModal] = reactExports.useState(false);
  const [showDateModal, setShowDateModal] = reactExports.useState(false);
  const [showTimeModal, setShowTimeModal] = reactExports.useState(false);
  const [locationType, setLocationType] = reactExports.useState("");
  const [dateType, setDateType] = reactExports.useState("pickup");
  const [currentUserLocation, setCurrentUserLocation] = reactExports.useState(null);
  const [searchLoading, setSearchLoading] = reactExports.useState(false);
  const [activePackageTab, setActivePackageTab] = reactExports.useState(0);
  const [expandedFaq, setExpandedFaq] = reactExports.useState(null);
  const [currentDisplayDate, setCurrentDisplayDate] = reactExports.useState(/* @__PURE__ */ new Date());
  reactExports.useEffect(() => {
    if (slug) {
      dispatch(getCityServiceBySlug(slug));
    }
  }, [dispatch, slug]);
  reactExports.useEffect(() => {
    if (currentCityService) {
      setFromLocation(currentCityService.cityName || "");
      const tomorrow = /* @__PURE__ */ new Date();
      tomorrow.setDate(tomorrow.getDate() + 1);
      setPickupDate(tomorrow.toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric" }));
    }
  }, [currentCityService]);
  const packageHours = [
    { label: "1 hr (10 km)", hours: 1 },
    { label: "2 hr (20 km)", hours: 2 },
    { label: "3 hr (30 km)", hours: 3 },
    { label: "4 hr (40 km)", hours: 4 },
    { label: "5 hr (50 km)", hours: 5 },
    { label: "6 hr (60 km)", hours: 6 }
  ];
  const tripTypeOptions = [
    { value: "oneway", label: "One Way" },
    { value: "round", label: "Round Trip" }
  ];
  const handleLocationSelect = (location2) => {
    if (locationType === "from") {
      setFromLocation(location2);
    } else if (locationType === "to") {
      setToLocation(location2);
    }
    setShowLocationModal(false);
  };
  const handleDateSelect = (dayObj) => {
    if (dayObj && !dayObj.otherMonth && dayObj.date) {
      const dateStr = dayObj.date.toLocaleDateString("en-GB", {
        day: "numeric",
        month: "short",
        year: "numeric"
      });
      if (dateType === "return") {
        setReturnDate(dateStr);
      } else {
        setPickupDate(dateStr);
      }
      setShowDateModal(false);
    }
  };
  const handleTimeSelect = (time) => {
    setPickupTime(time);
    setShowTimeModal(false);
  };
  const addStop = () => setStops([...stops, { id: Date.now(), value: "" }]);
  const removeStop = (id) => setStops(stops.filter((stop) => stop.id !== id));
  const handleStopChange = (id, value) => {
    setStops(stops.map((stop) => stop.id === id ? { ...stop, value } : stop));
  };
  const handleUpdateSearch = async () => {
    setSearchLoading(true);
    try {
      if (!fromLocation) {
        zt.error("Please enter a pickup location");
        setSearchLoading(false);
        return;
      }
      if (!toLocation) {
        zt.error("Please enter a drop location");
        setSearchLoading(false);
        return;
      }
      if (tripType === "round" && !returnDate) {
        zt.error("Please select a return date for round trip");
        setSearchLoading(false);
        return;
      }
      let sourceCoords;
      if (fromLocation === "Current Location" && currentUserLocation) {
        sourceCoords = currentUserLocation;
      } else {
        sourceCoords = await geocodeLocation(fromLocation);
      }
      if (!sourceCoords) {
        zt.error(`Could not find location: ${fromLocation}`);
        setSearchLoading(false);
        return;
      }
      let destCoords = await geocodeLocation(toLocation);
      if (!destCoords) {
        zt.error(`Could not find location: ${toLocation}`);
        setSearchLoading(false);
        return;
      }
      const validStops = [];
      if (stops.length > 0) {
        for (const stop of stops) {
          if (!stop.value || stop.value.trim() === "") continue;
          const stopCoords = await geocodeLocation(stop.value);
          if (stopCoords) {
            validStops.push({
              address: stop.value,
              coordinates: [stopCoords.lng, stopCoords.lat],
              stopOrder: validStops.length + 1
            });
          }
        }
      }
      const searchParams = {
        from: fromLocation,
        to: toLocation,
        sourceLat: sourceCoords.lat,
        sourceLong: sourceCoords.lng,
        destLat: destCoords.lat,
        destLong: destCoords.lng,
        tripType: tripType === "oneway" ? "oneWay" : "roundTrip",
        fuelType: "petrol",
        isAc: true,
        pickupDate,
        pickupTime,
        returnDate,
        startTime: (/* @__PURE__ */ new Date()).toISOString(),
        stops: validStops.length > 0 ? validStops : void 0
      };
      navigate("/results", { state: { searchParams } });
    } catch (error) {
      console.error("Search error:", error);
      zt.error("Something went wrong with the search");
    } finally {
      setSearchLoading(false);
    }
  };
  const getDaysInMonth = (date) => new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
  const getFirstDayOfMonth = (date) => new Date(date.getFullYear(), date.getMonth(), 1).getDay();
  const generateCalendarDays = () => {
    const daysInMonth = getDaysInMonth(currentDisplayDate);
    const firstDay = getFirstDayOfMonth(currentDisplayDate);
    const days = [];
    const startOffset = firstDay === 0 ? 6 : firstDay - 1;
    for (let i2 = 0; i2 < startOffset; i2++) {
      days.push({ day: "", otherMonth: true });
    }
    for (let i2 = 1; i2 <= daysInMonth; i2++) {
      days.push({
        day: i2.toString(),
        date: new Date(currentDisplayDate.getFullYear(), currentDisplayDate.getMonth(), i2)
      });
    }
    return days;
  };
  const calendarDays = generateCalendarDays();
  const changeMonth = (offset) => {
    const newDate = new Date(currentDisplayDate);
    newDate.setMonth(newDate.getMonth() + offset);
    setCurrentDisplayDate(newDate);
  };
  const generateTimeSlots = () => {
    const times = [];
    for (let hour = 0; hour < 24; hour++) {
      for (let minute = 0; minute < 60; minute += 15) {
        const period = hour >= 12 ? "PM" : "AM";
        const displayHour = hour % 12 || 12;
        const timeString = `${displayHour}:${minute.toString().padStart(2, "0")} ${period}`;
        times.push(timeString);
      }
    }
    return times;
  };
  const timeSlots = generateTimeSlots();
  const LocationModal = () => {
    const [searchText, setSearchText] = reactExports.useState("");
    const handleCurrentLocation = () => {
      if ("geolocation" in navigator) {
        navigator.geolocation.getCurrentPosition(
          (position) => {
            const coords = {
              lat: position.coords.latitude,
              lng: position.coords.longitude
            };
            setCurrentUserLocation(coords);
            handleLocationSelect("Current Location");
          },
          (error) => {
            console.error("Error getting location:", error);
            zt.error("Could not get location");
          }
        );
      } else {
        zt.error("Geolocation not supported");
      }
    };
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 border-b border-gray-200", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: locationType === "from" ? "PICKUP" : "DROP" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowLocationModal(false), className: "p-1 text-gray-500 hover:text-gray-700", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          LocationAutocomplete,
          {
            value: searchText,
            onChange: setSearchText,
            onLocationSelect: handleLocationSelect,
            placeholder: `Search ${locationType === "from" ? "Pickup" : "Drop"}...`
          }
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "button",
        {
          onClick: handleCurrentLocation,
          className: "flex items-center gap-2 text-blue-600 text-sm font-medium mb-4 hover:bg-blue-50 p-2 rounded w-full transition-colors",
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(MapPin, { className: "w-4 h-4" }),
            " Use Current Location"
          ]
        }
      ) })
    ] }) });
  };
  const StopsModal = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: "Add Stops" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowStopsModal(false), className: "p-1 text-gray-500 hover:text-gray-700", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
      stops.map((stop, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600 mb-2", children: [
          "Stop ",
          index2 + 1
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            LocationAutocomplete,
            {
              value: stop.value,
              onChange: (val) => handleStopChange(stop.id, val),
              onLocationSelect: (val) => handleStopChange(stop.id, val),
              placeholder: "Enter stop location",
              className: "flex-1"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => removeStop(stop.id), className: "text-gray-500 hover:text-red-500", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
        ] })
      ] }, stop.id)),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { onClick: addStop, className: "flex items-center gap-2 text-blue-600 text-sm font-medium mt-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(Plus, { className: "w-4 h-4" }),
        " Add Stops"
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-t border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowStopsModal(false), className: "w-full bg-blue-600 text-white py-3 rounded-lg font-semibold", children: "DONE" }) })
  ] }) });
  const DateModal = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: dateType === "return" ? "RETURN DATE" : "PICKUP DATE" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowDateModal(false), className: "p-1 text-gray-500 hover:text-gray-700", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-4 text-gray-900", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => changeMonth(-1), className: "p-2 hover:bg-gray-100 rounded-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 rotate-90" }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-bold uppercase", children: currentDisplayDate.toLocaleDateString("en-US", { month: "long", year: "numeric" }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => changeMonth(1), className: "p-2 hover:bg-gray-100 rounded-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 -rotate-90" }) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"].map((day) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center text-xs text-gray-500 font-medium py-2", children: day }, day)) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-7 gap-1", children: calendarDays.map((dayObj, index2) => {
        var _a2;
        const currentDateStr = (_a2 = dayObj.date) == null ? void 0 : _a2.toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric" });
        const isSelected = currentDateStr === (dateType === "return" ? returnDate : pickupDate);
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: `h-10 flex items-center justify-center rounded-full text-sm font-medium cursor-pointer
                    ${!dayObj.day || dayObj.otherMonth ? "text-transparent pointer-events-none" : "text-gray-700 hover:bg-gray-100"}
                    ${isSelected ? "bg-orange-500 text-white hover:bg-orange-600" : ""}
                  `,
            onClick: () => handleDateSelect(dayObj),
            children: dayObj.day
          },
          index2
        );
      }) })
    ] })
  ] }) });
  const TimeModal = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-md", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: "PICKUP TIME" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowTimeModal(false), className: "p-1 text-gray-500 hover:text-gray-700", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-h-96 overflow-y-auto p-4", children: timeSlots.map((time, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      {
        className: `py-3 border-b text-black border-gray-100 cursor-pointer hover:bg-gray-50 ${pickupTime === time ? "bg-blue-50" : ""}`,
        onClick: () => handleTimeSelect(time),
        children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-medium", children: time })
      },
      index2
    )) })
  ] }) });
  if (currentCityLoading) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-screen bg-white flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-orange-500 mx-auto" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-4 text-gray-600", children: "Loading city service details..." })
    ] }) });
  }
  if (currentCityError || !currentCityService) {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center min-h-screen", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-2xl font-bold text-gray-800 mb-4", children: "City Service Not Found" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => navigate("/"), className: "px-6 py-2 bg-green-600 text-white rounded-lg", children: "Go to Home" })
    ] });
  }
  const data = currentCityService;
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen bg-gray-50", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
    showLocationModal && /* @__PURE__ */ jsxRuntimeExports.jsx(LocationModal, {}),
    showStopsModal && /* @__PURE__ */ jsxRuntimeExports.jsx(StopsModal, {}),
    showDateModal && /* @__PURE__ */ jsxRuntimeExports.jsx(DateModal, {}),
    showTimeModal && /* @__PURE__ */ jsxRuntimeExports.jsx(TimeModal, {}),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "pt-16", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full bg-orange-500 py-4 px-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto flex flex-wrap items-center justify-between gap-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-8 ml-8", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "TRIP TYPE" }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "button",
              {
                className: "text-sm font-semibold bg-white px-4 py-2 rounded-md flex items-center gap-1 text-black min-w-[180px]",
                onClick: () => setShowTripTypeDropdown(!showTripTypeDropdown),
                children: [
                  (_a = tripTypeOptions.find((opt) => opt.value === tripType)) == null ? void 0 : _a.label,
                  /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4" })
                ]
              }
            ),
            showTripTypeDropdown && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute top-full left-0 mt-1 bg-white text-black border border-gray-200 rounded-md shadow-lg z-10 min-w-[180px]", children: tripTypeOptions.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: `px-4 py-2 cursor-pointer hover:bg-gray-100 ${tripType === option.value ? "bg-blue-50 text-blue-600" : ""}`,
                onClick: () => {
                  setTripType(option.value);
                  setShowTripTypeDropdown(false);
                },
                children: option.label
              },
              option.value
            )) })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "FROM" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
                onClick: () => {
                  setLocationType("from");
                  setShowLocationModal(true);
                },
                children: fromLocation || "Select"
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-5 relative inline-block", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "absolute -top-3 right-2 text-[11px] px-1.5 py-[1px] bg-white text-purple-600 border border-black rounded-md font-semibold shadow-sm", children: "new" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-[#2276e3] shadow",
                onClick: () => setShowStopsModal(true),
                children: "+ Add Stops"
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "TO" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
                onClick: () => {
                  setLocationType("to");
                  setShowLocationModal(true);
                },
                children: toLocation || "Select"
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "PICKUP DATE" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
                onClick: () => {
                  setDateType("pickup");
                  setShowDateModal(true);
                },
                children: pickupDate || "Select Date"
              }
            )
          ] }),
          tripType === "round" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "RETURN DATE" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
                onClick: () => {
                  setDateType("return");
                  setShowDateModal(true);
                },
                children: returnDate || "Select Date"
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold mb-1", children: "PICKUP TIME" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                className: "text-sm font-semibold bg-white px-4 py-2 rounded-md text-black min-w-[120px]",
                onClick: () => setShowTimeModal(true),
                children: pickupTime
              }
            )
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            className: "text-lg font-semibold bg-white px-4 py-2 rounded-md text-[#2276e3]",
            onClick: handleUpdateSearch,
            disabled: searchLoading,
            children: searchLoading ? "SEARCHING..." : "UPDATE SEARCH"
          }
        ) })
      ] }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-gradient-to-r from-blue-600 to-blue-700 text-white py-12", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h1", { className: "text-3xl md:text-4xl font-bold mb-2", children: [
          data.cityName,
          " Taxi Services"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-lg opacity-90", children: [
          "Book reliable cabs starting from ",
          /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "font-bold text-yellow-300", children: [
            "₹",
            data.startsFrom
          ] })
        ] })
      ] }) }),
      data.routesFromCity && data.routesFromCity.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "py-12 bg-gray-100", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-2xl font-bold text-gray-900 mb-6", children: [
          "Top Cabs Routes from ",
          data.cityName
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: data.routesFromCity.map((route, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(RouteCard, { route }, index2)) })
      ] }) }),
      data.routesToCity && data.routesToCity.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "py-12 bg-white", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-2xl font-bold text-gray-900 mb-6", children: [
          "Top Cabs Routes to ",
          data.cityName
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: data.routesToCity.map((route, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(RouteCard, { route }, index2)) })
      ] }) }),
      data.rentalPackages && data.rentalPackages.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "py-12 bg-gray-100", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-2xl font-bold text-gray-900 mb-6", children: [
          "Available Rental Cab in ",
          data.cityName
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-wrap gap-2 mb-6", children: packageHours.map((pkg, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            onClick: () => setActivePackageTab(index2),
            className: `px-4 py-2 rounded-lg font-medium transition-colors ${activePackageTab === index2 ? "bg-blue-600 text-white" : "bg-white text-gray-700 hover:bg-gray-50"}`,
            children: pkg.label
          },
          index2
        )) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: data.rentalPackages.map((group, index2) => {
          var _a2;
          const selectedPackage = (_a2 = group.packages) == null ? void 0 : _a2.find(
            (p2) => p2.hours === packageHours[activePackageTab].hours
          );
          if (!selectedPackage) return null;
          return /* @__PURE__ */ jsxRuntimeExports.jsx(
            RentalPackageCard,
            {
              group,
              package: selectedPackage
            },
            index2
          );
        }) })
      ] }) }),
      data.faqs && data.faqs.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "py-12 bg-white", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-4xl mx-auto px-4 sm:px-6 lg:px-8", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-2xl font-bold text-gray-900 mb-6", children: [
          "FAQs About ",
          data.cityName,
          " Cabs Services"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-4", children: data.faqs.map((faq2, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-gray-50 rounded-lg overflow-hidden", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "button",
            {
              onClick: () => setExpandedFaq(expandedFaq === index2 ? null : index2),
              className: "w-full px-6 py-4 flex items-center justify-between text-left hover:bg-gray-100 transition-colors",
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium text-gray-900", children: faq2.question }),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  ChevronDown,
                  {
                    className: `w-5 h-5 text-gray-500 transition-transform ${expandedFaq === index2 ? "transform rotate-180" : ""}`
                  }
                )
              ]
            }
          ),
          expandedFaq === index2 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-6 py-4 bg-white border-t", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-700", children: faq2.answer }) })
        ] }, index2)) })
      ] }) }),
      data.routesFromCitySlugsOnly && data.routesFromCitySlugsOnly.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
        LinkListSection,
        {
          title: `Cabs from ${data.cityName}`,
          routes: data.routesFromCitySlugsOnly
        }
      ),
      data.routesToCitySlugsOnly && data.routesToCitySlugsOnly.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
        LinkListSection,
        {
          title: `Cabs to ${data.cityName}`,
          routes: data.routesToCitySlugsOnly
        }
      ),
      (data.airportRoutesFrom && data.airportRoutesFrom.length > 0 || data.airportRoutesTo && data.airportRoutesTo.length > 0) && /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "py-12 bg-white", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-6", children: "Airport Routes" }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4", children: [
          (_b = data.airportRoutesFrom) == null ? void 0 : _b.map((route, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
            Link,
            {
              to: `/airport/${route.slug}`,
              className: "text-blue-600 hover:text-blue-800 hover:underline",
              children: [
                route.airportName,
                " to ",
                route.cityName
              ]
            },
            `from-${index2}`
          )),
          (_c = data.airportRoutesTo) == null ? void 0 : _c.map((route, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
            Link,
            {
              to: `/airport/${route.slug}`,
              className: "text-blue-600 hover:text-blue-800 hover:underline",
              children: [
                route.cityName,
                " to ",
                route.airportName
              ]
            },
            `to-${index2}`
          ))
        ] })
      ] }) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Footer, {})
  ] });
};
const RouteCard = ({ route }) => {
  const navigate = useNavigate();
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg shadow-sm hover:shadow-md transition-shadow p-6", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start justify-between mb-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "font-semibold text-gray-900 text-lg mb-2", children: [
          route.originCity,
          " to ",
          route.destinationCity
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-4 text-sm text-gray-600", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(MapPin, { className: "w-4 h-4" }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
              route.distance,
              " kms"
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(Clock, { className: "w-4 h-4" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: route.durationText })
          ] })
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Car, { className: "w-8 h-8 text-blue-600" })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2 mb-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600", children: [
        route.includedKm || route.distance,
        " kms included"
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600", children: [
        "Extra fare ₹",
        route.extraFarePerKm,
        "/km after ",
        route.includedKm || route.distance,
        " kms"
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "button",
      {
        onClick: () => navigate(`/top/${route.slug}`),
        className: "w-full bg-green-600 hover:bg-green-700 text-white font-medium py-2 px-4 rounded-lg flex items-center justify-center gap-2 transition-colors",
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
            "₹",
            route.startsFrom,
            " onwards"
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "w-4 h-4" })
        ]
      }
    )
  ] });
};
const RentalPackageCard = ({ group, package: pkg }) => {
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg shadow-sm hover:shadow-md transition-shadow p-6", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold text-gray-900 text-lg mb-1", children: group.groupName }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500", children: [
        group.category,
        " • ",
        group.seats,
        " seats"
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2 mb-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600", children: [
        pkg.baseKm,
        " kms included"
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600", children: [
        "Extra fare ₹",
        pkg.extraFarePerKm,
        "/km after ",
        pkg.baseKm,
        " kms"
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: "w-full bg-green-600 hover:bg-green-700 text-white font-medium py-2 px-4 rounded-lg flex items-center justify-center gap-2 transition-colors", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
        "₹",
        pkg.price,
        " onwards"
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "w-4 h-4" })
    ] })
  ] });
};
const LinkListSection = ({ title, routes: routes2 }) => {
  return /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "py-12 bg-gray-100", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-6", children: title }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4", children: routes2.map((route, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
      Link,
      {
        to: `/top/${route.slug}`,
        className: "text-blue-600 hover:text-blue-800 hover:underline",
        children: [
          route.originCity,
          " to ",
          route.destinationCity
        ]
      },
      index2
    )) })
  ] }) });
};
const HeroSectionMobile = () => {
  const navigate = useNavigate();
  const dispatch = useDispatch();
  const [tab, setTab] = reactExports.useState("outstation");
  const [tripType, setTripType] = reactExports.useState("oneway");
  const [pickup, setPickup] = reactExports.useState("");
  const [drop, setDrop] = reactExports.useState("");
  const [stops, setStops] = reactExports.useState([]);
  const [pickupDate, setPickupDate] = reactExports.useState("");
  const [pickupTime, setPickupTime] = reactExports.useState("");
  const [dropDate, setDropDate] = reactExports.useState("");
  const [dropTime, setDropTime] = reactExports.useState("");
  const [hourlyPackage, setHourlyPackage] = reactExports.useState(null);
  const [isSearching, setIsSearching] = reactExports.useState(false);
  const addStop = () => setStops((s2) => [...s2, ""]);
  const updateStop = (idx, val) => {
    setStops((s2) => s2.map((st, i2) => i2 === idx ? val : st));
  };
  const removeStop = (idx) => setStops((s2) => s2.filter((_2, i2) => i2 !== idx));
  const swapLocations = () => {
    setPickup((oldPickup) => {
      const oldDrop = drop;
      setDrop(oldPickup);
      setStops((oldStops) => {
        if (!oldStops || oldStops.length === 0) return oldStops;
        return [...oldStops].reverse();
      });
      return oldDrop;
    });
  };
  const handleSearch = async (e2) => {
    e2 == null ? void 0 : e2.preventDefault();
    if (!pickup || pickup.trim() === "") {
      zt.error("Please enter pickup location");
      return;
    }
    if (tab !== "hourly" && (!drop || drop.trim() === "")) {
      zt.error("Please enter drop location");
      return;
    }
    if (!pickupDate) {
      zt.error("Please select pickup date");
      return;
    }
    if (!pickupTime) {
      zt.error("Please select pickup time");
      return;
    }
    setIsSearching(true);
    zt.loading("Finding cabs...", { id: "search-loading" });
    try {
      const sourceCoords = await geocodeLocation(pickup);
      if (!sourceCoords) {
        zt.dismiss("search-loading");
        zt.error(`Could not find location: ${pickup}`);
        setIsSearching(false);
        return;
      }
      let destCoords = null;
      let distance = 0;
      if (tab !== "hourly") {
        destCoords = await geocodeLocation(drop);
        if (!destCoords) {
          zt.dismiss("search-loading");
          zt.error(`Could not find location: ${drop}`);
          setIsSearching(false);
          return;
        }
        distance = calculateDistance(
          sourceCoords.lat,
          sourceCoords.lng,
          destCoords.lat,
          destCoords.lng
        );
      }
      const validStops = [];
      if (stops.length > 0) {
        for (const stopValue of stops) {
          if (!stopValue || stopValue.trim() === "") continue;
          const stopCoords = await geocodeLocation(stopValue);
          if (stopCoords) {
            validStops.push({
              address: stopValue,
              coordinates: [stopCoords.lng, stopCoords.lat],
              stopOrder: validStops.length + 1
            });
          }
        }
      }
      const searchParams = {
        sourceLat: sourceCoords.lat,
        sourceLong: sourceCoords.lng,
        destLat: destCoords == null ? void 0 : destCoords.lat,
        destLong: destCoords == null ? void 0 : destCoords.lng,
        tripType: tripType === "oneway" ? "oneWay" : tripType === "roundtrip" ? "roundTrip" : tab,
        distance: distance || 50,
        fuelType: "petrol",
        isAc: true,
        startTime: (/* @__PURE__ */ new Date()).toISOString(),
        // Include additional params for navigation
        from: pickup,
        to: drop,
        pickupDate,
        pickupTime,
        returnDate: tripType === "roundtrip" ? dropDate : void 0,
        stops: validStops.length > 0 ? validStops : void 0,
        rentalPackage: tab === "hourly" ? hourlyPackage : void 0
      };
      dispatch(searchCabs(searchParams));
      zt.dismiss("search-loading");
      setIsSearching(false);
      navigate("/results", {
        state: {
          searchParams,
          searchData: {
            tab,
            tripType,
            pickup,
            drop,
            stops,
            pickupDate,
            pickupTime,
            dropDate: tripType === "roundtrip" ? dropDate : null,
            dropTime: tripType === "roundtrip" ? dropTime : null,
            hourlyPackage,
            sourceLat: sourceCoords.lat,
            sourceLong: sourceCoords.lng,
            destLat: destCoords == null ? void 0 : destCoords.lat,
            destLong: destCoords == null ? void 0 : destCoords.lng,
            distance
          }
        }
      });
    } catch (error) {
      zt.dismiss("search-loading");
      zt.error("Search failed. Please try again.");
      console.error("Search error:", error);
      setIsSearching(false);
    }
  };
  const hourlyOptions = [
    { id: 1, title: "1 hr", sub: "10 km" },
    { id: 2, title: "2 hr", sub: "20 km" },
    { id: 3, title: "3 hr", sub: "30 km" },
    { id: 4, title: "4 hr", sub: "40 km" }
  ];
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full min-h-screen bg-gray-200 font-sans text-[#111827] pb-[1px]", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex bg-white border-b border-gray-200 text-sm font-semibold", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "button",
        {
          onClick: () => setTab("outstation"),
          className: `flex-1 py-3 text-center flex flex-col items-center gap-1 ${tab === "outstation" ? "text-[#1e67d1] border-b-4 border-[#1e67d1]" : "text-gray-500"}`,
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "img",
              {
                src: "https://cdn-icons-png.flaticon.com/128/89/89102.png",
                className: "w-5 h-5",
                alt: ""
              }
            ),
            "Outstation Cabs"
          ]
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "button",
        {
          onClick: () => setTab("airport"),
          className: `flex-1 py-3 text-center flex flex-col items-center gap-1 ${tab === "airport" ? "text-[#1e67d1] border-b-4 border-[#1e67d1]" : "text-gray-500"}`,
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "img",
              {
                src: "https://cdn-icons-png.flaticon.com/128/89/89102.png",
                className: "w-5 h-5",
                alt: ""
              }
            ),
            "Airport Cabs"
          ]
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "button",
        {
          onClick: () => setTab("hourly"),
          className: `flex-1 py-3 text-center flex flex-col items-center gap-1 ${tab === "hourly" ? "text-[#1e67d1] border-b-4 border-[#1e67d1]" : "text-gray-500"}`,
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "img",
              {
                src: "https://cdn-icons-png.flaticon.com/128/89/89102.png",
                className: "w-5 h-5",
                alt: ""
              }
            ),
            "Hourly Rentals"
          ]
        }
      )
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-[#e8f8ef] px-4 py-2 text-xs text-gray-700 flex items-start gap-2", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "inline-block bg-red-500 text-white text-[10px] px-2 py-0.5 rounded", children: "New" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        "Tap add stops and enter more locations to personalize your journey",
        " ",
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[#1e67d1] font-semibold", children: "know more" })
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mx-3 mt-3", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: handleSearch, className: "bg-white rounded-lg shadow-sm px-4 py-4 space-y-4", children: [
        tab === "outstation" && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex bg-gray-100 rounded-full overflow-hidden text-sm font-semibold", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                type: "button",
                onClick: () => setTripType("oneway"),
                className: `px-5 py-1 rounded-full ${tripType === "oneway" ? "bg-[#dbe9ff] text-[#1e67d1]" : "text-gray-600"}`,
                children: "One Way"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                type: "button",
                onClick: () => setTripType("roundtrip"),
                className: `px-5 py-1 rounded-full ${tripType === "roundtrip" ? "bg-[#dbe9ff] text-[#1e67d1]" : "text-gray-600"}`,
                children: "Round Trip"
              }
            )
          ] }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-black rounded-full mt-3 shrink-0" }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-black text-xs", children: "From (Area, Street or Landmark)" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "input",
                {
                  value: pickup,
                  onChange: (e2) => setPickup(e2.target.value),
                  placeholder: "Enter pickup location",
                  className: "text-black w-full mt-1 text-base font-bold placeholder-black border-b border-transparent focus:border-b focus:border-gray-200 outline-none py-1 bg-transparent"
                }
              )
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "button",
              {
                type: "button",
                onClick: swapLocations,
                className: "p-2 rounded-full hover:bg-gray-100 transition-colors",
                title: "Swap locations",
                children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "svg",
                  {
                    className: "mt-8",
                    xmlns: "https://www.w3.org/2000/svg",
                    viewBox: "0 0 28 28",
                    fill: "#647a97",
                    width: "3.2rem",
                    height: "2.2rem",
                    children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "path",
                      {
                        d: "M28 14c0-7.732-6.268-14-14-14S0 6.268 0 14s6.268 14 14 14c7.729-.008 13.992-6.271 14-14zm-14.11-3.589c-.192.41-.604.672-1.057.672h-1.458a.292.292 0 00-.292.292v4.375a1.167 1.167 0 11-2.333 0v-4.375a.292.292 0 00-.292-.292H7a1.166 1.166 0 01-.896-1.913l2.917-3.5a1.166 1.166 0 011.793 0l2.916 3.5c.29.348.352.832.16 1.241zm.11 7.672c0-.644.522-1.166 1.167-1.166h1.458c.161 0 .292-.13.292-.292V12.25a1.167 1.167 0 112.333 0v4.375c0 .161.13.292.292.292H21a1.166 1.166 0 01.897 1.913l-2.916 3.5a1.168 1.168 0 01-1.794 0l-2.916-3.5a1.172 1.172 0 01-.271-.747z",
                        fill: "#647A97",
                        fillRule: "nonzero"
                      }
                    )
                  }
                )
              }
            )
          ] }),
          stops.map((s2, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-black rounded-full mt-3 shrink-0" }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-gray-600 text-xs", children: [
                "Stop ",
                idx + 1
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "input",
                  {
                    value: s2,
                    onChange: (e2) => updateStop(idx, e2.target.value),
                    placeholder: `Enter stop ${idx + 1}`,
                    className: "w-full mt-1 text-base placeholder-gray-400 border-b border-transparent focus:border-b focus:border-gray-200 outline-none py-1 bg-transparent font-medium"
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "button",
                  {
                    type: "button",
                    onClick: () => removeStop(idx),
                    className: "text-sm text-gray-500 px-2 py-1 rounded hover:bg-gray-100",
                    title: "Remove stop",
                    children: "✕"
                  }
                )
              ] })
            ] })
          ] }, idx)),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-black rounded-full mt-3 shrink-0" }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-600 text-xs", children: "To (Area, Street or Landmark)" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "input",
                {
                  value: drop,
                  onChange: (e2) => setDrop(e2.target.value),
                  placeholder: "Enter drop location",
                  className: "w-full mt-1 text-base font-bold placeholder-black border-b border-transparent focus:border-b focus:border-gray-200 outline-none py-1 bg-transparent"
                }
              )
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-8" })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", onClick: addStop, className: "text-[#1e67d1] font-semibold text-sm", children: "+ Add stop" }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-4 border-t pt-4 text-sm", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-600", children: "Pickup Date/Time" }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-1", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "input",
                  {
                    type: "date",
                    value: pickupDate,
                    onChange: (e2) => setPickupDate(e2.target.value),
                    className: "w-full px-2 py-1 border rounded-md text-sm"
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "input",
                  {
                    type: "time",
                    value: pickupTime,
                    onChange: (e2) => setPickupTime(e2.target.value),
                    className: "w-full mt-2 px-2 py-1 border rounded-md text-sm"
                  }
                )
              ] })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-600", children: "Drop Date/Time" }),
              tripType === "roundtrip" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-1 text-right", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "input",
                  {
                    type: "date",
                    value: dropDate,
                    onChange: (e2) => setDropDate(e2.target.value),
                    className: "w-full px-2 py-1 border rounded-md text-sm"
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "input",
                  {
                    type: "time",
                    value: dropTime,
                    onChange: (e2) => setDropTime(e2.target.value),
                    className: "w-full mt-2 px-2 py-1 border rounded-md text-sm"
                  }
                )
              ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 text-right", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[#1e67d1] font-semibold", children: "Book roundtrip for maximum savings!" }) })
            ] })
          ] })
        ] }),
        tab === "airport" && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-600 text-sm", children: "From (Airport or Pickup address)" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "input",
            {
              value: pickup,
              onChange: (e2) => setPickup(e2.target.value),
              placeholder: "Enter pickup location",
              className: "w-full mt-1 text-base font-bold placeholder-black border-b border-transparent focus:border-b focus:border-gray-200 outline-none py-1 bg-transparent"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-600 text-sm", children: "To (Airport or Drop address)" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "input",
            {
              value: drop,
              onChange: (e2) => setDrop(e2.target.value),
              placeholder: "Enter drop location",
              className: "w-full mt-1 text-base font-bold placeholder-black border-b border-transparent focus:border-b focus:border-gray-200 outline-none py-1 bg-transparent"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-end -mt-10 pr-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: swapLocations, type: "button", className: "p-2 rounded-full hover:bg-gray-100", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            "svg",
            {
              xmlns: "https://www.w3.org/2000/svg",
              viewBox: "0 0 28 28",
              fill: "#647a97",
              width: "1.2rem",
              height: "1.2rem",
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                "path",
                {
                  d: "M28 14c0-7.732-6.268-14-14-14S0 6.268 0 14s6.268 14 14 14c7.729-.008 13.992-6.271 14-14zm-14.11-3.589c-.192.41-.604.672-1.057.672h-1.458a.292.292 0 00-.292.292v4.375a1.167 1.167 0 11-2.333 0v-4.375a.292.292 0 00-.292-.292H7a1.166 1.166 0 01-.896-1.913l2.917-3.5a1.166 1.166 0 011.793 0l2.916 3.5c.29.348.352.832.16 1.241zm.11 7.672c0-.644.522-1.166 1.167-1.166h1.458c.161 0 .292-.13.292-.292V12.25a1.167 1.167 0 112.333 0v4.375c0 .161.13.292.292.292H21a1.166 1.166 0 01.897 1.913l-2.916 3.5a1.168 1.168 0 01-1.794 0l-2.916-3.5a1.172 1.172 0 01-.271-.747z",
                  fill: "#647A97",
                  fillRule: "nonzero"
                }
              )
            }
          ) }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-600 text-sm", children: "Pickup Date/Time" }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2 mt-1", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "input",
                {
                  type: "date",
                  value: pickupDate,
                  onChange: (e2) => setPickupDate(e2.target.value),
                  className: "flex-1 px-2 py-1 border rounded-md text-sm"
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "input",
                {
                  type: "time",
                  value: pickupTime,
                  onChange: (e2) => setPickupTime(e2.target.value),
                  className: "flex-1 px-2 py-1 border rounded-md text-sm"
                }
              )
            ] })
          ] })
        ] }),
        tab === "hourly" && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-600 text-sm", children: "From (Area, Street or Landmark)" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "input",
            {
              value: pickup,
              onChange: (e2) => setPickup(e2.target.value),
              placeholder: "Enter pickup location",
              className: "w-full mt-1 text-base font-bold placeholder-black border-b border-transparent focus:border-b focus:border-gray-200 outline-none py-1 bg-transparent"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-600 text-sm", children: "Pickup date and time" }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2 mt-1 items-center", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "input",
                {
                  type: "date",
                  value: pickupDate,
                  onChange: (e2) => setPickupDate(e2.target.value),
                  className: "px-2 py-1 border rounded-md text-sm flex-1"
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "input",
                {
                  type: "time",
                  value: pickupTime,
                  onChange: (e2) => setPickupTime(e2.target.value),
                  className: "px-2 py-1 border rounded-md text-sm w-36"
                }
              )
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-4 text-sm text-gray-600", children: "Package Preference" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex gap-2 mt-2 overflow-x-auto pb-2", children: hourlyOptions.map((opt) => {
            const selected = hourlyPackage === opt.id;
            return /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "button",
              {
                type: "button",
                onClick: () => setHourlyPackage(opt.id),
                className: `min-w-[84px] px-3 py-2 rounded-lg text-center text-sm font-semibold whitespace-nowrap ${selected ? "bg-[#dbe9ff] text-[#1e67d1]" : "bg-[#f1f7ff] text-[#1e67d1]"}`,
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: opt.title }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs font-medium mt-1", children: opt.sub })
                ]
              },
              opt.id
            );
          }) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-center mt-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            type: "submit",
            disabled: isSearching,
            className: `bg-[#ff6600] absolute text-white font-semibold px-16 -mt-2 py-3 rounded-full shadow-md transform active:scale-95 ${isSearching ? "opacity-70" : ""}`,
            children: isSearching ? "SEARCHING..." : "SEARCH"
          }
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-blue-100 mx-3 rounded-lg p-3 flex items-center justify-between mb-3 mt-12", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "font-semibold text-sm text-gray-800", children: "Our Top Rated Partner" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-600", children: "India's Leading Outstation Cab Rentals Since 2006" })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "img",
          {
            src: "https://go-assets.ibcdn.com/u/GI/images/1751872285411-savari-banner-dweb.png",
            alt: "Savaari Partner",
            className: "h-6 w-auto"
          }
        )
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white mt-12 p-4 rounded-md shadow-sm", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold text-lg", children: "#SafeTravel" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-3 grid grid-cols-1 gap-3", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border rounded p-3", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-semibold", children: "Cabs with goSafe promise" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 mt-1", children: "Sanitized cabs, hand sanitizer, driver with mask & healthy status on Aarogya, and more." })
        ] }) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-3 text-sm text-gray-700" })
    ] })
  ] });
};
const ResultsPageMobile = () => {
  var _a, _b;
  const location = useLocation();
  const navigate = useNavigate();
  const { searchResults, searchLoading, searchError } = useSelector(
    (state) => state.booking
  );
  const searchData = ((_a = location.state) == null ? void 0 : _a.searchData) || ((_b = location.state) == null ? void 0 : _b.searchParams) || {
    pickup: "Delhi, India",
    drop: "Chandigarh, India",
    tripType: "oneway",
    pickupDate: "13 Nov",
    pickupTime: "10:00 AM"
  };
  const transformApiCabs = (apiCabs) => {
    if (!apiCabs || apiCabs.length === 0) return [];
    return apiCabs.map((cab, index2) => {
      var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
      return {
        id: cab.vehicleId || cab._id || index2 + 1,
        vehicleId: cab.vehicleId || cab._id,
        name: cab.vehicleName || cab.modelName || ((_a2 = cab.group) == null ? void 0 : _a2.groupName) || "Vehicle",
        type: `${(cab.category || ((_b2 = cab.group) == null ? void 0 : _b2.tier) || "Sedan").toUpperCase()} | ${cab.isAc !== false ? "AC" : "Non-AC"}`,
        passengers: cab.seats || ((_c = cab.group) == null ? void 0 : _c.seats) || 4,
        rating: cab.rating || 4.5,
        originalPrice: cab.originalPrice || Math.round((cab.finalPrice || ((_d = cab.fare) == null ? void 0 : _d.total) || 0) * 1.15),
        price: cab.finalPrice !== void 0 ? cab.finalPrice : ((_e = cab.fare) == null ? void 0 : _e.total) || 0,
        tax: Math.round((cab.finalPrice || ((_f = cab.fare) == null ? void 0 : _f.total) || 0) * 0.05),
        offer: Math.round((cab.finalPrice || ((_g = cab.fare) == null ? void 0 : _g.total) || 0) * 0.1),
        roofCarrier: cab.hasRoofCarrier ? 157 : 0,
        image: ((_h = cab.images) == null ? void 0 : _h.frontView) || ((_i = cab.images) == null ? void 0 : _i.insideView) || ((_k = (_j = cab.vehicleDetails) == null ? void 0 : _j.images) == null ? void 0 : _k.frontView) || ((_m = (_l = cab.group) == null ? void 0 : _l.vehicleImages) == null ? void 0 : _m.frontView) || "https://gos3.ibcdn.com/sedan_v_2_copy_2-1576142484.png",
        // Store original data for booking
        _original: cab
      };
    });
  };
  const cabs = reactExports.useMemo(() => {
    const apiCabs = searchResults.cabs || [];
    if (apiCabs.length > 0) {
      return transformApiCabs(apiCabs);
    }
    return [];
  }, [searchResults.cabs]);
  const routeInfo = searchResults.route || {};
  const handleCabSelect = (cab) => {
    var _a2, _b2, _c, _d, _e, _f, _g, _h;
    navigate(`/details-mobile/${cab.id}`, {
      state: {
        cab,
        searchData,
        // Pass coordinates and route info for booking
        picklat: searchData.sourceLat || ((_b2 = (_a2 = location.state) == null ? void 0 : _a2.searchParams) == null ? void 0 : _b2.sourceLat),
        picklng: searchData.sourceLong || ((_d = (_c = location.state) == null ? void 0 : _c.searchParams) == null ? void 0 : _d.sourceLong),
        droplat: searchData.destLat || ((_f = (_e = location.state) == null ? void 0 : _e.searchParams) == null ? void 0 : _f.destLat),
        droplng: searchData.destLong || ((_h = (_g = location.state) == null ? void 0 : _g.searchParams) == null ? void 0 : _h.destLong),
        distance: routeInfo.totalDistance || searchData.distance,
        tripType: searchData.tripType,
        pickupDate: searchData.pickupDate,
        pickupTime: searchData.pickupTime
      }
    });
  };
  const pickupDisplay = searchData.pickup || searchData.from || "Pickup";
  const dropDisplay = searchData.drop || searchData.to || "Drop";
  const tripTypeDisplay = searchData.tripType === "roundtrip" || searchData.tripType === "roundTrip" ? "Round Trip" : "One way";
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full min-h-screen bg-[#f6f7fb] font-sans text-[#111827]", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sticky top-0 bg-white shadow-sm p-3 flex items-center justify-between", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => navigate(-1), className: "text-black", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowLeft, { size: 22 }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("h1", { className: "font-semibold text-sm truncate max-w-[60%] text-center mr-10", children: [
        pickupDisplay == null ? void 0 : pickupDisplay.split(",")[0],
        " - ",
        dropDisplay == null ? void 0 : dropDisplay.split(",")[0]
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "text-[#1e67d1] text-sm" })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center text-gray-600 text-xs mt-1 mb-2", children: [
      tripTypeDisplay,
      " |",
      " ",
      searchData.pickupDate,
      ", ",
      searchData.pickupTime
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-[#e8f1fd] mx-3 rounded-lg p-3 flex items-center justify-between mb-3", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "font-semibold text-sm text-gray-800", children: "Our Top Rated Partner" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-600", children: "India's Leading Outstation Cab Rentals Since 2006" })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "img",
        {
          src: "https://go-assets.ibcdn.com/u/GI/images/1751872285411-savari-banner-dweb.png",
          alt: "Savaari Partner",
          className: "h-6 w-auto"
        }
      )
    ] }),
    searchLoading && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center py-20", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { className: "w-10 h-10 text-[#1e67d1] animate-spin" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-4 text-gray-600 text-sm", children: "Searching available cabs..." })
    ] }),
    searchError && !searchLoading && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mx-3 p-4 bg-red-50 rounded-lg text-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-red-600 font-medium", children: "Unable to fetch cabs" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-red-500 text-sm mt-1", children: searchError }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          onClick: () => navigate(-1),
          className: "mt-3 px-4 py-2 bg-red-100 text-red-600 rounded-lg text-sm font-medium",
          children: "Go Back & Retry"
        }
      )
    ] }),
    !searchLoading && !searchError && cabs.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mx-3 p-6 bg-white rounded-lg text-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-600 font-medium", children: "No cabs available" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500 text-sm mt-1", children: "Try searching for a different route or date" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          onClick: () => navigate(-1),
          className: "mt-4 px-6 py-2 bg-[#1e67d1] text-white rounded-lg text-sm font-medium",
          children: "Modify Search"
        }
      )
    ] }),
    !searchLoading && cabs.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-3 pb-20", children: cabs.map((cab) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "div",
      {
        onClick: () => handleCabSelect(cab),
        className: "bg-white rounded-lg shadow-sm mb-3 overflow-hidden active:scale-[0.98] transition",
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex p-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "img",
              {
                src: cab.image,
                alt: cab.name,
                className: "w-20 h-12 object-contain mr-3"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "font-semibold text-sm text-gray-900", children: [
                  cab.name,
                  " ",
                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-600", children: "Or Similar" })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "bg-[#e6f4ea] text-[#137333] px-2 py-0.5 text-[10px] font-bold rounded", children: [
                  cab.rating,
                  "/5"
                ] })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: cab.type }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-500", children: [
                cab.passengers,
                " passengers allowed"
              ] })
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center px-3 pb-2", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", {}),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right", children: [
              cab.originalPrice > cab.price && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-400 line-through", children: [
                "₹",
                cab.originalPrice
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-lg font-bold text-gray-900", children: [
                "₹",
                cab.price
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[10px] text-gray-500", children: [
                "+ ₹",
                cab.tax,
                " taxes & fees"
              ] })
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between border-t px-3 py-2 text-xs", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "border border-[#1e67d1] text-[#1e67d1] rounded-full px-2 py-[2px] text-[10px] font-semibold", children: "🎟️ GOCAB" }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-[#1e67d1] font-medium", children: [
              "Use code and get ₹",
              cab.offer,
              " off"
            ] })
          ] }),
          cab.roofCarrier > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-[#e6f9ff] px-3 py-2 text-[11px] text-[#0088aa] font-medium border-t border-[#ccf4ff]", children: [
            "✨ Roof Carrier available with this car starting @ INR",
            " ",
            cab.roofCarrier
          ] })
        ]
      },
      cab.id
    )) })
  ] });
};
const CitiesMobile = () => {
  const dispatch = useDispatch();
  const navigate = useNavigate();
  const { slug } = useParams();
  const {
    currentCityService,
    currentCityLoading,
    searchResults,
    searchLoading,
    searchError
  } = useSelector((state) => state.seo);
  const [from, setFrom] = reactExports.useState("Delhi");
  const [to, setTo] = reactExports.useState("");
  const [date, setDate] = reactExports.useState("");
  const [time, setTime] = reactExports.useState("10:00");
  const [selectedPackage, setSelectedPackage] = reactExports.useState(0);
  reactExports.useEffect(() => {
    const tomorrow = /* @__PURE__ */ new Date();
    tomorrow.setDate(tomorrow.getDate() + 1);
    setDate(tomorrow.toISOString().split("T")[0]);
  }, []);
  reactExports.useEffect(() => {
    if (slug) {
      dispatch(getCityServiceBySlug(slug));
    }
  }, [dispatch, slug]);
  reactExports.useEffect(() => {
    const city2 = currentCityService;
    if (city2) {
      setFrom(city2.cityName || from);
    }
  }, [currentCityService]);
  reactExports.useEffect(() => {
    if (slug && currentCityService) {
      dispatch(searchCityCabs({
        slug,
        params: {
          startTime: (/* @__PURE__ */ new Date()).toISOString(),
          isAc: true
        }
      }));
    }
  }, [dispatch, slug, currentCityService]);
  const city = currentCityService;
  const cabs = (searchResults == null ? void 0 : searchResults.cabs) || [];
  const vehicleOptions = (city == null ? void 0 : city.vehicleOptions) || [];
  const routesFrom = (city == null ? void 0 : city.popularRoutesFrom) || [];
  const routesTo = (city == null ? void 0 : city.popularRoutesTo) || [];
  const rentalPackages = (city == null ? void 0 : city.rentalPackages) || [
    { hours: 1, km: 10, price: 250 },
    { hours: 2, km: 20, price: 400 },
    { hours: 3, km: 30, price: 550 }
  ];
  const cityName = (city == null ? void 0 : city.cityName) || "Delhi";
  const handleSearch = () => {
    if (slug) {
      dispatch(searchCityCabs({
        slug,
        params: {
          startTime: (/* @__PURE__ */ new Date()).toISOString(),
          isAc: true
        }
      }));
    }
  };
  const handleSelectCab = (cab) => {
    var _a;
    const cityCoords = (city == null ? void 0 : city.coordinates) || { lat: 0, lng: 0 };
    const vehicleId = cab._id || cab.vehicleId || cab.groupId;
    navigate(`/details/${vehicleId}`, {
      state: {
        vehicleId,
        picklat: cityCoords.lat,
        picklng: cityCoords.lng,
        pickupAddress: from,
        pickupCity: cityName,
        droplat: cityCoords.lat,
        droplng: cityCoords.lng,
        dropAddress: to || cityName,
        dropCity: cityName,
        distance: ((_a = rentalPackages[selectedPackage]) == null ? void 0 : _a.km) || 10,
        tripType: "rental",
        fuelType: cab.fuelType || "petrol",
        isAc: true,
        scheduledTime: (/* @__PURE__ */ new Date()).toISOString(),
        vehicle: cab,
        rentalPackage: rentalPackages[selectedPackage]
      }
    });
  };
  const handleRouteClick = (route) => {
    if (route.slug) {
      navigate(`/top/${route.slug}`);
    }
  };
  if (currentCityLoading) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-screen bg-[#0d6efd] flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { className: "w-10 h-10 text-white animate-spin mx-auto" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-4 text-white", children: "Loading city details..." })
    ] }) });
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen bg-[#0d6efd] flex flex-col items-center pb-24", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full bg-[#0d6efd] px-4 py-5 space-y-4 text-white", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-xs font-semibold mb-1 uppercase opacity-80", children: "From" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "input",
          {
            type: "text",
            value: from,
            onChange: (e2) => setFrom(e2.target.value),
            className: "w-full bg-white text-gray-900 px-3 py-2 rounded-md font-semibold outline-none"
          }
        )
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-xs font-semibold mb-1 uppercase opacity-80", children: "To" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "input",
          {
            type: "text",
            placeholder: "Choose Drop Location",
            value: to,
            onChange: (e2) => setTo(e2.target.value),
            className: "w-full bg-white text-gray-900 px-3 py-2 rounded-md font-semibold placeholder-gray-500 outline-none"
          }
        )
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-xs font-semibold mb-1 uppercase opacity-80", children: "Pickup Date" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "input",
            {
              type: "date",
              value: date,
              onChange: (e2) => setDate(e2.target.value),
              className: "w-full bg-white text-gray-900 px-3 py-2 rounded-md outline-none"
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-xs font-semibold mb-1 uppercase opacity-80", children: "Pickup Time" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "input",
            {
              type: "time",
              value: time,
              onChange: (e2) => setTime(e2.target.value),
              className: "w-full bg-white text-gray-900 px-3 py-2 rounded-md outline-none"
            }
          )
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          onClick: handleSearch,
          className: "w-full bg-white text-[#0d6efd] font-semibold py-2 rounded-md mt-2 hover:bg-gray-100 transition",
          children: "UPDATE SEARCH"
        }
      )
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full bg-gray-100 text-gray-900 px-4 py-5", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-blue-700 font-semibold", children: [
        "Home > Cab Booking > ",
        cityName,
        " Cab Services"
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-lg font-bold mt-2", children: [
        cityName,
        " Taxi Services"
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm mt-2 text-gray-700 leading-snug", children: (city == null ? void 0 : city.description) || `Book a taxi service in ${cityName} for comfort & safety or enjoy worry-free full-day taxi. Book your taxi now.` }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "a",
        {
          href: "#",
          className: "text-blue-700 text-sm font-semibold mt-2 inline-block",
          children: "Read More"
        }
      )
    ] }),
    routesFrom.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full bg-white text-gray-900 px-4 py-5", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-lg font-bold mb-3", children: [
        "Top Cabs Routes from ",
        cityName
      ] }),
      routesFrom.map((route, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          onClick: () => handleRouteClick(route),
          className: "border-b border-gray-200 py-3 last:border-none cursor-pointer active:bg-gray-50",
          children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-start", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-base", children: route.title || `${route.origin} to ${route.destination}` }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500 mt-0.5", children: [
                route.distance,
                " kms | ",
                route.duration
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-semibold mt-1", children: route.included || `${route.distance} kms included` }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: route.extra || `Extra fare ₹12/km after ${route.distance} kms` })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[#111] font-bold text-lg", children: [
                "₹",
                route.price || route.startsFrom
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500 -mt-1", children: "Onwards" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "mt-2 bg-orange-500 text-white px-4 py-1 rounded-md text-sm font-semibold", children: "View Cabs" })
            ] })
          ] })
        },
        index2
      ))
    ] }),
    routesTo.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full bg-white text-gray-900 px-4 py-5 mt-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-lg font-bold mb-3", children: [
        "Top Cabs Routes to ",
        cityName
      ] }),
      routesTo.map((route, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          onClick: () => handleRouteClick(route),
          className: "border-b border-gray-200 py-3 last:border-none cursor-pointer active:bg-gray-50",
          children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-start", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-base", children: route.title || `${route.origin} to ${route.destination}` }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500 mt-0.5", children: [
                route.distance,
                " kms | ",
                route.duration
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-semibold mt-1", children: route.included || `${route.distance} kms included` }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: route.extra || `Extra fare ₹12/km after ${route.distance} kms` })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[#111] font-bold text-lg", children: [
                "₹",
                route.price || route.startsFrom
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500 -mt-1", children: "Onwards" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "mt-2 bg-orange-500 text-white px-4 py-1 rounded-md text-sm font-semibold", children: "View Cabs" })
            ] })
          ] })
        },
        index2
      ))
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full bg-white text-gray-900 px-4 py-5 mt-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { className: "text-lg font-bold mb-4", children: [
        "Available Rental Cab in ",
        cityName
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-around mb-4", children: rentalPackages.slice(0, 3).map((pkg, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "div",
        {
          onClick: () => setSelectedPackage(index2),
          className: `text-center px-4 py-2 rounded-md cursor-pointer ${selectedPackage === index2 ? "bg-blue-600 text-white" : "border border-gray-300"}`,
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm font-semibold", children: [
              pkg.hours,
              " hr (",
              pkg.km,
              " km)"
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm font-medium", children: [
              "₹",
              pkg.price
            ] })
          ]
        },
        index2
      )) }),
      searchLoading ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center py-8", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { className: "w-8 h-8 text-blue-600 animate-spin mx-auto" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-4 text-gray-600 text-sm", children: "Searching available cabs..." })
      ] }) : searchError ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center py-8", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-red-600 font-medium", children: "Unable to fetch cabs" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-red-500 text-sm mt-1", children: searchError })
      ] }) : cabs.length > 0 ? cabs.map((cab, index2) => {
        var _a, _b, _c, _d, _e, _f, _g, _h;
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            onClick: () => handleSelectCab(cab),
            className: "border-t border-gray-200 py-4 flex justify-between items-start cursor-pointer active:bg-gray-50",
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold text-base", children: [
                  cab.modelName || ((_a = cab.group) == null ? void 0 : _a.groupName) || "Standard",
                  " Or Similar"
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500", children: [
                  ((_b = cab.group) == null ? void 0 : _b.tier) || "Standard",
                  " | AC | ",
                  ((_c = cab.group) == null ? void 0 : _c.seats) || cab.seats || 4,
                  " passengers allowed"
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "mt-2 text-sm text-gray-700 space-y-1", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
                    "✓ ",
                    ((_d = rentalPackages[selectedPackage]) == null ? void 0 : _d.km) || 10,
                    " Kms included"
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
                    "✓ Extra Kms charges: ₹",
                    ((_g = (_f = (_e = cab.group) == null ? void 0 : _e.fuelPricing) == null ? void 0 : _f[0]) == null ? void 0 : _g.ratePerKmAc) || 13,
                    "/Km"
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
                    "✓ ",
                    ((_h = rentalPackages[selectedPackage]) == null ? void 0 : _h.hours) || 1,
                    "h 00m (appx.)"
                  ] })
                ] })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-right", children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "bg-orange-500 text-white px-4 py-1 rounded-md text-sm font-semibold mt-2", children: "Book" }) })
            ]
          },
          cab._id || index2
        );
      }) : vehicleOptions.length > 0 ? vehicleOptions.map((vehicle, index2) => {
        var _a, _b;
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            onClick: () => handleSelectCab(vehicle),
            className: "border-t border-gray-200 py-4 flex justify-between items-start cursor-pointer active:bg-gray-50",
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold text-base", children: [
                  vehicle.displayName || vehicle.groupName,
                  " Or Similar"
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500", children: [
                  vehicle.category,
                  " | AC | ",
                  vehicle.seats || 4,
                  " passengers allowed"
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "mt-2 text-sm text-gray-700 space-y-1", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
                    "✓ ",
                    ((_a = rentalPackages[selectedPackage]) == null ? void 0 : _a.km) || 10,
                    " Kms included"
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
                    "✓ Extra Kms charges: ₹",
                    vehicle.extraKmRate || 13,
                    "/Km"
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
                    "✓ ",
                    ((_b = rentalPackages[selectedPackage]) == null ? void 0 : _b.hours) || 1,
                    "h 00m (appx.)"
                  ] })
                ] })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-right", children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "bg-orange-500 text-white px-4 py-1 rounded-md text-sm font-semibold mt-2", children: "Book" }) })
            ]
          },
          vehicle.groupId || index2
        );
      }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center py-8", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500", children: "No vehicles available." }) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "fixed bottom-4 right-4 flex flex-col gap-3 items-end", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "a",
        {
          href: "https://wa.me/",
          target: "_blank",
          rel: "noopener noreferrer",
          className: "bg-green-500 text-white flex items-center gap-2 px-4 py-2 rounded-full shadow-lg text-sm font-semibold",
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(FaWhatsapp, { className: "text-lg" }),
            " Chat with us"
          ]
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "a",
        {
          href: "tel:+911234567890",
          className: "bg-blue-600 text-white flex items-center gap-2 px-4 py-2 rounded-full shadow-lg text-sm font-semibold",
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(FaPhoneAlt, { className: "text-lg" }),
            " Call us now"
          ]
        }
      )
    ] })
  ] });
};
const formatDateDisplay = (date) => {
  const d2 = new Date(date);
  const options = { weekday: "short", day: "2-digit", month: "short", year: "2-digit" };
  return d2.toLocaleDateString("en-GB", options).replace(",", "");
};
const AirportMobile = () => {
  const dispatch = useDispatch();
  const navigate = useNavigate();
  const { slug } = useParams();
  const {
    currentAirportRoute,
    currentAirportLoading,
    searchResults,
    searchLoading,
    searchError
  } = useSelector((state) => state.seo);
  const [from, setFrom] = reactExports.useState("Kempegowda International Airport");
  const [to, setTo] = reactExports.useState("Bangalore");
  const [date, setDate] = reactExports.useState("");
  const [time, setTime] = reactExports.useState("10:00");
  const [tripType, setTripType] = reactExports.useState("drop");
  const [readMoreOpen, setReadMoreOpen] = reactExports.useState(false);
  reactExports.useEffect(() => {
    const tomorrow = /* @__PURE__ */ new Date();
    tomorrow.setDate(tomorrow.getDate() + 1);
    setDate(tomorrow.toISOString().split("T")[0]);
  }, []);
  reactExports.useEffect(() => {
    if (slug) {
      dispatch(getAirportRouteBySlug(slug));
    }
  }, [dispatch, slug]);
  reactExports.useEffect(() => {
    const route2 = currentAirportRoute;
    if (route2) {
      setFrom(route2.airportName || route2.originCity || from);
      setTo(route2.cityName || route2.destinationCity || to);
    }
  }, [currentAirportRoute]);
  reactExports.useEffect(() => {
    if (slug && currentAirportRoute) {
      dispatch(searchAirportCabs({
        slug,
        params: {
          startTime: (/* @__PURE__ */ new Date()).toISOString(),
          isAc: true
        }
      }));
    }
  }, [dispatch, slug, currentAirportRoute]);
  const route = currentAirportRoute;
  const cabs = (searchResults == null ? void 0 : searchResults.cabs) || [];
  const vehicleOptions = (route == null ? void 0 : route.vehicleOptions) || [];
  const handleUpdate = () => {
    if (slug) {
      dispatch(searchAirportCabs({
        slug,
        params: {
          startTime: (/* @__PURE__ */ new Date()).toISOString(),
          isAc: true
        }
      }));
    }
  };
  const handleSelectCab = (cab) => {
    const originCoords = (route == null ? void 0 : route.originCoords) || { lat: 0, lng: 0 };
    const destCoords = (route == null ? void 0 : route.destCoords) || { lat: 0, lng: 0 };
    const vehicleId = cab._id || cab.vehicleId || cab.groupId;
    navigate(`/details/${vehicleId}`, {
      state: {
        vehicleId,
        picklat: originCoords.lat,
        picklng: originCoords.lng,
        pickupAddress: from,
        pickupCity: (route == null ? void 0 : route.cityName) || to,
        droplat: destCoords.lat,
        droplng: destCoords.lng,
        dropAddress: to,
        dropCity: (route == null ? void 0 : route.cityName) || to,
        distance: (route == null ? void 0 : route.distance) || 0,
        tripType: "airport",
        fuelType: cab.fuelType || "petrol",
        isAc: true,
        scheduledTime: (/* @__PURE__ */ new Date()).toISOString(),
        vehicle: cab,
        route
      }
    });
  };
  (route == null ? void 0 : route.cityName) || "Bangalore";
  const airportName = (route == null ? void 0 : route.airportName) || "Bangalore Airport";
  if (currentAirportLoading) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-screen bg-gray-50 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { className: "w-10 h-10 text-blue-600 animate-spin mx-auto" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-4 text-gray-600", children: "Loading airport details..." })
    ] }) });
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen bg-gray-50 text-gray-900", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-blue-600 px-4 pt-6 pb-8", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-w-3xl mx-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-white font-semibold tracking-wide", children: "FROM" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 bg-blue-700 rounded-2xl px-4 py-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "input",
          {
            value: from,
            onChange: (e2) => setFrom(e2.target.value),
            className: "w-full bg-transparent text-white font-bold text-lg outline-none"
          }
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-white font-semibold tracking-wide", children: "TO" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 bg-blue-700 rounded-2xl px-4 py-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "input",
          {
            value: to,
            onChange: (e2) => setTo(e2.target.value),
            className: "w-full bg-transparent text-white font-bold text-lg outline-none"
          }
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-white font-semibold tracking-wide", children: "PICKUP DATE" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 bg-blue-700 rounded-2xl px-4 py-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "input",
              {
                type: "date",
                value: date,
                onChange: (e2) => setDate(e2.target.value),
                className: "w-full bg-transparent text-white font-semibold outline-none"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 text-white font-bold", children: date ? formatDateDisplay(date) : "" })
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-white font-semibold tracking-wide", children: "PICKUP TIME" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 bg-blue-700 rounded-2xl px-4 py-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "input",
              {
                type: "time",
                value: time,
                onChange: (e2) => setTime(e2.target.value),
                className: "w-full bg-transparent text-white font-semibold outline-none"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 text-white font-bold", children: time })
          ] })
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          onClick: handleUpdate,
          className: "w-full mt-3 bg-white text-black font-bold py-3 rounded-xl shadow-lg",
          children: "UPDATE SEARCH"
        }
      )
    ] }) }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-3xl mx-auto px-4 mt-6", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-t-xl pt-4 pb-4 px-4 shadow", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-blue-600", children: [
          "Home > Cab Booking >",
          " ",
          /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-black font-semibold", children: [
            airportName,
            " Cab Booking"
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h1", { className: "text-2xl font-bold text-gray-900 mt-3", children: [
          "Book ",
          airportName,
          " Taxi & use ",
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-600", children: "GOCAB" }),
          " for 10% off"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-700 mt-3 leading-relaxed", children: (route == null ? void 0 : route.description) || `Book sanitized ${airportName} taxi services for a hassle-free experience. Book all types of cabs and other taxi services like Airport transfer, Railway transfer with top car operators.` }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            onClick: () => setReadMoreOpen((s2) => !s2),
            className: "text-blue-600 text-sm font-semibold mt-3",
            children: readMoreOpen ? "Show Less" : "Read More"
          }
        ),
        readMoreOpen && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-3 text-sm text-gray-700", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: (route == null ? void 0 : route.longDescription) || "We partner with trusted operators to provide clean vehicles, trained drivers and transparent fares. Choose the car that fits your group and luggage." }) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-b-xl px-4 py-4 shadow mb-6", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 mb-3", children: "Select trip type to update price, included kms & extra fare" }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-6", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "flex items-center gap-3 cursor-pointer", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "input",
              {
                type: "radio",
                name: "tripType",
                checked: tripType === "drop",
                onChange: () => setTripType("drop"),
                className: "accent-blue-600 w-4 h-4"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-semibold", children: "Airport Drop" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: "Drop passenger to airport" })
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "flex items-center gap-3 cursor-pointer", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "input",
              {
                type: "radio",
                name: "tripType",
                checked: tripType === "pickup",
                onChange: () => setTripType("pickup"),
                className: "accent-blue-600 w-4 h-4"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-semibold", children: "Airport Pickup" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: "Pickup passenger from airport" })
            ] })
          ] })
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl px-4 py-4 shadow mb-6", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: "Available Cabs" }),
        searchLoading ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center py-8", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { className: "w-8 h-8 text-blue-600 animate-spin mx-auto" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-4 text-gray-600 text-sm", children: "Searching available cabs..." })
        ] }) : searchError ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center py-8", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-red-600 font-medium", children: "Unable to fetch cabs" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-red-500 text-sm mt-1", children: searchError })
        ] }) : cabs.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-3", children: cabs.map((cab, i2) => {
          var _a, _b, _c, _d, _e, _f, _g;
          return /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "div",
            {
              onClick: () => handleSelectCab(cab),
              className: "flex items-center justify-between p-3 border rounded-lg active:scale-[0.98] transition cursor-pointer",
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "img",
                    {
                      src: ((_b = (_a = cab.group) == null ? void 0 : _a.vehicleImages) == null ? void 0 : _b.frontView) || cab.image || "https://gos3.ibcdn.com/sedan_v_2_copy_2-1576142484.png",
                      alt: cab.modelName || ((_c = cab.group) == null ? void 0 : _c.groupName),
                      className: "w-16 h-10 object-contain"
                    }
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm", children: cab.modelName || ((_d = cab.group) == null ? void 0 : _d.groupName) || "Standard" }),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-500", children: [
                      ((_e = cab.group) == null ? void 0 : _e.tier) || "Standard",
                      " • ",
                      ((_f = cab.group) == null ? void 0 : _f.seats) || cab.seats || 4,
                      " seats"
                    ] })
                  ] })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold", children: [
                    "₹",
                    ((_g = cab.fare) == null ? void 0 : _g.total) || cab.price || 0
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-400", children: "+ taxes" })
                ] })
              ]
            },
            cab._id || i2
          );
        }) }) : vehicleOptions.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-3", children: vehicleOptions.map((vehicle, i2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            onClick: () => handleSelectCab(vehicle),
            className: "flex items-center justify-between p-3 border rounded-lg active:scale-[0.98] transition cursor-pointer",
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "img",
                  {
                    src: vehicle.image || "https://gos3.ibcdn.com/sedan_v_2_copy_2-1576142484.png",
                    alt: vehicle.groupName,
                    className: "w-16 h-10 object-contain"
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-sm", children: vehicle.displayName || vehicle.groupName }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-500", children: [
                    vehicle.category,
                    " • ",
                    vehicle.seats || 4,
                    " seats"
                  ] })
                ] })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold", children: [
                  "₹",
                  vehicle.price || 0
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-400", children: "+ taxes" })
              ] })
            ]
          },
          vehicle.groupId || i2
        )) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center py-8", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500", children: "No vehicles available." }) })
      ] }),
      (route == null ? void 0 : route.faqs) && route.faqs.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl px-4 py-6 shadow mb-10", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-xl font-bold text-gray-900 mb-4", children: [
          "FAQs About ",
          airportName,
          " Cabs Services"
        ] }),
        route.faqs.map((faq2, i2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-6", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold text-gray-900", children: [
            "Q. ",
            faq2.question
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-gray-700 mt-1", children: [
            "A. ",
            faq2.answer
          ] })
        ] }, i2))
      ] }),
      (route == null ? void 0 : route.reviews) && route.reviews.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl px-4 py-4 shadow mb-8", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-xl font-bold text-gray-900 mb-4", children: "Customer reviews" }),
        route.reviews.slice(0, 2).map((review, i2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3 mb-6", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-10 h-10 bg-gray-300 rounded-full" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold", children: review.userName || "Customer" }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "bg-green-600 text-white px-2 py-1 rounded text-xs font-bold", children: [
                review.rating || 5,
                " / 5"
              ] })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-700 mt-1", children: review.comment || "Great service!" }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500 mt-1", children: [
              "Travelled in ",
              review.cabType || "sedan"
            ] })
          ] })
        ] }, i2)),
        /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "text-blue-600 text-sm font-semibold", children: "View More" })
      ] })
    ] })
  ] });
};
const ResultDetailMobile = () => {
  var _a, _b, _c, _d, _e, _f;
  const navigate = useNavigate();
  const location = useLocation();
  const cab = (_a = location.state) == null ? void 0 : _a.cab;
  const searchData = ((_b = location.state) == null ? void 0 : _b.searchData) || {};
  const { isAuthenticated, user } = useSelector((state) => state.auth);
  if (!cab) {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => navigate(-1), className: "mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowLeft, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "No cab data found." })
    ] });
  }
  const originalCab = cab._original || cab;
  const cabName = cab.name || originalCab.vehicleName || originalCab.modelName || "Vehicle";
  const cabType = cab.type || `${originalCab.category || "Sedan"} | ${originalCab.isAc !== false ? "AC" : "Non-AC"}`;
  const passengers = cab.passengers || originalCab.seats || 4;
  const price = cab.price || ((_c = originalCab.fare) == null ? void 0 : _c.total) || originalCab.finalPrice || 0;
  const originalPrice = cab.originalPrice || Math.round(price * 1.15);
  const fuelType = originalCab.fuelType || "CNG/Diesel";
  const includedKm = originalCab.includedKm || searchData.distance || 300;
  const extraKmRate = originalCab.extraKmRate || ((_f = (_e = (_d = originalCab.group) == null ? void 0 : _d.fuelPricing) == null ? void 0 : _e[0]) == null ? void 0 : _f.ratePerKmAc) || 15;
  const tripType = searchData.tripType === "roundtrip" || searchData.tripType === "roundTrip" ? "Round trip" : "One-way trip";
  searchData.pickup || searchData.from || "Pickup Location";
  searchData.drop || searchData.to || "Drop Location";
  const pickupDate = searchData.pickupDate || "15 Nov";
  const pickupTime = searchData.pickupTime || "10:00 AM";
  const formatDate = (dateStr) => {
    if (dateStr.includes("-")) {
      const date = new Date(dateStr);
      return date.toLocaleDateString("en-IN", { day: "2-digit", month: "short", year: "numeric" });
    }
    return dateStr;
  };
  const cancellationTime = `${pickupDate} 9:00 am`;
  const carImages = reactExports.useMemo(() => {
    var _a2, _b2;
    const images = [];
    const cabImages = originalCab.images || ((_a2 = originalCab.vehicleDetails) == null ? void 0 : _a2.images) || ((_b2 = originalCab.group) == null ? void 0 : _b2.vehicleImages) || {};
    if (cabImages.frontView) images.push(cabImages.frontView);
    if (cabImages.sideView) images.push(cabImages.sideView);
    if (cabImages.insideView) images.push(cabImages.insideView);
    if (cabImages.backView) images.push(cabImages.backView);
    if (cabImages.bootSpace) images.push(cabImages.bootSpace);
    if (images.length === 0) {
      return [
        cab.image || "https://go-assets.ibcdn.com/u/MMT/images/1732607472482-hatchback_Unknown_Unknown_EXTERIOR_Front_view_.jpeg",
        "https://go-assets.ibcdn.com/u/MMT/images/1732607474462-hatchback_Unknown_Unknown_EXTERIOR_Side_View.jpeg",
        "https://go-assets.ibcdn.com/u/MMT/images/1732607476045-hatchback_Unknown_Unknown_INTERIOR_Dashboard,_leg_space_in_front_seat.jpeg",
        "https://go-assets.ibcdn.com/u/MMT/images/1732607478924-hatchback_Unknown_Unknown_INTERIOR_Ample_leg_space_in_back_seat.jpeg",
        "https://go-assets.ibcdn.com/u/MMT/images/1732607480576-hatchback_Unknown_Unknown_BOOT_Sufficient_boot_space_for_2_bags.jpeg"
      ];
    }
    return images;
  }, [cab, originalCab]);
  const reserveAmount = Math.round(price * 0.2);
  const handleContinue = () => {
    var _a2, _b2, _c2, _d2, _e2;
    navigate("/search-details-mobile", {
      state: {
        cab,
        searchData,
        picklat: (_a2 = location.state) == null ? void 0 : _a2.picklat,
        picklng: (_b2 = location.state) == null ? void 0 : _b2.picklng,
        droplat: (_c2 = location.state) == null ? void 0 : _c2.droplat,
        droplng: (_d2 = location.state) == null ? void 0 : _d2.droplng,
        distance: (_e2 = location.state) == null ? void 0 : _e2.distance,
        tripType: searchData.tripType,
        pickupDate,
        pickupTime
      }
    });
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full min-h-screen bg-white pb-24", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3 p-3 border-b text-black", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowLeft, { size: 22, onClick: () => navigate(-1), className: "cursor-pointer" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "leading-tight", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold text-[17px] text-black", children: [
          cabName,
          " - ",
          cabType
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600", children: [
          tripType,
          " | ",
          formatDate(pickupDate),
          ", ",
          pickupTime
        ] })
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-4 mt-3", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-xl font-semibold text-black", children: [
        cabName,
        " Or Similar"
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-gray-500 text-sm", children: [
        cabType,
        " | ",
        passengers,
        " passengers allowed"
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex overflow-x-auto gap-3 px-4 mt-3 snap-x snap-mandatory", children: carImages.map((img, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      {
        className: "min-w-[200px] max-w-[200px] h-[140px] rounded-md overflow-hidden snap-center bg-gray-200",
        children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: img, alt: `car-${index2}`, className: "w-full h-full object-cover" })
      },
      index2
    )) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-yellow-50 text-yellow-700 px-4 py-3 mt-3 text-sm", children: "Car images shown here are for representation purpose only." }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-4 mt-5", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-gray-400 text-sm font-semibold", children: "Cancellation Policy" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 bg-white border rounded-lg p-3", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[15px] font-semibold text-black", children: [
        "Full refund, till ",
        cancellationTime
      ] }) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-4 mt-5", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-[#f4f8ff] rounded-xl p-4 border", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3 items-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "img",
          {
            src: "https://cdn-icons-png.flaticon.com/512/2967/2967350.png",
            alt: "driver",
            className: "w-12 h-12"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-[16px] font-semibold text-black", children: "Cab & Driver details" }) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mt-3 text-[14px] leading-5 text-gray-700", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold text-black", children: "Cab operator" }),
        " will be assigned as soon as booking is complete. Your ",
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold text-black", children: "cab and driver" }),
        " details will be shared via",
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold", children: " Whatsapp & SMS " }),
        "on your registered mobile number by"
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mt-2 font-semibold text-black text-[15px]", children: [
        formatDate(pickupDate),
        " at 9:30 am"
      ] })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-4 mt-5", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-[16px] font-semibold text-black", children: "Passenger and Luggage info" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "text-[#1e67d1] font-semibold text-sm", children: "View details ➜" })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 bg-white p-4 rounded-xl border", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3 items-center", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "img",
            {
              src: "https://cdn-icons-png.flaticon.com/512/1077/1077012.png",
              className: "w-5 h-5",
              alt: "passengers"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold text-black text-sm", children: [
              "Up to ",
              passengers,
              " passengers"
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500 text-xs", children: "Allowed as per govt guidelines" })
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-[1px] bg-gray-200 my-4" }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-around text-center", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "img",
              {
                src: "https://cdn-icons-png.flaticon.com/512/3103/3103461.png",
                className: "w-6 h-6 mx-auto",
                alt: "luggage"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-black text-sm mt-1", children: "1 large bag" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: '(30"x19"x11")' })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-gray-500 text-sm mt-5", children: "OR" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "img",
              {
                src: "https://cdn-icons-png.flaticon.com/512/7756/7756464.png",
                className: "w-6 h-6 mx-auto",
                alt: "small bags"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-black text-sm mt-1", children: "2 small bags" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: '(19"x13"x7")' })
          ] })
        ] })
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-4 mt-5", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold text-black text-[16px]", children: "Important Information" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-green-100 text-green-700 px-4 py-2 mt-3 rounded-lg text-sm", children: [
        "Reserve this cab @₹",
        reserveAmount,
        " in next screen"
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-4 mt-4 text-sm space-y-2", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "flex items-center gap-2 text-black", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-green-600 text-lg", children: "✔" }),
        "Free waiting upto 45 minutes"
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "flex items-center gap-2 text-black", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-green-600 text-lg", children: "✔" }),
        "Free cancellation until 1 hour before pickup"
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-4 mt-5", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold text-gray-800 text-lg", children: [
        "Fuel Type: ",
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-normal", children: fuelType })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-4 mt-3", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-1/2 border rounded-xl p-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-gray-800 mb-2", children: "Petrol" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "text-sm text-gray-600 space-y-1", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "✔ Better luggage capacity" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "✔ Stronger AC" })
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-1/2 border-2 border-green-600 rounded-xl p-4 bg-green-50", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-gray-800 mb-2", children: fuelType }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "text-sm text-gray-600 space-y-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "✔ Based on availability" }) })
        ] })
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-4 mt-5", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-gray-50 rounded-lg p-3 text-sm", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-gray-700", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold", children: "Extra Kms Charges:" }),
      " ₹",
      extraKmRate,
      "/Km after ",
      includedKm,
      " Kms"
    ] }) }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-green-100 text-green-700 px-4 py-3 mt-5 text-center text-sm", children: [
      "Reserve this cab @₹",
      reserveAmount,
      " in next screen"
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "fixed bottom-0 left-0 w-full bg-white border-t px-4 py-3 flex justify-between items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-lg font-semibold", children: [
          originalPrice > price && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "line-through text-gray-400 mr-2 text-sm", children: [
            "₹",
            originalPrice
          ] }),
          "₹",
          price
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: "+ taxes & fees" })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          onClick: handleContinue,
          className: "bg-orange-600 text-white px-6 py-2 rounded-lg text-lg shadow",
          children: "Continue"
        }
      )
    ] })
  ] });
};
function SearchDetailMobile() {
  var _a, _b, _c, _d, _e, _f;
  const navigate = useNavigate();
  const dispatch = useDispatch();
  const location = useLocation();
  const cab = (_a = location.state) == null ? void 0 : _a.cab;
  const searchData = ((_b = location.state) == null ? void 0 : _b.searchData) || {};
  const { user, isAuthenticated } = useSelector((state) => state.auth);
  const {
    bookingReview,
    reviewLoading,
    reviewError,
    createLoading,
    createSuccess,
    createError,
    currentBooking
  } = useSelector((state) => state.booking);
  const [selectedOffer, setSelectedOffer] = reactExports.useState(null);
  const [roofCarrier, setRoofCarrier] = reactExports.useState(false);
  const [gender, setGender] = reactExports.useState("male");
  const [paymentType, setPaymentType] = reactExports.useState("partial");
  const originalCab = (cab == null ? void 0 : cab._original) || cab || {};
  reactExports.useEffect(() => {
    var _a2, _b2, _c2, _d2, _e2;
    if (originalCab.vehicleId || originalCab._id) {
      const vehicleId = originalCab.vehicleId || originalCab._id || (cab == null ? void 0 : cab.vehicleId) || (cab == null ? void 0 : cab.id);
      dispatch(getBookingReview({
        vehicleId,
        picklat: (_a2 = location.state) == null ? void 0 : _a2.picklat,
        picklng: (_b2 = location.state) == null ? void 0 : _b2.picklng,
        pickupAddress: searchData.pickup || searchData.from,
        droplat: (_c2 = location.state) == null ? void 0 : _c2.droplat,
        droplng: (_d2 = location.state) == null ? void 0 : _d2.droplng,
        dropAddress: searchData.drop || searchData.to,
        distance: ((_e2 = location.state) == null ? void 0 : _e2.distance) || searchData.distance || 100,
        tripType: searchData.tripType === "roundtrip" ? "roundTrip" : "oneWay",
        fuelType: originalCab.fuelType || "petrol",
        isAc: true,
        scheduledTime: (/* @__PURE__ */ new Date()).toISOString()
      }));
    }
  }, [dispatch, originalCab, location.state, searchData]);
  const loadRazorpay = () => {
    return new Promise((resolve) => {
      const script = document.createElement("script");
      script.src = "https://checkout.razorpay.com/v1/checkout.js";
      script.onload = () => resolve(true);
      script.onerror = () => resolve(false);
      document.body.appendChild(script);
    });
  };
  reactExports.useEffect(() => {
    if (createError) {
      zt.error(createError);
    }
  }, [createError]);
  const review = bookingReview || {};
  const fareBreakdown = review.fareBreakdown || {};
  const cabName = (cab == null ? void 0 : cab.name) || originalCab.vehicleName || originalCab.modelName || review.vehicleName || "Vehicle";
  const cabType = (cab == null ? void 0 : cab.type) || `${originalCab.category || review.category || "SUV"} | AC | ${originalCab.seats || review.seats || 6} passengers allowed`;
  const fuelType = originalCab.fuelType || review.fuelType || "CNG";
  const includedKm = review.includedKm || originalCab.includedKm || searchData.distance || 300;
  const extraKmRate = review.extraKmRate || originalCab.extraKmRate || 26;
  const baseFare = fareBreakdown.baseFare || (cab == null ? void 0 : cab.price) || ((_c = originalCab.fare) == null ? void 0 : _c.total) || 5e3;
  const taxes = fareBreakdown.taxes || Math.round(baseFare * 0.05) || 0;
  const totalFare = fareBreakdown.total || review.totalFare || baseFare + taxes;
  const advancePayment = review.advancePayment || Math.round(totalFare * 0.25);
  const roofCarrierPrice = review.roofCarrierPrice || 315;
  const tripType = searchData.tripType === "roundtrip" || searchData.tripType === "roundTrip" ? "Round trip" : "One-way trip";
  const pickupLocation = searchData.pickup || searchData.from || "Pickup Location";
  const dropLocation = searchData.drop || searchData.to || "Drop Location";
  const pickupDate = searchData.pickupDate || ((_d = location.state) == null ? void 0 : _d.pickupDate) || "15 Nov";
  const pickupTime = searchData.pickupTime || ((_e = location.state) == null ? void 0 : _e.pickupTime) || "10:00 AM";
  const formatDate = (dateStr) => {
    if (dateStr.includes("-")) {
      const date = new Date(dateStr);
      return date.toLocaleDateString("en-IN", { day: "2-digit", month: "short", year: "numeric" });
    }
    return dateStr;
  };
  const getCancellationPolicyText = () => {
    if (!review.cancellationPolicy) {
      return `Full refund, till ${formatDate(pickupDate)} 9:00am`;
    }
    if (typeof review.cancellationPolicy === "object") {
      return review.cancellationPolicy.summary || review.cancellationPolicy.description || "Free cancellation available";
    }
    return review.cancellationPolicy;
  };
  const cancellationPolicy = getCancellationPolicyText();
  const defaultOffers = [
    {
      code: "GOCAB",
      description: "Use GOCAB and get Rs. 500 off on cab bookings."
    },
    {
      code: "GOCABNEW",
      description: "Get flat Rs. 300 off on your first cab booking!"
    },
    {
      code: "CABOFFER",
      description: "Get up-to Rs.200 Off on Outstation Cab transactions"
    }
  ];
  const rawOffers = review.availableOffers || defaultOffers;
  const offers = Array.isArray(rawOffers) ? rawOffers.map((offer) => {
    var _a2, _b2;
    return {
      code: typeof offer.code === "string" ? offer.code : String(offer.code || "OFFER"),
      description: typeof offer.description === "string" ? offer.description : typeof offer.description === "object" ? ((_a2 = offer.description) == null ? void 0 : _a2.summary) || ((_b2 = offer.description) == null ? void 0 : _b2.text) || "Get special discount!" : String(offer.description || "Get special discount!")
    };
  }) : defaultOffers;
  const handlePayAndConfirm = async () => {
    var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i, _j, _k, _l;
    if (!isAuthenticated) {
      zt.error("Please login to continue with booking");
      return;
    }
    const vehicleId = originalCab.vehicleId || originalCab._id || (cab == null ? void 0 : cab.vehicleId) || (cab == null ? void 0 : cab.id);
    const groupId = ((_a2 = location.state) == null ? void 0 : _a2.groupId) || originalCab.groupId;
    const modelId = ((_b2 = location.state) == null ? void 0 : _b2.modelId) || originalCab.modelId;
    const zoneId = ((_c2 = location.state) == null ? void 0 : _c2.zoneId) || ((_d2 = originalCab.zone) == null ? void 0 : _d2.id);
    const bookingData = {
      pickupLocation: {
        address: pickupLocation,
        coordinates: [((_e2 = location.state) == null ? void 0 : _e2.picklng) || 0, ((_f2 = location.state) == null ? void 0 : _f2.picklat) || 0]
      },
      dropLocation: {
        address: dropLocation,
        coordinates: [((_g = location.state) == null ? void 0 : _g.droplng) || 0, ((_h = location.state) == null ? void 0 : _h.droplat) || 0]
      },
      // NEW: Pass groupId and modelId for new booking system
      groupId,
      modelId,
      vehicleId: vehicleId || void 0,
      // Optional for backward compatibility
      zoneId,
      tripType: searchData.tripType === "roundtrip" ? "roundTrip" : "oneWay",
      pickupDate: searchData.pickupDate || pickupDate,
      pickupTime: searchData.pickupTime || pickupTime,
      distance: ((_i = location.state) == null ? void 0 : _i.distance) || searchData.distance || 100,
      paymentMode: "online",
      fuelType: fuelType.toLowerCase(),
      isAc: true,
      // Calculate duration roughly (Assuming 60km/h average speed), send as Number (hours)
      duration: Math.round((((_j = location.state) == null ? void 0 : _j.distance) || searchData.distance || 100) / 60)
    };
    if (searchData.tripType === "roundtrip" && searchData.dropDate) {
      bookingData.returnDate = searchData.dropDate;
      bookingData.returnTime = searchData.dropTime;
    }
    if (selectedOffer) {
      bookingData.promoCode = selectedOffer;
    }
    try {
      const bookingAction = await dispatch(createBooking(bookingData)).unwrap();
      const bookingId = ((_k = bookingAction.data) == null ? void 0 : _k._id) || ((_l = bookingAction.data) == null ? void 0 : _l.id);
      if (!bookingId) {
        throw new Error("Booking creation failed - ID missing");
      }
      console.log("Booking created:", bookingId);
      zt.success("Booking created. Initiating payment...");
      const isScriptLoaded = await loadRazorpay();
      if (!isScriptLoaded) {
        zt.error("Razorpay SDK failed to load. Are you online?");
        return;
      }
      const finalTotalFare = totalFare + (roofCarrier ? roofCarrierPrice : 0);
      const payAmount = paymentType === "partial" ? advancePayment : finalTotalFare;
      const orderAction = await dispatch(createPaymentOrder({
        bookingId,
        amount: payAmount,
        paymentType
      })).unwrap();
      const { data: orderData } = orderAction;
      console.log("Payment order created:", orderData);
      const options = {
        key: orderData.keyId,
        amount: orderData.amount,
        currency: orderData.currency,
        name: "Cab Booking",
        description: `Booking for ${cabName}`,
        order_id: orderData.orderId,
        handler: async function(response) {
          try {
            zt.loading("Verifying payment...");
            await dispatch(verifyPayment({
              razorpay_order_id: response.razorpay_order_id,
              razorpay_payment_id: response.razorpay_payment_id,
              razorpay_signature: response.razorpay_signature
            })).unwrap();
            zt.dismiss();
            zt.success("Payment successful!");
            dispatch(resetCreateBooking());
            navigate(`/booking/${bookingId}`, { replace: true });
          } catch (verifyError) {
            console.error("Verification failed:", verifyError);
            zt.error("Payment verification failed. Please contact support.");
          }
        },
        prefill: {
          name: user == null ? void 0 : user.name,
          email: user == null ? void 0 : user.email,
          contact: user == null ? void 0 : user.phone
        },
        theme: {
          color: "#ea580c"
        },
        modal: {
          ondismiss: function() {
            zt.error("Payment cancelled");
          }
        }
      };
      const rzp1 = new window.Razorpay(options);
      rzp1.open();
    } catch (error) {
      console.error("Booking process failed:", error);
      zt.error(error.message || "Something went wrong");
    }
  };
  if (!cab) {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => navigate(-1), className: "mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowLeft, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "No booking data found. Please go back and select a cab." })
    ] });
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full bg-gray-100 min-h-screen p-4 text-gray-900 pb-32", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3 mb-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowLeft, { size: 22, onClick: () => navigate(-1), className: "cursor-pointer" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-lg font-semibold", children: "Review booking" })
    ] }),
    reviewLoading && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center py-8", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { className: "w-8 h-8 text-orange-500 animate-spin" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "ml-3 text-gray-600", children: "Loading booking details..." })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white p-4 rounded-2xl shadow mb-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: tripType }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold text-[17px] leading-5 mt-1", children: [
        pickupLocation,
        " → ",
        dropLocation
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600 mt-1", children: [
        formatDate(pickupDate),
        ", ",
        pickupTime
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white p-4 rounded-2xl shadow mb-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "img",
          {
            src: (cab == null ? void 0 : cab.image) || ((_f = originalCab.images) == null ? void 0 : _f.frontView) || "https://go-assets.ibcdn.com/u/MMT/images/1732607472482-hatchback_Unknown_Unknown_EXTERIOR_Front_view_.jpeg",
            className: "w-28 h-16 object-cover rounded",
            alt: "car"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold text-[16px]", children: [
            cabName,
            " Or Similar"
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: cabType })
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-3 space-y-1 text-sm", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold", children: "Fuel Type:" }),
          " ",
          fuelType
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold", children: "Cancellation Policy:" }),
          " ",
          cancellationPolicy
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold", children: "Extra Kms Charges:" }),
          " Rs ",
          extraKmRate,
          "/Km after ",
          includedKm,
          " Kms"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold", children: "Luggage:" }),
          " 1 large bag or 3 small bags"
        ] })
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white p-4 rounded-2xl shadow mb-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold mb-3", children: "Special Request" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "flex items-center justify-between text-sm", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "input",
            {
              type: "checkbox",
              className: "w-4 h-4",
              checked: roofCarrier,
              onChange: (e2) => setRoofCarrier(e2.target.checked)
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Roof Carrier" })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
          "₹ ",
          roofCarrierPrice
        ] })
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white p-4 rounded-2xl shadow mb-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-2xl", children: "💰" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold", children: "Wallet Cash" })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "text-blue-600 font-semibold", children: "Apply ₹100" })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 mb-4", children: "Total Wallet Balance: ₹100" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-[17px] mb-3", children: "Offers" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500 mb-3", children: "Promo-code / offers / Bank offers" }),
      offers.map((offer) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "label",
        {
          className: "flex items-start justify-between py-3 border-b last:border-none",
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold", children: offer.code }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-600", children: offer.description })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "input",
              {
                type: "radio",
                name: "offer",
                className: "w-4 h-4 mt-1",
                checked: selectedOffer === offer.code,
                onChange: () => setSelectedOffer(offer.code)
              }
            )
          ]
        },
        offer.code
      ))
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white p-4 rounded-2xl shadow mb-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-[17px] mb-1", children: "Your Contact details" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500 mb-3", children: "Tickets will be shared to given contact" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-6 mb-4 text-sm font-medium", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "flex items-center gap-1", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "input",
            {
              type: "radio",
              name: "gender",
              checked: gender === "male",
              onChange: () => setGender("male")
            }
          ),
          "Male"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "flex items-center gap-1", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "input",
            {
              type: "radio",
              name: "gender",
              checked: gender === "female",
              onChange: () => setGender("female")
            }
          ),
          "Female"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "flex items-center gap-1", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "input",
            {
              type: "radio",
              name: "gender",
              checked: gender === "other",
              onChange: () => setGender("other")
            }
          ),
          "Other"
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: "Full Name" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-medium mb-3", children: (user == null ? void 0 : user.name) || "Guest User" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: "Email" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-medium mb-3", children: (user == null ? void 0 : user.email) || "Not provided" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: "Phone" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-medium", children: (user == null ? void 0 : user.phone) || (user == null ? void 0 : user.phoneNumber) || "Not provided" })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white p-4 rounded-2xl shadow mb-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-[17px]", children: "Your Pickup location" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500 mb-2", children: "Our driver will reach at this location" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 p-3 bg-gray-100 rounded-xl text-sm", children: pickupLocation })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white p-4 rounded-2xl shadow mb-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-3xl", children: "🏆" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-bold text-orange-500", children: "Loyalty Rewards" })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-[16px] mb-1", children: "Complete 3 more bookings* & unlock Premium Rewards" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500 mb-3", children: "Use additional benefits on your next bookings." }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-orange-50 p-3 rounded-xl", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-2 mb-2", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-orange-500 text-lg", children: "✔" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold", children: "Flat ₹50 cashback" }),
            " on airport & hourly rental cabs"
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-2", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-orange-500 text-lg", children: "✔" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold", children: "2% cashback*" }),
            " on outstation cabs"
          ] })
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "text-blue-600 text-sm font-semibold mt-3", children: "View all benefits >" })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white p-4 rounded-2xl shadow mb-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold text-[17px] mb-3", children: "Payment Options" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "label",
          {
            onClick: () => setPaymentType("partial"),
            className: `flex items-start gap-3 p-3 rounded-lg border cursor-pointer ${paymentType === "partial" ? "bg-orange-50 border-orange-200" : "border-gray-100"}`,
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-5 h-5 rounded-full border flex items-center justify-center mt-0.5 ${paymentType === "partial" ? "border-orange-500" : "border-gray-300"}`, children: paymentType === "partial" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2.5 h-2.5 rounded-full bg-orange-500" }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold text-gray-900", children: [
                  "Pay ₹",
                  advancePayment,
                  " Now"
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-500", children: [
                  "Remaining ₹",
                  totalFare + (roofCarrier ? roofCarrierPrice : 0) - advancePayment,
                  " to driver"
                ] })
              ] })
            ]
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "label",
          {
            onClick: () => setPaymentType("full"),
            className: `flex items-start gap-3 p-3 rounded-lg border cursor-pointer ${paymentType === "full" ? "bg-orange-50 border-orange-200" : "border-gray-100"}`,
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-5 h-5 rounded-full border flex items-center justify-center mt-0.5 ${paymentType === "full" ? "border-orange-500" : "border-gray-300"}`, children: paymentType === "full" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2.5 h-2.5 rounded-full bg-orange-500" }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold text-gray-900", children: [
                  "Pay ₹",
                  totalFare + (roofCarrier ? roofCarrierPrice : 0),
                  " Now"
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: "Full payment" })
              ] })
            ]
          }
        )
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "fixed bottom-0 left-0 w-full bg-white p-4 shadow-lg border-t", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-3", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xl font-semibold", children: [
            "₹ ",
            totalFare + (roofCarrier ? roofCarrierPrice : 0)
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: "Includes tolls & taxes" })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-right", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-blue-600 font-semibold cursor-pointer", onClick: () => {
          var _a2;
          return (_a2 = document.querySelector(".mb-24")) == null ? void 0 : _a2.scrollIntoView({ behavior: "smooth" });
        }, children: paymentType === "partial" ? "Partial Payment" : "Full Payment" }) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          onClick: handlePayAndConfirm,
          disabled: createLoading,
          className: `w-full bg-orange-500 text-white py-3 rounded-xl text-center text-[17px] font-semibold ${createLoading ? "opacity-70" : ""}`,
          children: createLoading ? /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex items-center justify-center gap-2", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { className: "w-5 h-5 animate-spin" }),
            "Processing..."
          ] }) : `Pay ₹${paymentType === "partial" ? advancePayment : totalFare + (roofCarrier ? roofCarrierPrice : 0)} & confirm now`
        }
      )
    ] })
  ] });
}
const FareBreakdown = ({
  fare,
  payment: payment2 = null,
  showPaymentInfo = true,
  className = "",
  title = null
}) => {
  const { t: t2 } = useTranslation();
  if (!fare) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `bg-gray-50 rounded-lg p-4 ${className}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500 text-center", children: t2("payment.noFareInfo") }) });
  }
  const subtotal = (fare.base || 0) + (fare.distance || 0) + (fare.stops || 0) + (fare.nightCharge || 0) + (fare.zoneExtraCharge || 0) + (fare.taxes || 0);
  const discount = fare.discount || 0;
  const total = fare.total || subtotal - discount;
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `bg-white rounded-lg shadow p-6 ${className}`, children: [
    title && /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-bold mb-4", children: title }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-700 font-medium", children: t2("payment.baseFare") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: t2("payment.minimumBookingCharge") })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold", children: [
          "₹",
          fare.base || 0
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-700 font-medium", children: t2("payment.distanceFare") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: t2("payment.perKilometerCharges") })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold", children: [
          "₹",
          fare.distance || 0
        ] })
      ] }),
      fare.stops > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-700 font-medium", children: t2("payment.stopsCharge") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: t2("payment.additionalStops") })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold", children: [
          "₹",
          fare.stops
        ] })
      ] }),
      fare.nightCharge > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-700 font-medium", children: t2("payment.nightCharge") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: t2("payment.lateNightSurcharge") })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold", children: [
          "₹",
          fare.nightCharge
        ] })
      ] }),
      fare.zoneExtraCharge > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-700 font-medium", children: t2("payment.zoneExtraCharge") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: t2("payment.additionalZoneCharges") })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold", children: [
          "₹",
          fare.zoneExtraCharge
        ] })
      ] }),
      fare.taxes > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-700 font-medium", children: t2("payment.gstTaxes") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: t2("payment.governmentTaxes") })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold", children: [
          "₹",
          fare.taxes
        ] })
      ] }),
      discount > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "border-gray-200" }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-600 font-medium", children: t2("payment.subtotal") }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold", children: [
            "₹",
            subtotal
          ] })
        ] })
      ] }),
      discount > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-green-600 font-medium", children: t2("payment.discountApplied") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-green-500", children: t2("payment.promotionalDiscount") })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-semibold text-green-600", children: [
          "-₹",
          discount
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "border-gray-300" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center bg-gray-50 -mx-2 px-2 py-3 rounded", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-lg font-bold text-gray-900", children: t2("payment.totalFare") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-600", children: t2("payment.finalAmountToPay") })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xl font-bold text-orange-600", children: [
          "₹",
          total
        ] })
      ] }),
      showPaymentInfo && payment2 && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "border-gray-200 mt-4" }),
        payment2.onlinePaid > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center text-green-600 font-medium", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-semibold", children: t2("payment.paidAmount") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-green-500", children: t2("payment.onlinePaymentReceived") })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-bold", children: [
            "₹",
            payment2.onlinePaid
          ] })
        ] }),
        total - (payment2.onlinePaid || 0) > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center text-orange-600 font-bold bg-orange-50 -mx-2 px-2 py-2 rounded", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-bold", children: t2("payment.pendingAmount") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-orange-500", children: t2("payment.toBePaidToDriver") })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-lg font-bold", children: [
            "₹",
            total - (payment2.onlinePaid || 0)
          ] })
        ] }),
        total - (payment2.onlinePaid || 0) === 0 && payment2.onlinePaid > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center text-green-600 font-bold bg-green-50 -mx-2 px-2 py-2 rounded", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-bold", children: t2("payment.paymentStatus") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-green-500", children: t2("payment.fullyPaidOnline") })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-bold", children: [
            "✓ ",
            t2("payment.paid")
          ] })
        ] })
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4 p-3 bg-blue-50 rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-blue-700", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("strong", { children: [
        t2("common.note"),
        ":"
      ] }),
      " ",
      t2("payment.fareCalculationNote")
    ] }) })
  ] });
};
const BookingDetails = () => {
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
  const { id } = useParams();
  const navigate = useNavigate();
  const dispatch = useDispatch();
  const { t: t2 } = useTranslation();
  const [activeTab, setActiveTab] = reactExports.useState("details");
  const {
    bookingDetails,
    detailsLoading,
    detailsError,
    timeline,
    timelineLoading,
    invoice,
    invoiceLoading
  } = useSelector((state) => state.booking);
  reactExports.useEffect(() => {
    if (id) {
      dispatch(getBookingById(id));
      dispatch(getBookingTimeline(id));
    }
    return () => {
      dispatch(resetBookingDetails());
      dispatch(resetTimeline());
      dispatch(resetInvoice());
    };
  }, [dispatch, id]);
  reactExports.useEffect(() => {
    if (activeTab === "invoice" && id && !invoice) {
      dispatch(getBookingInvoice(id));
    }
  }, [activeTab, id, invoice, dispatch]);
  const formatDate = (dateString) => {
    if (!dateString) return "";
    const date = new Date(dateString);
    return date.toLocaleDateString("en-IN", {
      day: "numeric",
      month: "short",
      year: "numeric",
      hour: "2-digit",
      minute: "2-digit"
    });
  };
  const getStatusColor = (status) => {
    switch (status) {
      case "completed":
        return "bg-green-100 text-green-700";
      case "cancelled":
        return "bg-red-100 text-red-700";
      case "inProgress":
        return "bg-blue-100 text-blue-700";
      case "assigned":
        return "bg-purple-100 text-purple-700";
      default:
        return "bg-yellow-100 text-yellow-700";
    }
  };
  if (detailsLoading) {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-center items-center h-96", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-600 text-lg", children: t2("common.loading") }) })
    ] });
  }
  if (detailsError) {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col justify-center items-center h-96", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-red-500 text-lg mb-4", children: detailsError }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            onClick: () => navigate("/my-trips"),
            className: "px-6 py-2 bg-orange-500 text-white rounded-md",
            children: t2("booking.backToMyTrips")
          }
        )
      ] })
    ] });
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen bg-gray-50 text-gray-900", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-[#fc6325] h-[120px] flex items-center justify-between px-4 md:px-[170px] mt-16", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-2xl font-semibold text-white", children: t2("booking.bookingDetails") }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-white text-sm mt-1", children: [
          t2("booking.orderId"),
          ": ",
          (bookingDetails == null ? void 0 : bookingDetails.orderId) || t2("common.notAvailable")
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `px-4 py-2 rounded-full font-semibold ${getStatusColor(bookingDetails == null ? void 0 : bookingDetails.status)}`, children: ((_a = bookingDetails == null ? void 0 : bookingDetails.status) == null ? void 0 : _a.toUpperCase()) || t2("common.notAvailable") })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-10 px-4 md:px-[170px] mt-6 border-b border-gray-200", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          onClick: () => setActiveTab("details"),
          className: `pb-3 font-medium ${activeTab === "details" ? "border-b-2 border-[#fc6325] text-black" : "text-gray-500"}`,
          children: t2("booking.tripDetails")
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          onClick: () => setActiveTab("timeline"),
          className: `pb-3 font-medium ${activeTab === "timeline" ? "border-b-2 border-[#fc6325] text-black" : "text-gray-500"}`,
          children: t2("booking.timeline")
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          onClick: () => setActiveTab("invoice"),
          className: `pb-3 font-medium ${activeTab === "invoice" ? "border-b-2 border-[#fc6325] text-black" : "text-gray-500"}`,
          children: t2("booking.invoice")
        }
      )
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-4 md:px-[170px] py-8", children: [
      activeTab === "details" && bookingDetails && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg shadow p-6", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-bold mb-4", children: t2("booking.tripInformation") }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: t2("booking.pickupLocation") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-medium", children: ((_b = bookingDetails.pickupLocation) == null ? void 0 : _b.address) || t2("common.notAvailable") })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: t2("booking.dropLocation") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-medium", children: ((_c = bookingDetails.dropLocation) == null ? void 0 : _c.address) || t2("common.notAvailable") })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-8", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: t2("booking.tripType") }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-medium capitalize", children: bookingDetails.tripType || t2("common.notAvailable") })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: t2("booking.distance") }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "font-medium", children: [
                  bookingDetails.distance || 0,
                  " ",
                  t2("common.km")
                ] })
              ] })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: t2("booking.scheduledTime") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-medium", children: formatDate(bookingDetails.scheduledTime) })
            ] })
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          FareBreakdown,
          {
            fare: bookingDetails.fare,
            payment: bookingDetails.payment,
            showPaymentInfo: true,
            title: t2("payment.fareBreakdown")
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg shadow p-6", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-bold mb-4", children: t2("booking.customerDetails") }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: t2("profile.name") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-medium", children: ((_d = bookingDetails.customer) == null ? void 0 : _d.fullName) || t2("common.notAvailable") })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: t2("profile.phone") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-medium", children: ((_e = bookingDetails.customer) == null ? void 0 : _e.phone) || t2("common.notAvailable") })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: t2("profile.email") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-medium", children: ((_f = bookingDetails.customer) == null ? void 0 : _f.email) || t2("common.notAvailable") })
            ] })
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg shadow p-6", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-bold mb-4", children: t2("payment.driverDetails") }),
          bookingDetails.driver ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: t2("profile.name") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-medium", children: ((_g = bookingDetails.driver) == null ? void 0 : _g.fullName) || t2("common.notAvailable") })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: t2("profile.phone") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "font-medium", children: ((_h = bookingDetails.driver) == null ? void 0 : _h.phone) || t2("common.notAvailable") })
            ] })
          ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500", children: t2("booking.driverNotAssigned") })
        ] })
      ] }),
      activeTab === "timeline" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg shadow p-6", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-bold mb-6", children: t2("booking.bookingTimeline") }),
        timelineLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500", children: t2("common.loading") }) : timeline && timeline.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-6", children: timeline.map((event, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-4 h-4 bg-orange-500 rounded-full" }),
            index2 < timeline.length - 1 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-0.5 h-16 bg-gray-300" })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold", children: event.title }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: event.description }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-400 mt-1", children: formatDate(event.timestamp) })
          ] })
        ] }, index2)) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500", children: t2("booking.noTimelineEvents") })
      ] }),
      activeTab === "invoice" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-lg shadow p-6", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-bold mb-6", children: t2("booking.invoice") }),
        invoiceLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500", children: t2("common.loading") }) : invoice ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-6", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-start", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-bold text-xl", children: invoice.invoiceNumber }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500", children: [
                t2("booking.date"),
                ": ",
                formatDate(invoice.createdAt)
              ] })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `px-3 py-1 rounded text-sm font-medium ${invoice.status === "paid" ? "bg-green-100 text-green-700" : "bg-yellow-100 text-yellow-700"}`, children: (_i = invoice.status) == null ? void 0 : _i.toUpperCase() })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("hr", {}),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-semibold mb-2", children: t2("booking.customer") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: ((_j = invoice.recipientDetails) == null ? void 0 : _j.name) || t2("common.notAvailable") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: ((_k = invoice.recipientDetails) == null ? void 0 : _k.email) || t2("common.notAvailable") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: ((_l = invoice.recipientDetails) == null ? void 0 : _l.phone) || t2("common.notAvailable") })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-semibold mb-2", children: t2("booking.tripDetails") }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
              t2("booking.pickup"),
              ": ",
              ((_m = invoice.tripDetails) == null ? void 0 : _m.pickupAddress) || t2("common.notAvailable")
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
              t2("booking.drop"),
              ": ",
              ((_n = invoice.tripDetails) == null ? void 0 : _n.dropAddress) || t2("common.notAvailable")
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500", children: [
              t2("booking.distance"),
              ": ",
              ((_o = invoice.tripDetails) == null ? void 0 : _o.distance) || 0,
              " ",
              t2("common.km"),
              " |",
              t2("booking.duration"),
              ": ",
              ((_p = invoice.tripDetails) == null ? void 0 : _p.duration) || 0,
              " ",
              t2("common.mins")
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            FareBreakdown,
            {
              fare: bookingDetails.fare,
              payment: bookingDetails.payment,
              showPaymentInfo: false,
              title: t2("payment.fareBreakdown"),
              className: "shadow-none border border-gray-200"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "w-full py-3 bg-orange-500 text-white rounded-lg font-semibold hover:bg-orange-600", children: t2("booking.downloadInvoicePDF") })
        ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500", children: t2("booking.invoiceNotAvailable") })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-6", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "button",
        {
          onClick: () => navigate("/my-trips"),
          className: "px-6 py-3 bg-gray-200 text-gray-700 rounded-lg font-medium hover:bg-gray-300",
          children: [
            "← ",
            t2("booking.backToMyTrips")
          ]
        }
      ) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Footer, {})
  ] });
};
const Register = () => {
  const dispatch = useDispatch();
  const navigate = useNavigate();
  const { t: t2 } = useTranslation();
  const { loading, error, registerSuccess, message } = useSelector(
    (state) => state.auth
  );
  const [formData, setFormData] = reactExports.useState({
    fullName: "",
    email: "",
    password: "",
    phone: "",
    userName: "",
    address: "",
    city: "",
    state: "",
    pincode: ""
  });
  const [profileImage, setProfileImage] = reactExports.useState(null);
  const handleChange = (e2) => {
    setFormData({ ...formData, [e2.target.name]: e2.target.value });
  };
  const handleImageChange = (e2) => {
    setProfileImage(e2.target.files[0]);
  };
  const handleSubmit = (e2) => {
    e2.preventDefault();
    const data = new FormData();
    data.append("fullName", formData.fullName);
    data.append("email", formData.email);
    data.append("password", formData.password);
    data.append("phone", formData.phone);
    data.append("userName", formData.userName);
    data.append("fullAddress[address]", formData.address);
    data.append("fullAddress[city]", formData.city);
    data.append("fullAddress[state]", formData.state);
    data.append("fullAddress[pincode]", formData.pincode);
    if (profileImage) {
      data.append("profileImage", profileImage);
    }
    dispatch(registerUser(data));
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen bg-gray-50 flex flex-col", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-grow flex items-center justify-center pt-24 pb-12 px-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-2xl w-full bg-white rounded-xl shadow-lg p-8", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-3xl font-bold text-center text-gray-800 mb-8", children: t2("auth.createAccount") }),
      error && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-6 text-sm", children: error }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t2("profile.name") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "input",
              {
                type: "text",
                name: "fullName",
                value: formData.fullName,
                onChange: handleChange,
                required: true,
                className: "w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-orange-500 outline-none text-gray-900",
                placeholder: t2("auth.enterName")
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t2("auth.userName") || "Username" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "input",
              {
                type: "text",
                name: "userName",
                value: formData.userName,
                onChange: handleChange,
                required: true,
                className: "w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-orange-500 outline-none text-gray-900",
                placeholder: "johndoe123"
              }
            )
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t2("auth.email") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "input",
              {
                type: "email",
                name: "email",
                value: formData.email,
                onChange: handleChange,
                required: true,
                className: "w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-orange-500 outline-none text-gray-900",
                placeholder: t2("auth.enterEmail")
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t2("auth.phone") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "input",
              {
                type: "tel",
                name: "phone",
                value: formData.phone,
                onChange: handleChange,
                required: true,
                className: "w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-orange-500 outline-none text-gray-900",
                placeholder: t2("auth.enterPhone")
              }
            )
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t2("auth.password") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "input",
            {
              type: "password",
              name: "password",
              value: formData.password,
              onChange: handleChange,
              required: true,
              className: "w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-orange-500 outline-none text-gray-900",
              placeholder: t2("auth.enterPassword")
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border-t pt-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-700 mb-4", children: t2("profile.address") }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-1 gap-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t2("profile.streetAddress") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "input",
                {
                  type: "text",
                  name: "address",
                  value: formData.address,
                  onChange: handleChange,
                  required: true,
                  className: "w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-orange-500 outline-none text-gray-900",
                  placeholder: "123 Main St"
                }
              )
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t2("profile.city") }),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "input",
                  {
                    type: "text",
                    name: "city",
                    value: formData.city,
                    onChange: handleChange,
                    required: true,
                    className: "w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-orange-500 outline-none text-gray-900",
                    placeholder: "Bhopal"
                  }
                )
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t2("profile.state") }),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "input",
                  {
                    type: "text",
                    name: "state",
                    value: formData.state,
                    onChange: handleChange,
                    required: true,
                    className: "w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-orange-500 outline-none text-gray-900",
                    placeholder: "MP"
                  }
                )
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t2("profile.pincode") }),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "input",
                  {
                    type: "text",
                    name: "pincode",
                    value: formData.pincode,
                    onChange: handleChange,
                    required: true,
                    className: "w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-orange-500 outline-none text-gray-900",
                    placeholder: "462001"
                  }
                )
              ] })
            ] })
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border-t pt-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t2("profile.profileImage") || "Profile Image" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center space-x-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            "input",
            {
              type: "file",
              accept: "image/*",
              onChange: handleImageChange,
              className: "block w-full text-sm text-gray-500\r\n                    file:mr-4 file:py-2 file:px-4\r\n                    file:rounded-full file:border-0\r\n                    file:text-sm file:font-semibold\r\n                    file:bg-orange-50 file:text-orange-700\r\n                    hover:file:bg-orange-100"
            }
          ) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            type: "submit",
            disabled: loading,
            className: `w-full py-3 rounded-lg font-bold text-white transition-colors text-lg
                ${loading ? "bg-gray-400 cursor-not-allowed" : "bg-orange-600 hover:bg-orange-700"}`,
            children: loading ? t2("common.creatingAccount") || "Creating Account..." : t2("auth.register")
          }
        )
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-6 text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-gray-600", children: [
        t2("auth.alreadyHaveAccount"),
        " ",
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-orange-600 font-semibold cursor-pointer", onClick: () => navigate("/"), children: t2("auth.login") })
      ] }) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Footer, {})
  ] });
};
const Support = () => {
  const navigate = useNavigate();
  const dispatch = useDispatch();
  const { isAuthenticated } = useSelector((state) => state.auth);
  const {
    categories,
    callbackReasons,
    timeSlots,
    orders,
    createLoading,
    createSuccess,
    createError,
    callbacksLoading,
    callbackSuccess,
    callbackError
  } = useSelector((state) => state.support);
  const [showTicketModal, setShowTicketModal] = reactExports.useState(false);
  const [showCallbackModal, setShowCallbackModal] = reactExports.useState(false);
  const [ticketForm, setTicketForm] = reactExports.useState({
    category: "",
    orderId: "",
    subject: "",
    text: "",
    attachments: []
  });
  const [callbackForm, setCallbackForm] = reactExports.useState({
    name: "",
    contact: "",
    orderId: "",
    reasonCategory: "",
    preferredSlot: {
      date: "",
      timeSlot: ""
    }
  });
  const [openFAQ, setOpenFAQ] = reactExports.useState(null);
  const faqs = [
    {
      question: "How Do I Cancel My Booking?",
      answer: "You can cancel your booking from the 'My Trips' section. Go to your booking details and click on 'Cancel Booking'. Cancellation charges may apply based on the time of cancellation."
    },
    {
      question: "How Do I Get A Refund For A Cancelled Ride?",
      answer: "Refunds are processed automatically within 5-7 business days to your original payment method. For wallet payments, refunds are instant."
    },
    {
      question: "I Left Something In The Cab. How Do I Retrieve It?",
      answer: "Please raise a support ticket with your booking details. Our team will contact the driver and help you retrieve your belongings."
    },
    {
      question: "How Do I Report A Safety Concern?",
      answer: "Your safety is our priority. Please raise a ticket under 'Safety Issue' category or call our 24/7 helpline immediately for urgent concerns."
    },
    {
      question: "Why Was I Charged More Than The Estimated Fare?",
      answer: "Final fare may vary due to route changes, waiting time, toll charges, or extra kilometers. You can view the fare breakdown in your trip details."
    },
    {
      question: "How Do I Update My Profile Information?",
      answer: "Go to Profile section from the menu. You can update your name, email, phone number and other details from there."
    }
  ];
  reactExports.useEffect(() => {
    if (isAuthenticated) {
      dispatch(getCategories());
      dispatch(getCallbackReasons());
      dispatch(getTimeSlots());
      dispatch(getMyOrders());
    }
  }, [dispatch, isAuthenticated]);
  reactExports.useEffect(() => {
    if (createSuccess) {
      zt.success("Ticket created successfully!");
      setShowTicketModal(false);
      setTicketForm({ category: "", orderId: "", subject: "", text: "", attachments: [] });
      dispatch(resetCreateState());
    }
    if (createError) {
      zt.error(createError);
      dispatch(resetCreateState());
    }
  }, [createSuccess, createError, dispatch]);
  reactExports.useEffect(() => {
    if (callbackSuccess) {
      zt.success("Callback request submitted successfully!");
      setShowCallbackModal(false);
      setCallbackForm({ name: "", contact: "", reasonCategory: "", preferredSlot: { date: "", timeSlot: "" } });
      dispatch(resetCallbackState());
    }
    if (callbackError) {
      zt.error(callbackError);
      dispatch(resetCallbackState());
    }
  }, [callbackSuccess, callbackError, dispatch]);
  const handleTicketSubmit = (e2) => {
    e2.preventDefault();
    if (!ticketForm.category || !ticketForm.subject || !ticketForm.text) {
      zt.error("Please fill all required fields");
      return;
    }
    dispatch(createTicket(ticketForm));
  };
  const handleCallbackSubmit = (e2) => {
    e2.preventDefault();
    if (!callbackForm.name || !callbackForm.contact || !callbackForm.reasonCategory || !callbackForm.preferredSlot.timeSlot || !callbackForm.orderId) {
      zt.error("Please fill all required fields");
      return;
    }
    const payload = { ...callbackForm };
    if (!payload.preferredSlot.date) {
      const { date, ...restSlot } = payload.preferredSlot;
      payload.preferredSlot = restSlot;
    }
    dispatch(requestCallback(payload));
  };
  const handleFileChange = (e2) => {
    const files = Array.from(e2.target.files);
    setTicketForm((prev) => ({ ...prev, attachments: [...prev.attachments, ...files] }));
  };
  const removeAttachment = (index2) => {
    setTicketForm((prev) => ({
      ...prev,
      attachments: prev.attachments.filter((_2, i2) => i2 !== index2)
    }));
  };
  const handleOpenTicketModal = () => {
    if (!isAuthenticated) {
      zt.error("Please login to raise a ticket");
      navigate("/register");
      return;
    }
    setShowTicketModal(true);
  };
  const handleOpenCallbackModal = () => {
    if (!isAuthenticated) {
      zt.error("Please login to request a callback");
      navigate("/register");
      return;
    }
    setShowCallbackModal(true);
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen bg-[#f0f5fa]", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "pt-20 pb-10", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-w-6xl mx-auto px-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => navigate(-1), className: "p-2 hover:bg-gray-200 rounded-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowLeft, { className: "w-5 h-5 text-gray-700" }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-8 h-8 bg-blue-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Headphones, { className: "w-4 h-4 text-blue-600" }) }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-lg font-semibold text-gray-900", children: "Help & Support" })
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            onClick: () => navigate("/my-tickets"),
            className: "px-4 py-2 bg-blue-600 text-white rounded-lg font-medium hover:bg-blue-700",
            children: "My Tickets"
          }
        )
      ] }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-4xl mx-auto px-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-white rounded-2xl shadow-sm p-8 mb-8", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "inline-flex items-center gap-2 px-4 py-2 bg-gray-100 rounded-full mb-6", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(Headphones, { className: "w-4 h-4 text-gray-600" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-gray-600", children: "24/7 Support Available" })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-3xl font-bold text-blue-600 mb-2", children: "How Can We Help You" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-3xl font-bold text-blue-600 mb-4", children: "Today ?" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500 mb-8 max-w-lg mx-auto", children: "We're Here To Assist You With Any Questions Or Concerns About Your Rides. Choose How You'd Like To Reach Us." }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-center gap-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "button",
              {
                onClick: handleOpenTicketModal,
                className: "flex items-center gap-2 px-6 py-3 bg-blue-600 text-white rounded-lg font-medium hover:bg-blue-700",
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(MessageSquare, { className: "w-5 h-5" }),
                  "Raise A Ticket"
                ]
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "button",
              {
                onClick: handleOpenCallbackModal,
                className: "flex items-center gap-2 px-6 py-3 bg-gray-800 text-white rounded-lg font-medium hover:bg-gray-900",
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(Phone, { className: "w-5 h-5" }),
                  "Request A Callback"
                ]
              }
            )
          ] })
        ] }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-2xl shadow-sm p-8", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-xl font-bold text-gray-900 text-center mb-2", children: "Frequently Asked Questions" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500 text-center mb-6", children: "Quick Answers To Common Questions" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-3", children: faqs.map((faq2, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border border-gray-200 rounded-lg", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "button",
              {
                onClick: () => setOpenFAQ(openFAQ === index2 ? null : index2),
                className: "w-full flex items-center justify-between p-4 text-left",
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium text-gray-900", children: faq2.question }),
                  openFAQ === index2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronUp, { className: "w-5 h-5 text-gray-500" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 text-gray-500" })
                ]
              }
            ),
            openFAQ === index2 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-4 pb-4 text-gray-600 text-sm", children: faq2.answer })
          ] }, index2)) })
        ] })
      ] })
    ] }),
    showTicketModal && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-2xl max-h-[90vh] overflow-y-auto", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between p-4 border-b", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: "Raise A Ticket" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowTicketModal(false), className: "p-1 hover:bg-gray-100 rounded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: handleTicketSubmit, className: "p-6 space-y-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [
              "Select Category ",
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500", children: "*" })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "select",
              {
                value: ticketForm.category,
                onChange: (e2) => setTicketForm((prev) => ({ ...prev, category: e2.target.value })),
                className: "w-full border border-gray-300 rounded-lg px-3 py-2.5 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-gray-900 bg-white",
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "Select" }),
                  categories.map((cat, idx) => {
                    const value = typeof cat === "object" ? cat.value || cat._id || cat.name : cat;
                    const label = typeof cat === "object" ? cat.label || cat.name || cat.value : cat;
                    return /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value, children: label }, idx);
                  })
                ]
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [
              "Select Order ",
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500", children: "*" })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "select",
              {
                value: ticketForm.orderId,
                onChange: (e2) => setTicketForm((prev) => ({ ...prev, orderId: e2.target.value })),
                className: "w-full border border-gray-300 rounded-lg px-3 py-2.5 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-gray-900 bg-white",
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "Select" }),
                  orders.map((order) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: order.orderId || order._id, children: order.orderId || order._id }, order._id))
                ]
              }
            )
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [
            "Subject ",
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500", children: "*" })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "input",
            {
              type: "text",
              value: ticketForm.subject,
              onChange: (e2) => setTicketForm((prev) => ({ ...prev, subject: e2.target.value })),
              placeholder: "Brief Description About The Problem",
              className: "w-full border border-gray-300 rounded-lg px-3 py-2.5 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-gray-900 bg-white"
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [
            "Describe Your Issue ",
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500", children: "*" })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "textarea",
            {
              value: ticketForm.text,
              onChange: (e2) => setTicketForm((prev) => ({ ...prev, text: e2.target.value })),
              placeholder: "Provide Detailed Information",
              rows: 4,
              className: "w-full border border-gray-300 rounded-lg px-3 py-2.5 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 resize-none text-gray-900 bg-white"
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between pt-2", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-gray-600 hover:text-gray-800", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(Paperclip, { className: "w-5 h-5" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm", children: "+ Add Attachments (Optional)" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "input",
              {
                type: "file",
                multiple: true,
                onChange: handleFileChange,
                className: "hidden",
                accept: "image/*,.pdf,.doc,.docx"
              }
            )
          ] }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              type: "submit",
              disabled: createLoading,
              className: "px-8 py-2.5 bg-blue-600 text-white rounded-lg font-medium hover:bg-blue-700 disabled:opacity-50",
              children: createLoading ? "Submitting..." : "Raise Ticket"
            }
          )
        ] }),
        ticketForm.attachments.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-wrap gap-2 mt-2", children: ticketForm.attachments.map((file, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1 bg-gray-100 px-2 py-1 rounded text-sm", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: file.name }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", onClick: () => removeAttachment(idx), children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-4 h-4 text-gray-500" }) })
        ] }, idx)) })
      ] })
    ] }) }),
    showCallbackModal && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl w-full max-w-2xl", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between p-4 border-b", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: "Request Callback" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setShowCallbackModal(false), className: "p-1 hover:bg-gray-100 rounded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-5 h-5" }) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: handleCallbackSubmit, className: "p-6 space-y-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [
              "Name ",
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500", children: "*" })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "input",
              {
                type: "text",
                value: callbackForm.name,
                onChange: (e2) => setCallbackForm((prev) => ({ ...prev, name: e2.target.value })),
                placeholder: "Enter Name",
                className: "w-full border border-gray-300 rounded-lg px-3 py-2.5 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-gray-900 bg-white"
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [
              "Phone Number ",
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500", children: "*" })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "input",
              {
                type: "tel",
                value: callbackForm.contact,
                onChange: (e2) => setCallbackForm((prev) => ({ ...prev, contact: e2.target.value })),
                placeholder: "Enter Number",
                className: "w-full border border-gray-300 rounded-lg px-3 py-2.5 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-gray-900 bg-white"
              }
            )
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [
            "Select Order ",
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500", children: "*" })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "select",
            {
              value: callbackForm.orderId,
              onChange: (e2) => setCallbackForm((prev) => ({ ...prev, orderId: e2.target.value })),
              className: "w-full border border-gray-300 rounded-lg px-3 py-2.5 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-gray-900 bg-white",
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "Select Order" }),
                orders.map((order) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: order.orderId || order._id, children: order.orderId || order._id }, order._id))
              ]
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [
              "Preferred Time ",
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500", children: "*" })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "select",
              {
                value: callbackForm.preferredSlot.timeSlot,
                onChange: (e2) => setCallbackForm((prev) => ({
                  ...prev,
                  preferredSlot: { ...prev.preferredSlot, timeSlot: e2.target.value }
                })),
                className: "w-full border border-gray-300 rounded-lg px-3 py-2.5 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-gray-900 bg-white",
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "Select Time Slot" }),
                  timeSlots.map((slot, idx) => {
                    const value = typeof slot === "object" ? slot.value || slot._id || slot.name : slot;
                    const label = typeof slot === "object" ? slot.label || slot.name || slot.value : slot;
                    return /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value, children: label }, idx);
                  })
                ]
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [
              "Reason For Callback ",
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500", children: "*" })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "select",
              {
                value: callbackForm.reasonCategory,
                onChange: (e2) => setCallbackForm((prev) => ({ ...prev, reasonCategory: e2.target.value })),
                className: "w-full border border-gray-300 rounded-lg px-3 py-2.5 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-gray-900 bg-white",
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "Select Reason" }),
                  callbackReasons.map((reason, idx) => {
                    const value = typeof reason === "object" ? reason.value || reason._id || reason.name : reason;
                    const label = typeof reason === "object" ? reason.label || reason.name || reason.value : reason;
                    return /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value, children: label }, idx);
                  })
                ]
              }
            )
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-center pt-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            type: "submit",
            disabled: callbacksLoading,
            className: "px-8 py-2.5 bg-blue-600 text-white rounded-lg font-medium hover:bg-blue-700 disabled:opacity-50",
            children: callbacksLoading ? "Submitting..." : "Request Callback"
          }
        ) })
      ] })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Footer, {})
  ] });
};
const MyTickets = () => {
  const navigate = useNavigate();
  const dispatch = useDispatch();
  const { isAuthenticated } = useSelector((state) => state.auth);
  const { tickets, ticketsLoading, ticketsError } = useSelector((state) => state.support);
  reactExports.useEffect(() => {
    if (isAuthenticated) {
      dispatch(getMyTickets());
    } else {
      navigate("/register");
    }
  }, [dispatch, isAuthenticated, navigate]);
  const getStatusColor = (status) => {
    switch (status == null ? void 0 : status.toLowerCase()) {
      case "open":
        return "bg-green-100 text-green-700 border-green-200";
      case "pending":
        return "bg-yellow-100 text-yellow-700 border-yellow-200";
      case "closed":
        return "bg-gray-100 text-gray-700 border-gray-200";
      default:
        return "bg-blue-100 text-blue-700 border-blue-200";
    }
  };
  const formatTimeAgo = (date) => {
    if (!date) return "";
    const now2 = /* @__PURE__ */ new Date();
    const past = new Date(date);
    const diffMs = now2 - past;
    const diffMins = Math.floor(diffMs / 6e4);
    const diffHours = Math.floor(diffMs / 36e5);
    const diffDays = Math.floor(diffMs / 864e5);
    if (diffMins < 60) return `${diffMins} mins ago`;
    if (diffHours < 24) return `${diffHours}hrs Ago`;
    return `${diffDays} days ago`;
  };
  const getLastMessage = (ticket) => {
    var _a, _b;
    if (ticket.messages && ticket.messages.length > 0) {
      const lastMsg = ticket.messages[ticket.messages.length - 1];
      return ((_a = lastMsg.text) == null ? void 0 : _a.substring(0, 80)) + (((_b = lastMsg.text) == null ? void 0 : _b.length) > 80 ? "..." : "");
    }
    return ticket.subject || "No messages yet";
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen bg-[#f0f5fa]", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pt-20 pb-10", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-4xl mx-auto px-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3 mb-6", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            onClick: () => navigate("/support"),
            className: "p-2 hover:bg-white rounded-full border border-gray-200 bg-white",
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowLeft, { className: "w-5 h-5 text-gray-700" })
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-lg font-semibold text-gray-900", children: "My Tickets" })
      ] }),
      ticketsLoading ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl p-8 text-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-spin rounded-full h-10 w-10 border-b-2 border-blue-600 mx-auto" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-4 text-gray-500", children: "Loading tickets..." })
      ] }) : ticketsError ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-white rounded-xl p-8 text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-red-500", children: ticketsError }) }) : tickets.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl p-8 text-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(MessageSquare, { className: "w-12 h-12 text-gray-300 mx-auto mb-4" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500 mb-4", children: "No tickets found" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            onClick: () => navigate("/support"),
            className: "px-6 py-2 bg-blue-600 text-white rounded-lg font-medium hover:bg-blue-700",
            children: "Raise A Ticket"
          }
        )
      ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-4", children: tickets.map((ticket) => {
        var _a, _b, _c, _d;
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            onClick: () => navigate(`/ticket/${ticket._id}`),
            className: "bg-white rounded-xl p-5 cursor-pointer hover:shadow-md transition-shadow",
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start justify-between mb-3", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold text-gray-900", children: ticket.ticketId || `TCK-${(_a = ticket._id) == null ? void 0 : _a.slice(-4).toUpperCase()}` }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500 mt-0.5", children: [
                    (_b = ticket.subject) == null ? void 0 : _b.substring(0, 30),
                    "..."
                  ] }),
                  ticket.orderId && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500", children: [
                    "Order: ",
                    ticket.orderId
                  ] })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `inline-block px-3 py-1 rounded-full text-xs font-medium border ${getStatusColor(ticket.status)}`, children: ((_c = ticket.status) == null ? void 0 : _c.charAt(0).toUpperCase()) + ((_d = ticket.status) == null ? void 0 : _d.slice(1)) || "Open" }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1 mt-2 text-gray-400 text-xs", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(Clock, { className: "w-3 h-3" }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: formatTimeAgo(ticket.updatedAt || ticket.createdAt) })
                  ] })
                ] })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-2 pt-3 border-t border-gray-100", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-6 h-6 bg-gray-100 rounded flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(MessageSquare, { className: "w-3 h-3 text-gray-500" }) }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: getLastMessage(ticket) })
              ] })
            ]
          },
          ticket._id
        );
      }) })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Footer, {})
  ] });
};
const TicketDetails = () => {
  var _a, _b, _c, _d, _e, _f;
  const navigate = useNavigate();
  const dispatch = useDispatch();
  const { id } = useParams();
  const messagesEndRef = reactExports.useRef(null);
  const { user, isAuthenticated } = useSelector((state) => state.auth);
  const { currentTicket, ticketLoading, ticketError, messageLoading } = useSelector((state) => state.support);
  const [newMessage, setNewMessage] = reactExports.useState("");
  const [attachments, setAttachments] = reactExports.useState([]);
  reactExports.useEffect(() => {
    if (!isAuthenticated) {
      navigate("/register");
      return;
    }
    if (id) {
      dispatch(getTicketDetails(id));
    }
    return () => {
      dispatch(clearCurrentTicket());
    };
  }, [dispatch, id, isAuthenticated, navigate]);
  reactExports.useEffect(() => {
    scrollToBottom();
  }, [currentTicket == null ? void 0 : currentTicket.messages]);
  const scrollToBottom = () => {
    var _a2;
    (_a2 = messagesEndRef.current) == null ? void 0 : _a2.scrollIntoView({ behavior: "smooth" });
  };
  const handleSendMessage = async (e2) => {
    e2.preventDefault();
    if (!newMessage.trim() && attachments.length === 0) {
      zt.error("Please enter a message");
      return;
    }
    const result = await dispatch(addMessage({
      ticketId: id,
      text: newMessage,
      attachments
    }));
    if (!result.error) {
      setNewMessage("");
      setAttachments([]);
    }
  };
  const handleFileChange = (e2) => {
    const files = Array.from(e2.target.files);
    setAttachments((prev) => [...prev, ...files]);
  };
  const removeAttachment = (index2) => {
    setAttachments((prev) => prev.filter((_2, i2) => i2 !== index2));
  };
  const formatDateTime = (date) => {
    if (!date) return "";
    const d2 = new Date(date);
    return d2.toLocaleDateString("en-IN", {
      day: "2-digit",
      month: "short",
      hour: "2-digit",
      minute: "2-digit",
      hour12: true
    });
  };
  const getStatusColor = (status) => {
    switch (status == null ? void 0 : status.toLowerCase()) {
      case "open":
        return "bg-green-100 text-green-700 border-green-200";
      case "pending":
        return "bg-yellow-100 text-yellow-700 border-yellow-200";
      case "closed":
        return "bg-gray-100 text-gray-700 border-gray-200";
      default:
        return "bg-blue-100 text-blue-700 border-blue-200";
    }
  };
  const isOwnMessage = (message) => {
    var _a2;
    return ((_a2 = message.sender) == null ? void 0 : _a2._id) === (user == null ? void 0 : user._id) || message.senderType === "user";
  };
  const getInitials = (name) => {
    return name.split(" ").map((n2) => n2[0]).join("").toUpperCase().slice(0, 2);
  };
  if (ticketLoading) {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen bg-[#f0f5fa]", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pt-20 flex items-center justify-center h-[80vh]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-spin rounded-full h-10 w-10 border-b-2 border-blue-600 mx-auto" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-4 text-gray-500", children: "Loading ticket..." })
      ] }) })
    ] });
  }
  if (ticketError) {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen bg-[#f0f5fa]", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pt-20 flex items-center justify-center h-[80vh]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-red-500 mb-4", children: ticketError }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            onClick: () => navigate("/my-tickets"),
            className: "px-6 py-2 bg-blue-600 text-white rounded-lg",
            children: "Back to Tickets"
          }
        )
      ] }) })
    ] });
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen bg-[#f0f5fa] flex flex-col", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "pt-20 flex-1 flex flex-col max-w-4xl mx-auto w-full px-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3 py-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            onClick: () => navigate("/my-tickets"),
            className: "p-2 hover:bg-white rounded-full",
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowLeft, { className: "w-5 h-5 text-gray-700" })
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-lg font-semibold text-gray-900", children: "Back To My Tickets" })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-white rounded-xl p-5 mb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start justify-between", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "font-semibold text-gray-900 text-lg", children: (currentTicket == null ? void 0 : currentTicket.ticketId) || `TCK-${(_a = currentTicket == null ? void 0 : currentTicket._id) == null ? void 0 : _a.slice(-4).toUpperCase()}` }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500 mt-1", children: currentTicket == null ? void 0 : currentTicket.subject }),
          (((_b = currentTicket == null ? void 0 : currentTicket.booking) == null ? void 0 : _b.orderId) || (currentTicket == null ? void 0 : currentTicket.orderId)) && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500", children: [
            "Order: ",
            ((_c = currentTicket.booking) == null ? void 0 : _c.orderId) || currentTicket.orderId
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-right", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `inline-block px-3 py-1 rounded-full text-xs font-medium border ${getStatusColor(currentTicket == null ? void 0 : currentTicket.status)}`, children: ((_d = currentTicket == null ? void 0 : currentTicket.status) == null ? void 0 : _d.charAt(0).toUpperCase()) + ((_e = currentTicket == null ? void 0 : currentTicket.status) == null ? void 0 : _e.slice(1)) || "Open" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1 mt-2 text-gray-400 text-xs justify-end", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(Clock, { className: "w-3 h-3" }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
              "Created: ",
              formatDateTime(currentTicket == null ? void 0 : currentTicket.createdAt)
            ] })
          ] })
        ] })
      ] }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white rounded-xl flex-1 flex flex-col min-h-[400px] max-h-[500px]", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-y-auto p-5 space-y-6", children: [
          (_f = currentTicket == null ? void 0 : currentTicket.messages) == null ? void 0 : _f.map((message, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: `flex ${isOwnMessage(message) ? "justify-end" : "justify-start"}`,
              children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex gap-3 max-w-[70%] ${isOwnMessage(message) ? "flex-row-reverse" : ""}`, children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0 text-sm font-medium ${isOwnMessage(message) ? "bg-blue-100 text-blue-600" : "bg-gray-100 text-gray-600"}`, children: isOwnMessage(message) ? getInitials((user == null ? void 0 : user.fullName) || "You") : "GC" }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: isOwnMessage(message) ? "text-right" : "", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500 mb-1", children: isOwnMessage(message) ? "You" : "GoCabs Support" }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `rounded-lg px-4 py-3 ${isOwnMessage(message) ? "bg-blue-500 text-white" : "bg-gray-100 text-gray-800"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm", children: message.text }) }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-400 mt-1", children: formatDateTime(message.createdAt) }),
                  message.attachments && message.attachments.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-wrap gap-2 mt-2", children: message.attachments.map((att, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
                    "a",
                    {
                      href: att.url || att,
                      target: "_blank",
                      rel: "noopener noreferrer",
                      className: "text-xs text-blue-500 underline",
                      children: [
                        "Attachment ",
                        idx + 1
                      ]
                    },
                    idx
                  )) })
                ] })
              ] })
            },
            message._id || index2
          )),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: messagesEndRef })
        ] }),
        (currentTicket == null ? void 0 : currentTicket.status) !== "closed" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border-t p-4", children: [
          attachments.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-wrap gap-2 mb-2", children: attachments.map((file, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1 bg-gray-100 px-2 py-1 rounded text-sm", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs", children: file.name }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", onClick: () => removeAttachment(idx), children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-3 h-3 text-gray-500" }) })
          ] }, idx)) }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: handleSendMessage, className: "flex items-center gap-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "input",
              {
                type: "text",
                value: newMessage,
                onChange: (e2) => setNewMessage(e2.target.value),
                placeholder: "Type Your Message..",
                className: "flex-1 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-gray-900 bg-white"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "p-2.5 border border-gray-200 rounded-lg cursor-pointer hover:bg-gray-50", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(Paperclip, { className: "w-5 h-5 text-gray-500" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "input",
                {
                  type: "file",
                  multiple: true,
                  onChange: handleFileChange,
                  className: "hidden",
                  accept: "image/*,.pdf,.doc,.docx"
                }
              )
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "button",
              {
                type: "submit",
                disabled: messageLoading,
                className: "flex items-center gap-2 px-6 py-2.5 bg-blue-600 text-white rounded-lg font-medium hover:bg-blue-700 disabled:opacity-50",
                children: [
                  messageLoading ? "Sending..." : "Send",
                  /* @__PURE__ */ jsxRuntimeExports.jsx(Send, { className: "w-4 h-4" })
                ]
              }
            )
          ] })
        ] }),
        (currentTicket == null ? void 0 : currentTicket.status) === "closed" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border-t p-4 text-center text-gray-500 text-sm", children: "This ticket has been closed. Please create a new ticket if you need further assistance." })
      ] })
    ] })
  ] });
};
const FAQPage = () => {
  const dispatch = useDispatch();
  const [searchQuery, setSearchQuery] = reactExports.useState("");
  const [selectedCategory, setSelectedCategory] = reactExports.useState("all");
  const [expandedFAQs, setExpandedFAQs] = reactExports.useState(/* @__PURE__ */ new Set());
  const [feedbackGiven, setFeedbackGiven] = reactExports.useState(/* @__PURE__ */ new Set());
  const {
    groupedFAQs,
    groupedLoading,
    categories,
    searchResults,
    searchLoading,
    feedbackLoading
  } = useSelector((state) => state.faq);
  reactExports.useEffect(() => {
    dispatch(getFAQsByCategory());
    dispatch(getFAQCategories());
  }, [dispatch]);
  const handleSearch = (e2) => {
    e2.preventDefault();
    if (searchQuery.trim()) {
      dispatch(searchFAQs({ query: searchQuery, limit: 20 }));
    }
  };
  const handleClearSearch = () => {
    setSearchQuery("");
    dispatch(resetSearchResults());
  };
  const toggleFAQ = (faqId) => {
    const newExpanded = new Set(expandedFAQs);
    if (newExpanded.has(faqId)) {
      newExpanded.delete(faqId);
    } else {
      newExpanded.add(faqId);
    }
    setExpandedFAQs(newExpanded);
  };
  const handleFeedback = (faqId, helpful) => {
    if (!feedbackGiven.has(faqId)) {
      dispatch(markFAQHelpful({ id: faqId, helpful }));
      setFeedbackGiven(new Set(feedbackGiven).add(faqId));
    }
  };
  const categoryLabels = {
    booking: "Booking",
    payment: "Payment",
    cancellation: "Cancellation",
    pricing: "Pricing",
    vehicles: "Vehicles",
    general: "General",
    support: "Support"
  };
  const categoryIcons = {
    booking: "📅",
    payment: "💳",
    cancellation: "🔄",
    pricing: "💰",
    vehicles: "🚗",
    general: "❓",
    support: "🎧"
  };
  const getFilteredFAQs = () => {
    if (searchResults.length > 0) {
      return { search: searchResults };
    }
    if (selectedCategory === "all") {
      return groupedFAQs;
    }
    return { [selectedCategory]: groupedFAQs[selectedCategory] || [] };
  };
  const filteredFAQs = getFilteredFAQs();
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "faq-page", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "faq-hero", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "faq-hero-content", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { children: "Frequently Asked Questions" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Find answers to common questions about GoCabs" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: handleSearch, className: "faq-search-form", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "search-input-wrapper", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "search-icon", children: "🔍" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "input",
            {
              type: "text",
              placeholder: "Search for answers...",
              value: searchQuery,
              onChange: (e2) => setSearchQuery(e2.target.value),
              className: "search-input"
            }
          ),
          searchQuery && /* @__PURE__ */ jsxRuntimeExports.jsx(
            "button",
            {
              type: "button",
              onClick: handleClearSearch,
              className: "clear-search-btn",
              children: "×"
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "submit", className: "search-btn", disabled: searchLoading, children: searchLoading ? "Searching..." : "Search" })
      ] })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "faq-container", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "faq-sidebar", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { children: "Categories" }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "category-list", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "button",
            {
              className: `category-btn ${selectedCategory === "all" ? "active" : ""}`,
              onClick: () => {
                setSelectedCategory("all");
                handleClearSearch();
              },
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "category-icon", children: "📋" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "category-label", children: "All FAQs" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "category-count", children: Object.values(groupedFAQs).reduce((sum, faqs) => sum + faqs.length, 0) })
              ]
            }
          ),
          categories.map((cat) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "button",
            {
              className: `category-btn ${selectedCategory === cat.category ? "active" : ""}`,
              onClick: () => {
                setSelectedCategory(cat.category);
                handleClearSearch();
              },
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "category-icon", children: categoryIcons[cat.category] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "category-label", children: categoryLabels[cat.category] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "category-count", children: cat.count })
              ]
            },
            cat.category
          ))
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "faq-content", children: groupedLoading ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "faq-loading", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "spinner" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Loading FAQs..." })
      ] }) : Object.keys(filteredFAQs).length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "faq-empty", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "No FAQs found" }) }) : Object.entries(filteredFAQs).map(([category, faqs]) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "faq-category-section", children: [
        searchResults.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "category-title", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "category-icon-large", children: categoryIcons[category] || "📋" }),
          categoryLabels[category] || category
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "faq-list", children: faqs.map((faq2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: `faq-item ${expandedFAQs.has(faq2._id) ? "expanded" : ""}`,
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs(
                "button",
                {
                  className: "faq-question",
                  onClick: () => toggleFAQ(faq2._id),
                  children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "question-text", children: faq2.question }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "expand-icon", children: expandedFAQs.has(faq2._id) ? "−" : "+" })
                  ]
                }
              ),
              expandedFAQs.has(faq2._id) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "faq-answer", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: faq2.answer }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "faq-feedback", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "feedback-label", children: "Was this helpful?" }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "feedback-buttons", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "button",
                      {
                        onClick: () => handleFeedback(faq2._id, true),
                        disabled: feedbackGiven.has(faq2._id) || feedbackLoading,
                        className: "feedback-btn helpful",
                        children: "👍 Yes"
                      }
                    ),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "button",
                      {
                        onClick: () => handleFeedback(faq2._id, false),
                        disabled: feedbackGiven.has(faq2._id) || feedbackLoading,
                        className: "feedback-btn not-helpful",
                        children: "👎 No"
                      }
                    )
                  ] }),
                  feedbackGiven.has(faq2._id) && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "feedback-thanks", children: "Thank you for your feedback!" })
                ] })
              ] })
            ]
          },
          faq2._id
        )) })
      ] }, category)) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "faq-support-section", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { children: "Still have questions?" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Can't find the answer you're looking for? Our support team is here to help." }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "contact-support-btn", children: "Contact Support" })
    ] })
  ] });
};
const Home = () => {
  const navigate = useNavigate();
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen bg-gray-50", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(Navbar, {}),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "pt-16", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "hidden md:block", children: /* @__PURE__ */ jsxRuntimeExports.jsx(HeroSection, { onSearch: (searchParams) => navigate("/results", { state: { searchParams } }) }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "block md:hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx(HeroSectionMobile, {}) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "hidden md:block", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CabFaq, {}) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "block md:hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx(FAQMobile, {}) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "hidden md:block", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CabRoutes, {}) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "block md:hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx(RoutesMobile, {}) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "hidden md:block", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Footer, {}) })
  ] });
};
const isSSR = typeof window === "undefined";
const ProfileCompletionChecker = () => {
  const { user, isAuthenticated } = useSelector((state) => state.auth);
  const location = useLocation();
  const navigate = useNavigate();
  reactExports.useEffect(() => {
    var _a, _b;
    if (isSSR) return;
    if (isAuthenticated && user) {
      const isEmailPlaceholder = (_a = user.email) == null ? void 0 : _a.startsWith("user_");
      const isAddressMissing = !((_b = user.fullAddress) == null ? void 0 : _b.address);
      const restrictedPaths = ["/profile", "/logout", "/support"];
      if ((isEmailPlaceholder || isAddressMissing) && !restrictedPaths.includes(location.pathname)) {
        zt("Please complete your profile details", { icon: "👤", id: "profile-prompt" });
        navigate("/profile");
      }
    }
  }, [isAuthenticated, user, location.pathname, navigate]);
  return null;
};
const AppRoutes = () => {
  var _a;
  const dispatch = useDispatch();
  const { settings } = useSelector((state) => state.setting || {});
  const { socialConfig } = useSelector((state) => state.auth);
  const { isFetched } = useSelector((state) => state.language);
  const { footer: footer2, loading: cmsLoading } = useSelector((state) => state.cms || {});
  reactExports.useEffect(() => {
    if (isSSR) return;
    if (!settings || Object.keys(settings).length === 0) {
      dispatch(fetchSettings());
    }
    if (!socialConfig || Object.keys(socialConfig).length === 0) {
      dispatch(getSocialConfig());
    }
    if (!isFetched) {
      dispatch(fetchGlobalLanguage());
    }
    if (!footer2 || footer2.length === 0) {
      dispatch(getFooter());
    }
  }, [dispatch]);
  reactExports.useEffect(() => {
    var _a2, _b;
    if (isSSR) return;
    if (settings) {
      if ((_a2 = settings.general) == null ? void 0 : _a2.storeName) {
        document.title = settings.general.storeName;
      }
      if ((_b = settings.design) == null ? void 0 : _b.favicon) {
        let link = document.querySelector("link[rel~='icon']");
        if (!link) {
          link = document.createElement("link");
          link.rel = "icon";
          document.getElementsByTagName("head")[0].appendChild(link);
        }
        link.href = settings.design.favicon;
      }
    }
  }, [settings]);
  const googleClientId = ((_a = socialConfig == null ? void 0 : socialConfig.google) == null ? void 0 : _a.clientId) || "";
  const [showLoader, setShowLoader] = React$4.useState(false);
  reactExports.useEffect(() => {
    if (!isFetched) {
      setShowLoader(true);
    } else {
      setShowLoader(false);
    }
  }, [isFetched]);
  if (!isSSR && showLoader) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center min-h-screen bg-gray-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center gap-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-green-600" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500 font-medium", children: "Loading..." })
    ] }) });
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(GoogleOAuthProvider, { clientId: googleClientId, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(ProfileCompletionChecker, {}),
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      Fe,
      {
        position: "top-center",
        reverseOrder: false,
        gutter: 8,
        containerClassName: "",
        containerStyle: {},
        toastOptions: {
          duration: 4e3,
          style: { background: "#363636", color: "#fff" },
          success: { duration: 3e3, style: { background: "#10B981", color: "#fff" } },
          error: { duration: 5e3, style: { background: "#EF4444", color: "#fff" } },
          loading: { style: { background: "#3B82F6", color: "#fff" } }
        }
      }
    ),
    /* @__PURE__ */ jsxRuntimeExports.jsxs(Routes, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/", element: /* @__PURE__ */ jsxRuntimeExports.jsx(Home, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/airport", element: /* @__PURE__ */ jsxRuntimeExports.jsx(Airport, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/airport/:slug", element: /* @__PURE__ */ jsxRuntimeExports.jsx(Airport, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/top", element: /* @__PURE__ */ jsxRuntimeExports.jsx(Top, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/top/:slug", element: /* @__PURE__ */ jsxRuntimeExports.jsx(Top, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/cities", element: /* @__PURE__ */ jsxRuntimeExports.jsx(Cities, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/cities/:slug", element: /* @__PURE__ */ jsxRuntimeExports.jsx(Cities, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/city-taxi/:slug", element: /* @__PURE__ */ jsxRuntimeExports.jsx(CityTaxiService, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/top-mobile", element: /* @__PURE__ */ jsxRuntimeExports.jsx(TopMobile, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/cities-mobile", element: /* @__PURE__ */ jsxRuntimeExports.jsx(CitiesMobile, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/airport-mobile", element: /* @__PURE__ */ jsxRuntimeExports.jsx(AirportMobile, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/details-mobile/:id", element: /* @__PURE__ */ jsxRuntimeExports.jsx(ResultDetailMobile, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/search-details-mobile", element: /* @__PURE__ */ jsxRuntimeExports.jsx(SearchDetailMobile, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/results", element: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "hidden md:block", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CabResults, {}) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "block md:hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResultsPageMobile, {}) })
      ] }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/details/:id", element: /* @__PURE__ */ jsxRuntimeExports.jsx(DetailPage, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/payment/:id", element: /* @__PURE__ */ jsxRuntimeExports.jsx(PaymentPage, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/my-trips", element: /* @__PURE__ */ jsxRuntimeExports.jsx(MyTrips, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/booking/:id", element: /* @__PURE__ */ jsxRuntimeExports.jsx(BookingDetails, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/profile", element: /* @__PURE__ */ jsxRuntimeExports.jsx(Profile, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/register", element: /* @__PURE__ */ jsxRuntimeExports.jsx(Register, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/results-mobile", element: /* @__PURE__ */ jsxRuntimeExports.jsx(ResultsPageMobile, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/support", element: /* @__PURE__ */ jsxRuntimeExports.jsx(Support, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/my-tickets", element: /* @__PURE__ */ jsxRuntimeExports.jsx(MyTickets, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/ticket/:id", element: /* @__PURE__ */ jsxRuntimeExports.jsx(TicketDetails, {}) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/faqs", element: /* @__PURE__ */ jsxRuntimeExports.jsx(FAQPage, {}) })
    ] })
  ] });
};
const App = () => {
  return /* @__PURE__ */ jsxRuntimeExports.jsx(AppRoutes, {});
};
const preloadedState = window.__PRELOADED_STATE__;
delete window.__PRELOADED_STATE__;
const store = makeStore(preloadedState);
const root = document.getElementById("root");
const loadingOverlay = document.getElementById("loading-overlay");
ReactDOM.hydrateRoot(
  root,
  /* @__PURE__ */ jsxRuntimeExports.jsx(Provider_default, { store, children: /* @__PURE__ */ jsxRuntimeExports.jsx(BrowserRouter, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(App, {}) }) })
);
setTimeout(() => {
  if (loadingOverlay) {
    loadingOverlay.classList.add("hidden");
  }
  if (root) {
    root.classList.add("hydrated");
  }
}, 100);
