"use strict";
var dash_spreadsheet_v1 = (() => {
  var __create = Object.create;
  var __defProp = Object.defineProperty;
  var __defProps = Object.defineProperties;
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
  var __getOwnPropNames = Object.getOwnPropertyNames;
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
  var __getProtoOf = Object.getPrototypeOf;
  var __hasOwnProp = Object.prototype.hasOwnProperty;
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
  var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
  var __spreadValues = (a, b) => {
    for (var prop in b || (b = {}))
      if (__hasOwnProp.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    if (__getOwnPropSymbols)
      for (var prop of __getOwnPropSymbols(b)) {
        if (__propIsEnum.call(b, prop))
          __defNormalProp(a, prop, b[prop]);
      }
    return a;
  };
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
  var __esm = (fn, res) => function __init() {
    return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
  };
  var __commonJS = (cb, mod) => function __require() {
    return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  };
  var __export = (target, all) => {
    for (var name in all)
      __defProp(target, name, { get: all[name], enumerable: true });
  };
  var __copyProps = (to, from, except, desc) => {
    if (from && typeof from === "object" || typeof from === "function") {
      for (let key2 of __getOwnPropNames(from))
        if (!__hasOwnProp.call(to, key2) && key2 !== except)
          __defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable });
    }
    return to;
  };
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
    isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
    mod
  ));
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  var __async = (__this, __arguments, generator) => {
    return new Promise((resolve, reject) => {
      var fulfilled = (value) => {
        try {
          step(generator.next(value));
        } catch (e) {
          reject(e);
        }
      };
      var rejected = (value) => {
        try {
          step(generator.throw(value));
        } catch (e) {
          reject(e);
        }
      };
      var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
      step((generator = generator.apply(__this, __arguments)).next());
    });
  };

  // use-react-external:react
  var react_exports = {};
  __export(react_exports, {
    Children: () => Children,
    Component: () => Component,
    Fragment: () => Fragment,
    Profiler: () => Profiler,
    PureComponent: () => PureComponent,
    StrictMode: () => StrictMode,
    Suspense: () => Suspense,
    __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: () => __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
    act: () => act,
    cloneElement: () => cloneElement,
    createContext: () => createContext,
    createElement: () => createElement,
    createFactory: () => createFactory,
    createRef: () => createRef,
    default: () => react_default,
    forwardRef: () => forwardRef,
    isValidElement: () => isValidElement,
    lazy: () => lazy,
    memo: () => memo,
    startTransition: () => startTransition,
    unstable_act: () => unstable_act,
    useCallback: () => useCallback,
    useContext: () => useContext,
    useDebugValue: () => useDebugValue,
    useDeferredValue: () => useDeferredValue,
    useEffect: () => useEffect,
    useId: () => useId,
    useImperativeHandle: () => useImperativeHandle,
    useInsertionEffect: () => useInsertionEffect,
    useLayoutEffect: () => useLayoutEffect,
    useMemo: () => useMemo,
    useReducer: () => useReducer,
    useRef: () => useRef,
    useState: () => useState,
    useSyncExternalStore: () => useSyncExternalStore,
    useTransition: () => useTransition,
    version: () => version
  });
  var react_default, Children, Component, Fragment, Profiler, PureComponent, StrictMode, Suspense, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, act, cloneElement, createContext, createElement, createFactory, createRef, forwardRef, isValidElement, lazy, memo, startTransition, unstable_act, useCallback, useContext, useDebugValue, useDeferredValue, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore, useTransition, version;
  var init_react = __esm({
    "use-react-external:react"() {
      react_default = React;
      Children = React.Children;
      Component = React.Component;
      Fragment = React.Fragment;
      Profiler = React.Profiler;
      PureComponent = React.PureComponent;
      StrictMode = React.StrictMode;
      Suspense = React.Suspense;
      __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
      act = React.act;
      cloneElement = React.cloneElement;
      createContext = React.createContext;
      createElement = React.createElement;
      createFactory = React.createFactory;
      createRef = React.createRef;
      forwardRef = React.forwardRef;
      isValidElement = React.isValidElement;
      lazy = React.lazy;
      memo = React.memo;
      startTransition = React.startTransition;
      unstable_act = React.unstable_act;
      useCallback = React.useCallback;
      useContext = React.useContext;
      useDebugValue = React.useDebugValue;
      useDeferredValue = React.useDeferredValue;
      useEffect = React.useEffect;
      useId = React.useId;
      useImperativeHandle = React.useImperativeHandle;
      useInsertionEffect = React.useInsertionEffect;
      useLayoutEffect = React.useLayoutEffect;
      useMemo = React.useMemo;
      useReducer = React.useReducer;
      useRef = React.useRef;
      useState = React.useState;
      useSyncExternalStore = React.useSyncExternalStore;
      useTransition = React.useTransition;
      version = React.version;
    }
  });

  // node_modules/scheduler/cjs/scheduler.development.js
  var require_scheduler_development = __commonJS({
    "node_modules/scheduler/cjs/scheduler.development.js"(exports) {
      "use strict";
      if (true) {
        (function() {
          "use strict";
          if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
            __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
          }
          var enableSchedulerDebugging = false;
          var enableProfiling = false;
          var frameYieldMs = 5;
          function push(heap, node) {
            var index = heap.length;
            heap.push(node);
            siftUp(heap, node, index);
          }
          function peek(heap) {
            return heap.length === 0 ? null : heap[0];
          }
          function pop(heap) {
            if (heap.length === 0) {
              return null;
            }
            var first = heap[0];
            var last = heap.pop();
            if (last !== first) {
              heap[0] = last;
              siftDown(heap, last, 0);
            }
            return first;
          }
          function siftUp(heap, node, i) {
            var index = i;
            while (index > 0) {
              var parentIndex = index - 1 >>> 1;
              var parent = heap[parentIndex];
              if (compare(parent, node) > 0) {
                heap[parentIndex] = node;
                heap[index] = parent;
                index = parentIndex;
              } else {
                return;
              }
            }
          }
          function siftDown(heap, node, i) {
            var index = i;
            var length = heap.length;
            var halfLength = length >>> 1;
            while (index < halfLength) {
              var leftIndex = (index + 1) * 2 - 1;
              var left = heap[leftIndex];
              var rightIndex = leftIndex + 1;
              var right = heap[rightIndex];
              if (compare(left, node) < 0) {
                if (rightIndex < length && compare(right, left) < 0) {
                  heap[index] = right;
                  heap[rightIndex] = node;
                  index = rightIndex;
                } else {
                  heap[index] = left;
                  heap[leftIndex] = node;
                  index = leftIndex;
                }
              } else if (rightIndex < length && compare(right, node) < 0) {
                heap[index] = right;
                heap[rightIndex] = node;
                index = rightIndex;
              } else {
                return;
              }
            }
          }
          function compare(a, b) {
            var diff = a.sortIndex - b.sortIndex;
            return diff !== 0 ? diff : a.id - b.id;
          }
          var ImmediatePriority = 1;
          var UserBlockingPriority = 2;
          var NormalPriority = 3;
          var LowPriority = 4;
          var IdlePriority = 5;
          function markTaskErrored(task, ms2) {
          }
          var hasPerformanceNow = typeof performance === "object" && typeof performance.now === "function";
          if (hasPerformanceNow) {
            var localPerformance = performance;
            exports.unstable_now = function() {
              return localPerformance.now();
            };
          } else {
            var localDate = Date;
            var initialTime = localDate.now();
            exports.unstable_now = function() {
              return localDate.now() - initialTime;
            };
          }
          var maxSigned31BitInt = 1073741823;
          var IMMEDIATE_PRIORITY_TIMEOUT = -1;
          var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
          var NORMAL_PRIORITY_TIMEOUT = 5e3;
          var LOW_PRIORITY_TIMEOUT = 1e4;
          var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt;
          var taskQueue = [];
          var timerQueue = [];
          var taskIdCounter = 1;
          var currentTask = null;
          var currentPriorityLevel = NormalPriority;
          var isPerformingWork = false;
          var isHostCallbackScheduled = false;
          var isHostTimeoutScheduled = false;
          var localSetTimeout = typeof setTimeout === "function" ? setTimeout : null;
          var localClearTimeout = typeof clearTimeout === "function" ? clearTimeout : null;
          var localSetImmediate = typeof setImmediate !== "undefined" ? setImmediate : null;
          var isInputPending = typeof navigator !== "undefined" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null;
          function advanceTimers(currentTime) {
            var timer = peek(timerQueue);
            while (timer !== null) {
              if (timer.callback === null) {
                pop(timerQueue);
              } else if (timer.startTime <= currentTime) {
                pop(timerQueue);
                timer.sortIndex = timer.expirationTime;
                push(taskQueue, timer);
              } else {
                return;
              }
              timer = peek(timerQueue);
            }
          }
          function handleTimeout(currentTime) {
            isHostTimeoutScheduled = false;
            advanceTimers(currentTime);
            if (!isHostCallbackScheduled) {
              if (peek(taskQueue) !== null) {
                isHostCallbackScheduled = true;
                requestHostCallback(flushWork);
              } else {
                var firstTimer = peek(timerQueue);
                if (firstTimer !== null) {
                  requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
                }
              }
            }
          }
          function flushWork(hasTimeRemaining, initialTime2) {
            isHostCallbackScheduled = false;
            if (isHostTimeoutScheduled) {
              isHostTimeoutScheduled = false;
              cancelHostTimeout();
            }
            isPerformingWork = true;
            var previousPriorityLevel = currentPriorityLevel;
            try {
              if (enableProfiling) {
                try {
                  return workLoop(hasTimeRemaining, initialTime2);
                } catch (error) {
                  if (currentTask !== null) {
                    var currentTime = exports.unstable_now();
                    markTaskErrored(currentTask, currentTime);
                    currentTask.isQueued = false;
                  }
                  throw error;
                }
              } else {
                return workLoop(hasTimeRemaining, initialTime2);
              }
            } finally {
              currentTask = null;
              currentPriorityLevel = previousPriorityLevel;
              isPerformingWork = false;
            }
          }
          function workLoop(hasTimeRemaining, initialTime2) {
            var currentTime = initialTime2;
            advanceTimers(currentTime);
            currentTask = peek(taskQueue);
            while (currentTask !== null && !enableSchedulerDebugging) {
              if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {
                break;
              }
              var callback = currentTask.callback;
              if (typeof callback === "function") {
                currentTask.callback = null;
                currentPriorityLevel = currentTask.priorityLevel;
                var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
                var continuationCallback = callback(didUserCallbackTimeout);
                currentTime = exports.unstable_now();
                if (typeof continuationCallback === "function") {
                  currentTask.callback = continuationCallback;
                } else {
                  if (currentTask === peek(taskQueue)) {
                    pop(taskQueue);
                  }
                }
                advanceTimers(currentTime);
              } else {
                pop(taskQueue);
              }
              currentTask = peek(taskQueue);
            }
            if (currentTask !== null) {
              return true;
            } else {
              var firstTimer = peek(timerQueue);
              if (firstTimer !== null) {
                requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
              }
              return false;
            }
          }
          function unstable_runWithPriority(priorityLevel, eventHandler) {
            switch (priorityLevel) {
              case ImmediatePriority:
              case UserBlockingPriority:
              case NormalPriority:
              case LowPriority:
              case IdlePriority:
                break;
              default:
                priorityLevel = NormalPriority;
            }
            var previousPriorityLevel = currentPriorityLevel;
            currentPriorityLevel = priorityLevel;
            try {
              return eventHandler();
            } finally {
              currentPriorityLevel = previousPriorityLevel;
            }
          }
          function unstable_next(eventHandler) {
            var priorityLevel;
            switch (currentPriorityLevel) {
              case ImmediatePriority:
              case UserBlockingPriority:
              case NormalPriority:
                priorityLevel = NormalPriority;
                break;
              default:
                priorityLevel = currentPriorityLevel;
                break;
            }
            var previousPriorityLevel = currentPriorityLevel;
            currentPriorityLevel = priorityLevel;
            try {
              return eventHandler();
            } finally {
              currentPriorityLevel = previousPriorityLevel;
            }
          }
          function unstable_wrapCallback(callback) {
            var parentPriorityLevel = currentPriorityLevel;
            return function() {
              var previousPriorityLevel = currentPriorityLevel;
              currentPriorityLevel = parentPriorityLevel;
              try {
                return callback.apply(this, arguments);
              } finally {
                currentPriorityLevel = previousPriorityLevel;
              }
            };
          }
          function unstable_scheduleCallback(priorityLevel, callback, options) {
            var currentTime = exports.unstable_now();
            var startTime2;
            if (typeof options === "object" && options !== null) {
              var delay = options.delay;
              if (typeof delay === "number" && delay > 0) {
                startTime2 = currentTime + delay;
              } else {
                startTime2 = currentTime;
              }
            } else {
              startTime2 = currentTime;
            }
            var timeout;
            switch (priorityLevel) {
              case ImmediatePriority:
                timeout = IMMEDIATE_PRIORITY_TIMEOUT;
                break;
              case UserBlockingPriority:
                timeout = USER_BLOCKING_PRIORITY_TIMEOUT;
                break;
              case IdlePriority:
                timeout = IDLE_PRIORITY_TIMEOUT;
                break;
              case LowPriority:
                timeout = LOW_PRIORITY_TIMEOUT;
                break;
              case NormalPriority:
              default:
                timeout = NORMAL_PRIORITY_TIMEOUT;
                break;
            }
            var expirationTime = startTime2 + timeout;
            var newTask = {
              id: taskIdCounter++,
              callback,
              priorityLevel,
              startTime: startTime2,
              expirationTime,
              sortIndex: -1
            };
            if (startTime2 > currentTime) {
              newTask.sortIndex = startTime2;
              push(timerQueue, newTask);
              if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
                if (isHostTimeoutScheduled) {
                  cancelHostTimeout();
                } else {
                  isHostTimeoutScheduled = true;
                }
                requestHostTimeout(handleTimeout, startTime2 - currentTime);
              }
            } else {
              newTask.sortIndex = expirationTime;
              push(taskQueue, newTask);
              if (!isHostCallbackScheduled && !isPerformingWork) {
                isHostCallbackScheduled = true;
                requestHostCallback(flushWork);
              }
            }
            return newTask;
          }
          function unstable_pauseExecution() {
          }
          function unstable_continueExecution() {
            if (!isHostCallbackScheduled && !isPerformingWork) {
              isHostCallbackScheduled = true;
              requestHostCallback(flushWork);
            }
          }
          function unstable_getFirstCallbackNode() {
            return peek(taskQueue);
          }
          function unstable_cancelCallback(task) {
            task.callback = null;
          }
          function unstable_getCurrentPriorityLevel() {
            return currentPriorityLevel;
          }
          var isMessageLoopRunning = false;
          var scheduledHostCallback = null;
          var taskTimeoutID = -1;
          var frameInterval = frameYieldMs;
          var startTime = -1;
          function shouldYieldToHost() {
            var timeElapsed = exports.unstable_now() - startTime;
            if (timeElapsed < frameInterval) {
              return false;
            }
            return true;
          }
          function requestPaint() {
          }
          function forceFrameRate(fps) {
            if (fps < 0 || fps > 125) {
              console["error"]("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");
              return;
            }
            if (fps > 0) {
              frameInterval = Math.floor(1e3 / fps);
            } else {
              frameInterval = frameYieldMs;
            }
          }
          var performWorkUntilDeadline = function() {
            if (scheduledHostCallback !== null) {
              var currentTime = exports.unstable_now();
              startTime = currentTime;
              var hasTimeRemaining = true;
              var hasMoreWork = true;
              try {
                hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
              } finally {
                if (hasMoreWork) {
                  schedulePerformWorkUntilDeadline();
                } else {
                  isMessageLoopRunning = false;
                  scheduledHostCallback = null;
                }
              }
            } else {
              isMessageLoopRunning = false;
            }
          };
          var schedulePerformWorkUntilDeadline;
          if (typeof localSetImmediate === "function") {
            schedulePerformWorkUntilDeadline = function() {
              localSetImmediate(performWorkUntilDeadline);
            };
          } else if (typeof MessageChannel !== "undefined") {
            var channel = new MessageChannel();
            var port = channel.port2;
            channel.port1.onmessage = performWorkUntilDeadline;
            schedulePerformWorkUntilDeadline = function() {
              port.postMessage(null);
            };
          } else {
            schedulePerformWorkUntilDeadline = function() {
              localSetTimeout(performWorkUntilDeadline, 0);
            };
          }
          function requestHostCallback(callback) {
            scheduledHostCallback = callback;
            if (!isMessageLoopRunning) {
              isMessageLoopRunning = true;
              schedulePerformWorkUntilDeadline();
            }
          }
          function requestHostTimeout(callback, ms2) {
            taskTimeoutID = localSetTimeout(function() {
              callback(exports.unstable_now());
            }, ms2);
          }
          function cancelHostTimeout() {
            localClearTimeout(taskTimeoutID);
            taskTimeoutID = -1;
          }
          var unstable_requestPaint = requestPaint;
          var unstable_Profiling = null;
          exports.unstable_IdlePriority = IdlePriority;
          exports.unstable_ImmediatePriority = ImmediatePriority;
          exports.unstable_LowPriority = LowPriority;
          exports.unstable_NormalPriority = NormalPriority;
          exports.unstable_Profiling = unstable_Profiling;
          exports.unstable_UserBlockingPriority = UserBlockingPriority;
          exports.unstable_cancelCallback = unstable_cancelCallback;
          exports.unstable_continueExecution = unstable_continueExecution;
          exports.unstable_forceFrameRate = forceFrameRate;
          exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
          exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
          exports.unstable_next = unstable_next;
          exports.unstable_pauseExecution = unstable_pauseExecution;
          exports.unstable_requestPaint = unstable_requestPaint;
          exports.unstable_runWithPriority = unstable_runWithPriority;
          exports.unstable_scheduleCallback = unstable_scheduleCallback;
          exports.unstable_shouldYield = shouldYieldToHost;
          exports.unstable_wrapCallback = unstable_wrapCallback;
          if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
            __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
          }
        })();
      }
    }
  });

  // node_modules/scheduler/index.js
  var require_scheduler = __commonJS({
    "node_modules/scheduler/index.js"(exports, module) {
      "use strict";
      if (false) {
        module.exports = null;
      } else {
        module.exports = require_scheduler_development();
      }
    }
  });

  // node_modules/react-dom/cjs/react-dom.development.js
  var require_react_dom_development = __commonJS({
    "node_modules/react-dom/cjs/react-dom.development.js"(exports) {
      "use strict";
      if (true) {
        (function() {
          "use strict";
          if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
            __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
          }
          var React4 = (init_react(), __toCommonJS(react_exports));
          var Scheduler = require_scheduler();
          var ReactSharedInternals = React4.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
          var suppressWarning = false;
          function setSuppressWarning(newSuppressWarning) {
            {
              suppressWarning = newSuppressWarning;
            }
          }
          function warn(format) {
            {
              if (!suppressWarning) {
                for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                  args[_key - 1] = arguments[_key];
                }
                printWarning("warn", format, args);
              }
            }
          }
          function error(format) {
            {
              if (!suppressWarning) {
                for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
                  args[_key2 - 1] = arguments[_key2];
                }
                printWarning("error", format, args);
              }
            }
          }
          function printWarning(level, format, args) {
            {
              var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
              var stack = ReactDebugCurrentFrame2.getStackAddendum();
              if (stack !== "") {
                format += "%s";
                args = args.concat([stack]);
              }
              var argsWithFormat = args.map(function(item) {
                return String(item);
              });
              argsWithFormat.unshift("Warning: " + format);
              Function.prototype.apply.call(console[level], console, argsWithFormat);
            }
          }
          var FunctionComponent = 0;
          var ClassComponent = 1;
          var IndeterminateComponent = 2;
          var HostRoot = 3;
          var HostPortal = 4;
          var HostComponent = 5;
          var HostText = 6;
          var Fragment2 = 7;
          var Mode = 8;
          var ContextConsumer = 9;
          var ContextProvider = 10;
          var ForwardRef = 11;
          var Profiler2 = 12;
          var SuspenseComponent = 13;
          var MemoComponent = 14;
          var SimpleMemoComponent = 15;
          var LazyComponent = 16;
          var IncompleteClassComponent = 17;
          var DehydratedFragment = 18;
          var SuspenseListComponent = 19;
          var ScopeComponent = 21;
          var OffscreenComponent = 22;
          var LegacyHiddenComponent = 23;
          var CacheComponent = 24;
          var TracingMarkerComponent = 25;
          var enableClientRenderFallbackOnTextMismatch = true;
          var enableNewReconciler = false;
          var enableLazyContextPropagation = false;
          var enableLegacyHidden = false;
          var enableSuspenseAvoidThisFallback = false;
          var disableCommentsAsDOMContainers = true;
          var enableCustomElementPropertySupport = false;
          var warnAboutStringRefs = true;
          var enableSchedulingProfiler = true;
          var enableProfilerTimer = true;
          var enableProfilerCommitHooks = true;
          var allNativeEvents = /* @__PURE__ */ new Set();
          var registrationNameDependencies = {};
          var possibleRegistrationNames = {};
          function registerTwoPhaseEvent(registrationName, dependencies) {
            registerDirectEvent(registrationName, dependencies);
            registerDirectEvent(registrationName + "Capture", dependencies);
          }
          function registerDirectEvent(registrationName, dependencies) {
            {
              if (registrationNameDependencies[registrationName]) {
                error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", registrationName);
              }
            }
            registrationNameDependencies[registrationName] = dependencies;
            {
              var lowerCasedName = registrationName.toLowerCase();
              possibleRegistrationNames[lowerCasedName] = registrationName;
              if (registrationName === "onDoubleClick") {
                possibleRegistrationNames.ondblclick = registrationName;
              }
            }
            for (var i = 0; i < dependencies.length; i++) {
              allNativeEvents.add(dependencies[i]);
            }
          }
          var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
          var hasOwnProperty = Object.prototype.hasOwnProperty;
          function typeName(value) {
            {
              var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
              var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
              return type;
            }
          }
          function willCoercionThrow(value) {
            {
              try {
                testStringCoercion(value);
                return false;
              } catch (e) {
                return true;
              }
            }
          }
          function testStringCoercion(value) {
            return "" + value;
          }
          function checkAttributeStringCoercion(value, attributeName) {
            {
              if (willCoercionThrow(value)) {
                error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.", attributeName, typeName(value));
                return testStringCoercion(value);
              }
            }
          }
          function checkKeyStringCoercion(value) {
            {
              if (willCoercionThrow(value)) {
                error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
                return testStringCoercion(value);
              }
            }
          }
          function checkPropStringCoercion(value, propName) {
            {
              if (willCoercionThrow(value)) {
                error("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName(value));
                return testStringCoercion(value);
              }
            }
          }
          function checkCSSPropertyStringCoercion(value, propName) {
            {
              if (willCoercionThrow(value)) {
                error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName(value));
                return testStringCoercion(value);
              }
            }
          }
          function checkHtmlStringCoercion(value) {
            {
              if (willCoercionThrow(value)) {
                error("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
                return testStringCoercion(value);
              }
            }
          }
          function checkFormFieldValueStringCoercion(value) {
            {
              if (willCoercionThrow(value)) {
                error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before before using it here.", typeName(value));
                return testStringCoercion(value);
              }
            }
          }
          var RESERVED = 0;
          var STRING = 1;
          var BOOLEANISH_STRING = 2;
          var BOOLEAN = 3;
          var OVERLOADED_BOOLEAN = 4;
          var NUMERIC = 5;
          var POSITIVE_NUMERIC = 6;
          var ATTRIBUTE_NAME_START_CHAR = ":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";
          var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
          var VALID_ATTRIBUTE_NAME_REGEX = new RegExp("^[" + ATTRIBUTE_NAME_START_CHAR + "][" + ATTRIBUTE_NAME_CHAR + "]*$");
          var illegalAttributeNameCache = {};
          var validatedAttributeNameCache = {};
          function isAttributeNameSafe(attributeName) {
            if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
              return true;
            }
            if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
              return false;
            }
            if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
              validatedAttributeNameCache[attributeName] = true;
              return true;
            }
            illegalAttributeNameCache[attributeName] = true;
            {
              error("Invalid attribute name: `%s`", attributeName);
            }
            return false;
          }
          function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
            if (propertyInfo !== null) {
              return propertyInfo.type === RESERVED;
            }
            if (isCustomComponentTag) {
              return false;
            }
            if (name.length > 2 && (name[0] === "o" || name[0] === "O") && (name[1] === "n" || name[1] === "N")) {
              return true;
            }
            return false;
          }
          function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
            if (propertyInfo !== null && propertyInfo.type === RESERVED) {
              return false;
            }
            switch (typeof value) {
              case "function":
              case "symbol":
                return true;
              case "boolean": {
                if (isCustomComponentTag) {
                  return false;
                }
                if (propertyInfo !== null) {
                  return !propertyInfo.acceptsBooleans;
                } else {
                  var prefix2 = name.toLowerCase().slice(0, 5);
                  return prefix2 !== "data-" && prefix2 !== "aria-";
                }
              }
              default:
                return false;
            }
          }
          function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
            if (value === null || typeof value === "undefined") {
              return true;
            }
            if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
              return true;
            }
            if (isCustomComponentTag) {
              return false;
            }
            if (propertyInfo !== null) {
              switch (propertyInfo.type) {
                case BOOLEAN:
                  return !value;
                case OVERLOADED_BOOLEAN:
                  return value === false;
                case NUMERIC:
                  return isNaN(value);
                case POSITIVE_NUMERIC:
                  return isNaN(value) || value < 1;
              }
            }
            return false;
          }
          function getPropertyInfo(name) {
            return properties.hasOwnProperty(name) ? properties[name] : null;
          }
          function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL2, removeEmptyString) {
            this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
            this.attributeName = attributeName;
            this.attributeNamespace = attributeNamespace;
            this.mustUseProperty = mustUseProperty;
            this.propertyName = name;
            this.type = type;
            this.sanitizeURL = sanitizeURL2;
            this.removeEmptyString = removeEmptyString;
          }
          var properties = {};
          var reservedProps = [
            "children",
            "dangerouslySetInnerHTML",
            "defaultValue",
            "defaultChecked",
            "innerHTML",
            "suppressContentEditableWarning",
            "suppressHydrationWarning",
            "style"
          ];
          reservedProps.forEach(function(name) {
            properties[name] = new PropertyInfoRecord(
              name,
              RESERVED,
              false,
              name,
              null,
              false,
              false
            );
          });
          [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(_ref) {
            var name = _ref[0], attributeName = _ref[1];
            properties[name] = new PropertyInfoRecord(
              name,
              STRING,
              false,
              attributeName,
              null,
              false,
              false
            );
          });
          ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(name) {
            properties[name] = new PropertyInfoRecord(
              name,
              BOOLEANISH_STRING,
              false,
              name.toLowerCase(),
              null,
              false,
              false
            );
          });
          ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(name) {
            properties[name] = new PropertyInfoRecord(
              name,
              BOOLEANISH_STRING,
              false,
              name,
              null,
              false,
              false
            );
          });
          [
            "allowFullScreen",
            "async",
            "autoFocus",
            "autoPlay",
            "controls",
            "default",
            "defer",
            "disabled",
            "disablePictureInPicture",
            "disableRemotePlayback",
            "formNoValidate",
            "hidden",
            "loop",
            "noModule",
            "noValidate",
            "open",
            "playsInline",
            "readOnly",
            "required",
            "reversed",
            "scoped",
            "seamless",
            "itemScope"
          ].forEach(function(name) {
            properties[name] = new PropertyInfoRecord(
              name,
              BOOLEAN,
              false,
              name.toLowerCase(),
              null,
              false,
              false
            );
          });
          [
            "checked",
            "multiple",
            "muted",
            "selected"
          ].forEach(function(name) {
            properties[name] = new PropertyInfoRecord(
              name,
              BOOLEAN,
              true,
              name,
              null,
              false,
              false
            );
          });
          [
            "capture",
            "download"
          ].forEach(function(name) {
            properties[name] = new PropertyInfoRecord(
              name,
              OVERLOADED_BOOLEAN,
              false,
              name,
              null,
              false,
              false
            );
          });
          [
            "cols",
            "rows",
            "size",
            "span"
          ].forEach(function(name) {
            properties[name] = new PropertyInfoRecord(
              name,
              POSITIVE_NUMERIC,
              false,
              name,
              null,
              false,
              false
            );
          });
          ["rowSpan", "start"].forEach(function(name) {
            properties[name] = new PropertyInfoRecord(
              name,
              NUMERIC,
              false,
              name.toLowerCase(),
              null,
              false,
              false
            );
          });
          var CAMELIZE = /[\-\:]([a-z])/g;
          var capitalize = function(token) {
            return token[1].toUpperCase();
          };
          [
            "accent-height",
            "alignment-baseline",
            "arabic-form",
            "baseline-shift",
            "cap-height",
            "clip-path",
            "clip-rule",
            "color-interpolation",
            "color-interpolation-filters",
            "color-profile",
            "color-rendering",
            "dominant-baseline",
            "enable-background",
            "fill-opacity",
            "fill-rule",
            "flood-color",
            "flood-opacity",
            "font-family",
            "font-size",
            "font-size-adjust",
            "font-stretch",
            "font-style",
            "font-variant",
            "font-weight",
            "glyph-name",
            "glyph-orientation-horizontal",
            "glyph-orientation-vertical",
            "horiz-adv-x",
            "horiz-origin-x",
            "image-rendering",
            "letter-spacing",
            "lighting-color",
            "marker-end",
            "marker-mid",
            "marker-start",
            "overline-position",
            "overline-thickness",
            "paint-order",
            "panose-1",
            "pointer-events",
            "rendering-intent",
            "shape-rendering",
            "stop-color",
            "stop-opacity",
            "strikethrough-position",
            "strikethrough-thickness",
            "stroke-dasharray",
            "stroke-dashoffset",
            "stroke-linecap",
            "stroke-linejoin",
            "stroke-miterlimit",
            "stroke-opacity",
            "stroke-width",
            "text-anchor",
            "text-decoration",
            "text-rendering",
            "underline-position",
            "underline-thickness",
            "unicode-bidi",
            "unicode-range",
            "units-per-em",
            "v-alphabetic",
            "v-hanging",
            "v-ideographic",
            "v-mathematical",
            "vector-effect",
            "vert-adv-y",
            "vert-origin-x",
            "vert-origin-y",
            "word-spacing",
            "writing-mode",
            "xmlns:xlink",
            "x-height"
          ].forEach(function(attributeName) {
            var name = attributeName.replace(CAMELIZE, capitalize);
            properties[name] = new PropertyInfoRecord(
              name,
              STRING,
              false,
              attributeName,
              null,
              false,
              false
            );
          });
          [
            "xlink:actuate",
            "xlink:arcrole",
            "xlink:role",
            "xlink:show",
            "xlink:title",
            "xlink:type"
          ].forEach(function(attributeName) {
            var name = attributeName.replace(CAMELIZE, capitalize);
            properties[name] = new PropertyInfoRecord(
              name,
              STRING,
              false,
              attributeName,
              "http://www.w3.org/1999/xlink",
              false,
              false
            );
          });
          [
            "xml:base",
            "xml:lang",
            "xml:space"
          ].forEach(function(attributeName) {
            var name = attributeName.replace(CAMELIZE, capitalize);
            properties[name] = new PropertyInfoRecord(
              name,
              STRING,
              false,
              attributeName,
              "http://www.w3.org/XML/1998/namespace",
              false,
              false
            );
          });
          ["tabIndex", "crossOrigin"].forEach(function(attributeName) {
            properties[attributeName] = new PropertyInfoRecord(
              attributeName,
              STRING,
              false,
              attributeName.toLowerCase(),
              null,
              false,
              false
            );
          });
          var xlinkHref = "xlinkHref";
          properties[xlinkHref] = new PropertyInfoRecord(
            "xlinkHref",
            STRING,
            false,
            "xlink:href",
            "http://www.w3.org/1999/xlink",
            true,
            false
          );
          ["src", "href", "action", "formAction"].forEach(function(attributeName) {
            properties[attributeName] = new PropertyInfoRecord(
              attributeName,
              STRING,
              false,
              attributeName.toLowerCase(),
              null,
              true,
              true
            );
          });
          var 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;
          var didWarn = false;
          function sanitizeURL(url) {
            {
              if (!didWarn && isJavaScriptProtocol.test(url)) {
                didWarn = true;
                error("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", JSON.stringify(url));
              }
            }
          }
          function getValueForProperty(node, name, expected, propertyInfo) {
            {
              if (propertyInfo.mustUseProperty) {
                var propertyName = propertyInfo.propertyName;
                return node[propertyName];
              } else {
                {
                  checkAttributeStringCoercion(expected, name);
                }
                if (propertyInfo.sanitizeURL) {
                  sanitizeURL("" + expected);
                }
                var attributeName = propertyInfo.attributeName;
                var stringValue = null;
                if (propertyInfo.type === OVERLOADED_BOOLEAN) {
                  if (node.hasAttribute(attributeName)) {
                    var value = node.getAttribute(attributeName);
                    if (value === "") {
                      return true;
                    }
                    if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
                      return value;
                    }
                    if (value === "" + expected) {
                      return expected;
                    }
                    return value;
                  }
                } else if (node.hasAttribute(attributeName)) {
                  if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
                    return node.getAttribute(attributeName);
                  }
                  if (propertyInfo.type === BOOLEAN) {
                    return expected;
                  }
                  stringValue = node.getAttribute(attributeName);
                }
                if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
                  return stringValue === null ? expected : stringValue;
                } else if (stringValue === "" + expected) {
                  return expected;
                } else {
                  return stringValue;
                }
              }
            }
          }
          function getValueForAttribute(node, name, expected, isCustomComponentTag) {
            {
              if (!isAttributeNameSafe(name)) {
                return;
              }
              if (!node.hasAttribute(name)) {
                return expected === void 0 ? void 0 : null;
              }
              var value = node.getAttribute(name);
              {
                checkAttributeStringCoercion(expected, name);
              }
              if (value === "" + expected) {
                return expected;
              }
              return value;
            }
          }
          function setValueForProperty(node, name, value, isCustomComponentTag) {
            var propertyInfo = getPropertyInfo(name);
            if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
              return;
            }
            if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
              value = null;
            }
            if (isCustomComponentTag || propertyInfo === null) {
              if (isAttributeNameSafe(name)) {
                var _attributeName = name;
                if (value === null) {
                  node.removeAttribute(_attributeName);
                } else {
                  {
                    checkAttributeStringCoercion(value, name);
                  }
                  node.setAttribute(_attributeName, "" + value);
                }
              }
              return;
            }
            var mustUseProperty = propertyInfo.mustUseProperty;
            if (mustUseProperty) {
              var propertyName = propertyInfo.propertyName;
              if (value === null) {
                var type = propertyInfo.type;
                node[propertyName] = type === BOOLEAN ? false : "";
              } else {
                node[propertyName] = value;
              }
              return;
            }
            var attributeName = propertyInfo.attributeName, attributeNamespace = propertyInfo.attributeNamespace;
            if (value === null) {
              node.removeAttribute(attributeName);
            } else {
              var _type = propertyInfo.type;
              var attributeValue;
              if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
                attributeValue = "";
              } else {
                {
                  {
                    checkAttributeStringCoercion(value, attributeName);
                  }
                  attributeValue = "" + value;
                }
                if (propertyInfo.sanitizeURL) {
                  sanitizeURL(attributeValue.toString());
                }
              }
              if (attributeNamespace) {
                node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
              } else {
                node.setAttribute(attributeName, attributeValue);
              }
            }
          }
          var REACT_ELEMENT_TYPE = Symbol.for("react.element");
          var REACT_PORTAL_TYPE = Symbol.for("react.portal");
          var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
          var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
          var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
          var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
          var REACT_CONTEXT_TYPE = Symbol.for("react.context");
          var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
          var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
          var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
          var REACT_MEMO_TYPE = Symbol.for("react.memo");
          var REACT_LAZY_TYPE = Symbol.for("react.lazy");
          var REACT_SCOPE_TYPE = Symbol.for("react.scope");
          var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode");
          var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
          var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden");
          var REACT_CACHE_TYPE = Symbol.for("react.cache");
          var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker");
          var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
          var FAUX_ITERATOR_SYMBOL = "@@iterator";
          function getIteratorFn(maybeIterable) {
            if (maybeIterable === null || typeof maybeIterable !== "object") {
              return null;
            }
            var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
            if (typeof maybeIterator === "function") {
              return maybeIterator;
            }
            return null;
          }
          var assign = Object.assign;
          var disabledDepth = 0;
          var prevLog;
          var prevInfo;
          var prevWarn;
          var prevError;
          var prevGroup;
          var prevGroupCollapsed;
          var prevGroupEnd;
          function disabledLog() {
          }
          disabledLog.__reactDisabledLog = true;
          function disableLogs() {
            {
              if (disabledDepth === 0) {
                prevLog = console.log;
                prevInfo = console.info;
                prevWarn = console.warn;
                prevError = console.error;
                prevGroup = console.group;
                prevGroupCollapsed = console.groupCollapsed;
                prevGroupEnd = console.groupEnd;
                var props = {
                  configurable: true,
                  enumerable: true,
                  value: disabledLog,
                  writable: true
                };
                Object.defineProperties(console, {
                  info: props,
                  log: props,
                  warn: props,
                  error: props,
                  group: props,
                  groupCollapsed: props,
                  groupEnd: props
                });
              }
              disabledDepth++;
            }
          }
          function reenableLogs() {
            {
              disabledDepth--;
              if (disabledDepth === 0) {
                var props = {
                  configurable: true,
                  enumerable: true,
                  writable: true
                };
                Object.defineProperties(console, {
                  log: assign({}, props, {
                    value: prevLog
                  }),
                  info: assign({}, props, {
                    value: prevInfo
                  }),
                  warn: assign({}, props, {
                    value: prevWarn
                  }),
                  error: assign({}, props, {
                    value: prevError
                  }),
                  group: assign({}, props, {
                    value: prevGroup
                  }),
                  groupCollapsed: assign({}, props, {
                    value: prevGroupCollapsed
                  }),
                  groupEnd: assign({}, props, {
                    value: prevGroupEnd
                  })
                });
              }
              if (disabledDepth < 0) {
                error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
              }
            }
          }
          var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
          var prefix;
          function describeBuiltInComponentFrame(name, source, ownerFn) {
            {
              if (prefix === void 0) {
                try {
                  throw Error();
                } catch (x) {
                  var match = x.stack.trim().match(/\n( *(at )?)/);
                  prefix = match && match[1] || "";
                }
              }
              return "\n" + prefix + name;
            }
          }
          var reentry = false;
          var componentFrameCache;
          {
            var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
            componentFrameCache = new PossiblyWeakMap();
          }
          function describeNativeComponentFrame(fn, construct) {
            if (!fn || reentry) {
              return "";
            }
            {
              var frame = componentFrameCache.get(fn);
              if (frame !== void 0) {
                return frame;
              }
            }
            var control;
            reentry = true;
            var previousPrepareStackTrace = Error.prepareStackTrace;
            Error.prepareStackTrace = void 0;
            var previousDispatcher;
            {
              previousDispatcher = ReactCurrentDispatcher.current;
              ReactCurrentDispatcher.current = null;
              disableLogs();
            }
            try {
              if (construct) {
                var Fake = function() {
                  throw Error();
                };
                Object.defineProperty(Fake.prototype, "props", {
                  set: function() {
                    throw Error();
                  }
                });
                if (typeof Reflect === "object" && Reflect.construct) {
                  try {
                    Reflect.construct(Fake, []);
                  } catch (x) {
                    control = x;
                  }
                  Reflect.construct(fn, [], Fake);
                } else {
                  try {
                    Fake.call();
                  } catch (x) {
                    control = x;
                  }
                  fn.call(Fake.prototype);
                }
              } else {
                try {
                  throw Error();
                } catch (x) {
                  control = x;
                }
                fn();
              }
            } catch (sample) {
              if (sample && control && typeof sample.stack === "string") {
                var sampleLines = sample.stack.split("\n");
                var controlLines = control.stack.split("\n");
                var s = sampleLines.length - 1;
                var c = controlLines.length - 1;
                while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
                  c--;
                }
                for (; s >= 1 && c >= 0; s--, c--) {
                  if (sampleLines[s] !== controlLines[c]) {
                    if (s !== 1 || c !== 1) {
                      do {
                        s--;
                        c--;
                        if (c < 0 || sampleLines[s] !== controlLines[c]) {
                          var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
                          if (fn.displayName && _frame.includes("<anonymous>")) {
                            _frame = _frame.replace("<anonymous>", fn.displayName);
                          }
                          {
                            if (typeof fn === "function") {
                              componentFrameCache.set(fn, _frame);
                            }
                          }
                          return _frame;
                        }
                      } while (s >= 1 && c >= 0);
                    }
                    break;
                  }
                }
              }
            } finally {
              reentry = false;
              {
                ReactCurrentDispatcher.current = previousDispatcher;
                reenableLogs();
              }
              Error.prepareStackTrace = previousPrepareStackTrace;
            }
            var name = fn ? fn.displayName || fn.name : "";
            var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
            {
              if (typeof fn === "function") {
                componentFrameCache.set(fn, syntheticFrame);
              }
            }
            return syntheticFrame;
          }
          function describeClassComponentFrame(ctor, source, ownerFn) {
            {
              return describeNativeComponentFrame(ctor, true);
            }
          }
          function describeFunctionComponentFrame(fn, source, ownerFn) {
            {
              return describeNativeComponentFrame(fn, false);
            }
          }
          function shouldConstruct(Component2) {
            var prototype = Component2.prototype;
            return !!(prototype && prototype.isReactComponent);
          }
          function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
            if (type == null) {
              return "";
            }
            if (typeof type === "function") {
              {
                return describeNativeComponentFrame(type, shouldConstruct(type));
              }
            }
            if (typeof type === "string") {
              return describeBuiltInComponentFrame(type);
            }
            switch (type) {
              case REACT_SUSPENSE_TYPE:
                return describeBuiltInComponentFrame("Suspense");
              case REACT_SUSPENSE_LIST_TYPE:
                return describeBuiltInComponentFrame("SuspenseList");
            }
            if (typeof type === "object") {
              switch (type.$$typeof) {
                case REACT_FORWARD_REF_TYPE:
                  return describeFunctionComponentFrame(type.render);
                case REACT_MEMO_TYPE:
                  return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
                case REACT_LAZY_TYPE: {
                  var lazyComponent = type;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
                  } catch (x) {
                  }
                }
              }
            }
            return "";
          }
          function describeFiber(fiber) {
            var owner = fiber._debugOwner ? fiber._debugOwner.type : null;
            var source = fiber._debugSource;
            switch (fiber.tag) {
              case HostComponent:
                return describeBuiltInComponentFrame(fiber.type);
              case LazyComponent:
                return describeBuiltInComponentFrame("Lazy");
              case SuspenseComponent:
                return describeBuiltInComponentFrame("Suspense");
              case SuspenseListComponent:
                return describeBuiltInComponentFrame("SuspenseList");
              case FunctionComponent:
              case IndeterminateComponent:
              case SimpleMemoComponent:
                return describeFunctionComponentFrame(fiber.type);
              case ForwardRef:
                return describeFunctionComponentFrame(fiber.type.render);
              case ClassComponent:
                return describeClassComponentFrame(fiber.type);
              default:
                return "";
            }
          }
          function getStackByFiberInDevAndProd(workInProgress2) {
            try {
              var info = "";
              var node = workInProgress2;
              do {
                info += describeFiber(node);
                node = node.return;
              } while (node);
              return info;
            } catch (x) {
              return "\nError generating stack: " + x.message + "\n" + x.stack;
            }
          }
          function getWrappedName(outerType, innerType, wrapperName) {
            var displayName = outerType.displayName;
            if (displayName) {
              return displayName;
            }
            var functionName = innerType.displayName || innerType.name || "";
            return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
          }
          function getContextName(type) {
            return type.displayName || "Context";
          }
          function getComponentNameFromType(type) {
            if (type == null) {
              return null;
            }
            {
              if (typeof type.tag === "number") {
                error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
              }
            }
            if (typeof type === "function") {
              return type.displayName || type.name || null;
            }
            if (typeof type === "string") {
              return type;
            }
            switch (type) {
              case REACT_FRAGMENT_TYPE:
                return "Fragment";
              case REACT_PORTAL_TYPE:
                return "Portal";
              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";
            }
            if (typeof type === "object") {
              switch (type.$$typeof) {
                case REACT_CONTEXT_TYPE:
                  var context = type;
                  return getContextName(context) + ".Consumer";
                case REACT_PROVIDER_TYPE:
                  var provider = type;
                  return getContextName(provider._context) + ".Provider";
                case REACT_FORWARD_REF_TYPE:
                  return getWrappedName(type, type.render, "ForwardRef");
                case REACT_MEMO_TYPE:
                  var outerName = type.displayName || null;
                  if (outerName !== null) {
                    return outerName;
                  }
                  return getComponentNameFromType(type.type) || "Memo";
                case REACT_LAZY_TYPE: {
                  var lazyComponent = type;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    return getComponentNameFromType(init(payload));
                  } catch (x) {
                    return null;
                  }
                }
              }
            }
            return null;
          }
          function getWrappedName$1(outerType, innerType, wrapperName) {
            var functionName = innerType.displayName || innerType.name || "";
            return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName);
          }
          function getContextName$1(type) {
            return type.displayName || "Context";
          }
          function getComponentNameFromFiber(fiber) {
            var tag = fiber.tag, type = fiber.type;
            switch (tag) {
              case CacheComponent:
                return "Cache";
              case ContextConsumer:
                var context = type;
                return getContextName$1(context) + ".Consumer";
              case ContextProvider:
                var provider = type;
                return getContextName$1(provider._context) + ".Provider";
              case DehydratedFragment:
                return "DehydratedFragment";
              case ForwardRef:
                return getWrappedName$1(type, type.render, "ForwardRef");
              case Fragment2:
                return "Fragment";
              case HostComponent:
                return type;
              case HostPortal:
                return "Portal";
              case HostRoot:
                return "Root";
              case HostText:
                return "Text";
              case LazyComponent:
                return getComponentNameFromType(type);
              case Mode:
                if (type === REACT_STRICT_MODE_TYPE) {
                  return "StrictMode";
                }
                return "Mode";
              case OffscreenComponent:
                return "Offscreen";
              case Profiler2:
                return "Profiler";
              case ScopeComponent:
                return "Scope";
              case SuspenseComponent:
                return "Suspense";
              case SuspenseListComponent:
                return "SuspenseList";
              case TracingMarkerComponent:
                return "TracingMarker";
              case ClassComponent:
              case FunctionComponent:
              case IncompleteClassComponent:
              case IndeterminateComponent:
              case MemoComponent:
              case SimpleMemoComponent:
                if (typeof type === "function") {
                  return type.displayName || type.name || null;
                }
                if (typeof type === "string") {
                  return type;
                }
                break;
            }
            return null;
          }
          var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
          var current = null;
          var isRendering = false;
          function getCurrentFiberOwnerNameInDevOrNull() {
            {
              if (current === null) {
                return null;
              }
              var owner = current._debugOwner;
              if (owner !== null && typeof owner !== "undefined") {
                return getComponentNameFromFiber(owner);
              }
            }
            return null;
          }
          function getCurrentFiberStackInDev() {
            {
              if (current === null) {
                return "";
              }
              return getStackByFiberInDevAndProd(current);
            }
          }
          function resetCurrentFiber() {
            {
              ReactDebugCurrentFrame.getCurrentStack = null;
              current = null;
              isRendering = false;
            }
          }
          function setCurrentFiber(fiber) {
            {
              ReactDebugCurrentFrame.getCurrentStack = fiber === null ? null : getCurrentFiberStackInDev;
              current = fiber;
              isRendering = false;
            }
          }
          function getCurrentFiber() {
            {
              return current;
            }
          }
          function setIsRendering(rendering) {
            {
              isRendering = rendering;
            }
          }
          function toString(value) {
            return "" + value;
          }
          function getToStringValue(value) {
            switch (typeof value) {
              case "boolean":
              case "number":
              case "string":
              case "undefined":
                return value;
              case "object":
                {
                  checkFormFieldValueStringCoercion(value);
                }
                return value;
              default:
                return "";
            }
          }
          var hasReadOnlyValue = {
            button: true,
            checkbox: true,
            image: true,
            hidden: true,
            radio: true,
            reset: true,
            submit: true
          };
          function checkControlledValueProps(tagName, props) {
            {
              if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) {
                error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.");
              }
              if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) {
                error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.");
              }
            }
          }
          function isCheckable(elem) {
            var type = elem.type;
            var nodeName = elem.nodeName;
            return nodeName && nodeName.toLowerCase() === "input" && (type === "checkbox" || type === "radio");
          }
          function getTracker(node) {
            return node._valueTracker;
          }
          function detachTracker(node) {
            node._valueTracker = null;
          }
          function getValueFromNode(node) {
            var value = "";
            if (!node) {
              return value;
            }
            if (isCheckable(node)) {
              value = node.checked ? "true" : "false";
            } else {
              value = node.value;
            }
            return value;
          }
          function trackValueOnNode(node) {
            var valueField = isCheckable(node) ? "checked" : "value";
            var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
            {
              checkFormFieldValueStringCoercion(node[valueField]);
            }
            var currentValue = "" + node[valueField];
            if (node.hasOwnProperty(valueField) || typeof descriptor === "undefined" || typeof descriptor.get !== "function" || typeof descriptor.set !== "function") {
              return;
            }
            var get2 = descriptor.get, set2 = descriptor.set;
            Object.defineProperty(node, valueField, {
              configurable: true,
              get: function() {
                return get2.call(this);
              },
              set: function(value) {
                {
                  checkFormFieldValueStringCoercion(value);
                }
                currentValue = "" + value;
                set2.call(this, value);
              }
            });
            Object.defineProperty(node, valueField, {
              enumerable: descriptor.enumerable
            });
            var tracker = {
              getValue: function() {
                return currentValue;
              },
              setValue: function(value) {
                {
                  checkFormFieldValueStringCoercion(value);
                }
                currentValue = "" + value;
              },
              stopTracking: function() {
                detachTracker(node);
                delete node[valueField];
              }
            };
            return tracker;
          }
          function track(node) {
            if (getTracker(node)) {
              return;
            }
            node._valueTracker = trackValueOnNode(node);
          }
          function updateValueIfChanged(node) {
            if (!node) {
              return false;
            }
            var tracker = getTracker(node);
            if (!tracker) {
              return true;
            }
            var lastValue = tracker.getValue();
            var nextValue = getValueFromNode(node);
            if (nextValue !== lastValue) {
              tracker.setValue(nextValue);
              return true;
            }
            return false;
          }
          function getActiveElement(doc) {
            doc = doc || (typeof document !== "undefined" ? document : void 0);
            if (typeof doc === "undefined") {
              return null;
            }
            try {
              return doc.activeElement || doc.body;
            } catch (e) {
              return doc.body;
            }
          }
          var didWarnValueDefaultValue = false;
          var didWarnCheckedDefaultChecked = false;
          var didWarnControlledToUncontrolled = false;
          var didWarnUncontrolledToControlled = false;
          function isControlled(props) {
            var usesChecked = props.type === "checkbox" || props.type === "radio";
            return usesChecked ? props.checked != null : props.value != null;
          }
          function getHostProps(element, props) {
            var node = element;
            var checked = props.checked;
            var hostProps = assign({}, props, {
              defaultChecked: void 0,
              defaultValue: void 0,
              value: void 0,
              checked: checked != null ? checked : node._wrapperState.initialChecked
            });
            return hostProps;
          }
          function initWrapperState(element, props) {
            {
              checkControlledValueProps("input", props);
              if (props.checked !== void 0 && props.defaultChecked !== void 0 && !didWarnCheckedDefaultChecked) {
                error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type);
                didWarnCheckedDefaultChecked = true;
              }
              if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue) {
                error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type);
                didWarnValueDefaultValue = true;
              }
            }
            var node = element;
            var defaultValue = props.defaultValue == null ? "" : props.defaultValue;
            node._wrapperState = {
              initialChecked: props.checked != null ? props.checked : props.defaultChecked,
              initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
              controlled: isControlled(props)
            };
          }
          function updateChecked(element, props) {
            var node = element;
            var checked = props.checked;
            if (checked != null) {
              setValueForProperty(node, "checked", checked, false);
            }
          }
          function updateWrapper(element, props) {
            var node = element;
            {
              var controlled = isControlled(props);
              if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
                error("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components");
                didWarnUncontrolledToControlled = true;
              }
              if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
                error("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components");
                didWarnControlledToUncontrolled = true;
              }
            }
            updateChecked(element, props);
            var value = getToStringValue(props.value);
            var type = props.type;
            if (value != null) {
              if (type === "number") {
                if (value === 0 && node.value === "" || node.value != value) {
                  node.value = toString(value);
                }
              } else if (node.value !== toString(value)) {
                node.value = toString(value);
              }
            } else if (type === "submit" || type === "reset") {
              node.removeAttribute("value");
              return;
            }
            {
              if (props.hasOwnProperty("value")) {
                setDefaultValue(node, props.type, value);
              } else if (props.hasOwnProperty("defaultValue")) {
                setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
              }
            }
            {
              if (props.checked == null && props.defaultChecked != null) {
                node.defaultChecked = !!props.defaultChecked;
              }
            }
          }
          function postMountWrapper(element, props, isHydrating2) {
            var node = element;
            if (props.hasOwnProperty("value") || props.hasOwnProperty("defaultValue")) {
              var type = props.type;
              var isButton = type === "submit" || type === "reset";
              if (isButton && (props.value === void 0 || props.value === null)) {
                return;
              }
              var initialValue = toString(node._wrapperState.initialValue);
              if (!isHydrating2) {
                {
                  if (initialValue !== node.value) {
                    node.value = initialValue;
                  }
                }
              }
              {
                node.defaultValue = initialValue;
              }
            }
            var name = node.name;
            if (name !== "") {
              node.name = "";
            }
            {
              node.defaultChecked = !node.defaultChecked;
              node.defaultChecked = !!node._wrapperState.initialChecked;
            }
            if (name !== "") {
              node.name = name;
            }
          }
          function restoreControlledState(element, props) {
            var node = element;
            updateWrapper(node, props);
            updateNamedCousins(node, props);
          }
          function updateNamedCousins(rootNode, props) {
            var name = props.name;
            if (props.type === "radio" && name != null) {
              var queryRoot = rootNode;
              while (queryRoot.parentNode) {
                queryRoot = queryRoot.parentNode;
              }
              {
                checkAttributeStringCoercion(name, "name");
              }
              var group = queryRoot.querySelectorAll("input[name=" + JSON.stringify("" + name) + '][type="radio"]');
              for (var i = 0; i < group.length; i++) {
                var otherNode = group[i];
                if (otherNode === rootNode || otherNode.form !== rootNode.form) {
                  continue;
                }
                var otherProps = getFiberCurrentPropsFromNode(otherNode);
                if (!otherProps) {
                  throw new Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");
                }
                updateValueIfChanged(otherNode);
                updateWrapper(otherNode, otherProps);
              }
            }
          }
          function setDefaultValue(node, type, value) {
            if (type !== "number" || getActiveElement(node.ownerDocument) !== node) {
              if (value == null) {
                node.defaultValue = toString(node._wrapperState.initialValue);
              } else if (node.defaultValue !== toString(value)) {
                node.defaultValue = toString(value);
              }
            }
          }
          var didWarnSelectedSetOnOption = false;
          var didWarnInvalidChild = false;
          var didWarnInvalidInnerHTML = false;
          function validateProps(element, props) {
            {
              if (props.value == null) {
                if (typeof props.children === "object" && props.children !== null) {
                  React4.Children.forEach(props.children, function(child) {
                    if (child == null) {
                      return;
                    }
                    if (typeof child === "string" || typeof child === "number") {
                      return;
                    }
                    if (!didWarnInvalidChild) {
                      didWarnInvalidChild = true;
                      error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>.");
                    }
                  });
                } else if (props.dangerouslySetInnerHTML != null) {
                  if (!didWarnInvalidInnerHTML) {
                    didWarnInvalidInnerHTML = true;
                    error("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected.");
                  }
                }
              }
              if (props.selected != null && !didWarnSelectedSetOnOption) {
                error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>.");
                didWarnSelectedSetOnOption = true;
              }
            }
          }
          function postMountWrapper$1(element, props) {
            if (props.value != null) {
              element.setAttribute("value", toString(getToStringValue(props.value)));
            }
          }
          var isArrayImpl = Array.isArray;
          function isArray(a) {
            return isArrayImpl(a);
          }
          var didWarnValueDefaultValue$1;
          {
            didWarnValueDefaultValue$1 = false;
          }
          function getDeclarationErrorAddendum() {
            var ownerName = getCurrentFiberOwnerNameInDevOrNull();
            if (ownerName) {
              return "\n\nCheck the render method of `" + ownerName + "`.";
            }
            return "";
          }
          var valuePropNames = ["value", "defaultValue"];
          function checkSelectPropTypes(props) {
            {
              checkControlledValueProps("select", props);
              for (var i = 0; i < valuePropNames.length; i++) {
                var propName = valuePropNames[i];
                if (props[propName] == null) {
                  continue;
                }
                var propNameIsArray = isArray(props[propName]);
                if (props.multiple && !propNameIsArray) {
                  error("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s", propName, getDeclarationErrorAddendum());
                } else if (!props.multiple && propNameIsArray) {
                  error("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s", propName, getDeclarationErrorAddendum());
                }
              }
            }
          }
          function updateOptions(node, multiple, propValue, setDefaultSelected) {
            var options2 = node.options;
            if (multiple) {
              var selectedValues = propValue;
              var selectedValue = {};
              for (var i = 0; i < selectedValues.length; i++) {
                selectedValue["$" + selectedValues[i]] = true;
              }
              for (var _i = 0; _i < options2.length; _i++) {
                var selected = selectedValue.hasOwnProperty("$" + options2[_i].value);
                if (options2[_i].selected !== selected) {
                  options2[_i].selected = selected;
                }
                if (selected && setDefaultSelected) {
                  options2[_i].defaultSelected = true;
                }
              }
            } else {
              var _selectedValue = toString(getToStringValue(propValue));
              var defaultSelected = null;
              for (var _i2 = 0; _i2 < options2.length; _i2++) {
                if (options2[_i2].value === _selectedValue) {
                  options2[_i2].selected = true;
                  if (setDefaultSelected) {
                    options2[_i2].defaultSelected = true;
                  }
                  return;
                }
                if (defaultSelected === null && !options2[_i2].disabled) {
                  defaultSelected = options2[_i2];
                }
              }
              if (defaultSelected !== null) {
                defaultSelected.selected = true;
              }
            }
          }
          function getHostProps$1(element, props) {
            return assign({}, props, {
              value: void 0
            });
          }
          function initWrapperState$1(element, props) {
            var node = element;
            {
              checkSelectPropTypes(props);
            }
            node._wrapperState = {
              wasMultiple: !!props.multiple
            };
            {
              if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue$1) {
                error("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components");
                didWarnValueDefaultValue$1 = true;
              }
            }
          }
          function postMountWrapper$2(element, props) {
            var node = element;
            node.multiple = !!props.multiple;
            var value = props.value;
            if (value != null) {
              updateOptions(node, !!props.multiple, value, false);
            } else if (props.defaultValue != null) {
              updateOptions(node, !!props.multiple, props.defaultValue, true);
            }
          }
          function postUpdateWrapper(element, props) {
            var node = element;
            var wasMultiple = node._wrapperState.wasMultiple;
            node._wrapperState.wasMultiple = !!props.multiple;
            var value = props.value;
            if (value != null) {
              updateOptions(node, !!props.multiple, value, false);
            } else if (wasMultiple !== !!props.multiple) {
              if (props.defaultValue != null) {
                updateOptions(node, !!props.multiple, props.defaultValue, true);
              } else {
                updateOptions(node, !!props.multiple, props.multiple ? [] : "", false);
              }
            }
          }
          function restoreControlledState$1(element, props) {
            var node = element;
            var value = props.value;
            if (value != null) {
              updateOptions(node, !!props.multiple, value, false);
            }
          }
          var didWarnValDefaultVal = false;
          function getHostProps$2(element, props) {
            var node = element;
            if (props.dangerouslySetInnerHTML != null) {
              throw new Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");
            }
            var hostProps = assign({}, props, {
              value: void 0,
              defaultValue: void 0,
              children: toString(node._wrapperState.initialValue)
            });
            return hostProps;
          }
          function initWrapperState$2(element, props) {
            var node = element;
            {
              checkControlledValueProps("textarea", props);
              if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValDefaultVal) {
                error("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component");
                didWarnValDefaultVal = true;
              }
            }
            var initialValue = props.value;
            if (initialValue == null) {
              var children = props.children, defaultValue = props.defaultValue;
              if (children != null) {
                {
                  error("Use the `defaultValue` or `value` props instead of setting children on <textarea>.");
                }
                {
                  if (defaultValue != null) {
                    throw new Error("If you supply `defaultValue` on a <textarea>, do not pass children.");
                  }
                  if (isArray(children)) {
                    if (children.length > 1) {
                      throw new Error("<textarea> can only have at most one child.");
                    }
                    children = children[0];
                  }
                  defaultValue = children;
                }
              }
              if (defaultValue == null) {
                defaultValue = "";
              }
              initialValue = defaultValue;
            }
            node._wrapperState = {
              initialValue: getToStringValue(initialValue)
            };
          }
          function updateWrapper$1(element, props) {
            var node = element;
            var value = getToStringValue(props.value);
            var defaultValue = getToStringValue(props.defaultValue);
            if (value != null) {
              var newValue = toString(value);
              if (newValue !== node.value) {
                node.value = newValue;
              }
              if (props.defaultValue == null && node.defaultValue !== newValue) {
                node.defaultValue = newValue;
              }
            }
            if (defaultValue != null) {
              node.defaultValue = toString(defaultValue);
            }
          }
          function postMountWrapper$3(element, props) {
            var node = element;
            var textContent = node.textContent;
            if (textContent === node._wrapperState.initialValue) {
              if (textContent !== "" && textContent !== null) {
                node.value = textContent;
              }
            }
          }
          function restoreControlledState$2(element, props) {
            updateWrapper$1(element, props);
          }
          var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
          var MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
          var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
          function getIntrinsicNamespace(type) {
            switch (type) {
              case "svg":
                return SVG_NAMESPACE;
              case "math":
                return MATH_NAMESPACE;
              default:
                return HTML_NAMESPACE;
            }
          }
          function getChildNamespace(parentNamespace, type) {
            if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {
              return getIntrinsicNamespace(type);
            }
            if (parentNamespace === SVG_NAMESPACE && type === "foreignObject") {
              return HTML_NAMESPACE;
            }
            return parentNamespace;
          }
          var createMicrosoftUnsafeLocalFunction = function(func) {
            if (typeof MSApp !== "undefined" && MSApp.execUnsafeLocalFunction) {
              return function(arg0, arg1, arg2, arg3) {
                MSApp.execUnsafeLocalFunction(function() {
                  return func(arg0, arg1, arg2, arg3);
                });
              };
            } else {
              return func;
            }
          };
          var reusableSVGContainer;
          var setInnerHTML = createMicrosoftUnsafeLocalFunction(function(node, html) {
            if (node.namespaceURI === SVG_NAMESPACE) {
              if (!("innerHTML" in node)) {
                reusableSVGContainer = reusableSVGContainer || document.createElement("div");
                reusableSVGContainer.innerHTML = "<svg>" + html.valueOf().toString() + "</svg>";
                var svgNode = reusableSVGContainer.firstChild;
                while (node.firstChild) {
                  node.removeChild(node.firstChild);
                }
                while (svgNode.firstChild) {
                  node.appendChild(svgNode.firstChild);
                }
                return;
              }
            }
            node.innerHTML = html;
          });
          var ELEMENT_NODE = 1;
          var TEXT_NODE = 3;
          var COMMENT_NODE = 8;
          var DOCUMENT_NODE = 9;
          var DOCUMENT_FRAGMENT_NODE = 11;
          var setTextContent = function(node, text) {
            if (text) {
              var firstChild = node.firstChild;
              if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
                firstChild.nodeValue = text;
                return;
              }
            }
            node.textContent = text;
          };
          var shorthandToLonghand = {
            animation: ["animationDelay", "animationDirection", "animationDuration", "animationFillMode", "animationIterationCount", "animationName", "animationPlayState", "animationTimingFunction"],
            background: ["backgroundAttachment", "backgroundClip", "backgroundColor", "backgroundImage", "backgroundOrigin", "backgroundPositionX", "backgroundPositionY", "backgroundRepeat", "backgroundSize"],
            backgroundPosition: ["backgroundPositionX", "backgroundPositionY"],
            border: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth", "borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth", "borderLeftColor", "borderLeftStyle", "borderLeftWidth", "borderRightColor", "borderRightStyle", "borderRightWidth", "borderTopColor", "borderTopStyle", "borderTopWidth"],
            borderBlockEnd: ["borderBlockEndColor", "borderBlockEndStyle", "borderBlockEndWidth"],
            borderBlockStart: ["borderBlockStartColor", "borderBlockStartStyle", "borderBlockStartWidth"],
            borderBottom: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth"],
            borderColor: ["borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor"],
            borderImage: ["borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth"],
            borderInlineEnd: ["borderInlineEndColor", "borderInlineEndStyle", "borderInlineEndWidth"],
            borderInlineStart: ["borderInlineStartColor", "borderInlineStartStyle", "borderInlineStartWidth"],
            borderLeft: ["borderLeftColor", "borderLeftStyle", "borderLeftWidth"],
            borderRadius: ["borderBottomLeftRadius", "borderBottomRightRadius", "borderTopLeftRadius", "borderTopRightRadius"],
            borderRight: ["borderRightColor", "borderRightStyle", "borderRightWidth"],
            borderStyle: ["borderBottomStyle", "borderLeftStyle", "borderRightStyle", "borderTopStyle"],
            borderTop: ["borderTopColor", "borderTopStyle", "borderTopWidth"],
            borderWidth: ["borderBottomWidth", "borderLeftWidth", "borderRightWidth", "borderTopWidth"],
            columnRule: ["columnRuleColor", "columnRuleStyle", "columnRuleWidth"],
            columns: ["columnCount", "columnWidth"],
            flex: ["flexBasis", "flexGrow", "flexShrink"],
            flexFlow: ["flexDirection", "flexWrap"],
            font: ["fontFamily", "fontFeatureSettings", "fontKerning", "fontLanguageOverride", "fontSize", "fontSizeAdjust", "fontStretch", "fontStyle", "fontVariant", "fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition", "fontWeight", "lineHeight"],
            fontVariant: ["fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition"],
            gap: ["columnGap", "rowGap"],
            grid: ["gridAutoColumns", "gridAutoFlow", "gridAutoRows", "gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
            gridArea: ["gridColumnEnd", "gridColumnStart", "gridRowEnd", "gridRowStart"],
            gridColumn: ["gridColumnEnd", "gridColumnStart"],
            gridColumnGap: ["columnGap"],
            gridGap: ["columnGap", "rowGap"],
            gridRow: ["gridRowEnd", "gridRowStart"],
            gridRowGap: ["rowGap"],
            gridTemplate: ["gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
            listStyle: ["listStyleImage", "listStylePosition", "listStyleType"],
            margin: ["marginBottom", "marginLeft", "marginRight", "marginTop"],
            marker: ["markerEnd", "markerMid", "markerStart"],
            mask: ["maskClip", "maskComposite", "maskImage", "maskMode", "maskOrigin", "maskPositionX", "maskPositionY", "maskRepeat", "maskSize"],
            maskPosition: ["maskPositionX", "maskPositionY"],
            outline: ["outlineColor", "outlineStyle", "outlineWidth"],
            overflow: ["overflowX", "overflowY"],
            padding: ["paddingBottom", "paddingLeft", "paddingRight", "paddingTop"],
            placeContent: ["alignContent", "justifyContent"],
            placeItems: ["alignItems", "justifyItems"],
            placeSelf: ["alignSelf", "justifySelf"],
            textDecoration: ["textDecorationColor", "textDecorationLine", "textDecorationStyle"],
            textEmphasis: ["textEmphasisColor", "textEmphasisStyle"],
            transition: ["transitionDelay", "transitionDuration", "transitionProperty", "transitionTimingFunction"],
            wordWrap: ["overflowWrap"]
          };
          var isUnitlessNumber = {
            animationIterationCount: true,
            aspectRatio: true,
            borderImageOutset: true,
            borderImageSlice: true,
            borderImageWidth: true,
            boxFlex: true,
            boxFlexGroup: true,
            boxOrdinalGroup: true,
            columnCount: true,
            columns: true,
            flex: true,
            flexGrow: true,
            flexPositive: true,
            flexShrink: true,
            flexNegative: true,
            flexOrder: true,
            gridArea: true,
            gridRow: true,
            gridRowEnd: true,
            gridRowSpan: true,
            gridRowStart: true,
            gridColumn: true,
            gridColumnEnd: true,
            gridColumnSpan: true,
            gridColumnStart: true,
            fontWeight: true,
            lineClamp: true,
            lineHeight: true,
            opacity: true,
            order: true,
            orphans: true,
            tabSize: true,
            widows: true,
            zIndex: true,
            zoom: true,
            fillOpacity: true,
            floodOpacity: true,
            stopOpacity: true,
            strokeDasharray: true,
            strokeDashoffset: true,
            strokeMiterlimit: true,
            strokeOpacity: true,
            strokeWidth: true
          };
          function prefixKey(prefix2, key2) {
            return prefix2 + key2.charAt(0).toUpperCase() + key2.substring(1);
          }
          var prefixes = ["Webkit", "ms", "Moz", "O"];
          Object.keys(isUnitlessNumber).forEach(function(prop) {
            prefixes.forEach(function(prefix2) {
              isUnitlessNumber[prefixKey(prefix2, prop)] = isUnitlessNumber[prop];
            });
          });
          function dangerousStyleValue(name, value, isCustomProperty) {
            var isEmpty = value == null || typeof value === "boolean" || value === "";
            if (isEmpty) {
              return "";
            }
            if (!isCustomProperty && typeof value === "number" && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
              return value + "px";
            }
            {
              checkCSSPropertyStringCoercion(value, name);
            }
            return ("" + value).trim();
          }
          var uppercasePattern = /([A-Z])/g;
          var msPattern = /^ms-/;
          function hyphenateStyleName(name) {
            return name.replace(uppercasePattern, "-$1").toLowerCase().replace(msPattern, "-ms-");
          }
          var warnValidStyle = function() {
          };
          {
            var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
            var msPattern$1 = /^-ms-/;
            var hyphenPattern = /-(.)/g;
            var badStyleValueWithSemicolonPattern = /;\s*$/;
            var warnedStyleNames = {};
            var warnedStyleValues = {};
            var warnedForNaNValue = false;
            var warnedForInfinityValue = false;
            var camelize = function(string) {
              return string.replace(hyphenPattern, function(_, character) {
                return character.toUpperCase();
              });
            };
            var warnHyphenatedStyleName = function(name) {
              if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
                return;
              }
              warnedStyleNames[name] = true;
              error(
                "Unsupported style property %s. Did you mean %s?",
                name,
                camelize(name.replace(msPattern$1, "ms-"))
              );
            };
            var warnBadVendoredStyleName = function(name) {
              if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
                return;
              }
              warnedStyleNames[name] = true;
              error("Unsupported vendor-prefixed style property %s. Did you mean %s?", name, name.charAt(0).toUpperCase() + name.slice(1));
            };
            var warnStyleValueWithSemicolon = function(name, value) {
              if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
                return;
              }
              warnedStyleValues[value] = true;
              error(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`, name, value.replace(badStyleValueWithSemicolonPattern, ""));
            };
            var warnStyleValueIsNaN = function(name, value) {
              if (warnedForNaNValue) {
                return;
              }
              warnedForNaNValue = true;
              error("`NaN` is an invalid value for the `%s` css style property.", name);
            };
            var warnStyleValueIsInfinity = function(name, value) {
              if (warnedForInfinityValue) {
                return;
              }
              warnedForInfinityValue = true;
              error("`Infinity` is an invalid value for the `%s` css style property.", name);
            };
            warnValidStyle = function(name, value) {
              if (name.indexOf("-") > -1) {
                warnHyphenatedStyleName(name);
              } else if (badVendoredStyleNamePattern.test(name)) {
                warnBadVendoredStyleName(name);
              } else if (badStyleValueWithSemicolonPattern.test(value)) {
                warnStyleValueWithSemicolon(name, value);
              }
              if (typeof value === "number") {
                if (isNaN(value)) {
                  warnStyleValueIsNaN(name, value);
                } else if (!isFinite(value)) {
                  warnStyleValueIsInfinity(name, value);
                }
              }
            };
          }
          var warnValidStyle$1 = warnValidStyle;
          function createDangerousStringForStyles(styles) {
            {
              var serialized = "";
              var delimiter = "";
              for (var styleName in styles) {
                if (!styles.hasOwnProperty(styleName)) {
                  continue;
                }
                var styleValue = styles[styleName];
                if (styleValue != null) {
                  var isCustomProperty = styleName.indexOf("--") === 0;
                  serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ":";
                  serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
                  delimiter = ";";
                }
              }
              return serialized || null;
            }
          }
          function setValueForStyles(node, styles) {
            var style2 = node.style;
            for (var styleName in styles) {
              if (!styles.hasOwnProperty(styleName)) {
                continue;
              }
              var isCustomProperty = styleName.indexOf("--") === 0;
              {
                if (!isCustomProperty) {
                  warnValidStyle$1(styleName, styles[styleName]);
                }
              }
              var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);
              if (styleName === "float") {
                styleName = "cssFloat";
              }
              if (isCustomProperty) {
                style2.setProperty(styleName, styleValue);
              } else {
                style2[styleName] = styleValue;
              }
            }
          }
          function isValueEmpty(value) {
            return value == null || typeof value === "boolean" || value === "";
          }
          function expandShorthandMap(styles) {
            var expanded = {};
            for (var key2 in styles) {
              var longhands = shorthandToLonghand[key2] || [key2];
              for (var i = 0; i < longhands.length; i++) {
                expanded[longhands[i]] = key2;
              }
            }
            return expanded;
          }
          function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
            {
              if (!nextStyles) {
                return;
              }
              var expandedUpdates = expandShorthandMap(styleUpdates);
              var expandedStyles = expandShorthandMap(nextStyles);
              var warnedAbout = {};
              for (var key2 in expandedUpdates) {
                var originalKey = expandedUpdates[key2];
                var correctOriginalKey = expandedStyles[key2];
                if (correctOriginalKey && originalKey !== correctOriginalKey) {
                  var warningKey = originalKey + "," + correctOriginalKey;
                  if (warnedAbout[warningKey]) {
                    continue;
                  }
                  warnedAbout[warningKey] = true;
                  error("%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.", isValueEmpty(styleUpdates[originalKey]) ? "Removing" : "Updating", originalKey, correctOriginalKey);
                }
              }
            }
          }
          var omittedCloseTags = {
            area: true,
            base: true,
            br: true,
            col: true,
            embed: true,
            hr: true,
            img: true,
            input: true,
            keygen: true,
            link: true,
            meta: true,
            param: true,
            source: true,
            track: true,
            wbr: true
          };
          var voidElementTags = assign({
            menuitem: true
          }, omittedCloseTags);
          var HTML = "__html";
          function assertValidProps(tag, props) {
            if (!props) {
              return;
            }
            if (voidElementTags[tag]) {
              if (props.children != null || props.dangerouslySetInnerHTML != null) {
                throw new Error(tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");
              }
            }
            if (props.dangerouslySetInnerHTML != null) {
              if (props.children != null) {
                throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
              }
              if (typeof props.dangerouslySetInnerHTML !== "object" || !(HTML in props.dangerouslySetInnerHTML)) {
                throw new Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.");
              }
            }
            {
              if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {
                error("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional.");
              }
            }
            if (props.style != null && typeof props.style !== "object") {
              throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");
            }
          }
          function isCustomComponent(tagName, props) {
            if (tagName.indexOf("-") === -1) {
              return typeof props.is === "string";
            }
            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 possibleStandardNames = {
            accept: "accept",
            acceptcharset: "acceptCharset",
            "accept-charset": "acceptCharset",
            accesskey: "accessKey",
            action: "action",
            allowfullscreen: "allowFullScreen",
            alt: "alt",
            as: "as",
            async: "async",
            autocapitalize: "autoCapitalize",
            autocomplete: "autoComplete",
            autocorrect: "autoCorrect",
            autofocus: "autoFocus",
            autoplay: "autoPlay",
            autosave: "autoSave",
            capture: "capture",
            cellpadding: "cellPadding",
            cellspacing: "cellSpacing",
            challenge: "challenge",
            charset: "charSet",
            checked: "checked",
            children: "children",
            cite: "cite",
            class: "className",
            classid: "classID",
            classname: "className",
            cols: "cols",
            colspan: "colSpan",
            content: "content",
            contenteditable: "contentEditable",
            contextmenu: "contextMenu",
            controls: "controls",
            controlslist: "controlsList",
            coords: "coords",
            crossorigin: "crossOrigin",
            dangerouslysetinnerhtml: "dangerouslySetInnerHTML",
            data: "data",
            datetime: "dateTime",
            default: "default",
            defaultchecked: "defaultChecked",
            defaultvalue: "defaultValue",
            defer: "defer",
            dir: "dir",
            disabled: "disabled",
            disablepictureinpicture: "disablePictureInPicture",
            disableremoteplayback: "disableRemotePlayback",
            download: "download",
            draggable: "draggable",
            enctype: "encType",
            enterkeyhint: "enterKeyHint",
            for: "htmlFor",
            form: "form",
            formmethod: "formMethod",
            formaction: "formAction",
            formenctype: "formEncType",
            formnovalidate: "formNoValidate",
            formtarget: "formTarget",
            frameborder: "frameBorder",
            headers: "headers",
            height: "height",
            hidden: "hidden",
            high: "high",
            href: "href",
            hreflang: "hrefLang",
            htmlfor: "htmlFor",
            httpequiv: "httpEquiv",
            "http-equiv": "httpEquiv",
            icon: "icon",
            id: "id",
            imagesizes: "imageSizes",
            imagesrcset: "imageSrcSet",
            innerhtml: "innerHTML",
            inputmode: "inputMode",
            integrity: "integrity",
            is: "is",
            itemid: "itemID",
            itemprop: "itemProp",
            itemref: "itemRef",
            itemscope: "itemScope",
            itemtype: "itemType",
            keyparams: "keyParams",
            keytype: "keyType",
            kind: "kind",
            label: "label",
            lang: "lang",
            list: "list",
            loop: "loop",
            low: "low",
            manifest: "manifest",
            marginwidth: "marginWidth",
            marginheight: "marginHeight",
            max: "max",
            maxlength: "maxLength",
            media: "media",
            mediagroup: "mediaGroup",
            method: "method",
            min: "min",
            minlength: "minLength",
            multiple: "multiple",
            muted: "muted",
            name: "name",
            nomodule: "noModule",
            nonce: "nonce",
            novalidate: "noValidate",
            open: "open",
            optimum: "optimum",
            pattern: "pattern",
            placeholder: "placeholder",
            playsinline: "playsInline",
            poster: "poster",
            preload: "preload",
            profile: "profile",
            radiogroup: "radioGroup",
            readonly: "readOnly",
            referrerpolicy: "referrerPolicy",
            rel: "rel",
            required: "required",
            reversed: "reversed",
            role: "role",
            rows: "rows",
            rowspan: "rowSpan",
            sandbox: "sandbox",
            scope: "scope",
            scoped: "scoped",
            scrolling: "scrolling",
            seamless: "seamless",
            selected: "selected",
            shape: "shape",
            size: "size",
            sizes: "sizes",
            span: "span",
            spellcheck: "spellCheck",
            src: "src",
            srcdoc: "srcDoc",
            srclang: "srcLang",
            srcset: "srcSet",
            start: "start",
            step: "step",
            style: "style",
            summary: "summary",
            tabindex: "tabIndex",
            target: "target",
            title: "title",
            type: "type",
            usemap: "useMap",
            value: "value",
            width: "width",
            wmode: "wmode",
            wrap: "wrap",
            about: "about",
            accentheight: "accentHeight",
            "accent-height": "accentHeight",
            accumulate: "accumulate",
            additive: "additive",
            alignmentbaseline: "alignmentBaseline",
            "alignment-baseline": "alignmentBaseline",
            allowreorder: "allowReorder",
            alphabetic: "alphabetic",
            amplitude: "amplitude",
            arabicform: "arabicForm",
            "arabic-form": "arabicForm",
            ascent: "ascent",
            attributename: "attributeName",
            attributetype: "attributeType",
            autoreverse: "autoReverse",
            azimuth: "azimuth",
            basefrequency: "baseFrequency",
            baselineshift: "baselineShift",
            "baseline-shift": "baselineShift",
            baseprofile: "baseProfile",
            bbox: "bbox",
            begin: "begin",
            bias: "bias",
            by: "by",
            calcmode: "calcMode",
            capheight: "capHeight",
            "cap-height": "capHeight",
            clip: "clip",
            clippath: "clipPath",
            "clip-path": "clipPath",
            clippathunits: "clipPathUnits",
            cliprule: "clipRule",
            "clip-rule": "clipRule",
            color: "color",
            colorinterpolation: "colorInterpolation",
            "color-interpolation": "colorInterpolation",
            colorinterpolationfilters: "colorInterpolationFilters",
            "color-interpolation-filters": "colorInterpolationFilters",
            colorprofile: "colorProfile",
            "color-profile": "colorProfile",
            colorrendering: "colorRendering",
            "color-rendering": "colorRendering",
            contentscripttype: "contentScriptType",
            contentstyletype: "contentStyleType",
            cursor: "cursor",
            cx: "cx",
            cy: "cy",
            d: "d",
            datatype: "datatype",
            decelerate: "decelerate",
            descent: "descent",
            diffuseconstant: "diffuseConstant",
            direction: "direction",
            display: "display",
            divisor: "divisor",
            dominantbaseline: "dominantBaseline",
            "dominant-baseline": "dominantBaseline",
            dur: "dur",
            dx: "dx",
            dy: "dy",
            edgemode: "edgeMode",
            elevation: "elevation",
            enablebackground: "enableBackground",
            "enable-background": "enableBackground",
            end: "end",
            exponent: "exponent",
            externalresourcesrequired: "externalResourcesRequired",
            fill: "fill",
            fillopacity: "fillOpacity",
            "fill-opacity": "fillOpacity",
            fillrule: "fillRule",
            "fill-rule": "fillRule",
            filter: "filter",
            filterres: "filterRes",
            filterunits: "filterUnits",
            floodopacity: "floodOpacity",
            "flood-opacity": "floodOpacity",
            floodcolor: "floodColor",
            "flood-color": "floodColor",
            focusable: "focusable",
            fontfamily: "fontFamily",
            "font-family": "fontFamily",
            fontsize: "fontSize",
            "font-size": "fontSize",
            fontsizeadjust: "fontSizeAdjust",
            "font-size-adjust": "fontSizeAdjust",
            fontstretch: "fontStretch",
            "font-stretch": "fontStretch",
            fontstyle: "fontStyle",
            "font-style": "fontStyle",
            fontvariant: "fontVariant",
            "font-variant": "fontVariant",
            fontweight: "fontWeight",
            "font-weight": "fontWeight",
            format: "format",
            from: "from",
            fx: "fx",
            fy: "fy",
            g1: "g1",
            g2: "g2",
            glyphname: "glyphName",
            "glyph-name": "glyphName",
            glyphorientationhorizontal: "glyphOrientationHorizontal",
            "glyph-orientation-horizontal": "glyphOrientationHorizontal",
            glyphorientationvertical: "glyphOrientationVertical",
            "glyph-orientation-vertical": "glyphOrientationVertical",
            glyphref: "glyphRef",
            gradienttransform: "gradientTransform",
            gradientunits: "gradientUnits",
            hanging: "hanging",
            horizadvx: "horizAdvX",
            "horiz-adv-x": "horizAdvX",
            horizoriginx: "horizOriginX",
            "horiz-origin-x": "horizOriginX",
            ideographic: "ideographic",
            imagerendering: "imageRendering",
            "image-rendering": "imageRendering",
            in2: "in2",
            in: "in",
            inlist: "inlist",
            intercept: "intercept",
            k1: "k1",
            k2: "k2",
            k3: "k3",
            k4: "k4",
            k: "k",
            kernelmatrix: "kernelMatrix",
            kernelunitlength: "kernelUnitLength",
            kerning: "kerning",
            keypoints: "keyPoints",
            keysplines: "keySplines",
            keytimes: "keyTimes",
            lengthadjust: "lengthAdjust",
            letterspacing: "letterSpacing",
            "letter-spacing": "letterSpacing",
            lightingcolor: "lightingColor",
            "lighting-color": "lightingColor",
            limitingconeangle: "limitingConeAngle",
            local: "local",
            markerend: "markerEnd",
            "marker-end": "markerEnd",
            markerheight: "markerHeight",
            markermid: "markerMid",
            "marker-mid": "markerMid",
            markerstart: "markerStart",
            "marker-start": "markerStart",
            markerunits: "markerUnits",
            markerwidth: "markerWidth",
            mask: "mask",
            maskcontentunits: "maskContentUnits",
            maskunits: "maskUnits",
            mathematical: "mathematical",
            mode: "mode",
            numoctaves: "numOctaves",
            offset: "offset",
            opacity: "opacity",
            operator: "operator",
            order: "order",
            orient: "orient",
            orientation: "orientation",
            origin: "origin",
            overflow: "overflow",
            overlineposition: "overlinePosition",
            "overline-position": "overlinePosition",
            overlinethickness: "overlineThickness",
            "overline-thickness": "overlineThickness",
            paintorder: "paintOrder",
            "paint-order": "paintOrder",
            panose1: "panose1",
            "panose-1": "panose1",
            pathlength: "pathLength",
            patterncontentunits: "patternContentUnits",
            patterntransform: "patternTransform",
            patternunits: "patternUnits",
            pointerevents: "pointerEvents",
            "pointer-events": "pointerEvents",
            points: "points",
            pointsatx: "pointsAtX",
            pointsaty: "pointsAtY",
            pointsatz: "pointsAtZ",
            prefix: "prefix",
            preservealpha: "preserveAlpha",
            preserveaspectratio: "preserveAspectRatio",
            primitiveunits: "primitiveUnits",
            property: "property",
            r: "r",
            radius: "radius",
            refx: "refX",
            refy: "refY",
            renderingintent: "renderingIntent",
            "rendering-intent": "renderingIntent",
            repeatcount: "repeatCount",
            repeatdur: "repeatDur",
            requiredextensions: "requiredExtensions",
            requiredfeatures: "requiredFeatures",
            resource: "resource",
            restart: "restart",
            result: "result",
            results: "results",
            rotate: "rotate",
            rx: "rx",
            ry: "ry",
            scale: "scale",
            security: "security",
            seed: "seed",
            shaperendering: "shapeRendering",
            "shape-rendering": "shapeRendering",
            slope: "slope",
            spacing: "spacing",
            specularconstant: "specularConstant",
            specularexponent: "specularExponent",
            speed: "speed",
            spreadmethod: "spreadMethod",
            startoffset: "startOffset",
            stddeviation: "stdDeviation",
            stemh: "stemh",
            stemv: "stemv",
            stitchtiles: "stitchTiles",
            stopcolor: "stopColor",
            "stop-color": "stopColor",
            stopopacity: "stopOpacity",
            "stop-opacity": "stopOpacity",
            strikethroughposition: "strikethroughPosition",
            "strikethrough-position": "strikethroughPosition",
            strikethroughthickness: "strikethroughThickness",
            "strikethrough-thickness": "strikethroughThickness",
            string: "string",
            stroke: "stroke",
            strokedasharray: "strokeDasharray",
            "stroke-dasharray": "strokeDasharray",
            strokedashoffset: "strokeDashoffset",
            "stroke-dashoffset": "strokeDashoffset",
            strokelinecap: "strokeLinecap",
            "stroke-linecap": "strokeLinecap",
            strokelinejoin: "strokeLinejoin",
            "stroke-linejoin": "strokeLinejoin",
            strokemiterlimit: "strokeMiterlimit",
            "stroke-miterlimit": "strokeMiterlimit",
            strokewidth: "strokeWidth",
            "stroke-width": "strokeWidth",
            strokeopacity: "strokeOpacity",
            "stroke-opacity": "strokeOpacity",
            suppresscontenteditablewarning: "suppressContentEditableWarning",
            suppresshydrationwarning: "suppressHydrationWarning",
            surfacescale: "surfaceScale",
            systemlanguage: "systemLanguage",
            tablevalues: "tableValues",
            targetx: "targetX",
            targety: "targetY",
            textanchor: "textAnchor",
            "text-anchor": "textAnchor",
            textdecoration: "textDecoration",
            "text-decoration": "textDecoration",
            textlength: "textLength",
            textrendering: "textRendering",
            "text-rendering": "textRendering",
            to: "to",
            transform: "transform",
            typeof: "typeof",
            u1: "u1",
            u2: "u2",
            underlineposition: "underlinePosition",
            "underline-position": "underlinePosition",
            underlinethickness: "underlineThickness",
            "underline-thickness": "underlineThickness",
            unicode: "unicode",
            unicodebidi: "unicodeBidi",
            "unicode-bidi": "unicodeBidi",
            unicoderange: "unicodeRange",
            "unicode-range": "unicodeRange",
            unitsperem: "unitsPerEm",
            "units-per-em": "unitsPerEm",
            unselectable: "unselectable",
            valphabetic: "vAlphabetic",
            "v-alphabetic": "vAlphabetic",
            values: "values",
            vectoreffect: "vectorEffect",
            "vector-effect": "vectorEffect",
            version: "version",
            vertadvy: "vertAdvY",
            "vert-adv-y": "vertAdvY",
            vertoriginx: "vertOriginX",
            "vert-origin-x": "vertOriginX",
            vertoriginy: "vertOriginY",
            "vert-origin-y": "vertOriginY",
            vhanging: "vHanging",
            "v-hanging": "vHanging",
            videographic: "vIdeographic",
            "v-ideographic": "vIdeographic",
            viewbox: "viewBox",
            viewtarget: "viewTarget",
            visibility: "visibility",
            vmathematical: "vMathematical",
            "v-mathematical": "vMathematical",
            vocab: "vocab",
            widths: "widths",
            wordspacing: "wordSpacing",
            "word-spacing": "wordSpacing",
            writingmode: "writingMode",
            "writing-mode": "writingMode",
            x1: "x1",
            x2: "x2",
            x: "x",
            xchannelselector: "xChannelSelector",
            xheight: "xHeight",
            "x-height": "xHeight",
            xlinkactuate: "xlinkActuate",
            "xlink:actuate": "xlinkActuate",
            xlinkarcrole: "xlinkArcrole",
            "xlink:arcrole": "xlinkArcrole",
            xlinkhref: "xlinkHref",
            "xlink:href": "xlinkHref",
            xlinkrole: "xlinkRole",
            "xlink:role": "xlinkRole",
            xlinkshow: "xlinkShow",
            "xlink:show": "xlinkShow",
            xlinktitle: "xlinkTitle",
            "xlink:title": "xlinkTitle",
            xlinktype: "xlinkType",
            "xlink:type": "xlinkType",
            xmlbase: "xmlBase",
            "xml:base": "xmlBase",
            xmllang: "xmlLang",
            "xml:lang": "xmlLang",
            xmlns: "xmlns",
            "xml:space": "xmlSpace",
            xmlnsxlink: "xmlnsXlink",
            "xmlns:xlink": "xmlnsXlink",
            xmlspace: "xmlSpace",
            y1: "y1",
            y2: "y2",
            y: "y",
            ychannelselector: "yChannelSelector",
            z: "z",
            zoomandpan: "zoomAndPan"
          };
          var ariaProperties = {
            "aria-current": 0,
            "aria-description": 0,
            "aria-details": 0,
            "aria-disabled": 0,
            "aria-hidden": 0,
            "aria-invalid": 0,
            "aria-keyshortcuts": 0,
            "aria-label": 0,
            "aria-roledescription": 0,
            "aria-autocomplete": 0,
            "aria-checked": 0,
            "aria-expanded": 0,
            "aria-haspopup": 0,
            "aria-level": 0,
            "aria-modal": 0,
            "aria-multiline": 0,
            "aria-multiselectable": 0,
            "aria-orientation": 0,
            "aria-placeholder": 0,
            "aria-pressed": 0,
            "aria-readonly": 0,
            "aria-required": 0,
            "aria-selected": 0,
            "aria-sort": 0,
            "aria-valuemax": 0,
            "aria-valuemin": 0,
            "aria-valuenow": 0,
            "aria-valuetext": 0,
            "aria-atomic": 0,
            "aria-busy": 0,
            "aria-live": 0,
            "aria-relevant": 0,
            "aria-dropeffect": 0,
            "aria-grabbed": 0,
            "aria-activedescendant": 0,
            "aria-colcount": 0,
            "aria-colindex": 0,
            "aria-colspan": 0,
            "aria-controls": 0,
            "aria-describedby": 0,
            "aria-errormessage": 0,
            "aria-flowto": 0,
            "aria-labelledby": 0,
            "aria-owns": 0,
            "aria-posinset": 0,
            "aria-rowcount": 0,
            "aria-rowindex": 0,
            "aria-rowspan": 0,
            "aria-setsize": 0
          };
          var warnedProperties = {};
          var rARIA = new RegExp("^(aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$");
          var rARIACamel = new RegExp("^(aria)[A-Z][" + ATTRIBUTE_NAME_CHAR + "]*$");
          function validateProperty(tagName, name) {
            {
              if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) {
                return true;
              }
              if (rARIACamel.test(name)) {
                var ariaName = "aria-" + name.slice(4).toLowerCase();
                var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null;
                if (correctName == null) {
                  error("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.", name);
                  warnedProperties[name] = true;
                  return true;
                }
                if (name !== correctName) {
                  error("Invalid ARIA attribute `%s`. Did you mean `%s`?", name, correctName);
                  warnedProperties[name] = true;
                  return true;
                }
              }
              if (rARIA.test(name)) {
                var lowerCasedName = name.toLowerCase();
                var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null;
                if (standardName == null) {
                  warnedProperties[name] = true;
                  return false;
                }
                if (name !== standardName) {
                  error("Unknown ARIA attribute `%s`. Did you mean `%s`?", name, standardName);
                  warnedProperties[name] = true;
                  return true;
                }
              }
            }
            return true;
          }
          function warnInvalidARIAProps(type, props) {
            {
              var invalidProps = [];
              for (var key2 in props) {
                var isValid = validateProperty(type, key2);
                if (!isValid) {
                  invalidProps.push(key2);
                }
              }
              var unknownPropString = invalidProps.map(function(prop) {
                return "`" + prop + "`";
              }).join(", ");
              if (invalidProps.length === 1) {
                error("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type);
              } else if (invalidProps.length > 1) {
                error("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type);
              }
            }
          }
          function validateProperties(type, props) {
            if (isCustomComponent(type, props)) {
              return;
            }
            warnInvalidARIAProps(type, props);
          }
          var didWarnValueNull = false;
          function validateProperties$1(type, props) {
            {
              if (type !== "input" && type !== "textarea" && type !== "select") {
                return;
              }
              if (props != null && props.value === null && !didWarnValueNull) {
                didWarnValueNull = true;
                if (type === "select" && props.multiple) {
                  error("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.", type);
                } else {
                  error("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.", type);
                }
              }
            }
          }
          var validateProperty$1 = function() {
          };
          {
            var warnedProperties$1 = {};
            var EVENT_NAME_REGEX = /^on./;
            var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
            var rARIA$1 = new RegExp("^(aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$");
            var rARIACamel$1 = new RegExp("^(aria)[A-Z][" + ATTRIBUTE_NAME_CHAR + "]*$");
            validateProperty$1 = function(tagName, name, value, eventRegistry) {
              if (hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
                return true;
              }
              var lowerCasedName = name.toLowerCase();
              if (lowerCasedName === "onfocusin" || lowerCasedName === "onfocusout") {
                error("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React.");
                warnedProperties$1[name] = true;
                return true;
              }
              if (eventRegistry != null) {
                var registrationNameDependencies2 = eventRegistry.registrationNameDependencies, possibleRegistrationNames2 = eventRegistry.possibleRegistrationNames;
                if (registrationNameDependencies2.hasOwnProperty(name)) {
                  return true;
                }
                var registrationName = possibleRegistrationNames2.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames2[lowerCasedName] : null;
                if (registrationName != null) {
                  error("Invalid event handler property `%s`. Did you mean `%s`?", name, registrationName);
                  warnedProperties$1[name] = true;
                  return true;
                }
                if (EVENT_NAME_REGEX.test(name)) {
                  error("Unknown event handler property `%s`. It will be ignored.", name);
                  warnedProperties$1[name] = true;
                  return true;
                }
              } else if (EVENT_NAME_REGEX.test(name)) {
                if (INVALID_EVENT_NAME_REGEX.test(name)) {
                  error("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.", name);
                }
                warnedProperties$1[name] = true;
                return true;
              }
              if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
                return true;
              }
              if (lowerCasedName === "innerhtml") {
                error("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`.");
                warnedProperties$1[name] = true;
                return true;
              }
              if (lowerCasedName === "aria") {
                error("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead.");
                warnedProperties$1[name] = true;
                return true;
              }
              if (lowerCasedName === "is" && value !== null && value !== void 0 && typeof value !== "string") {
                error("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.", typeof value);
                warnedProperties$1[name] = true;
                return true;
              }
              if (typeof value === "number" && isNaN(value)) {
                error("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.", name);
                warnedProperties$1[name] = true;
                return true;
              }
              var propertyInfo = getPropertyInfo(name);
              var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED;
              if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
                var standardName = possibleStandardNames[lowerCasedName];
                if (standardName !== name) {
                  error("Invalid DOM property `%s`. Did you mean `%s`?", name, standardName);
                  warnedProperties$1[name] = true;
                  return true;
                }
              } else if (!isReserved && name !== lowerCasedName) {
                error("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.", name, lowerCasedName);
                warnedProperties$1[name] = true;
                return true;
              }
              if (typeof value === "boolean" && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
                if (value) {
                  error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.', value, name, name, value, name);
                } else {
                  error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
                }
                warnedProperties$1[name] = true;
                return true;
              }
              if (isReserved) {
                return true;
              }
              if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
                warnedProperties$1[name] = true;
                return false;
              }
              if ((value === "false" || value === "true") && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
                error("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?", value, name, value === "false" ? "The browser will interpret it as a truthy value." : 'Although this works, it will not work as expected if you pass the string "false".', name, value);
                warnedProperties$1[name] = true;
                return true;
              }
              return true;
            };
          }
          var warnUnknownProperties = function(type, props, eventRegistry) {
            {
              var unknownProps = [];
              for (var key2 in props) {
                var isValid = validateProperty$1(type, key2, props[key2], eventRegistry);
                if (!isValid) {
                  unknownProps.push(key2);
                }
              }
              var unknownPropString = unknownProps.map(function(prop) {
                return "`" + prop + "`";
              }).join(", ");
              if (unknownProps.length === 1) {
                error("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", unknownPropString, type);
              } else if (unknownProps.length > 1) {
                error("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", unknownPropString, type);
              }
            }
          };
          function validateProperties$2(type, props, eventRegistry) {
            if (isCustomComponent(type, props)) {
              return;
            }
            warnUnknownProperties(type, props, eventRegistry);
          }
          var IS_EVENT_HANDLE_NON_MANAGED_NODE = 1;
          var IS_NON_DELEGATED = 1 << 1;
          var IS_CAPTURE_PHASE = 1 << 2;
          var SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS = IS_EVENT_HANDLE_NON_MANAGED_NODE | IS_NON_DELEGATED | IS_CAPTURE_PHASE;
          var currentReplayingEvent = null;
          function setReplayingEvent(event) {
            {
              if (currentReplayingEvent !== null) {
                error("Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            currentReplayingEvent = event;
          }
          function resetReplayingEvent() {
            {
              if (currentReplayingEvent === null) {
                error("Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            currentReplayingEvent = null;
          }
          function isReplayingEvent(event) {
            return event === currentReplayingEvent;
          }
          function getEventTarget(nativeEvent) {
            var target = nativeEvent.target || nativeEvent.srcElement || window;
            if (target.correspondingUseElement) {
              target = target.correspondingUseElement;
            }
            return target.nodeType === TEXT_NODE ? target.parentNode : target;
          }
          var restoreImpl = null;
          var restoreTarget = null;
          var restoreQueue = null;
          function restoreStateOfTarget(target) {
            var internalInstance = getInstanceFromNode(target);
            if (!internalInstance) {
              return;
            }
            if (typeof restoreImpl !== "function") {
              throw new Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.");
            }
            var stateNode = internalInstance.stateNode;
            if (stateNode) {
              var _props = getFiberCurrentPropsFromNode(stateNode);
              restoreImpl(internalInstance.stateNode, internalInstance.type, _props);
            }
          }
          function setRestoreImplementation(impl) {
            restoreImpl = impl;
          }
          function enqueueStateRestore(target) {
            if (restoreTarget) {
              if (restoreQueue) {
                restoreQueue.push(target);
              } else {
                restoreQueue = [target];
              }
            } else {
              restoreTarget = target;
            }
          }
          function needsStateRestore() {
            return restoreTarget !== null || restoreQueue !== null;
          }
          function restoreStateIfNeeded() {
            if (!restoreTarget) {
              return;
            }
            var target = restoreTarget;
            var queuedTargets = restoreQueue;
            restoreTarget = null;
            restoreQueue = null;
            restoreStateOfTarget(target);
            if (queuedTargets) {
              for (var i = 0; i < queuedTargets.length; i++) {
                restoreStateOfTarget(queuedTargets[i]);
              }
            }
          }
          var batchedUpdatesImpl = function(fn, bookkeeping) {
            return fn(bookkeeping);
          };
          var flushSyncImpl = function() {
          };
          var isInsideEventHandler = false;
          function finishEventHandler() {
            var controlledComponentsHavePendingUpdates = needsStateRestore();
            if (controlledComponentsHavePendingUpdates) {
              flushSyncImpl();
              restoreStateIfNeeded();
            }
          }
          function batchedUpdates(fn, a, b) {
            if (isInsideEventHandler) {
              return fn(a, b);
            }
            isInsideEventHandler = true;
            try {
              return batchedUpdatesImpl(fn, a, b);
            } finally {
              isInsideEventHandler = false;
              finishEventHandler();
            }
          }
          function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushSyncImpl) {
            batchedUpdatesImpl = _batchedUpdatesImpl;
            flushSyncImpl = _flushSyncImpl;
          }
          function isInteractive(tag) {
            return tag === "button" || tag === "input" || tag === "select" || tag === "textarea";
          }
          function shouldPreventMouseEvent(name, type, props) {
            switch (name) {
              case "onClick":
              case "onClickCapture":
              case "onDoubleClick":
              case "onDoubleClickCapture":
              case "onMouseDown":
              case "onMouseDownCapture":
              case "onMouseMove":
              case "onMouseMoveCapture":
              case "onMouseUp":
              case "onMouseUpCapture":
              case "onMouseEnter":
                return !!(props.disabled && isInteractive(type));
              default:
                return false;
            }
          }
          function getListener(inst, registrationName) {
            var stateNode = inst.stateNode;
            if (stateNode === null) {
              return null;
            }
            var props = getFiberCurrentPropsFromNode(stateNode);
            if (props === null) {
              return null;
            }
            var listener = props[registrationName];
            if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
              return null;
            }
            if (listener && typeof listener !== "function") {
              throw new Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type.");
            }
            return listener;
          }
          var passiveBrowserEventsSupported = false;
          if (canUseDOM) {
            try {
              var options = {};
              Object.defineProperty(options, "passive", {
                get: function() {
                  passiveBrowserEventsSupported = true;
                }
              });
              window.addEventListener("test", options, options);
              window.removeEventListener("test", options, options);
            } catch (e) {
              passiveBrowserEventsSupported = false;
            }
          }
          function invokeGuardedCallbackProd(name, func, context, a, b, c, d, e, f) {
            var funcArgs = Array.prototype.slice.call(arguments, 3);
            try {
              func.apply(context, funcArgs);
            } catch (error2) {
              this.onError(error2);
            }
          }
          var invokeGuardedCallbackImpl = invokeGuardedCallbackProd;
          {
            if (typeof window !== "undefined" && typeof window.dispatchEvent === "function" && typeof document !== "undefined" && typeof document.createEvent === "function") {
              var fakeNode = document.createElement("react");
              invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name, func, context, a, b, c, d, e, f) {
                if (typeof document === "undefined" || document === null) {
                  throw new Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");
                }
                var evt = document.createEvent("Event");
                var didCall = false;
                var didError = true;
                var windowEvent = window.event;
                var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, "event");
                function restoreAfterDispatch() {
                  fakeNode.removeEventListener(evtType, callCallback2, false);
                  if (typeof window.event !== "undefined" && window.hasOwnProperty("event")) {
                    window.event = windowEvent;
                  }
                }
                var funcArgs = Array.prototype.slice.call(arguments, 3);
                function callCallback2() {
                  didCall = true;
                  restoreAfterDispatch();
                  func.apply(context, funcArgs);
                  didError = false;
                }
                var error2;
                var didSetError = false;
                var isCrossOriginError = false;
                function handleWindowError(event) {
                  error2 = event.error;
                  didSetError = true;
                  if (error2 === null && event.colno === 0 && event.lineno === 0) {
                    isCrossOriginError = true;
                  }
                  if (event.defaultPrevented) {
                    if (error2 != null && typeof error2 === "object") {
                      try {
                        error2._suppressLogging = true;
                      } catch (inner) {
                      }
                    }
                  }
                }
                var evtType = "react-" + (name ? name : "invokeguardedcallback");
                window.addEventListener("error", handleWindowError);
                fakeNode.addEventListener(evtType, callCallback2, false);
                evt.initEvent(evtType, false, false);
                fakeNode.dispatchEvent(evt);
                if (windowEventDescriptor) {
                  Object.defineProperty(window, "event", windowEventDescriptor);
                }
                if (didCall && didError) {
                  if (!didSetError) {
                    error2 = new Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`);
                  } else if (isCrossOriginError) {
                    error2 = new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.");
                  }
                  this.onError(error2);
                }
                window.removeEventListener("error", handleWindowError);
                if (!didCall) {
                  restoreAfterDispatch();
                  return invokeGuardedCallbackProd.apply(this, arguments);
                }
              };
            }
          }
          var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;
          var hasError = false;
          var caughtError = null;
          var hasRethrowError = false;
          var rethrowError = null;
          var reporter = {
            onError: function(error2) {
              hasError = true;
              caughtError = error2;
            }
          };
          function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
            hasError = false;
            caughtError = null;
            invokeGuardedCallbackImpl$1.apply(reporter, arguments);
          }
          function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {
            invokeGuardedCallback.apply(this, arguments);
            if (hasError) {
              var error2 = clearCaughtError();
              if (!hasRethrowError) {
                hasRethrowError = true;
                rethrowError = error2;
              }
            }
          }
          function rethrowCaughtError() {
            if (hasRethrowError) {
              var error2 = rethrowError;
              hasRethrowError = false;
              rethrowError = null;
              throw error2;
            }
          }
          function hasCaughtError() {
            return hasError;
          }
          function clearCaughtError() {
            if (hasError) {
              var error2 = caughtError;
              hasError = false;
              caughtError = null;
              return error2;
            } else {
              throw new Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");
            }
          }
          function get(key2) {
            return key2._reactInternals;
          }
          function has(key2) {
            return key2._reactInternals !== void 0;
          }
          function set(key2, value) {
            key2._reactInternals = value;
          }
          var NoFlags = 0;
          var PerformedWork = 1;
          var Placement = 2;
          var Update = 4;
          var ChildDeletion = 16;
          var ContentReset = 32;
          var Callback = 64;
          var DidCapture = 128;
          var ForceClientRender = 256;
          var Ref = 512;
          var Snapshot = 1024;
          var Passive = 2048;
          var Hydrating = 4096;
          var Visibility = 8192;
          var StoreConsistency = 16384;
          var LifecycleEffectMask = Passive | Update | Callback | Ref | Snapshot | StoreConsistency;
          var HostEffectMask = 32767;
          var Incomplete = 32768;
          var ShouldCapture = 65536;
          var ForceUpdateForLegacySuspense = 131072;
          var Forked = 1048576;
          var RefStatic = 2097152;
          var LayoutStatic = 4194304;
          var PassiveStatic = 8388608;
          var MountLayoutDev = 16777216;
          var MountPassiveDev = 33554432;
          var BeforeMutationMask = Update | Snapshot | 0;
          var MutationMask = Placement | Update | ChildDeletion | ContentReset | Ref | Hydrating | Visibility;
          var LayoutMask = Update | Callback | Ref | Visibility;
          var PassiveMask = Passive | ChildDeletion;
          var StaticMask = LayoutStatic | PassiveStatic | RefStatic;
          var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
          function getNearestMountedFiber(fiber) {
            var node = fiber;
            var nearestMounted = fiber;
            if (!fiber.alternate) {
              var nextNode = node;
              do {
                node = nextNode;
                if ((node.flags & (Placement | Hydrating)) !== NoFlags) {
                  nearestMounted = node.return;
                }
                nextNode = node.return;
              } while (nextNode);
            } else {
              while (node.return) {
                node = node.return;
              }
            }
            if (node.tag === HostRoot) {
              return nearestMounted;
            }
            return null;
          }
          function getSuspenseInstanceFromFiber(fiber) {
            if (fiber.tag === SuspenseComponent) {
              var suspenseState = fiber.memoizedState;
              if (suspenseState === null) {
                var current2 = fiber.alternate;
                if (current2 !== null) {
                  suspenseState = current2.memoizedState;
                }
              }
              if (suspenseState !== null) {
                return suspenseState.dehydrated;
              }
            }
            return null;
          }
          function getContainerFromFiber(fiber) {
            return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;
          }
          function isFiberMounted(fiber) {
            return getNearestMountedFiber(fiber) === fiber;
          }
          function isMounted(component) {
            {
              var owner = ReactCurrentOwner.current;
              if (owner !== null && owner.tag === ClassComponent) {
                var ownerFiber = owner;
                var instance = ownerFiber.stateNode;
                if (!instance._warnedAboutRefsInRender) {
                  error("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", getComponentNameFromFiber(ownerFiber) || "A component");
                }
                instance._warnedAboutRefsInRender = true;
              }
            }
            var fiber = get(component);
            if (!fiber) {
              return false;
            }
            return getNearestMountedFiber(fiber) === fiber;
          }
          function assertIsMounted(fiber) {
            if (getNearestMountedFiber(fiber) !== fiber) {
              throw new Error("Unable to find node on an unmounted component.");
            }
          }
          function findCurrentFiberUsingSlowPath(fiber) {
            var alternate = fiber.alternate;
            if (!alternate) {
              var nearestMounted = getNearestMountedFiber(fiber);
              if (nearestMounted === null) {
                throw new Error("Unable to find node on an unmounted component.");
              }
              if (nearestMounted !== fiber) {
                return null;
              }
              return fiber;
            }
            var a = fiber;
            var b = alternate;
            while (true) {
              var parentA = a.return;
              if (parentA === null) {
                break;
              }
              var parentB = parentA.alternate;
              if (parentB === null) {
                var nextParent = parentA.return;
                if (nextParent !== null) {
                  a = b = nextParent;
                  continue;
                }
                break;
              }
              if (parentA.child === parentB.child) {
                var child = parentA.child;
                while (child) {
                  if (child === a) {
                    assertIsMounted(parentA);
                    return fiber;
                  }
                  if (child === b) {
                    assertIsMounted(parentA);
                    return alternate;
                  }
                  child = child.sibling;
                }
                throw new Error("Unable to find node on an unmounted component.");
              }
              if (a.return !== b.return) {
                a = parentA;
                b = parentB;
              } else {
                var didFindChild = false;
                var _child = parentA.child;
                while (_child) {
                  if (_child === a) {
                    didFindChild = true;
                    a = parentA;
                    b = parentB;
                    break;
                  }
                  if (_child === b) {
                    didFindChild = true;
                    b = parentA;
                    a = parentB;
                    break;
                  }
                  _child = _child.sibling;
                }
                if (!didFindChild) {
                  _child = parentB.child;
                  while (_child) {
                    if (_child === a) {
                      didFindChild = true;
                      a = parentB;
                      b = parentA;
                      break;
                    }
                    if (_child === b) {
                      didFindChild = true;
                      b = parentB;
                      a = parentA;
                      break;
                    }
                    _child = _child.sibling;
                  }
                  if (!didFindChild) {
                    throw new Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.");
                  }
                }
              }
              if (a.alternate !== b) {
                throw new Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            if (a.tag !== HostRoot) {
              throw new Error("Unable to find node on an unmounted component.");
            }
            if (a.stateNode.current === a) {
              return fiber;
            }
            return alternate;
          }
          function findCurrentHostFiber(parent) {
            var currentParent = findCurrentFiberUsingSlowPath(parent);
            return currentParent !== null ? findCurrentHostFiberImpl(currentParent) : null;
          }
          function findCurrentHostFiberImpl(node) {
            if (node.tag === HostComponent || node.tag === HostText) {
              return node;
            }
            var child = node.child;
            while (child !== null) {
              var match = findCurrentHostFiberImpl(child);
              if (match !== null) {
                return match;
              }
              child = child.sibling;
            }
            return null;
          }
          function findCurrentHostFiberWithNoPortals(parent) {
            var currentParent = findCurrentFiberUsingSlowPath(parent);
            return currentParent !== null ? findCurrentHostFiberWithNoPortalsImpl(currentParent) : null;
          }
          function findCurrentHostFiberWithNoPortalsImpl(node) {
            if (node.tag === HostComponent || node.tag === HostText) {
              return node;
            }
            var child = node.child;
            while (child !== null) {
              if (child.tag !== HostPortal) {
                var match = findCurrentHostFiberWithNoPortalsImpl(child);
                if (match !== null) {
                  return match;
                }
              }
              child = child.sibling;
            }
            return null;
          }
          var scheduleCallback = Scheduler.unstable_scheduleCallback;
          var cancelCallback = Scheduler.unstable_cancelCallback;
          var shouldYield = Scheduler.unstable_shouldYield;
          var requestPaint = Scheduler.unstable_requestPaint;
          var now = Scheduler.unstable_now;
          var getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel;
          var ImmediatePriority = Scheduler.unstable_ImmediatePriority;
          var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;
          var NormalPriority = Scheduler.unstable_NormalPriority;
          var LowPriority = Scheduler.unstable_LowPriority;
          var IdlePriority = Scheduler.unstable_IdlePriority;
          var unstable_yieldValue = Scheduler.unstable_yieldValue;
          var unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue;
          var rendererID = null;
          var injectedHook = null;
          var injectedProfilingHooks = null;
          var hasLoggedError = false;
          var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined";
          function injectInternals(internals) {
            if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined") {
              return false;
            }
            var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
            if (hook.isDisabled) {
              return true;
            }
            if (!hook.supportsFiber) {
              {
                error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools");
              }
              return true;
            }
            try {
              if (enableSchedulingProfiler) {
                internals = assign({}, internals, {
                  getLaneLabelMap,
                  injectProfilingHooks
                });
              }
              rendererID = hook.inject(internals);
              injectedHook = hook;
            } catch (err) {
              {
                error("React instrumentation encountered an error: %s.", err);
              }
            }
            if (hook.checkDCE) {
              return true;
            } else {
              return false;
            }
          }
          function onScheduleRoot(root2, children) {
            {
              if (injectedHook && typeof injectedHook.onScheduleFiberRoot === "function") {
                try {
                  injectedHook.onScheduleFiberRoot(rendererID, root2, children);
                } catch (err) {
                  if (!hasLoggedError) {
                    hasLoggedError = true;
                    error("React instrumentation encountered an error: %s", err);
                  }
                }
              }
            }
          }
          function onCommitRoot(root2, eventPriority) {
            if (injectedHook && typeof injectedHook.onCommitFiberRoot === "function") {
              try {
                var didError = (root2.current.flags & DidCapture) === DidCapture;
                if (enableProfilerTimer) {
                  var schedulerPriority;
                  switch (eventPriority) {
                    case DiscreteEventPriority:
                      schedulerPriority = ImmediatePriority;
                      break;
                    case ContinuousEventPriority:
                      schedulerPriority = UserBlockingPriority;
                      break;
                    case DefaultEventPriority:
                      schedulerPriority = NormalPriority;
                      break;
                    case IdleEventPriority:
                      schedulerPriority = IdlePriority;
                      break;
                    default:
                      schedulerPriority = NormalPriority;
                      break;
                  }
                  injectedHook.onCommitFiberRoot(rendererID, root2, schedulerPriority, didError);
                } else {
                  injectedHook.onCommitFiberRoot(rendererID, root2, void 0, didError);
                }
              } catch (err) {
                {
                  if (!hasLoggedError) {
                    hasLoggedError = true;
                    error("React instrumentation encountered an error: %s", err);
                  }
                }
              }
            }
          }
          function onPostCommitRoot(root2) {
            if (injectedHook && typeof injectedHook.onPostCommitFiberRoot === "function") {
              try {
                injectedHook.onPostCommitFiberRoot(rendererID, root2);
              } catch (err) {
                {
                  if (!hasLoggedError) {
                    hasLoggedError = true;
                    error("React instrumentation encountered an error: %s", err);
                  }
                }
              }
            }
          }
          function onCommitUnmount(fiber) {
            if (injectedHook && typeof injectedHook.onCommitFiberUnmount === "function") {
              try {
                injectedHook.onCommitFiberUnmount(rendererID, fiber);
              } catch (err) {
                {
                  if (!hasLoggedError) {
                    hasLoggedError = true;
                    error("React instrumentation encountered an error: %s", err);
                  }
                }
              }
            }
          }
          function setIsStrictModeForDevtools(newIsStrictMode) {
            {
              if (typeof unstable_yieldValue === "function") {
                unstable_setDisableYieldValue(newIsStrictMode);
                setSuppressWarning(newIsStrictMode);
              }
              if (injectedHook && typeof injectedHook.setStrictMode === "function") {
                try {
                  injectedHook.setStrictMode(rendererID, newIsStrictMode);
                } catch (err) {
                  {
                    if (!hasLoggedError) {
                      hasLoggedError = true;
                      error("React instrumentation encountered an error: %s", err);
                    }
                  }
                }
              }
            }
          }
          function injectProfilingHooks(profilingHooks) {
            injectedProfilingHooks = profilingHooks;
          }
          function getLaneLabelMap() {
            {
              var map = /* @__PURE__ */ new Map();
              var lane = 1;
              for (var index2 = 0; index2 < TotalLanes; index2++) {
                var label = getLabelForLane(lane);
                map.set(lane, label);
                lane *= 2;
              }
              return map;
            }
          }
          function markCommitStarted(lanes) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStarted === "function") {
                injectedProfilingHooks.markCommitStarted(lanes);
              }
            }
          }
          function markCommitStopped() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStopped === "function") {
                injectedProfilingHooks.markCommitStopped();
              }
            }
          }
          function markComponentRenderStarted(fiber) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStarted === "function") {
                injectedProfilingHooks.markComponentRenderStarted(fiber);
              }
            }
          }
          function markComponentRenderStopped() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStopped === "function") {
                injectedProfilingHooks.markComponentRenderStopped();
              }
            }
          }
          function markComponentPassiveEffectMountStarted(fiber) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted === "function") {
                injectedProfilingHooks.markComponentPassiveEffectMountStarted(fiber);
              }
            }
          }
          function markComponentPassiveEffectMountStopped() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped === "function") {
                injectedProfilingHooks.markComponentPassiveEffectMountStopped();
              }
            }
          }
          function markComponentPassiveEffectUnmountStarted(fiber) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted === "function") {
                injectedProfilingHooks.markComponentPassiveEffectUnmountStarted(fiber);
              }
            }
          }
          function markComponentPassiveEffectUnmountStopped() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped === "function") {
                injectedProfilingHooks.markComponentPassiveEffectUnmountStopped();
              }
            }
          }
          function markComponentLayoutEffectMountStarted(fiber) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted === "function") {
                injectedProfilingHooks.markComponentLayoutEffectMountStarted(fiber);
              }
            }
          }
          function markComponentLayoutEffectMountStopped() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped === "function") {
                injectedProfilingHooks.markComponentLayoutEffectMountStopped();
              }
            }
          }
          function markComponentLayoutEffectUnmountStarted(fiber) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted === "function") {
                injectedProfilingHooks.markComponentLayoutEffectUnmountStarted(fiber);
              }
            }
          }
          function markComponentLayoutEffectUnmountStopped() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped === "function") {
                injectedProfilingHooks.markComponentLayoutEffectUnmountStopped();
              }
            }
          }
          function markComponentErrored(fiber, thrownValue, lanes) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentErrored === "function") {
                injectedProfilingHooks.markComponentErrored(fiber, thrownValue, lanes);
              }
            }
          }
          function markComponentSuspended(fiber, wakeable, lanes) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentSuspended === "function") {
                injectedProfilingHooks.markComponentSuspended(fiber, wakeable, lanes);
              }
            }
          }
          function markLayoutEffectsStarted(lanes) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStarted === "function") {
                injectedProfilingHooks.markLayoutEffectsStarted(lanes);
              }
            }
          }
          function markLayoutEffectsStopped() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStopped === "function") {
                injectedProfilingHooks.markLayoutEffectsStopped();
              }
            }
          }
          function markPassiveEffectsStarted(lanes) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStarted === "function") {
                injectedProfilingHooks.markPassiveEffectsStarted(lanes);
              }
            }
          }
          function markPassiveEffectsStopped() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStopped === "function") {
                injectedProfilingHooks.markPassiveEffectsStopped();
              }
            }
          }
          function markRenderStarted(lanes) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStarted === "function") {
                injectedProfilingHooks.markRenderStarted(lanes);
              }
            }
          }
          function markRenderYielded() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderYielded === "function") {
                injectedProfilingHooks.markRenderYielded();
              }
            }
          }
          function markRenderStopped() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStopped === "function") {
                injectedProfilingHooks.markRenderStopped();
              }
            }
          }
          function markRenderScheduled(lane) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderScheduled === "function") {
                injectedProfilingHooks.markRenderScheduled(lane);
              }
            }
          }
          function markForceUpdateScheduled(fiber, lane) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markForceUpdateScheduled === "function") {
                injectedProfilingHooks.markForceUpdateScheduled(fiber, lane);
              }
            }
          }
          function markStateUpdateScheduled(fiber, lane) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markStateUpdateScheduled === "function") {
                injectedProfilingHooks.markStateUpdateScheduled(fiber, lane);
              }
            }
          }
          var NoMode = 0;
          var ConcurrentMode = 1;
          var ProfileMode = 2;
          var StrictLegacyMode = 8;
          var StrictEffectsMode = 16;
          var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback;
          var log = Math.log;
          var LN2 = Math.LN2;
          function clz32Fallback(x) {
            var asUint = x >>> 0;
            if (asUint === 0) {
              return 32;
            }
            return 31 - (log(asUint) / LN2 | 0) | 0;
          }
          var TotalLanes = 31;
          var NoLanes = 0;
          var NoLane = 0;
          var SyncLane = 1;
          var InputContinuousHydrationLane = 2;
          var InputContinuousLane = 4;
          var DefaultHydrationLane = 8;
          var DefaultLane = 16;
          var TransitionHydrationLane = 32;
          var TransitionLanes = 4194240;
          var TransitionLane1 = 64;
          var TransitionLane2 = 128;
          var TransitionLane3 = 256;
          var TransitionLane4 = 512;
          var TransitionLane5 = 1024;
          var TransitionLane6 = 2048;
          var TransitionLane7 = 4096;
          var TransitionLane8 = 8192;
          var TransitionLane9 = 16384;
          var TransitionLane10 = 32768;
          var TransitionLane11 = 65536;
          var TransitionLane12 = 131072;
          var TransitionLane13 = 262144;
          var TransitionLane14 = 524288;
          var TransitionLane15 = 1048576;
          var TransitionLane16 = 2097152;
          var RetryLanes = 130023424;
          var RetryLane1 = 4194304;
          var RetryLane2 = 8388608;
          var RetryLane3 = 16777216;
          var RetryLane4 = 33554432;
          var RetryLane5 = 67108864;
          var SomeRetryLane = RetryLane1;
          var SelectiveHydrationLane = 134217728;
          var NonIdleLanes = 268435455;
          var IdleHydrationLane = 268435456;
          var IdleLane = 536870912;
          var OffscreenLane = 1073741824;
          function getLabelForLane(lane) {
            {
              if (lane & SyncLane) {
                return "Sync";
              }
              if (lane & InputContinuousHydrationLane) {
                return "InputContinuousHydration";
              }
              if (lane & InputContinuousLane) {
                return "InputContinuous";
              }
              if (lane & DefaultHydrationLane) {
                return "DefaultHydration";
              }
              if (lane & DefaultLane) {
                return "Default";
              }
              if (lane & TransitionHydrationLane) {
                return "TransitionHydration";
              }
              if (lane & TransitionLanes) {
                return "Transition";
              }
              if (lane & RetryLanes) {
                return "Retry";
              }
              if (lane & SelectiveHydrationLane) {
                return "SelectiveHydration";
              }
              if (lane & IdleHydrationLane) {
                return "IdleHydration";
              }
              if (lane & IdleLane) {
                return "Idle";
              }
              if (lane & OffscreenLane) {
                return "Offscreen";
              }
            }
          }
          var NoTimestamp = -1;
          var nextTransitionLane = TransitionLane1;
          var nextRetryLane = RetryLane1;
          function getHighestPriorityLanes(lanes) {
            switch (getHighestPriorityLane(lanes)) {
              case SyncLane:
                return SyncLane;
              case InputContinuousHydrationLane:
                return InputContinuousHydrationLane;
              case InputContinuousLane:
                return InputContinuousLane;
              case DefaultHydrationLane:
                return DefaultHydrationLane;
              case DefaultLane:
                return DefaultLane;
              case TransitionHydrationLane:
                return TransitionHydrationLane;
              case TransitionLane1:
              case TransitionLane2:
              case TransitionLane3:
              case TransitionLane4:
              case TransitionLane5:
              case TransitionLane6:
              case TransitionLane7:
              case TransitionLane8:
              case TransitionLane9:
              case TransitionLane10:
              case TransitionLane11:
              case TransitionLane12:
              case TransitionLane13:
              case TransitionLane14:
              case TransitionLane15:
              case TransitionLane16:
                return lanes & TransitionLanes;
              case RetryLane1:
              case RetryLane2:
              case RetryLane3:
              case RetryLane4:
              case RetryLane5:
                return lanes & RetryLanes;
              case SelectiveHydrationLane:
                return SelectiveHydrationLane;
              case IdleHydrationLane:
                return IdleHydrationLane;
              case IdleLane:
                return IdleLane;
              case OffscreenLane:
                return OffscreenLane;
              default:
                {
                  error("Should have found matching lanes. This is a bug in React.");
                }
                return lanes;
            }
          }
          function getNextLanes(root2, wipLanes) {
            var pendingLanes = root2.pendingLanes;
            if (pendingLanes === NoLanes) {
              return NoLanes;
            }
            var nextLanes = NoLanes;
            var suspendedLanes = root2.suspendedLanes;
            var pingedLanes = root2.pingedLanes;
            var nonIdlePendingLanes = pendingLanes & NonIdleLanes;
            if (nonIdlePendingLanes !== NoLanes) {
              var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes;
              if (nonIdleUnblockedLanes !== NoLanes) {
                nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes);
              } else {
                var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes;
                if (nonIdlePingedLanes !== NoLanes) {
                  nextLanes = getHighestPriorityLanes(nonIdlePingedLanes);
                }
              }
            } else {
              var unblockedLanes = pendingLanes & ~suspendedLanes;
              if (unblockedLanes !== NoLanes) {
                nextLanes = getHighestPriorityLanes(unblockedLanes);
              } else {
                if (pingedLanes !== NoLanes) {
                  nextLanes = getHighestPriorityLanes(pingedLanes);
                }
              }
            }
            if (nextLanes === NoLanes) {
              return NoLanes;
            }
            if (wipLanes !== NoLanes && wipLanes !== nextLanes && (wipLanes & suspendedLanes) === NoLanes) {
              var nextLane = getHighestPriorityLane(nextLanes);
              var wipLane = getHighestPriorityLane(wipLanes);
              if (nextLane >= wipLane || nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes) {
                return wipLanes;
              }
            }
            if ((nextLanes & InputContinuousLane) !== NoLanes) {
              nextLanes |= pendingLanes & DefaultLane;
            }
            var entangledLanes = root2.entangledLanes;
            if (entangledLanes !== NoLanes) {
              var entanglements = root2.entanglements;
              var lanes = nextLanes & entangledLanes;
              while (lanes > 0) {
                var index2 = pickArbitraryLaneIndex(lanes);
                var lane = 1 << index2;
                nextLanes |= entanglements[index2];
                lanes &= ~lane;
              }
            }
            return nextLanes;
          }
          function getMostRecentEventTime(root2, lanes) {
            var eventTimes = root2.eventTimes;
            var mostRecentEventTime = NoTimestamp;
            while (lanes > 0) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              var eventTime = eventTimes[index2];
              if (eventTime > mostRecentEventTime) {
                mostRecentEventTime = eventTime;
              }
              lanes &= ~lane;
            }
            return mostRecentEventTime;
          }
          function computeExpirationTime(lane, currentTime) {
            switch (lane) {
              case SyncLane:
              case InputContinuousHydrationLane:
              case InputContinuousLane:
                return currentTime + 250;
              case DefaultHydrationLane:
              case DefaultLane:
              case TransitionHydrationLane:
              case TransitionLane1:
              case TransitionLane2:
              case TransitionLane3:
              case TransitionLane4:
              case TransitionLane5:
              case TransitionLane6:
              case TransitionLane7:
              case TransitionLane8:
              case TransitionLane9:
              case TransitionLane10:
              case TransitionLane11:
              case TransitionLane12:
              case TransitionLane13:
              case TransitionLane14:
              case TransitionLane15:
              case TransitionLane16:
                return currentTime + 5e3;
              case RetryLane1:
              case RetryLane2:
              case RetryLane3:
              case RetryLane4:
              case RetryLane5:
                return NoTimestamp;
              case SelectiveHydrationLane:
              case IdleHydrationLane:
              case IdleLane:
              case OffscreenLane:
                return NoTimestamp;
              default:
                {
                  error("Should have found matching lanes. This is a bug in React.");
                }
                return NoTimestamp;
            }
          }
          function markStarvedLanesAsExpired(root2, currentTime) {
            var pendingLanes = root2.pendingLanes;
            var suspendedLanes = root2.suspendedLanes;
            var pingedLanes = root2.pingedLanes;
            var expirationTimes = root2.expirationTimes;
            var lanes = pendingLanes;
            while (lanes > 0) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              var expirationTime = expirationTimes[index2];
              if (expirationTime === NoTimestamp) {
                if ((lane & suspendedLanes) === NoLanes || (lane & pingedLanes) !== NoLanes) {
                  expirationTimes[index2] = computeExpirationTime(lane, currentTime);
                }
              } else if (expirationTime <= currentTime) {
                root2.expiredLanes |= lane;
              }
              lanes &= ~lane;
            }
          }
          function getHighestPriorityPendingLanes(root2) {
            return getHighestPriorityLanes(root2.pendingLanes);
          }
          function getLanesToRetrySynchronouslyOnError(root2) {
            var everythingButOffscreen = root2.pendingLanes & ~OffscreenLane;
            if (everythingButOffscreen !== NoLanes) {
              return everythingButOffscreen;
            }
            if (everythingButOffscreen & OffscreenLane) {
              return OffscreenLane;
            }
            return NoLanes;
          }
          function includesSyncLane(lanes) {
            return (lanes & SyncLane) !== NoLanes;
          }
          function includesNonIdleWork(lanes) {
            return (lanes & NonIdleLanes) !== NoLanes;
          }
          function includesOnlyRetries(lanes) {
            return (lanes & RetryLanes) === lanes;
          }
          function includesOnlyNonUrgentLanes(lanes) {
            var UrgentLanes = SyncLane | InputContinuousLane | DefaultLane;
            return (lanes & UrgentLanes) === NoLanes;
          }
          function includesOnlyTransitions(lanes) {
            return (lanes & TransitionLanes) === lanes;
          }
          function includesBlockingLane(root2, lanes) {
            var SyncDefaultLanes = InputContinuousHydrationLane | InputContinuousLane | DefaultHydrationLane | DefaultLane;
            return (lanes & SyncDefaultLanes) !== NoLanes;
          }
          function includesExpiredLane(root2, lanes) {
            return (lanes & root2.expiredLanes) !== NoLanes;
          }
          function isTransitionLane(lane) {
            return (lane & TransitionLanes) !== NoLanes;
          }
          function claimNextTransitionLane() {
            var lane = nextTransitionLane;
            nextTransitionLane <<= 1;
            if ((nextTransitionLane & TransitionLanes) === NoLanes) {
              nextTransitionLane = TransitionLane1;
            }
            return lane;
          }
          function claimNextRetryLane() {
            var lane = nextRetryLane;
            nextRetryLane <<= 1;
            if ((nextRetryLane & RetryLanes) === NoLanes) {
              nextRetryLane = RetryLane1;
            }
            return lane;
          }
          function getHighestPriorityLane(lanes) {
            return lanes & -lanes;
          }
          function pickArbitraryLane(lanes) {
            return getHighestPriorityLane(lanes);
          }
          function pickArbitraryLaneIndex(lanes) {
            return 31 - clz32(lanes);
          }
          function laneToIndex(lane) {
            return pickArbitraryLaneIndex(lane);
          }
          function includesSomeLane(a, b) {
            return (a & b) !== NoLanes;
          }
          function isSubsetOfLanes(set2, subset) {
            return (set2 & subset) === subset;
          }
          function mergeLanes(a, b) {
            return a | b;
          }
          function removeLanes(set2, subset) {
            return set2 & ~subset;
          }
          function intersectLanes(a, b) {
            return a & b;
          }
          function laneToLanes(lane) {
            return lane;
          }
          function higherPriorityLane(a, b) {
            return a !== NoLane && a < b ? a : b;
          }
          function createLaneMap(initial) {
            var laneMap = [];
            for (var i = 0; i < TotalLanes; i++) {
              laneMap.push(initial);
            }
            return laneMap;
          }
          function markRootUpdated(root2, updateLane, eventTime) {
            root2.pendingLanes |= updateLane;
            if (updateLane !== IdleLane) {
              root2.suspendedLanes = NoLanes;
              root2.pingedLanes = NoLanes;
            }
            var eventTimes = root2.eventTimes;
            var index2 = laneToIndex(updateLane);
            eventTimes[index2] = eventTime;
          }
          function markRootSuspended(root2, suspendedLanes) {
            root2.suspendedLanes |= suspendedLanes;
            root2.pingedLanes &= ~suspendedLanes;
            var expirationTimes = root2.expirationTimes;
            var lanes = suspendedLanes;
            while (lanes > 0) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              expirationTimes[index2] = NoTimestamp;
              lanes &= ~lane;
            }
          }
          function markRootPinged(root2, pingedLanes, eventTime) {
            root2.pingedLanes |= root2.suspendedLanes & pingedLanes;
          }
          function markRootFinished(root2, remainingLanes) {
            var noLongerPendingLanes = root2.pendingLanes & ~remainingLanes;
            root2.pendingLanes = remainingLanes;
            root2.suspendedLanes = NoLanes;
            root2.pingedLanes = NoLanes;
            root2.expiredLanes &= remainingLanes;
            root2.mutableReadLanes &= remainingLanes;
            root2.entangledLanes &= remainingLanes;
            var entanglements = root2.entanglements;
            var eventTimes = root2.eventTimes;
            var expirationTimes = root2.expirationTimes;
            var lanes = noLongerPendingLanes;
            while (lanes > 0) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              entanglements[index2] = NoLanes;
              eventTimes[index2] = NoTimestamp;
              expirationTimes[index2] = NoTimestamp;
              lanes &= ~lane;
            }
          }
          function markRootEntangled(root2, entangledLanes) {
            var rootEntangledLanes = root2.entangledLanes |= entangledLanes;
            var entanglements = root2.entanglements;
            var lanes = rootEntangledLanes;
            while (lanes) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              if (lane & entangledLanes | entanglements[index2] & entangledLanes) {
                entanglements[index2] |= entangledLanes;
              }
              lanes &= ~lane;
            }
          }
          function getBumpedLaneForHydration(root2, renderLanes2) {
            var renderLane = getHighestPriorityLane(renderLanes2);
            var lane;
            switch (renderLane) {
              case InputContinuousLane:
                lane = InputContinuousHydrationLane;
                break;
              case DefaultLane:
                lane = DefaultHydrationLane;
                break;
              case TransitionLane1:
              case TransitionLane2:
              case TransitionLane3:
              case TransitionLane4:
              case TransitionLane5:
              case TransitionLane6:
              case TransitionLane7:
              case TransitionLane8:
              case TransitionLane9:
              case TransitionLane10:
              case TransitionLane11:
              case TransitionLane12:
              case TransitionLane13:
              case TransitionLane14:
              case TransitionLane15:
              case TransitionLane16:
              case RetryLane1:
              case RetryLane2:
              case RetryLane3:
              case RetryLane4:
              case RetryLane5:
                lane = TransitionHydrationLane;
                break;
              case IdleLane:
                lane = IdleHydrationLane;
                break;
              default:
                lane = NoLane;
                break;
            }
            if ((lane & (root2.suspendedLanes | renderLanes2)) !== NoLane) {
              return NoLane;
            }
            return lane;
          }
          function addFiberToLanesMap(root2, fiber, lanes) {
            if (!isDevToolsPresent) {
              return;
            }
            var pendingUpdatersLaneMap = root2.pendingUpdatersLaneMap;
            while (lanes > 0) {
              var index2 = laneToIndex(lanes);
              var lane = 1 << index2;
              var updaters = pendingUpdatersLaneMap[index2];
              updaters.add(fiber);
              lanes &= ~lane;
            }
          }
          function movePendingFibersToMemoized(root2, lanes) {
            if (!isDevToolsPresent) {
              return;
            }
            var pendingUpdatersLaneMap = root2.pendingUpdatersLaneMap;
            var memoizedUpdaters = root2.memoizedUpdaters;
            while (lanes > 0) {
              var index2 = laneToIndex(lanes);
              var lane = 1 << index2;
              var updaters = pendingUpdatersLaneMap[index2];
              if (updaters.size > 0) {
                updaters.forEach(function(fiber) {
                  var alternate = fiber.alternate;
                  if (alternate === null || !memoizedUpdaters.has(alternate)) {
                    memoizedUpdaters.add(fiber);
                  }
                });
                updaters.clear();
              }
              lanes &= ~lane;
            }
          }
          function getTransitionsForLanes(root2, lanes) {
            {
              return null;
            }
          }
          var DiscreteEventPriority = SyncLane;
          var ContinuousEventPriority = InputContinuousLane;
          var DefaultEventPriority = DefaultLane;
          var IdleEventPriority = IdleLane;
          var currentUpdatePriority = NoLane;
          function getCurrentUpdatePriority() {
            return currentUpdatePriority;
          }
          function setCurrentUpdatePriority(newPriority) {
            currentUpdatePriority = newPriority;
          }
          function runWithPriority(priority, fn) {
            var previousPriority = currentUpdatePriority;
            try {
              currentUpdatePriority = priority;
              return fn();
            } finally {
              currentUpdatePriority = previousPriority;
            }
          }
          function higherEventPriority(a, b) {
            return a !== 0 && a < b ? a : b;
          }
          function lowerEventPriority(a, b) {
            return a === 0 || a > b ? a : b;
          }
          function isHigherEventPriority(a, b) {
            return a !== 0 && a < b;
          }
          function lanesToEventPriority(lanes) {
            var lane = getHighestPriorityLane(lanes);
            if (!isHigherEventPriority(DiscreteEventPriority, lane)) {
              return DiscreteEventPriority;
            }
            if (!isHigherEventPriority(ContinuousEventPriority, lane)) {
              return ContinuousEventPriority;
            }
            if (includesNonIdleWork(lane)) {
              return DefaultEventPriority;
            }
            return IdleEventPriority;
          }
          function isRootDehydrated(root2) {
            var currentState = root2.current.memoizedState;
            return currentState.isDehydrated;
          }
          var _attemptSynchronousHydration;
          function setAttemptSynchronousHydration(fn) {
            _attemptSynchronousHydration = fn;
          }
          function attemptSynchronousHydration(fiber) {
            _attemptSynchronousHydration(fiber);
          }
          var attemptContinuousHydration;
          function setAttemptContinuousHydration(fn) {
            attemptContinuousHydration = fn;
          }
          var attemptHydrationAtCurrentPriority;
          function setAttemptHydrationAtCurrentPriority(fn) {
            attemptHydrationAtCurrentPriority = fn;
          }
          var getCurrentUpdatePriority$1;
          function setGetCurrentUpdatePriority(fn) {
            getCurrentUpdatePriority$1 = fn;
          }
          var attemptHydrationAtPriority;
          function setAttemptHydrationAtPriority(fn) {
            attemptHydrationAtPriority = fn;
          }
          var hasScheduledReplayAttempt = false;
          var queuedDiscreteEvents = [];
          var queuedFocus = null;
          var queuedDrag = null;
          var queuedMouse = null;
          var queuedPointers = /* @__PURE__ */ new Map();
          var queuedPointerCaptures = /* @__PURE__ */ new Map();
          var queuedExplicitHydrationTargets = [];
          var 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",
            "submit"
          ];
          function isDiscreteEventThatRequiresHydration(eventType) {
            return discreteReplayableEvents.indexOf(eventType) > -1;
          }
          function createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            return {
              blockedOn,
              domEventName,
              eventSystemFlags,
              nativeEvent,
              targetContainers: [targetContainer]
            };
          }
          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": {
                var pointerId = nativeEvent.pointerId;
                queuedPointers.delete(pointerId);
                break;
              }
              case "gotpointercapture":
              case "lostpointercapture": {
                var _pointerId = nativeEvent.pointerId;
                queuedPointerCaptures.delete(_pointerId);
                break;
              }
            }
          }
          function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {
              var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);
              if (blockedOn !== null) {
                var _fiber2 = getInstanceFromNode(blockedOn);
                if (_fiber2 !== null) {
                  attemptContinuousHydration(_fiber2);
                }
              }
              return queuedEvent;
            }
            existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
            var targetContainers = existingQueuedEvent.targetContainers;
            if (targetContainer !== null && targetContainers.indexOf(targetContainer) === -1) {
              targetContainers.push(targetContainer);
            }
            return existingQueuedEvent;
          }
          function queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            switch (domEventName) {
              case "focusin": {
                var focusEvent = nativeEvent;
                queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, domEventName, eventSystemFlags, targetContainer, focusEvent);
                return true;
              }
              case "dragenter": {
                var dragEvent = nativeEvent;
                queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, domEventName, eventSystemFlags, targetContainer, dragEvent);
                return true;
              }
              case "mouseover": {
                var mouseEvent = nativeEvent;
                queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, domEventName, eventSystemFlags, targetContainer, mouseEvent);
                return true;
              }
              case "pointerover": {
                var pointerEvent = nativeEvent;
                var pointerId = pointerEvent.pointerId;
                queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, pointerEvent));
                return true;
              }
              case "gotpointercapture": {
                var _pointerEvent = nativeEvent;
                var _pointerId2 = _pointerEvent.pointerId;
                queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, _pointerEvent));
                return true;
              }
            }
            return false;
          }
          function attemptExplicitHydrationTarget(queuedTarget) {
            var targetInst = getClosestInstanceFromNode(queuedTarget.target);
            if (targetInst !== null) {
              var nearestMounted = getNearestMountedFiber(targetInst);
              if (nearestMounted !== null) {
                var tag = nearestMounted.tag;
                if (tag === SuspenseComponent) {
                  var instance = getSuspenseInstanceFromFiber(nearestMounted);
                  if (instance !== null) {
                    queuedTarget.blockedOn = instance;
                    attemptHydrationAtPriority(queuedTarget.priority, function() {
                      attemptHydrationAtCurrentPriority(nearestMounted);
                    });
                    return;
                  }
                } else if (tag === HostRoot) {
                  var root2 = nearestMounted.stateNode;
                  if (isRootDehydrated(root2)) {
                    queuedTarget.blockedOn = getContainerFromFiber(nearestMounted);
                    return;
                  }
                }
              }
            }
            queuedTarget.blockedOn = null;
          }
          function queueExplicitHydrationTarget(target) {
            var updatePriority = getCurrentUpdatePriority$1();
            var queuedTarget = {
              blockedOn: null,
              target,
              priority: updatePriority
            };
            var i = 0;
            for (; i < queuedExplicitHydrationTargets.length; i++) {
              if (!isHigherEventPriority(updatePriority, queuedExplicitHydrationTargets[i].priority)) {
                break;
              }
            }
            queuedExplicitHydrationTargets.splice(i, 0, queuedTarget);
            if (i === 0) {
              attemptExplicitHydrationTarget(queuedTarget);
            }
          }
          function attemptReplayContinuousQueuedEvent(queuedEvent) {
            if (queuedEvent.blockedOn !== null) {
              return false;
            }
            var targetContainers = queuedEvent.targetContainers;
            while (targetContainers.length > 0) {
              var targetContainer = targetContainers[0];
              var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.domEventName, queuedEvent.eventSystemFlags, targetContainer, queuedEvent.nativeEvent);
              if (nextBlockedOn === null) {
                {
                  var nativeEvent = queuedEvent.nativeEvent;
                  var nativeEventClone = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
                  setReplayingEvent(nativeEventClone);
                  nativeEvent.target.dispatchEvent(nativeEventClone);
                  resetReplayingEvent();
                }
              } else {
                var _fiber3 = getInstanceFromNode(nextBlockedOn);
                if (_fiber3 !== null) {
                  attemptContinuousHydration(_fiber3);
                }
                queuedEvent.blockedOn = nextBlockedOn;
                return false;
              }
              targetContainers.shift();
            }
            return true;
          }
          function attemptReplayContinuousQueuedEventInMap(queuedEvent, key2, map) {
            if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
              map.delete(key2);
            }
          }
          function replayUnblockedEvents() {
            hasScheduledReplayAttempt = false;
            if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {
              queuedFocus = null;
            }
            if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {
              queuedDrag = null;
            }
            if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {
              queuedMouse = null;
            }
            queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
            queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
          }
          function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
            if (queuedEvent.blockedOn === unblocked) {
              queuedEvent.blockedOn = null;
              if (!hasScheduledReplayAttempt) {
                hasScheduledReplayAttempt = true;
                Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);
              }
            }
          }
          function retryIfBlockedOn(unblocked) {
            if (queuedDiscreteEvents.length > 0) {
              scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked);
              for (var i = 1; i < queuedDiscreteEvents.length; i++) {
                var queuedEvent = queuedDiscreteEvents[i];
                if (queuedEvent.blockedOn === unblocked) {
                  queuedEvent.blockedOn = null;
                }
              }
            }
            if (queuedFocus !== null) {
              scheduleCallbackIfUnblocked(queuedFocus, unblocked);
            }
            if (queuedDrag !== null) {
              scheduleCallbackIfUnblocked(queuedDrag, unblocked);
            }
            if (queuedMouse !== null) {
              scheduleCallbackIfUnblocked(queuedMouse, unblocked);
            }
            var unblock = function(queuedEvent2) {
              return scheduleCallbackIfUnblocked(queuedEvent2, unblocked);
            };
            queuedPointers.forEach(unblock);
            queuedPointerCaptures.forEach(unblock);
            for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {
              var queuedTarget = queuedExplicitHydrationTargets[_i];
              if (queuedTarget.blockedOn === unblocked) {
                queuedTarget.blockedOn = null;
              }
            }
            while (queuedExplicitHydrationTargets.length > 0) {
              var nextExplicitTarget = queuedExplicitHydrationTargets[0];
              if (nextExplicitTarget.blockedOn !== null) {
                break;
              } else {
                attemptExplicitHydrationTarget(nextExplicitTarget);
                if (nextExplicitTarget.blockedOn === null) {
                  queuedExplicitHydrationTargets.shift();
                }
              }
            }
          }
          var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
          var _enabled = true;
          function setEnabled(enabled) {
            _enabled = !!enabled;
          }
          function isEnabled() {
            return _enabled;
          }
          function createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags) {
            var eventPriority = getEventPriority(domEventName);
            var listenerWrapper;
            switch (eventPriority) {
              case DiscreteEventPriority:
                listenerWrapper = dispatchDiscreteEvent;
                break;
              case ContinuousEventPriority:
                listenerWrapper = dispatchContinuousEvent;
                break;
              case DefaultEventPriority:
              default:
                listenerWrapper = dispatchEvent;
                break;
            }
            return listenerWrapper.bind(null, domEventName, eventSystemFlags, targetContainer);
          }
          function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) {
            var previousPriority = getCurrentUpdatePriority();
            var prevTransition = ReactCurrentBatchConfig.transition;
            ReactCurrentBatchConfig.transition = null;
            try {
              setCurrentUpdatePriority(DiscreteEventPriority);
              dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
            } finally {
              setCurrentUpdatePriority(previousPriority);
              ReactCurrentBatchConfig.transition = prevTransition;
            }
          }
          function dispatchContinuousEvent(domEventName, eventSystemFlags, container, nativeEvent) {
            var previousPriority = getCurrentUpdatePriority();
            var prevTransition = ReactCurrentBatchConfig.transition;
            ReactCurrentBatchConfig.transition = null;
            try {
              setCurrentUpdatePriority(ContinuousEventPriority);
              dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
            } finally {
              setCurrentUpdatePriority(previousPriority);
              ReactCurrentBatchConfig.transition = prevTransition;
            }
          }
          function dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            if (!_enabled) {
              return;
            }
            {
              dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent);
            }
          }
          function dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            var blockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);
            if (blockedOn === null) {
              dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer);
              clearIfContinuousEvent(domEventName, nativeEvent);
              return;
            }
            if (queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent)) {
              nativeEvent.stopPropagation();
              return;
            }
            clearIfContinuousEvent(domEventName, nativeEvent);
            if (eventSystemFlags & IS_CAPTURE_PHASE && isDiscreteEventThatRequiresHydration(domEventName)) {
              while (blockedOn !== null) {
                var fiber = getInstanceFromNode(blockedOn);
                if (fiber !== null) {
                  attemptSynchronousHydration(fiber);
                }
                var nextBlockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);
                if (nextBlockedOn === null) {
                  dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer);
                }
                if (nextBlockedOn === blockedOn) {
                  break;
                }
                blockedOn = nextBlockedOn;
              }
              if (blockedOn !== null) {
                nativeEvent.stopPropagation();
              }
              return;
            }
            dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, null, targetContainer);
          }
          var return_targetInst = null;
          function findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            return_targetInst = null;
            var nativeEventTarget = getEventTarget(nativeEvent);
            var targetInst = getClosestInstanceFromNode(nativeEventTarget);
            if (targetInst !== null) {
              var nearestMounted = getNearestMountedFiber(targetInst);
              if (nearestMounted === null) {
                targetInst = null;
              } else {
                var tag = nearestMounted.tag;
                if (tag === SuspenseComponent) {
                  var instance = getSuspenseInstanceFromFiber(nearestMounted);
                  if (instance !== null) {
                    return instance;
                  }
                  targetInst = null;
                } else if (tag === HostRoot) {
                  var root2 = nearestMounted.stateNode;
                  if (isRootDehydrated(root2)) {
                    return getContainerFromFiber(nearestMounted);
                  }
                  targetInst = null;
                } else if (nearestMounted !== targetInst) {
                  targetInst = null;
                }
              }
            }
            return_targetInst = targetInst;
            return null;
          }
          function getEventPriority(domEventName) {
            switch (domEventName) {
              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 "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 DiscreteEventPriority;
              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 "toggle":
              case "touchmove":
              case "wheel":
              case "mouseenter":
              case "mouseleave":
              case "pointerenter":
              case "pointerleave":
                return ContinuousEventPriority;
              case "message": {
                var schedulerPriority = getCurrentPriorityLevel();
                switch (schedulerPriority) {
                  case ImmediatePriority:
                    return DiscreteEventPriority;
                  case UserBlockingPriority:
                    return ContinuousEventPriority;
                  case NormalPriority:
                  case LowPriority:
                    return DefaultEventPriority;
                  case IdlePriority:
                    return IdleEventPriority;
                  default:
                    return DefaultEventPriority;
                }
              }
              default:
                return DefaultEventPriority;
            }
          }
          function addEventBubbleListener(target, eventType, listener) {
            target.addEventListener(eventType, listener, false);
            return listener;
          }
          function addEventCaptureListener(target, eventType, listener) {
            target.addEventListener(eventType, listener, true);
            return listener;
          }
          function addEventCaptureListenerWithPassiveFlag(target, eventType, listener, passive) {
            target.addEventListener(eventType, listener, {
              capture: true,
              passive
            });
            return listener;
          }
          function addEventBubbleListenerWithPassiveFlag(target, eventType, listener, passive) {
            target.addEventListener(eventType, listener, {
              passive
            });
            return listener;
          }
          var root = null;
          var startText = null;
          var fallbackText = null;
          function initialize(nativeEventTarget) {
            root = nativeEventTarget;
            startText = getText();
            return true;
          }
          function reset() {
            root = null;
            startText = null;
            fallbackText = null;
          }
          function getData() {
            if (fallbackText) {
              return fallbackText;
            }
            var start;
            var startValue = startText;
            var startLength = startValue.length;
            var end;
            var endValue = getText();
            var endLength = endValue.length;
            for (start = 0; start < startLength; start++) {
              if (startValue[start] !== endValue[start]) {
                break;
              }
            }
            var minEnd = startLength - start;
            for (end = 1; end <= minEnd; end++) {
              if (startValue[startLength - end] !== endValue[endLength - end]) {
                break;
              }
            }
            var sliceTail = end > 1 ? 1 - end : void 0;
            fallbackText = endValue.slice(start, sliceTail);
            return fallbackText;
          }
          function getText() {
            if ("value" in root) {
              return root.value;
            }
            return root.textContent;
          }
          function getEventCharCode(nativeEvent) {
            var charCode;
            var keyCode = nativeEvent.keyCode;
            if ("charCode" in nativeEvent) {
              charCode = nativeEvent.charCode;
              if (charCode === 0 && keyCode === 13) {
                charCode = 13;
              }
            } else {
              charCode = keyCode;
            }
            if (charCode === 10) {
              charCode = 13;
            }
            if (charCode >= 32 || charCode === 13) {
              return charCode;
            }
            return 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) {
                if (!Interface.hasOwnProperty(_propName)) {
                  continue;
                }
                var normalize = Interface[_propName];
                if (normalize) {
                  this[_propName] = normalize(nativeEvent);
                } else {
                  this[_propName] = nativeEvent[_propName];
                }
              }
              var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
              if (defaultPrevented) {
                this.isDefaultPrevented = functionThatReturnsTrue;
              } else {
                this.isDefaultPrevented = functionThatReturnsFalse;
              }
              this.isPropagationStopped = functionThatReturnsFalse;
              return this;
            }
            assign(SyntheticBaseEvent.prototype, {
              preventDefault: function() {
                this.defaultPrevented = true;
                var event = this.nativeEvent;
                if (!event) {
                  return;
                }
                if (event.preventDefault) {
                  event.preventDefault();
                } else if (typeof event.returnValue !== "unknown") {
                  event.returnValue = false;
                }
                this.isDefaultPrevented = functionThatReturnsTrue;
              },
              stopPropagation: function() {
                var event = this.nativeEvent;
                if (!event) {
                  return;
                }
                if (event.stopPropagation) {
                  event.stopPropagation();
                } else if (typeof event.cancelBubble !== "unknown") {
                  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
          };
          var SyntheticEvent = createSyntheticEvent(EventInterface);
          var UIEventInterface = assign({}, EventInterface, {
            view: 0,
            detail: 0
          });
          var SyntheticUIEvent = createSyntheticEvent(UIEventInterface);
          var lastMovementX;
          var lastMovementY;
          var lastMouseEvent;
          function updateMouseMovementPolyfillState(event) {
            if (event !== lastMouseEvent) {
              if (lastMouseEvent && event.type === "mousemove") {
                lastMovementX = event.screenX - lastMouseEvent.screenX;
                lastMovementY = event.screenY - lastMouseEvent.screenY;
              } else {
                lastMovementX = 0;
                lastMovementY = 0;
              }
              lastMouseEvent = event;
            }
          }
          var 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) {
              if (event.relatedTarget === void 0)
                return event.fromElement === event.srcElement ? event.toElement : event.fromElement;
              return event.relatedTarget;
            },
            movementX: function(event) {
              if ("movementX" in event) {
                return event.movementX;
              }
              updateMouseMovementPolyfillState(event);
              return lastMovementX;
            },
            movementY: function(event) {
              if ("movementY" in event) {
                return event.movementY;
              }
              return lastMovementY;
            }
          });
          var SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface);
          var DragEventInterface = assign({}, MouseEventInterface, {
            dataTransfer: 0
          });
          var SyntheticDragEvent = createSyntheticEvent(DragEventInterface);
          var FocusEventInterface = assign({}, UIEventInterface, {
            relatedTarget: 0
          });
          var SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface);
          var AnimationEventInterface = assign({}, EventInterface, {
            animationName: 0,
            elapsedTime: 0,
            pseudoElement: 0
          });
          var SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface);
          var ClipboardEventInterface = assign({}, EventInterface, {
            clipboardData: function(event) {
              return "clipboardData" in event ? event.clipboardData : window.clipboardData;
            }
          });
          var SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface);
          var CompositionEventInterface = assign({}, EventInterface, {
            data: 0
          });
          var SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface);
          var SyntheticInputEvent = SyntheticCompositionEvent;
          var normalizeKey = {
            Esc: "Escape",
            Spacebar: " ",
            Left: "ArrowLeft",
            Up: "ArrowUp",
            Right: "ArrowRight",
            Down: "ArrowDown",
            Del: "Delete",
            Win: "OS",
            Menu: "ContextMenu",
            Apps: "ContextMenu",
            Scroll: "ScrollLock",
            MozPrintableKey: "Unidentified"
          };
          var 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"
          };
          function getEventKey(nativeEvent) {
            if (nativeEvent.key) {
              var key2 = normalizeKey[nativeEvent.key] || nativeEvent.key;
              if (key2 !== "Unidentified") {
                return key2;
              }
            }
            if (nativeEvent.type === "keypress") {
              var charCode = getEventCharCode(nativeEvent);
              return charCode === 13 ? "Enter" : String.fromCharCode(charCode);
            }
            if (nativeEvent.type === "keydown" || nativeEvent.type === "keyup") {
              return translateToKey[nativeEvent.keyCode] || "Unidentified";
            }
            return "";
          }
          var modifierKeyToProp = {
            Alt: "altKey",
            Control: "ctrlKey",
            Meta: "metaKey",
            Shift: "shiftKey"
          };
          function modifierStateGetter(keyArg) {
            var syntheticEvent = this;
            var nativeEvent = syntheticEvent.nativeEvent;
            if (nativeEvent.getModifierState) {
              return nativeEvent.getModifierState(keyArg);
            }
            var keyProp = modifierKeyToProp[keyArg];
            return keyProp ? !!nativeEvent[keyProp] : false;
          }
          function getEventModifierState(nativeEvent) {
            return modifierStateGetter;
          }
          var KeyboardEventInterface = assign({}, UIEventInterface, {
            key: getEventKey,
            code: 0,
            location: 0,
            ctrlKey: 0,
            shiftKey: 0,
            altKey: 0,
            metaKey: 0,
            repeat: 0,
            locale: 0,
            getModifierState: getEventModifierState,
            charCode: function(event) {
              if (event.type === "keypress") {
                return getEventCharCode(event);
              }
              return 0;
            },
            keyCode: function(event) {
              if (event.type === "keydown" || event.type === "keyup") {
                return event.keyCode;
              }
              return 0;
            },
            which: function(event) {
              if (event.type === "keypress") {
                return getEventCharCode(event);
              }
              if (event.type === "keydown" || event.type === "keyup") {
                return event.keyCode;
              }
              return 0;
            }
          });
          var SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface);
          var PointerEventInterface = assign({}, MouseEventInterface, {
            pointerId: 0,
            width: 0,
            height: 0,
            pressure: 0,
            tangentialPressure: 0,
            tiltX: 0,
            tiltY: 0,
            twist: 0,
            pointerType: 0,
            isPrimary: 0
          });
          var SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface);
          var TouchEventInterface = assign({}, UIEventInterface, {
            touches: 0,
            targetTouches: 0,
            changedTouches: 0,
            altKey: 0,
            metaKey: 0,
            ctrlKey: 0,
            shiftKey: 0,
            getModifierState: getEventModifierState
          });
          var SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface);
          var TransitionEventInterface = assign({}, EventInterface, {
            propertyName: 0,
            elapsedTime: 0,
            pseudoElement: 0
          });
          var SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface);
          var 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
          });
          var SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface);
          var END_KEYCODES = [9, 13, 27, 32];
          var START_KEYCODE = 229;
          var canUseCompositionEvent = canUseDOM && "CompositionEvent" in window;
          var documentMode = null;
          if (canUseDOM && "documentMode" in document) {
            documentMode = document.documentMode;
          }
          var canUseTextInputEvent = canUseDOM && "TextEvent" in window && !documentMode;
          var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
          var SPACEBAR_CODE = 32;
          var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
          function registerEvents() {
            registerTwoPhaseEvent("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]);
            registerTwoPhaseEvent("onCompositionEnd", ["compositionend", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
            registerTwoPhaseEvent("onCompositionStart", ["compositionstart", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
            registerTwoPhaseEvent("onCompositionUpdate", ["compositionupdate", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
          }
          var hasSpaceKeypress = false;
          function isKeypressCommand(nativeEvent) {
            return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && !(nativeEvent.ctrlKey && nativeEvent.altKey);
          }
          function getCompositionEventType(domEventName) {
            switch (domEventName) {
              case "compositionstart":
                return "onCompositionStart";
              case "compositionend":
                return "onCompositionEnd";
              case "compositionupdate":
                return "onCompositionUpdate";
            }
          }
          function isFallbackCompositionStart(domEventName, nativeEvent) {
            return domEventName === "keydown" && nativeEvent.keyCode === START_KEYCODE;
          }
          function isFallbackCompositionEnd(domEventName, nativeEvent) {
            switch (domEventName) {
              case "keyup":
                return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
              case "keydown":
                return nativeEvent.keyCode !== START_KEYCODE;
              case "keypress":
              case "mousedown":
              case "focusout":
                return true;
              default:
                return false;
            }
          }
          function getDataFromCustomEvent(nativeEvent) {
            var detail = nativeEvent.detail;
            if (typeof detail === "object" && "data" in detail) {
              return detail.data;
            }
            return null;
          }
          function isUsingKoreanIME(nativeEvent) {
            return nativeEvent.locale === "ko";
          }
          var isComposing = false;
          function extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
            var eventType;
            var fallbackData;
            if (canUseCompositionEvent) {
              eventType = getCompositionEventType(domEventName);
            } else if (!isComposing) {
              if (isFallbackCompositionStart(domEventName, nativeEvent)) {
                eventType = "onCompositionStart";
              }
            } else if (isFallbackCompositionEnd(domEventName, nativeEvent)) {
              eventType = "onCompositionEnd";
            }
            if (!eventType) {
              return null;
            }
            if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
              if (!isComposing && eventType === "onCompositionStart") {
                isComposing = initialize(nativeEventTarget);
              } else if (eventType === "onCompositionEnd") {
                if (isComposing) {
                  fallbackData = getData();
                }
              }
            }
            var listeners = accumulateTwoPhaseListeners(targetInst, eventType);
            if (listeners.length > 0) {
              var event = new SyntheticCompositionEvent(eventType, domEventName, null, nativeEvent, nativeEventTarget);
              dispatchQueue.push({
                event,
                listeners
              });
              if (fallbackData) {
                event.data = fallbackData;
              } else {
                var customData = getDataFromCustomEvent(nativeEvent);
                if (customData !== null) {
                  event.data = customData;
                }
              }
            }
          }
          function getNativeBeforeInputChars(domEventName, nativeEvent) {
            switch (domEventName) {
              case "compositionend":
                return getDataFromCustomEvent(nativeEvent);
              case "keypress":
                var which = nativeEvent.which;
                if (which !== SPACEBAR_CODE) {
                  return null;
                }
                hasSpaceKeypress = true;
                return SPACEBAR_CHAR;
              case "textInput":
                var chars = nativeEvent.data;
                if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
                  return null;
                }
                return chars;
              default:
                return null;
            }
          }
          function getFallbackBeforeInputChars(domEventName, nativeEvent) {
            if (isComposing) {
              if (domEventName === "compositionend" || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {
                var chars = getData();
                reset();
                isComposing = false;
                return chars;
              }
              return null;
            }
            switch (domEventName) {
              case "paste":
                return null;
              case "keypress":
                if (!isKeypressCommand(nativeEvent)) {
                  if (nativeEvent.char && nativeEvent.char.length > 1) {
                    return nativeEvent.char;
                  } else if (nativeEvent.which) {
                    return String.fromCharCode(nativeEvent.which);
                  }
                }
                return null;
              case "compositionend":
                return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;
              default:
                return null;
            }
          }
          function extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
            var chars;
            if (canUseTextInputEvent) {
              chars = getNativeBeforeInputChars(domEventName, nativeEvent);
            } else {
              chars = getFallbackBeforeInputChars(domEventName, nativeEvent);
            }
            if (!chars) {
              return null;
            }
            var listeners = accumulateTwoPhaseListeners(targetInst, "onBeforeInput");
            if (listeners.length > 0) {
              var event = new SyntheticInputEvent("onBeforeInput", "beforeinput", null, nativeEvent, nativeEventTarget);
              dispatchQueue.push({
                event,
                listeners
              });
              event.data = chars;
            }
          }
          function extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
            extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
          }
          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();
            if (nodeName === "input") {
              return !!supportedInputTypes[elem.type];
            }
            if (nodeName === "textarea") {
              return true;
            }
            return false;
          }
          function isEventSupported(eventNameSuffix) {
            if (!canUseDOM) {
              return false;
            }
            var eventName = "on" + eventNameSuffix;
            var isSupported = eventName in document;
            if (!isSupported) {
              var element = document.createElement("div");
              element.setAttribute(eventName, "return;");
              isSupported = typeof element[eventName] === "function";
            }
            return isSupported;
          }
          function registerEvents$1() {
            registerTwoPhaseEvent("onChange", ["change", "click", "focusin", "focusout", "input", "keydown", "keyup", "selectionchange"]);
          }
          function createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) {
            enqueueStateRestore(target);
            var listeners = accumulateTwoPhaseListeners(inst, "onChange");
            if (listeners.length > 0) {
              var event = new SyntheticEvent("onChange", "change", null, nativeEvent, target);
              dispatchQueue.push({
                event,
                listeners
              });
            }
          }
          var activeElement = null;
          var activeElementInst = null;
          function shouldUseChangeEvent(elem) {
            var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
            return nodeName === "select" || nodeName === "input" && elem.type === "file";
          }
          function manualDispatchChangeEvent(nativeEvent) {
            var dispatchQueue = [];
            createAndAccumulateChangeEvent(dispatchQueue, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
            batchedUpdates(runEventInBatch, dispatchQueue);
          }
          function runEventInBatch(dispatchQueue) {
            processDispatchQueue(dispatchQueue, 0);
          }
          function getInstIfValueChanged(targetInst) {
            var targetNode = getNodeFromInstance(targetInst);
            if (updateValueIfChanged(targetNode)) {
              return targetInst;
            }
          }
          function getTargetInstForChangeEvent(domEventName, targetInst) {
            if (domEventName === "change") {
              return targetInst;
            }
          }
          var isInputEventSupported = false;
          if (canUseDOM) {
            isInputEventSupported = isEventSupported("input") && (!document.documentMode || document.documentMode > 9);
          }
          function startWatchingForValueChange(target, targetInst) {
            activeElement = target;
            activeElementInst = targetInst;
            activeElement.attachEvent("onpropertychange", handlePropertyChange);
          }
          function stopWatchingForValueChange() {
            if (!activeElement) {
              return;
            }
            activeElement.detachEvent("onpropertychange", handlePropertyChange);
            activeElement = null;
            activeElementInst = null;
          }
          function handlePropertyChange(nativeEvent) {
            if (nativeEvent.propertyName !== "value") {
              return;
            }
            if (getInstIfValueChanged(activeElementInst)) {
              manualDispatchChangeEvent(nativeEvent);
            }
          }
          function handleEventsForInputEventPolyfill(domEventName, target, targetInst) {
            if (domEventName === "focusin") {
              stopWatchingForValueChange();
              startWatchingForValueChange(target, targetInst);
            } else if (domEventName === "focusout") {
              stopWatchingForValueChange();
            }
          }
          function getTargetInstForInputEventPolyfill(domEventName, targetInst) {
            if (domEventName === "selectionchange" || domEventName === "keyup" || domEventName === "keydown") {
              return getInstIfValueChanged(activeElementInst);
            }
          }
          function shouldUseClickEvent(elem) {
            var nodeName = elem.nodeName;
            return nodeName && nodeName.toLowerCase() === "input" && (elem.type === "checkbox" || elem.type === "radio");
          }
          function getTargetInstForClickEvent(domEventName, targetInst) {
            if (domEventName === "click") {
              return getInstIfValueChanged(targetInst);
            }
          }
          function getTargetInstForInputOrChangeEvent(domEventName, targetInst) {
            if (domEventName === "input" || domEventName === "change") {
              return getInstIfValueChanged(targetInst);
            }
          }
          function handleControlledInputBlur(node) {
            var state = node._wrapperState;
            if (!state || !state.controlled || node.type !== "number") {
              return;
            }
            {
              setDefaultValue(node, "number", node.value);
            }
          }
          function extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;
            var getTargetInstFunc, handleEventFunc;
            if (shouldUseChangeEvent(targetNode)) {
              getTargetInstFunc = getTargetInstForChangeEvent;
            } else if (isTextInputElement(targetNode)) {
              if (isInputEventSupported) {
                getTargetInstFunc = getTargetInstForInputOrChangeEvent;
              } else {
                getTargetInstFunc = getTargetInstForInputEventPolyfill;
                handleEventFunc = handleEventsForInputEventPolyfill;
              }
            } else if (shouldUseClickEvent(targetNode)) {
              getTargetInstFunc = getTargetInstForClickEvent;
            }
            if (getTargetInstFunc) {
              var inst = getTargetInstFunc(domEventName, targetInst);
              if (inst) {
                createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, nativeEventTarget);
                return;
              }
            }
            if (handleEventFunc) {
              handleEventFunc(domEventName, targetNode, targetInst);
            }
            if (domEventName === "focusout") {
              handleControlledInputBlur(targetNode);
            }
          }
          function registerEvents$2() {
            registerDirectEvent("onMouseEnter", ["mouseout", "mouseover"]);
            registerDirectEvent("onMouseLeave", ["mouseout", "mouseover"]);
            registerDirectEvent("onPointerEnter", ["pointerout", "pointerover"]);
            registerDirectEvent("onPointerLeave", ["pointerout", "pointerover"]);
          }
          function extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            var isOverEvent = domEventName === "mouseover" || domEventName === "pointerover";
            var isOutEvent = domEventName === "mouseout" || domEventName === "pointerout";
            if (isOverEvent && !isReplayingEvent(nativeEvent)) {
              var related = nativeEvent.relatedTarget || nativeEvent.fromElement;
              if (related) {
                if (getClosestInstanceFromNode(related) || isContainerMarkedAsRoot(related)) {
                  return;
                }
              }
            }
            if (!isOutEvent && !isOverEvent) {
              return;
            }
            var win;
            if (nativeEventTarget.window === nativeEventTarget) {
              win = nativeEventTarget;
            } else {
              var doc = nativeEventTarget.ownerDocument;
              if (doc) {
                win = doc.defaultView || doc.parentWindow;
              } else {
                win = window;
              }
            }
            var from;
            var to;
            if (isOutEvent) {
              var _related = nativeEvent.relatedTarget || nativeEvent.toElement;
              from = targetInst;
              to = _related ? getClosestInstanceFromNode(_related) : null;
              if (to !== null) {
                var nearestMounted = getNearestMountedFiber(to);
                if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {
                  to = null;
                }
              }
            } else {
              from = null;
              to = targetInst;
            }
            if (from === to) {
              return;
            }
            var SyntheticEventCtor = SyntheticMouseEvent;
            var leaveEventType = "onMouseLeave";
            var enterEventType = "onMouseEnter";
            var eventTypePrefix = "mouse";
            if (domEventName === "pointerout" || domEventName === "pointerover") {
              SyntheticEventCtor = SyntheticPointerEvent;
              leaveEventType = "onPointerLeave";
              enterEventType = "onPointerEnter";
              eventTypePrefix = "pointer";
            }
            var fromNode = from == null ? win : getNodeFromInstance(from);
            var toNode = to == null ? win : getNodeFromInstance(to);
            var leave = new SyntheticEventCtor(leaveEventType, eventTypePrefix + "leave", from, nativeEvent, nativeEventTarget);
            leave.target = fromNode;
            leave.relatedTarget = toNode;
            var enter = null;
            var nativeTargetInst = getClosestInstanceFromNode(nativeEventTarget);
            if (nativeTargetInst === targetInst) {
              var enterEvent = new SyntheticEventCtor(enterEventType, eventTypePrefix + "enter", to, nativeEvent, nativeEventTarget);
              enterEvent.target = toNode;
              enterEvent.relatedTarget = fromNode;
              enter = enterEvent;
            }
            accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leave, enter, from, to);
          }
          function is(x, y) {
            return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
          }
          var objectIs = typeof Object.is === "function" ? Object.is : is;
          function shallowEqual(objA, objB) {
            if (objectIs(objA, objB)) {
              return true;
            }
            if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
              return false;
            }
            var keysA = Object.keys(objA);
            var keysB = Object.keys(objB);
            if (keysA.length !== keysB.length) {
              return false;
            }
            for (var i = 0; i < keysA.length; i++) {
              var currentKey = keysA[i];
              if (!hasOwnProperty.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey])) {
                return false;
              }
            }
            return true;
          }
          function getLeafNode(node) {
            while (node && node.firstChild) {
              node = node.firstChild;
            }
            return node;
          }
          function getSiblingNode(node) {
            while (node) {
              if (node.nextSibling) {
                return node.nextSibling;
              }
              node = node.parentNode;
            }
          }
          function getNodeForCharacterOffset(root2, offset) {
            var node = getLeafNode(root2);
            var nodeStart = 0;
            var nodeEnd = 0;
            while (node) {
              if (node.nodeType === TEXT_NODE) {
                nodeEnd = nodeStart + node.textContent.length;
                if (nodeStart <= offset && nodeEnd >= offset) {
                  return {
                    node,
                    offset: offset - nodeStart
                  };
                }
                nodeStart = nodeEnd;
              }
              node = getLeafNode(getSiblingNode(node));
            }
          }
          function getOffsets(outerNode) {
            var ownerDocument = outerNode.ownerDocument;
            var win = ownerDocument && ownerDocument.defaultView || window;
            var selection = win.getSelection && win.getSelection();
            if (!selection || selection.rangeCount === 0) {
              return null;
            }
            var anchorNode = selection.anchorNode, anchorOffset = selection.anchorOffset, focusNode = selection.focusNode, focusOffset = selection.focusOffset;
            try {
              anchorNode.nodeType;
              focusNode.nodeType;
            } catch (e) {
              return null;
            }
            return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
          }
          function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
            var length = 0;
            var start = -1;
            var end = -1;
            var indexWithinAnchor = 0;
            var indexWithinFocus = 0;
            var node = outerNode;
            var parentNode = null;
            outer:
              while (true) {
                var next = null;
                while (true) {
                  if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
                    start = length + anchorOffset;
                  }
                  if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
                    end = length + focusOffset;
                  }
                  if (node.nodeType === TEXT_NODE) {
                    length += node.nodeValue.length;
                  }
                  if ((next = node.firstChild) === null) {
                    break;
                  }
                  parentNode = node;
                  node = next;
                }
                while (true) {
                  if (node === outerNode) {
                    break outer;
                  }
                  if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
                    start = length;
                  }
                  if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
                    end = length;
                  }
                  if ((next = node.nextSibling) !== null) {
                    break;
                  }
                  node = parentNode;
                  parentNode = node.parentNode;
                }
                node = next;
              }
            if (start === -1 || end === -1) {
              return null;
            }
            return {
              start,
              end
            };
          }
          function setOffsets(node, offsets) {
            var doc = node.ownerDocument || document;
            var win = doc && doc.defaultView || window;
            if (!win.getSelection) {
              return;
            }
            var selection = win.getSelection();
            var length = node.textContent.length;
            var start = Math.min(offsets.start, length);
            var end = offsets.end === void 0 ? start : Math.min(offsets.end, length);
            if (!selection.extend && start > end) {
              var temp = end;
              end = start;
              start = temp;
            }
            var startMarker = getNodeForCharacterOffset(node, start);
            var endMarker = getNodeForCharacterOffset(node, end);
            if (startMarker && endMarker) {
              if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
                return;
              }
              var range = doc.createRange();
              range.setStart(startMarker.node, startMarker.offset);
              selection.removeAllRanges();
              if (start > end) {
                selection.addRange(range);
                selection.extend(endMarker.node, endMarker.offset);
              } else {
                range.setEnd(endMarker.node, endMarker.offset);
                selection.addRange(range);
              }
            }
          }
          function isTextNode(node) {
            return node && node.nodeType === TEXT_NODE;
          }
          function containsNode(outerNode, innerNode) {
            if (!outerNode || !innerNode) {
              return false;
            } else if (outerNode === innerNode) {
              return true;
            } else if (isTextNode(outerNode)) {
              return false;
            } else if (isTextNode(innerNode)) {
              return containsNode(outerNode, innerNode.parentNode);
            } else if ("contains" in outerNode) {
              return outerNode.contains(innerNode);
            } else if (outerNode.compareDocumentPosition) {
              return !!(outerNode.compareDocumentPosition(innerNode) & 16);
            } else {
              return false;
            }
          }
          function isInDocument(node) {
            return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
          }
          function isSameOriginFrame(iframe) {
            try {
              return typeof iframe.contentWindow.location.href === "string";
            } catch (err) {
              return false;
            }
          }
          function getActiveElementDeep() {
            var win = window;
            var element = getActiveElement();
            while (element instanceof win.HTMLIFrameElement) {
              if (isSameOriginFrame(element)) {
                win = element.contentWindow;
              } else {
                return element;
              }
              element = getActiveElement(win.document);
            }
            return element;
          }
          function hasSelectionCapabilities(elem) {
            var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
            return nodeName && (nodeName === "input" && (elem.type === "text" || elem.type === "search" || elem.type === "tel" || elem.type === "url" || elem.type === "password") || nodeName === "textarea" || elem.contentEditable === "true");
          }
          function getSelectionInformation() {
            var focusedElem = getActiveElementDeep();
            return {
              focusedElem,
              selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null
            };
          }
          function restoreSelection(priorSelectionInformation) {
            var curFocusedElem = getActiveElementDeep();
            var priorFocusedElem = priorSelectionInformation.focusedElem;
            var priorSelectionRange = priorSelectionInformation.selectionRange;
            if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
              if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {
                setSelection(priorFocusedElem, priorSelectionRange);
              }
              var ancestors = [];
              var ancestor = priorFocusedElem;
              while (ancestor = ancestor.parentNode) {
                if (ancestor.nodeType === ELEMENT_NODE) {
                  ancestors.push({
                    element: ancestor,
                    left: ancestor.scrollLeft,
                    top: ancestor.scrollTop
                  });
                }
              }
              if (typeof priorFocusedElem.focus === "function") {
                priorFocusedElem.focus();
              }
              for (var i = 0; i < ancestors.length; i++) {
                var info = ancestors[i];
                info.element.scrollLeft = info.left;
                info.element.scrollTop = info.top;
              }
            }
          }
          function getSelection(input) {
            var selection;
            if ("selectionStart" in input) {
              selection = {
                start: input.selectionStart,
                end: input.selectionEnd
              };
            } else {
              selection = getOffsets(input);
            }
            return selection || {
              start: 0,
              end: 0
            };
          }
          function setSelection(input, offsets) {
            var start = offsets.start;
            var end = offsets.end;
            if (end === void 0) {
              end = start;
            }
            if ("selectionStart" in input) {
              input.selectionStart = start;
              input.selectionEnd = Math.min(end, input.value.length);
            } else {
              setOffsets(input, offsets);
            }
          }
          var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && document.documentMode <= 11;
          function registerEvents$3() {
            registerTwoPhaseEvent("onSelect", ["focusout", "contextmenu", "dragend", "focusin", "keydown", "keyup", "mousedown", "mouseup", "selectionchange"]);
          }
          var activeElement$1 = null;
          var activeElementInst$1 = null;
          var lastSelection = null;
          var mouseDown = false;
          function getSelection$1(node) {
            if ("selectionStart" in node && hasSelectionCapabilities(node)) {
              return {
                start: node.selectionStart,
                end: node.selectionEnd
              };
            } else {
              var win = node.ownerDocument && node.ownerDocument.defaultView || window;
              var selection = win.getSelection();
              return {
                anchorNode: selection.anchorNode,
                anchorOffset: selection.anchorOffset,
                focusNode: selection.focusNode,
                focusOffset: selection.focusOffset
              };
            }
          }
          function getEventTargetDocument(eventTarget) {
            return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
          }
          function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
            var doc = getEventTargetDocument(nativeEventTarget);
            if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
              return;
            }
            var currentSelection = getSelection$1(activeElement$1);
            if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
              lastSelection = currentSelection;
              var listeners = accumulateTwoPhaseListeners(activeElementInst$1, "onSelect");
              if (listeners.length > 0) {
                var event = new SyntheticEvent("onSelect", "select", null, nativeEvent, nativeEventTarget);
                dispatchQueue.push({
                  event,
                  listeners
                });
                event.target = activeElement$1;
              }
            }
          }
          function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;
            switch (domEventName) {
              case "focusin":
                if (isTextInputElement(targetNode) || targetNode.contentEditable === "true") {
                  activeElement$1 = targetNode;
                  activeElementInst$1 = targetInst;
                  lastSelection = null;
                }
                break;
              case "focusout":
                activeElement$1 = null;
                activeElementInst$1 = null;
                lastSelection = 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);
            }
          }
          function makePrefixMap(styleProp, eventName) {
            var prefixes2 = {};
            prefixes2[styleProp.toLowerCase()] = eventName.toLowerCase();
            prefixes2["Webkit" + styleProp] = "webkit" + eventName;
            prefixes2["Moz" + styleProp] = "moz" + eventName;
            return prefixes2;
          }
          var vendorPrefixes = {
            animationend: makePrefixMap("Animation", "AnimationEnd"),
            animationiteration: makePrefixMap("Animation", "AnimationIteration"),
            animationstart: makePrefixMap("Animation", "AnimationStart"),
            transitionend: makePrefixMap("Transition", "TransitionEnd")
          };
          var prefixedEventNames = {};
          var style = {};
          if (canUseDOM) {
            style = document.createElement("div").style;
            if (!("AnimationEvent" in window)) {
              delete vendorPrefixes.animationend.animation;
              delete vendorPrefixes.animationiteration.animation;
              delete vendorPrefixes.animationstart.animation;
            }
            if (!("TransitionEvent" in window)) {
              delete vendorPrefixes.transitionend.transition;
            }
          }
          function getVendorPrefixedEventName(eventName) {
            if (prefixedEventNames[eventName]) {
              return prefixedEventNames[eventName];
            } else if (!vendorPrefixes[eventName]) {
              return eventName;
            }
            var prefixMap = vendorPrefixes[eventName];
            for (var styleProp in prefixMap) {
              if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
                return prefixedEventNames[eventName] = prefixMap[styleProp];
              }
            }
            return eventName;
          }
          var ANIMATION_END = getVendorPrefixedEventName("animationend");
          var ANIMATION_ITERATION = getVendorPrefixedEventName("animationiteration");
          var ANIMATION_START = getVendorPrefixedEventName("animationstart");
          var TRANSITION_END = getVendorPrefixedEventName("transitionend");
          var topLevelEventsToReactNames = /* @__PURE__ */ new Map();
          var simpleEventPluginEvents = ["abort", "auxClick", "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"];
          function registerSimpleEvent(domEventName, reactName) {
            topLevelEventsToReactNames.set(domEventName, reactName);
            registerTwoPhaseEvent(reactName, [domEventName]);
          }
          function registerSimpleEvents() {
            for (var i = 0; i < simpleEventPluginEvents.length; i++) {
              var eventName = simpleEventPluginEvents[i];
              var domEventName = eventName.toLowerCase();
              var capitalizedEvent = eventName[0].toUpperCase() + eventName.slice(1);
              registerSimpleEvent(domEventName, "on" + capitalizedEvent);
            }
            registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
            registerSimpleEvent(ANIMATION_ITERATION, "onAnimationIteration");
            registerSimpleEvent(ANIMATION_START, "onAnimationStart");
            registerSimpleEvent("dblclick", "onDoubleClick");
            registerSimpleEvent("focusin", "onFocus");
            registerSimpleEvent("focusout", "onBlur");
            registerSimpleEvent(TRANSITION_END, "onTransitionEnd");
          }
          function extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            var reactName = topLevelEventsToReactNames.get(domEventName);
            if (reactName === void 0) {
              return;
            }
            var SyntheticEventCtor = SyntheticEvent;
            var reactEventType = domEventName;
            switch (domEventName) {
              case "keypress":
                if (getEventCharCode(nativeEvent) === 0) {
                  return;
                }
              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 (nativeEvent.button === 2) {
                  return;
                }
              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":
                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;
            }
            var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;
            {
              var accumulateTargetOnly = !inCapturePhase && domEventName === "scroll";
              var _listeners = accumulateSinglePhaseListeners(targetInst, reactName, nativeEvent.type, inCapturePhase, accumulateTargetOnly);
              if (_listeners.length > 0) {
                var _event = new SyntheticEventCtor(reactName, reactEventType, null, nativeEvent, nativeEventTarget);
                dispatchQueue.push({
                  event: _event,
                  listeners: _listeners
                });
              }
            }
          }
          registerSimpleEvents();
          registerEvents$2();
          registerEvents$1();
          registerEvents$3();
          registerEvents();
          function extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
            var shouldProcessPolyfillPlugins = (eventSystemFlags & SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS) === 0;
            if (shouldProcessPolyfillPlugins) {
              extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
              extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
              extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
              extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
            }
          }
          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"];
          var nonDelegatedEvents = new Set(["cancel", "close", "invalid", "load", "scroll", "toggle"].concat(mediaEventTypes));
          function executeDispatch(event, listener, currentTarget) {
            var type = event.type || "unknown-event";
            event.currentTarget = currentTarget;
            invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event);
            event.currentTarget = null;
          }
          function processDispatchQueueItemsInOrder(event, dispatchListeners, inCapturePhase) {
            var previousInstance;
            if (inCapturePhase) {
              for (var i = dispatchListeners.length - 1; i >= 0; i--) {
                var _dispatchListeners$i = dispatchListeners[i], instance = _dispatchListeners$i.instance, currentTarget = _dispatchListeners$i.currentTarget, listener = _dispatchListeners$i.listener;
                if (instance !== previousInstance && event.isPropagationStopped()) {
                  return;
                }
                executeDispatch(event, listener, currentTarget);
                previousInstance = instance;
              }
            } else {
              for (var _i = 0; _i < dispatchListeners.length; _i++) {
                var _dispatchListeners$_i = dispatchListeners[_i], _instance = _dispatchListeners$_i.instance, _currentTarget = _dispatchListeners$_i.currentTarget, _listener = _dispatchListeners$_i.listener;
                if (_instance !== previousInstance && event.isPropagationStopped()) {
                  return;
                }
                executeDispatch(event, _listener, _currentTarget);
                previousInstance = _instance;
              }
            }
          }
          function processDispatchQueue(dispatchQueue, eventSystemFlags) {
            var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;
            for (var i = 0; i < dispatchQueue.length; i++) {
              var _dispatchQueue$i = dispatchQueue[i], event = _dispatchQueue$i.event, listeners = _dispatchQueue$i.listeners;
              processDispatchQueueItemsInOrder(event, listeners, inCapturePhase);
            }
            rethrowCaughtError();
          }
          function dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
            var nativeEventTarget = getEventTarget(nativeEvent);
            var dispatchQueue = [];
            extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
            processDispatchQueue(dispatchQueue, eventSystemFlags);
          }
          function listenToNonDelegatedEvent(domEventName, targetElement) {
            {
              if (!nonDelegatedEvents.has(domEventName)) {
                error('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.', domEventName);
              }
            }
            var isCapturePhaseListener = false;
            var listenerSet = getEventListenerSet(targetElement);
            var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener);
            if (!listenerSet.has(listenerSetKey)) {
              addTrappedEventListener(targetElement, domEventName, IS_NON_DELEGATED, isCapturePhaseListener);
              listenerSet.add(listenerSetKey);
            }
          }
          function listenToNativeEvent(domEventName, isCapturePhaseListener, target) {
            {
              if (nonDelegatedEvents.has(domEventName) && !isCapturePhaseListener) {
                error('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.', domEventName);
              }
            }
            var eventSystemFlags = 0;
            if (isCapturePhaseListener) {
              eventSystemFlags |= IS_CAPTURE_PHASE;
            }
            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) {
                if (domEventName !== "selectionchange") {
                  if (!nonDelegatedEvents.has(domEventName)) {
                    listenToNativeEvent(domEventName, false, rootContainerElement);
                  }
                  listenToNativeEvent(domEventName, true, rootContainerElement);
                }
              });
              var ownerDocument = rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
              if (ownerDocument !== null) {
                if (!ownerDocument[listeningMarker]) {
                  ownerDocument[listeningMarker] = true;
                  listenToNativeEvent("selectionchange", false, ownerDocument);
                }
              }
            }
          }
          function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener, isDeferredListenerForLegacyFBSupport) {
            var listener = createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags);
            var isPassiveListener = void 0;
            if (passiveBrowserEventsSupported) {
              if (domEventName === "touchstart" || domEventName === "touchmove" || domEventName === "wheel") {
                isPassiveListener = true;
              }
            }
            targetContainer = targetContainer;
            var unsubscribeListener;
            if (isCapturePhaseListener) {
              if (isPassiveListener !== void 0) {
                unsubscribeListener = addEventCaptureListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);
              } else {
                unsubscribeListener = addEventCaptureListener(targetContainer, domEventName, listener);
              }
            } else {
              if (isPassiveListener !== void 0) {
                unsubscribeListener = addEventBubbleListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);
              } else {
                unsubscribeListener = addEventBubbleListener(targetContainer, domEventName, listener);
              }
            }
          }
          function isMatchingRootContainer(grandContainer, targetContainer) {
            return grandContainer === targetContainer || grandContainer.nodeType === COMMENT_NODE && grandContainer.parentNode === targetContainer;
          }
          function dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
            var ancestorInst = targetInst;
            if ((eventSystemFlags & IS_EVENT_HANDLE_NON_MANAGED_NODE) === 0 && (eventSystemFlags & IS_NON_DELEGATED) === 0) {
              var targetContainerNode = targetContainer;
              if (targetInst !== null) {
                var node = targetInst;
                mainLoop:
                  while (true) {
                    if (node === null) {
                      return;
                    }
                    var nodeTag = node.tag;
                    if (nodeTag === HostRoot || nodeTag === HostPortal) {
                      var container = node.stateNode.containerInfo;
                      if (isMatchingRootContainer(container, targetContainerNode)) {
                        break;
                      }
                      if (nodeTag === HostPortal) {
                        var grandNode = node.return;
                        while (grandNode !== null) {
                          var grandTag = grandNode.tag;
                          if (grandTag === HostRoot || grandTag === HostPortal) {
                            var grandContainer = grandNode.stateNode.containerInfo;
                            if (isMatchingRootContainer(grandContainer, targetContainerNode)) {
                              return;
                            }
                          }
                          grandNode = grandNode.return;
                        }
                      }
                      while (container !== null) {
                        var parentNode = getClosestInstanceFromNode(container);
                        if (parentNode === null) {
                          return;
                        }
                        var parentTag = parentNode.tag;
                        if (parentTag === HostComponent || parentTag === HostText) {
                          node = ancestorInst = parentNode;
                          continue mainLoop;
                        }
                        container = container.parentNode;
                      }
                    }
                    node = node.return;
                  }
              }
            }
            batchedUpdates(function() {
              return dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, ancestorInst);
            });
          }
          function createDispatchListener(instance, listener, currentTarget) {
            return {
              instance,
              listener,
              currentTarget
            };
          }
          function accumulateSinglePhaseListeners(targetFiber, reactName, nativeEventType, inCapturePhase, accumulateTargetOnly, nativeEvent) {
            var captureName = reactName !== null ? reactName + "Capture" : null;
            var reactEventName = inCapturePhase ? captureName : reactName;
            var listeners = [];
            var instance = targetFiber;
            var lastHostComponent = null;
            while (instance !== null) {
              var _instance2 = instance, stateNode = _instance2.stateNode, tag = _instance2.tag;
              if (tag === HostComponent && stateNode !== null) {
                lastHostComponent = stateNode;
                if (reactEventName !== null) {
                  var listener = getListener(instance, reactEventName);
                  if (listener != null) {
                    listeners.push(createDispatchListener(instance, listener, lastHostComponent));
                  }
                }
              }
              if (accumulateTargetOnly) {
                break;
              }
              instance = instance.return;
            }
            return listeners;
          }
          function accumulateTwoPhaseListeners(targetFiber, reactName) {
            var captureName = reactName + "Capture";
            var listeners = [];
            var instance = targetFiber;
            while (instance !== null) {
              var _instance3 = instance, stateNode = _instance3.stateNode, tag = _instance3.tag;
              if (tag === HostComponent && stateNode !== null) {
                var currentTarget = stateNode;
                var captureListener = getListener(instance, captureName);
                if (captureListener != null) {
                  listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
                }
                var bubbleListener = getListener(instance, reactName);
                if (bubbleListener != null) {
                  listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
                }
              }
              instance = instance.return;
            }
            return listeners;
          }
          function getParent(inst) {
            if (inst === null) {
              return null;
            }
            do {
              inst = inst.return;
            } while (inst && inst.tag !== HostComponent);
            if (inst) {
              return inst;
            }
            return null;
          }
          function getLowestCommonAncestor(instA, instB) {
            var nodeA = instA;
            var nodeB = instB;
            var depthA = 0;
            for (var tempA = nodeA; tempA; tempA = getParent(tempA)) {
              depthA++;
            }
            var depthB = 0;
            for (var tempB = nodeB; tempB; tempB = getParent(tempB)) {
              depthB++;
            }
            while (depthA - depthB > 0) {
              nodeA = getParent(nodeA);
              depthA--;
            }
            while (depthB - depthA > 0) {
              nodeB = getParent(nodeB);
              depthB--;
            }
            var depth = depthA;
            while (depth--) {
              if (nodeA === nodeB || nodeB !== null && nodeA === nodeB.alternate) {
                return nodeA;
              }
              nodeA = getParent(nodeA);
              nodeB = getParent(nodeB);
            }
            return null;
          }
          function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common, inCapturePhase) {
            var registrationName = event._reactName;
            var listeners = [];
            var instance = target;
            while (instance !== null) {
              if (instance === common) {
                break;
              }
              var _instance4 = instance, alternate = _instance4.alternate, stateNode = _instance4.stateNode, tag = _instance4.tag;
              if (alternate !== null && alternate === common) {
                break;
              }
              if (tag === HostComponent && stateNode !== null) {
                var currentTarget = stateNode;
                if (inCapturePhase) {
                  var captureListener = getListener(instance, registrationName);
                  if (captureListener != null) {
                    listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
                  }
                } else if (!inCapturePhase) {
                  var bubbleListener = getListener(instance, registrationName);
                  if (bubbleListener != null) {
                    listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
                  }
                }
              }
              instance = instance.return;
            }
            if (listeners.length !== 0) {
              dispatchQueue.push({
                event,
                listeners
              });
            }
          }
          function accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leaveEvent, enterEvent, from, to) {
            var common = from && to ? getLowestCommonAncestor(from, to) : null;
            if (from !== null) {
              accumulateEnterLeaveListenersForEvent(dispatchQueue, leaveEvent, from, common, false);
            }
            if (to !== null && enterEvent !== null) {
              accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common, true);
            }
          }
          function getListenerSetKey(domEventName, capture) {
            return domEventName + "__" + (capture ? "capture" : "bubble");
          }
          var didWarnInvalidHydration = false;
          var DANGEROUSLY_SET_INNER_HTML = "dangerouslySetInnerHTML";
          var SUPPRESS_CONTENT_EDITABLE_WARNING = "suppressContentEditableWarning";
          var SUPPRESS_HYDRATION_WARNING = "suppressHydrationWarning";
          var AUTOFOCUS = "autoFocus";
          var CHILDREN = "children";
          var STYLE = "style";
          var HTML$1 = "__html";
          var warnedUnknownTags;
          var validatePropertiesInDevelopment;
          var warnForPropDifference;
          var warnForExtraAttributes;
          var warnForInvalidEventListener;
          var canDiffStyleForHydrationWarning;
          var normalizeHTML;
          {
            warnedUnknownTags = {
              dialog: true,
              webview: true
            };
            validatePropertiesInDevelopment = function(type, props) {
              validateProperties(type, props);
              validateProperties$1(type, props);
              validateProperties$2(type, props, {
                registrationNameDependencies,
                possibleRegistrationNames
              });
            };
            canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode;
            warnForPropDifference = function(propName, serverValue, clientValue) {
              if (didWarnInvalidHydration) {
                return;
              }
              var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);
              var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);
              if (normalizedServerValue === normalizedClientValue) {
                return;
              }
              didWarnInvalidHydration = true;
              error("Prop `%s` did not match. Server: %s Client: %s", propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));
            };
            warnForExtraAttributes = function(attributeNames) {
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              var names = [];
              attributeNames.forEach(function(name) {
                names.push(name);
              });
              error("Extra attributes from the server: %s", names);
            };
            warnForInvalidEventListener = function(registrationName, listener) {
              if (listener === false) {
                error("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.", registrationName, registrationName, registrationName);
              } else {
                error("Expected `%s` listener to be a function, instead got a value of `%s` type.", registrationName, typeof listener);
              }
            };
            normalizeHTML = function(parent, html) {
              var testElement = parent.namespaceURI === HTML_NAMESPACE ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);
              testElement.innerHTML = html;
              return testElement.innerHTML;
            };
          }
          var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
          var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
          function normalizeMarkupForTextOrAttribute(markup) {
            {
              checkHtmlStringCoercion(markup);
            }
            var markupString = typeof markup === "string" ? markup : "" + markup;
            return markupString.replace(NORMALIZE_NEWLINES_REGEX, "\n").replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
          }
          function checkForUnmatchedText(serverText, clientText, isConcurrentMode, shouldWarnDev) {
            var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
            var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
            if (normalizedServerText === normalizedClientText) {
              return;
            }
            if (shouldWarnDev) {
              {
                if (!didWarnInvalidHydration) {
                  didWarnInvalidHydration = true;
                  error('Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
                }
              }
            }
            if (isConcurrentMode && enableClientRenderFallbackOnTextMismatch) {
              throw new Error("Text content does not match server-rendered HTML.");
            }
          }
          function getOwnerDocumentFromRootContainer(rootContainerElement) {
            return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
          }
          function noop() {
          }
          function trapClickOnNonInteractiveElement(node) {
            node.onclick = noop;
          }
          function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
            for (var propKey in nextProps) {
              if (!nextProps.hasOwnProperty(propKey)) {
                continue;
              }
              var nextProp = nextProps[propKey];
              if (propKey === STYLE) {
                {
                  if (nextProp) {
                    Object.freeze(nextProp);
                  }
                }
                setValueForStyles(domElement, nextProp);
              } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
                var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
                if (nextHtml != null) {
                  setInnerHTML(domElement, nextHtml);
                }
              } else if (propKey === CHILDREN) {
                if (typeof nextProp === "string") {
                  var canSetTextContent = tag !== "textarea" || nextProp !== "";
                  if (canSetTextContent) {
                    setTextContent(domElement, nextProp);
                  }
                } else if (typeof nextProp === "number") {
                  setTextContent(domElement, "" + nextProp);
                }
              } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING)
                ;
              else if (propKey === AUTOFOCUS)
                ;
              else if (registrationNameDependencies.hasOwnProperty(propKey)) {
                if (nextProp != null) {
                  if (typeof nextProp !== "function") {
                    warnForInvalidEventListener(propKey, nextProp);
                  }
                  if (propKey === "onScroll") {
                    listenToNonDelegatedEvent("scroll", domElement);
                  }
                }
              } else if (nextProp != null) {
                setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);
              }
            }
          }
          function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
            for (var i = 0; i < updatePayload.length; i += 2) {
              var propKey = updatePayload[i];
              var propValue = updatePayload[i + 1];
              if (propKey === STYLE) {
                setValueForStyles(domElement, propValue);
              } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
                setInnerHTML(domElement, propValue);
              } else if (propKey === CHILDREN) {
                setTextContent(domElement, propValue);
              } else {
                setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);
              }
            }
          }
          function createElement2(type, props, rootContainerElement, parentNamespace) {
            var isCustomComponentTag;
            var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
            var domElement;
            var namespaceURI = parentNamespace;
            if (namespaceURI === HTML_NAMESPACE) {
              namespaceURI = getIntrinsicNamespace(type);
            }
            if (namespaceURI === HTML_NAMESPACE) {
              {
                isCustomComponentTag = isCustomComponent(type, props);
                if (!isCustomComponentTag && type !== type.toLowerCase()) {
                  error("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.", type);
                }
              }
              if (type === "script") {
                var div = ownerDocument.createElement("div");
                div.innerHTML = "<script><\/script>";
                var firstChild = div.firstChild;
                domElement = div.removeChild(firstChild);
              } else if (typeof props.is === "string") {
                domElement = ownerDocument.createElement(type, {
                  is: props.is
                });
              } else {
                domElement = ownerDocument.createElement(type);
                if (type === "select") {
                  var node = domElement;
                  if (props.multiple) {
                    node.multiple = true;
                  } else if (props.size) {
                    node.size = props.size;
                  }
                }
              }
            } else {
              domElement = ownerDocument.createElementNS(namespaceURI, type);
            }
            {
              if (namespaceURI === HTML_NAMESPACE) {
                if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === "[object HTMLUnknownElement]" && !hasOwnProperty.call(warnedUnknownTags, type)) {
                  warnedUnknownTags[type] = true;
                  error("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.", type);
                }
              }
            }
            return domElement;
          }
          function createTextNode(text, rootContainerElement) {
            return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);
          }
          function setInitialProperties(domElement, tag, rawProps, rootContainerElement) {
            var isCustomComponentTag = isCustomComponent(tag, rawProps);
            {
              validatePropertiesInDevelopment(tag, rawProps);
            }
            var props;
            switch (tag) {
              case "dialog":
                listenToNonDelegatedEvent("cancel", domElement);
                listenToNonDelegatedEvent("close", domElement);
                props = rawProps;
                break;
              case "iframe":
              case "object":
              case "embed":
                listenToNonDelegatedEvent("load", domElement);
                props = rawProps;
                break;
              case "video":
              case "audio":
                for (var i = 0; i < mediaEventTypes.length; i++) {
                  listenToNonDelegatedEvent(mediaEventTypes[i], domElement);
                }
                props = rawProps;
                break;
              case "source":
                listenToNonDelegatedEvent("error", domElement);
                props = rawProps;
                break;
              case "img":
              case "image":
              case "link":
                listenToNonDelegatedEvent("error", domElement);
                listenToNonDelegatedEvent("load", domElement);
                props = rawProps;
                break;
              case "details":
                listenToNonDelegatedEvent("toggle", domElement);
                props = rawProps;
                break;
              case "input":
                initWrapperState(domElement, rawProps);
                props = getHostProps(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              case "option":
                validateProps(domElement, rawProps);
                props = rawProps;
                break;
              case "select":
                initWrapperState$1(domElement, rawProps);
                props = getHostProps$1(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              case "textarea":
                initWrapperState$2(domElement, rawProps);
                props = getHostProps$2(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              default:
                props = rawProps;
            }
            assertValidProps(tag, props);
            setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);
            switch (tag) {
              case "input":
                track(domElement);
                postMountWrapper(domElement, rawProps, false);
                break;
              case "textarea":
                track(domElement);
                postMountWrapper$3(domElement);
                break;
              case "option":
                postMountWrapper$1(domElement, rawProps);
                break;
              case "select":
                postMountWrapper$2(domElement, rawProps);
                break;
              default:
                if (typeof props.onClick === "function") {
                  trapClickOnNonInteractiveElement(domElement);
                }
                break;
            }
          }
          function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
            {
              validatePropertiesInDevelopment(tag, nextRawProps);
            }
            var updatePayload = null;
            var lastProps;
            var nextProps;
            switch (tag) {
              case "input":
                lastProps = getHostProps(domElement, lastRawProps);
                nextProps = getHostProps(domElement, nextRawProps);
                updatePayload = [];
                break;
              case "select":
                lastProps = getHostProps$1(domElement, lastRawProps);
                nextProps = getHostProps$1(domElement, nextRawProps);
                updatePayload = [];
                break;
              case "textarea":
                lastProps = getHostProps$2(domElement, lastRawProps);
                nextProps = getHostProps$2(domElement, nextRawProps);
                updatePayload = [];
                break;
              default:
                lastProps = lastRawProps;
                nextProps = nextRawProps;
                if (typeof lastProps.onClick !== "function" && typeof nextProps.onClick === "function") {
                  trapClickOnNonInteractiveElement(domElement);
                }
                break;
            }
            assertValidProps(tag, nextProps);
            var propKey;
            var styleName;
            var styleUpdates = null;
            for (propKey in lastProps) {
              if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
                continue;
              }
              if (propKey === STYLE) {
                var lastStyle = lastProps[propKey];
                for (styleName in lastStyle) {
                  if (lastStyle.hasOwnProperty(styleName)) {
                    if (!styleUpdates) {
                      styleUpdates = {};
                    }
                    styleUpdates[styleName] = "";
                  }
                }
              } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN)
                ;
              else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING)
                ;
              else if (propKey === AUTOFOCUS)
                ;
              else if (registrationNameDependencies.hasOwnProperty(propKey)) {
                if (!updatePayload) {
                  updatePayload = [];
                }
              } else {
                (updatePayload = updatePayload || []).push(propKey, null);
              }
            }
            for (propKey in nextProps) {
              var nextProp = nextProps[propKey];
              var lastProp = lastProps != null ? lastProps[propKey] : void 0;
              if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
                continue;
              }
              if (propKey === STYLE) {
                {
                  if (nextProp) {
                    Object.freeze(nextProp);
                  }
                }
                if (lastProp) {
                  for (styleName in lastProp) {
                    if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
                      if (!styleUpdates) {
                        styleUpdates = {};
                      }
                      styleUpdates[styleName] = "";
                    }
                  }
                  for (styleName in nextProp) {
                    if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
                      if (!styleUpdates) {
                        styleUpdates = {};
                      }
                      styleUpdates[styleName] = nextProp[styleName];
                    }
                  }
                } else {
                  if (!styleUpdates) {
                    if (!updatePayload) {
                      updatePayload = [];
                    }
                    updatePayload.push(propKey, styleUpdates);
                  }
                  styleUpdates = nextProp;
                }
              } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
                var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
                var lastHtml = lastProp ? lastProp[HTML$1] : void 0;
                if (nextHtml != null) {
                  if (lastHtml !== nextHtml) {
                    (updatePayload = updatePayload || []).push(propKey, nextHtml);
                  }
                }
              } else if (propKey === CHILDREN) {
                if (typeof nextProp === "string" || typeof nextProp === "number") {
                  (updatePayload = updatePayload || []).push(propKey, "" + nextProp);
                }
              } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING)
                ;
              else if (registrationNameDependencies.hasOwnProperty(propKey)) {
                if (nextProp != null) {
                  if (typeof nextProp !== "function") {
                    warnForInvalidEventListener(propKey, nextProp);
                  }
                  if (propKey === "onScroll") {
                    listenToNonDelegatedEvent("scroll", domElement);
                  }
                }
                if (!updatePayload && lastProp !== nextProp) {
                  updatePayload = [];
                }
              } else {
                (updatePayload = updatePayload || []).push(propKey, nextProp);
              }
            }
            if (styleUpdates) {
              {
                validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]);
              }
              (updatePayload = updatePayload || []).push(STYLE, styleUpdates);
            }
            return updatePayload;
          }
          function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
            if (tag === "input" && nextRawProps.type === "radio" && nextRawProps.name != null) {
              updateChecked(domElement, nextRawProps);
            }
            var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
            var isCustomComponentTag = isCustomComponent(tag, nextRawProps);
            updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag);
            switch (tag) {
              case "input":
                updateWrapper(domElement, nextRawProps);
                break;
              case "textarea":
                updateWrapper$1(domElement, nextRawProps);
                break;
              case "select":
                postUpdateWrapper(domElement, nextRawProps);
                break;
            }
          }
          function getPossibleStandardName(propName) {
            {
              var lowerCasedName = propName.toLowerCase();
              if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {
                return null;
              }
              return possibleStandardNames[lowerCasedName] || null;
            }
          }
          function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement, isConcurrentMode, shouldWarnDev) {
            var isCustomComponentTag;
            var extraAttributeNames;
            {
              isCustomComponentTag = isCustomComponent(tag, rawProps);
              validatePropertiesInDevelopment(tag, rawProps);
            }
            switch (tag) {
              case "dialog":
                listenToNonDelegatedEvent("cancel", domElement);
                listenToNonDelegatedEvent("close", domElement);
                break;
              case "iframe":
              case "object":
              case "embed":
                listenToNonDelegatedEvent("load", domElement);
                break;
              case "video":
              case "audio":
                for (var i = 0; i < mediaEventTypes.length; i++) {
                  listenToNonDelegatedEvent(mediaEventTypes[i], domElement);
                }
                break;
              case "source":
                listenToNonDelegatedEvent("error", domElement);
                break;
              case "img":
              case "image":
              case "link":
                listenToNonDelegatedEvent("error", domElement);
                listenToNonDelegatedEvent("load", domElement);
                break;
              case "details":
                listenToNonDelegatedEvent("toggle", domElement);
                break;
              case "input":
                initWrapperState(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              case "option":
                validateProps(domElement, rawProps);
                break;
              case "select":
                initWrapperState$1(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              case "textarea":
                initWrapperState$2(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
            }
            assertValidProps(tag, rawProps);
            {
              extraAttributeNames = /* @__PURE__ */ new Set();
              var attributes = domElement.attributes;
              for (var _i = 0; _i < attributes.length; _i++) {
                var name = attributes[_i].name.toLowerCase();
                switch (name) {
                  case "value":
                    break;
                  case "checked":
                    break;
                  case "selected":
                    break;
                  default:
                    extraAttributeNames.add(attributes[_i].name);
                }
              }
            }
            var updatePayload = null;
            for (var propKey in rawProps) {
              if (!rawProps.hasOwnProperty(propKey)) {
                continue;
              }
              var nextProp = rawProps[propKey];
              if (propKey === CHILDREN) {
                if (typeof nextProp === "string") {
                  if (domElement.textContent !== nextProp) {
                    if (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) {
                      checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev);
                    }
                    updatePayload = [CHILDREN, nextProp];
                  }
                } else if (typeof nextProp === "number") {
                  if (domElement.textContent !== "" + nextProp) {
                    if (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) {
                      checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev);
                    }
                    updatePayload = [CHILDREN, "" + nextProp];
                  }
                }
              } else if (registrationNameDependencies.hasOwnProperty(propKey)) {
                if (nextProp != null) {
                  if (typeof nextProp !== "function") {
                    warnForInvalidEventListener(propKey, nextProp);
                  }
                  if (propKey === "onScroll") {
                    listenToNonDelegatedEvent("scroll", domElement);
                  }
                }
              } else if (shouldWarnDev && true && typeof isCustomComponentTag === "boolean") {
                var serverValue = void 0;
                var propertyInfo = isCustomComponentTag && enableCustomElementPropertySupport ? null : getPropertyInfo(propKey);
                if (rawProps[SUPPRESS_HYDRATION_WARNING] === true)
                  ;
                else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || propKey === "value" || propKey === "checked" || propKey === "selected")
                  ;
                else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
                  var serverHTML = domElement.innerHTML;
                  var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
                  if (nextHtml != null) {
                    var expectedHTML = normalizeHTML(domElement, nextHtml);
                    if (expectedHTML !== serverHTML) {
                      warnForPropDifference(propKey, serverHTML, expectedHTML);
                    }
                  }
                } else if (propKey === STYLE) {
                  extraAttributeNames.delete(propKey);
                  if (canDiffStyleForHydrationWarning) {
                    var expectedStyle = createDangerousStringForStyles(nextProp);
                    serverValue = domElement.getAttribute("style");
                    if (expectedStyle !== serverValue) {
                      warnForPropDifference(propKey, serverValue, expectedStyle);
                    }
                  }
                } else if (isCustomComponentTag && !enableCustomElementPropertySupport) {
                  extraAttributeNames.delete(propKey.toLowerCase());
                  serverValue = getValueForAttribute(domElement, propKey, nextProp);
                  if (nextProp !== serverValue) {
                    warnForPropDifference(propKey, serverValue, nextProp);
                  }
                } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {
                  var isMismatchDueToBadCasing = false;
                  if (propertyInfo !== null) {
                    extraAttributeNames.delete(propertyInfo.attributeName);
                    serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);
                  } else {
                    var ownNamespace = parentNamespace;
                    if (ownNamespace === HTML_NAMESPACE) {
                      ownNamespace = getIntrinsicNamespace(tag);
                    }
                    if (ownNamespace === HTML_NAMESPACE) {
                      extraAttributeNames.delete(propKey.toLowerCase());
                    } else {
                      var standardName = getPossibleStandardName(propKey);
                      if (standardName !== null && standardName !== propKey) {
                        isMismatchDueToBadCasing = true;
                        extraAttributeNames.delete(standardName);
                      }
                      extraAttributeNames.delete(propKey);
                    }
                    serverValue = getValueForAttribute(domElement, propKey, nextProp);
                  }
                  var dontWarnCustomElement = enableCustomElementPropertySupport;
                  if (!dontWarnCustomElement && nextProp !== serverValue && !isMismatchDueToBadCasing) {
                    warnForPropDifference(propKey, serverValue, nextProp);
                  }
                }
              }
            }
            {
              if (shouldWarnDev) {
                if (extraAttributeNames.size > 0 && rawProps[SUPPRESS_HYDRATION_WARNING] !== true) {
                  warnForExtraAttributes(extraAttributeNames);
                }
              }
            }
            switch (tag) {
              case "input":
                track(domElement);
                postMountWrapper(domElement, rawProps, true);
                break;
              case "textarea":
                track(domElement);
                postMountWrapper$3(domElement);
                break;
              case "select":
              case "option":
                break;
              default:
                if (typeof rawProps.onClick === "function") {
                  trapClickOnNonInteractiveElement(domElement);
                }
                break;
            }
            return updatePayload;
          }
          function diffHydratedText(textNode, text, isConcurrentMode) {
            var isDifferent = textNode.nodeValue !== text;
            return isDifferent;
          }
          function warnForDeletedHydratableElement(parentNode, child) {
            {
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              error("Did not expect server HTML to contain a <%s> in <%s>.", child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());
            }
          }
          function warnForDeletedHydratableText(parentNode, child) {
            {
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              error('Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());
            }
          }
          function warnForInsertedHydratedElement(parentNode, tag, props) {
            {
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              error("Expected server HTML to contain a matching <%s> in <%s>.", tag, parentNode.nodeName.toLowerCase());
            }
          }
          function warnForInsertedHydratedText(parentNode, text) {
            {
              if (text === "") {
                return;
              }
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              error('Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase());
            }
          }
          function restoreControlledState$3(domElement, tag, props) {
            switch (tag) {
              case "input":
                restoreControlledState(domElement, props);
                return;
              case "textarea":
                restoreControlledState$2(domElement, props);
                return;
              case "select":
                restoreControlledState$1(domElement, props);
                return;
            }
          }
          var validateDOMNesting = function() {
          };
          var updatedAncestorInfo = function() {
          };
          {
            var specialTags = ["address", "applet", "area", "article", "aside", "base", "basefont", "bgsound", "blockquote", "body", "br", "button", "caption", "center", "col", "colgroup", "dd", "details", "dir", "div", "dl", "dt", "embed", "fieldset", "figcaption", "figure", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "iframe", "img", "input", "isindex", "li", "link", "listing", "main", "marquee", "menu", "menuitem", "meta", "nav", "noembed", "noframes", "noscript", "object", "ol", "p", "param", "plaintext", "pre", "script", "section", "select", "source", "style", "summary", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "title", "tr", "track", "ul", "wbr", "xmp"];
            var inScopeTags = [
              "applet",
              "caption",
              "html",
              "table",
              "td",
              "th",
              "marquee",
              "object",
              "template",
              "foreignObject",
              "desc",
              "title"
            ];
            var buttonScopeTags = inScopeTags.concat(["button"]);
            var impliedEndTags = ["dd", "dt", "li", "option", "optgroup", "p", "rp", "rt"];
            var emptyAncestorInfo = {
              current: null,
              formTag: null,
              aTagInScope: null,
              buttonTagInScope: null,
              nobrTagInScope: null,
              pTagInButtonScope: null,
              listItemTagAutoclosing: null,
              dlItemTagAutoclosing: null
            };
            updatedAncestorInfo = function(oldInfo, tag) {
              var ancestorInfo = assign({}, oldInfo || emptyAncestorInfo);
              var info = {
                tag
              };
              if (inScopeTags.indexOf(tag) !== -1) {
                ancestorInfo.aTagInScope = null;
                ancestorInfo.buttonTagInScope = null;
                ancestorInfo.nobrTagInScope = null;
              }
              if (buttonScopeTags.indexOf(tag) !== -1) {
                ancestorInfo.pTagInButtonScope = null;
              }
              if (specialTags.indexOf(tag) !== -1 && tag !== "address" && tag !== "div" && tag !== "p") {
                ancestorInfo.listItemTagAutoclosing = null;
                ancestorInfo.dlItemTagAutoclosing = null;
              }
              ancestorInfo.current = info;
              if (tag === "form") {
                ancestorInfo.formTag = info;
              }
              if (tag === "a") {
                ancestorInfo.aTagInScope = info;
              }
              if (tag === "button") {
                ancestorInfo.buttonTagInScope = info;
              }
              if (tag === "nobr") {
                ancestorInfo.nobrTagInScope = info;
              }
              if (tag === "p") {
                ancestorInfo.pTagInButtonScope = info;
              }
              if (tag === "li") {
                ancestorInfo.listItemTagAutoclosing = info;
              }
              if (tag === "dd" || tag === "dt") {
                ancestorInfo.dlItemTagAutoclosing = info;
              }
              return ancestorInfo;
            };
            var isTagValidWithParent = function(tag, parentTag) {
              switch (parentTag) {
                case "select":
                  return tag === "option" || tag === "optgroup" || tag === "#text";
                case "optgroup":
                  return tag === "option" || tag === "#text";
                case "option":
                  return tag === "#text";
                case "tr":
                  return tag === "th" || tag === "td" || tag === "style" || tag === "script" || tag === "template";
                case "tbody":
                case "thead":
                case "tfoot":
                  return tag === "tr" || tag === "style" || tag === "script" || tag === "template";
                case "colgroup":
                  return tag === "col" || tag === "template";
                case "table":
                  return tag === "caption" || tag === "colgroup" || tag === "tbody" || tag === "tfoot" || tag === "thead" || tag === "style" || tag === "script" || tag === "template";
                case "head":
                  return tag === "base" || tag === "basefont" || tag === "bgsound" || tag === "link" || tag === "meta" || tag === "title" || tag === "noscript" || tag === "noframes" || tag === "style" || tag === "script" || tag === "template";
                case "html":
                  return tag === "head" || tag === "body" || tag === "frameset";
                case "frameset":
                  return tag === "frame";
                case "#document":
                  return tag === "html";
              }
              switch (tag) {
                case "h1":
                case "h2":
                case "h3":
                case "h4":
                case "h5":
                case "h6":
                  return parentTag !== "h1" && parentTag !== "h2" && parentTag !== "h3" && parentTag !== "h4" && parentTag !== "h5" && parentTag !== "h6";
                case "rp":
                case "rt":
                  return impliedEndTags.indexOf(parentTag) === -1;
                case "body":
                case "caption":
                case "col":
                case "colgroup":
                case "frameset":
                case "frame":
                case "head":
                case "html":
                case "tbody":
                case "td":
                case "tfoot":
                case "th":
                case "thead":
                case "tr":
                  return parentTag == null;
              }
              return true;
            };
            var findInvalidAncestorForTag = function(tag, ancestorInfo) {
              switch (tag) {
                case "address":
                case "article":
                case "aside":
                case "blockquote":
                case "center":
                case "details":
                case "dialog":
                case "dir":
                case "div":
                case "dl":
                case "fieldset":
                case "figcaption":
                case "figure":
                case "footer":
                case "header":
                case "hgroup":
                case "main":
                case "menu":
                case "nav":
                case "ol":
                case "p":
                case "section":
                case "summary":
                case "ul":
                case "pre":
                case "listing":
                case "table":
                case "hr":
                case "xmp":
                case "h1":
                case "h2":
                case "h3":
                case "h4":
                case "h5":
                case "h6":
                  return ancestorInfo.pTagInButtonScope;
                case "form":
                  return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
                case "li":
                  return ancestorInfo.listItemTagAutoclosing;
                case "dd":
                case "dt":
                  return ancestorInfo.dlItemTagAutoclosing;
                case "button":
                  return ancestorInfo.buttonTagInScope;
                case "a":
                  return ancestorInfo.aTagInScope;
                case "nobr":
                  return ancestorInfo.nobrTagInScope;
              }
              return null;
            };
            var didWarn$1 = {};
            validateDOMNesting = function(childTag, childText, ancestorInfo) {
              ancestorInfo = ancestorInfo || emptyAncestorInfo;
              var parentInfo = ancestorInfo.current;
              var parentTag = parentInfo && parentInfo.tag;
              if (childText != null) {
                if (childTag != null) {
                  error("validateDOMNesting: when childText is passed, childTag should be null");
                }
                childTag = "#text";
              }
              var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
              var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
              var invalidParentOrAncestor = invalidParent || invalidAncestor;
              if (!invalidParentOrAncestor) {
                return;
              }
              var ancestorTag = invalidParentOrAncestor.tag;
              var warnKey = !!invalidParent + "|" + childTag + "|" + ancestorTag;
              if (didWarn$1[warnKey]) {
                return;
              }
              didWarn$1[warnKey] = true;
              var tagDisplayName = childTag;
              var whitespaceInfo = "";
              if (childTag === "#text") {
                if (/\S/.test(childText)) {
                  tagDisplayName = "Text nodes";
                } else {
                  tagDisplayName = "Whitespace text nodes";
                  whitespaceInfo = " Make sure you don't have any extra whitespace between tags on each line of your source code.";
                }
              } else {
                tagDisplayName = "<" + childTag + ">";
              }
              if (invalidParent) {
                var info = "";
                if (ancestorTag === "table" && childTag === "tr") {
                  info += " Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser.";
                }
                error("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s", tagDisplayName, ancestorTag, whitespaceInfo, info);
              } else {
                error("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.", tagDisplayName, ancestorTag);
              }
            };
          }
          var SUPPRESS_HYDRATION_WARNING$1 = "suppressHydrationWarning";
          var SUSPENSE_START_DATA = "$";
          var SUSPENSE_END_DATA = "/$";
          var SUSPENSE_PENDING_START_DATA = "$?";
          var SUSPENSE_FALLBACK_START_DATA = "$!";
          var STYLE$1 = "style";
          var eventsEnabled = null;
          var selectionInformation = null;
          function getRootHostContext(rootContainerInstance) {
            var type;
            var namespace;
            var nodeType = rootContainerInstance.nodeType;
            switch (nodeType) {
              case DOCUMENT_NODE:
              case DOCUMENT_FRAGMENT_NODE: {
                type = nodeType === DOCUMENT_NODE ? "#document" : "#fragment";
                var root2 = rootContainerInstance.documentElement;
                namespace = root2 ? root2.namespaceURI : getChildNamespace(null, "");
                break;
              }
              default: {
                var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
                var ownNamespace = container.namespaceURI || null;
                type = container.tagName;
                namespace = getChildNamespace(ownNamespace, type);
                break;
              }
            }
            {
              var validatedTag = type.toLowerCase();
              var ancestorInfo = updatedAncestorInfo(null, validatedTag);
              return {
                namespace,
                ancestorInfo
              };
            }
          }
          function getChildHostContext(parentHostContext, type, rootContainerInstance) {
            {
              var parentHostContextDev = parentHostContext;
              var namespace = getChildNamespace(parentHostContextDev.namespace, type);
              var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);
              return {
                namespace,
                ancestorInfo
              };
            }
          }
          function getPublicInstance(instance) {
            return instance;
          }
          function prepareForCommit(containerInfo) {
            eventsEnabled = isEnabled();
            selectionInformation = getSelectionInformation();
            var activeInstance = null;
            setEnabled(false);
            return activeInstance;
          }
          function resetAfterCommit(containerInfo) {
            restoreSelection(selectionInformation);
            setEnabled(eventsEnabled);
            eventsEnabled = null;
            selectionInformation = null;
          }
          function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
            var parentNamespace;
            {
              var hostContextDev = hostContext;
              validateDOMNesting(type, null, hostContextDev.ancestorInfo);
              if (typeof props.children === "string" || typeof props.children === "number") {
                var string = "" + props.children;
                var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
                validateDOMNesting(null, string, ownAncestorInfo);
              }
              parentNamespace = hostContextDev.namespace;
            }
            var domElement = createElement2(type, props, rootContainerInstance, parentNamespace);
            precacheFiberNode(internalInstanceHandle, domElement);
            updateFiberProps(domElement, props);
            return domElement;
          }
          function appendInitialChild(parentInstance, child) {
            parentInstance.appendChild(child);
          }
          function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {
            setInitialProperties(domElement, type, props, rootContainerInstance);
            switch (type) {
              case "button":
              case "input":
              case "select":
              case "textarea":
                return !!props.autoFocus;
              case "img":
                return true;
              default:
                return false;
            }
          }
          function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
            {
              var hostContextDev = hostContext;
              if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === "string" || typeof newProps.children === "number")) {
                var string = "" + newProps.children;
                var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
                validateDOMNesting(null, string, ownAncestorInfo);
              }
            }
            return diffProperties(domElement, type, oldProps, newProps);
          }
          function shouldSetTextContent(type, props) {
            return type === "textarea" || type === "noscript" || typeof props.children === "string" || typeof props.children === "number" || typeof props.dangerouslySetInnerHTML === "object" && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
          }
          function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
            {
              var hostContextDev = hostContext;
              validateDOMNesting(null, text, hostContextDev.ancestorInfo);
            }
            var textNode = createTextNode(text, rootContainerInstance);
            precacheFiberNode(internalInstanceHandle, textNode);
            return textNode;
          }
          function getCurrentEventPriority() {
            var currentEvent = window.event;
            if (currentEvent === void 0) {
              return DefaultEventPriority;
            }
            return getEventPriority(currentEvent.type);
          }
          var scheduleTimeout = typeof setTimeout === "function" ? setTimeout : void 0;
          var cancelTimeout = typeof clearTimeout === "function" ? clearTimeout : void 0;
          var noTimeout = -1;
          var localPromise = typeof Promise === "function" ? Promise : void 0;
          var scheduleMicrotask = typeof queueMicrotask === "function" ? queueMicrotask : typeof localPromise !== "undefined" ? function(callback) {
            return localPromise.resolve(null).then(callback).catch(handleErrorInNextTick);
          } : scheduleTimeout;
          function handleErrorInNextTick(error2) {
            setTimeout(function() {
              throw error2;
            });
          }
          function commitMount(domElement, type, newProps, internalInstanceHandle) {
            switch (type) {
              case "button":
              case "input":
              case "select":
              case "textarea":
                if (newProps.autoFocus) {
                  domElement.focus();
                }
                return;
              case "img": {
                if (newProps.src) {
                  domElement.src = newProps.src;
                }
                return;
              }
            }
          }
          function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
            updateProperties(domElement, updatePayload, type, oldProps, newProps);
            updateFiberProps(domElement, newProps);
          }
          function resetTextContent(domElement) {
            setTextContent(domElement, "");
          }
          function commitTextUpdate(textInstance, oldText, newText) {
            textInstance.nodeValue = newText;
          }
          function appendChild(parentInstance, child) {
            parentInstance.appendChild(child);
          }
          function appendChildToContainer(container, child) {
            var parentNode;
            if (container.nodeType === COMMENT_NODE) {
              parentNode = container.parentNode;
              parentNode.insertBefore(child, container);
            } else {
              parentNode = container;
              parentNode.appendChild(child);
            }
            var reactRootContainer = container._reactRootContainer;
            if ((reactRootContainer === null || reactRootContainer === void 0) && parentNode.onclick === null) {
              trapClickOnNonInteractiveElement(parentNode);
            }
          }
          function insertBefore(parentInstance, child, beforeChild) {
            parentInstance.insertBefore(child, beforeChild);
          }
          function insertInContainerBefore(container, child, beforeChild) {
            if (container.nodeType === COMMENT_NODE) {
              container.parentNode.insertBefore(child, beforeChild);
            } else {
              container.insertBefore(child, beforeChild);
            }
          }
          function removeChild(parentInstance, child) {
            parentInstance.removeChild(child);
          }
          function removeChildFromContainer(container, child) {
            if (container.nodeType === COMMENT_NODE) {
              container.parentNode.removeChild(child);
            } else {
              container.removeChild(child);
            }
          }
          function clearSuspenseBoundary(parentInstance, suspenseInstance) {
            var node = suspenseInstance;
            var depth = 0;
            do {
              var nextNode = node.nextSibling;
              parentInstance.removeChild(node);
              if (nextNode && nextNode.nodeType === COMMENT_NODE) {
                var data = nextNode.data;
                if (data === SUSPENSE_END_DATA) {
                  if (depth === 0) {
                    parentInstance.removeChild(nextNode);
                    retryIfBlockedOn(suspenseInstance);
                    return;
                  } else {
                    depth--;
                  }
                } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_PENDING_START_DATA || data === SUSPENSE_FALLBACK_START_DATA) {
                  depth++;
                }
              }
              node = nextNode;
            } while (node);
            retryIfBlockedOn(suspenseInstance);
          }
          function clearSuspenseBoundaryFromContainer(container, suspenseInstance) {
            if (container.nodeType === COMMENT_NODE) {
              clearSuspenseBoundary(container.parentNode, suspenseInstance);
            } else if (container.nodeType === ELEMENT_NODE) {
              clearSuspenseBoundary(container, suspenseInstance);
            }
            retryIfBlockedOn(container);
          }
          function hideInstance(instance) {
            instance = instance;
            var style2 = instance.style;
            if (typeof style2.setProperty === "function") {
              style2.setProperty("display", "none", "important");
            } else {
              style2.display = "none";
            }
          }
          function hideTextInstance(textInstance) {
            textInstance.nodeValue = "";
          }
          function unhideInstance(instance, props) {
            instance = instance;
            var styleProp = props[STYLE$1];
            var display = styleProp !== void 0 && styleProp !== null && styleProp.hasOwnProperty("display") ? styleProp.display : null;
            instance.style.display = dangerousStyleValue("display", display);
          }
          function unhideTextInstance(textInstance, text) {
            textInstance.nodeValue = text;
          }
          function clearContainer(container) {
            if (container.nodeType === ELEMENT_NODE) {
              container.textContent = "";
            } else if (container.nodeType === DOCUMENT_NODE) {
              if (container.documentElement) {
                container.removeChild(container.documentElement);
              }
            }
          }
          function canHydrateInstance(instance, type, props) {
            if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
              return null;
            }
            return instance;
          }
          function canHydrateTextInstance(instance, text) {
            if (text === "" || instance.nodeType !== TEXT_NODE) {
              return null;
            }
            return instance;
          }
          function canHydrateSuspenseInstance(instance) {
            if (instance.nodeType !== COMMENT_NODE) {
              return null;
            }
            return instance;
          }
          function isSuspenseInstancePending(instance) {
            return instance.data === SUSPENSE_PENDING_START_DATA;
          }
          function isSuspenseInstanceFallback(instance) {
            return instance.data === SUSPENSE_FALLBACK_START_DATA;
          }
          function getSuspenseInstanceFallbackErrorDetails(instance) {
            var dataset = instance.nextSibling && instance.nextSibling.dataset;
            var digest, message, stack;
            if (dataset) {
              digest = dataset.dgst;
              {
                message = dataset.msg;
                stack = dataset.stck;
              }
            }
            {
              return {
                message,
                digest,
                stack
              };
            }
          }
          function registerSuspenseInstanceRetry(instance, callback) {
            instance._reactRetry = callback;
          }
          function getNextHydratable(node) {
            for (; node != null; node = node.nextSibling) {
              var nodeType = node.nodeType;
              if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {
                break;
              }
              if (nodeType === COMMENT_NODE) {
                var nodeData = node.data;
                if (nodeData === SUSPENSE_START_DATA || nodeData === SUSPENSE_FALLBACK_START_DATA || nodeData === SUSPENSE_PENDING_START_DATA) {
                  break;
                }
                if (nodeData === SUSPENSE_END_DATA) {
                  return null;
                }
              }
            }
            return node;
          }
          function getNextHydratableSibling(instance) {
            return getNextHydratable(instance.nextSibling);
          }
          function getFirstHydratableChild(parentInstance) {
            return getNextHydratable(parentInstance.firstChild);
          }
          function getFirstHydratableChildWithinContainer(parentContainer) {
            return getNextHydratable(parentContainer.firstChild);
          }
          function getFirstHydratableChildWithinSuspenseInstance(parentInstance) {
            return getNextHydratable(parentInstance.nextSibling);
          }
          function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle, shouldWarnDev) {
            precacheFiberNode(internalInstanceHandle, instance);
            updateFiberProps(instance, props);
            var parentNamespace;
            {
              var hostContextDev = hostContext;
              parentNamespace = hostContextDev.namespace;
            }
            var isConcurrentMode = (internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
            return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance, isConcurrentMode, shouldWarnDev);
          }
          function hydrateTextInstance(textInstance, text, internalInstanceHandle, shouldWarnDev) {
            precacheFiberNode(internalInstanceHandle, textInstance);
            var isConcurrentMode = (internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
            return diffHydratedText(textInstance, text);
          }
          function hydrateSuspenseInstance(suspenseInstance, internalInstanceHandle) {
            precacheFiberNode(internalInstanceHandle, suspenseInstance);
          }
          function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {
            var node = suspenseInstance.nextSibling;
            var depth = 0;
            while (node) {
              if (node.nodeType === COMMENT_NODE) {
                var data = node.data;
                if (data === SUSPENSE_END_DATA) {
                  if (depth === 0) {
                    return getNextHydratableSibling(node);
                  } else {
                    depth--;
                  }
                } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
                  depth++;
                }
              }
              node = node.nextSibling;
            }
            return null;
          }
          function getParentSuspenseInstance(targetInstance) {
            var node = targetInstance.previousSibling;
            var depth = 0;
            while (node) {
              if (node.nodeType === COMMENT_NODE) {
                var data = node.data;
                if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
                  if (depth === 0) {
                    return node;
                  } else {
                    depth--;
                  }
                } else if (data === SUSPENSE_END_DATA) {
                  depth++;
                }
              }
              node = node.previousSibling;
            }
            return null;
          }
          function commitHydratedContainer(container) {
            retryIfBlockedOn(container);
          }
          function commitHydratedSuspenseInstance(suspenseInstance) {
            retryIfBlockedOn(suspenseInstance);
          }
          function shouldDeleteUnhydratedTailInstances(parentType) {
            return parentType !== "head" && parentType !== "body";
          }
          function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text, isConcurrentMode) {
            var shouldWarnDev = true;
            checkForUnmatchedText(textInstance.nodeValue, text, isConcurrentMode, shouldWarnDev);
          }
          function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text, isConcurrentMode) {
            if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
              var shouldWarnDev = true;
              checkForUnmatchedText(textInstance.nodeValue, text, isConcurrentMode, shouldWarnDev);
            }
          }
          function didNotHydrateInstanceWithinContainer(parentContainer, instance) {
            {
              if (instance.nodeType === ELEMENT_NODE) {
                warnForDeletedHydratableElement(parentContainer, instance);
              } else if (instance.nodeType === COMMENT_NODE)
                ;
              else {
                warnForDeletedHydratableText(parentContainer, instance);
              }
            }
          }
          function didNotHydrateInstanceWithinSuspenseInstance(parentInstance, instance) {
            {
              var parentNode = parentInstance.parentNode;
              if (parentNode !== null) {
                if (instance.nodeType === ELEMENT_NODE) {
                  warnForDeletedHydratableElement(parentNode, instance);
                } else if (instance.nodeType === COMMENT_NODE)
                  ;
                else {
                  warnForDeletedHydratableText(parentNode, instance);
                }
              }
            }
          }
          function didNotHydrateInstance(parentType, parentProps, parentInstance, instance, isConcurrentMode) {
            {
              if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
                if (instance.nodeType === ELEMENT_NODE) {
                  warnForDeletedHydratableElement(parentInstance, instance);
                } else if (instance.nodeType === COMMENT_NODE)
                  ;
                else {
                  warnForDeletedHydratableText(parentInstance, instance);
                }
              }
            }
          }
          function didNotFindHydratableInstanceWithinContainer(parentContainer, type, props) {
            {
              warnForInsertedHydratedElement(parentContainer, type);
            }
          }
          function didNotFindHydratableTextInstanceWithinContainer(parentContainer, text) {
            {
              warnForInsertedHydratedText(parentContainer, text);
            }
          }
          function didNotFindHydratableInstanceWithinSuspenseInstance(parentInstance, type, props) {
            {
              var parentNode = parentInstance.parentNode;
              if (parentNode !== null)
                warnForInsertedHydratedElement(parentNode, type);
            }
          }
          function didNotFindHydratableTextInstanceWithinSuspenseInstance(parentInstance, text) {
            {
              var parentNode = parentInstance.parentNode;
              if (parentNode !== null)
                warnForInsertedHydratedText(parentNode, text);
            }
          }
          function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props, isConcurrentMode) {
            {
              if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
                warnForInsertedHydratedElement(parentInstance, type);
              }
            }
          }
          function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text, isConcurrentMode) {
            {
              if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
                warnForInsertedHydratedText(parentInstance, text);
              }
            }
          }
          function errorHydratingContainer(parentContainer) {
            {
              error("An error occurred during hydration. The server HTML was replaced with client content in <%s>.", parentContainer.nodeName.toLowerCase());
            }
          }
          function preparePortalMount(portalInstance) {
            listenToAllSupportedEvents(portalInstance);
          }
          var randomKey = Math.random().toString(36).slice(2);
          var internalInstanceKey = "__reactFiber$" + randomKey;
          var internalPropsKey = "__reactProps$" + randomKey;
          var internalContainerInstanceKey = "__reactContainer$" + randomKey;
          var internalEventHandlersKey = "__reactEvents$" + randomKey;
          var internalEventHandlerListenersKey = "__reactListeners$" + randomKey;
          var internalEventHandlesSetKey = "__reactHandles$" + randomKey;
          function detachDeletedInstance(node) {
            delete node[internalInstanceKey];
            delete node[internalPropsKey];
            delete node[internalEventHandlersKey];
            delete node[internalEventHandlerListenersKey];
            delete node[internalEventHandlesSetKey];
          }
          function precacheFiberNode(hostInst, node) {
            node[internalInstanceKey] = hostInst;
          }
          function markContainerAsRoot(hostRoot, node) {
            node[internalContainerInstanceKey] = hostRoot;
          }
          function unmarkContainerAsRoot(node) {
            node[internalContainerInstanceKey] = null;
          }
          function isContainerMarkedAsRoot(node) {
            return !!node[internalContainerInstanceKey];
          }
          function getClosestInstanceFromNode(targetNode) {
            var targetInst = targetNode[internalInstanceKey];
            if (targetInst) {
              return targetInst;
            }
            var parentNode = targetNode.parentNode;
            while (parentNode) {
              targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];
              if (targetInst) {
                var alternate = targetInst.alternate;
                if (targetInst.child !== null || alternate !== null && alternate.child !== null) {
                  var suspenseInstance = getParentSuspenseInstance(targetNode);
                  while (suspenseInstance !== null) {
                    var targetSuspenseInst = suspenseInstance[internalInstanceKey];
                    if (targetSuspenseInst) {
                      return targetSuspenseInst;
                    }
                    suspenseInstance = getParentSuspenseInstance(suspenseInstance);
                  }
                }
                return targetInst;
              }
              targetNode = parentNode;
              parentNode = targetNode.parentNode;
            }
            return null;
          }
          function getInstanceFromNode(node) {
            var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];
            if (inst) {
              if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {
                return inst;
              } else {
                return null;
              }
            }
            return null;
          }
          function getNodeFromInstance(inst) {
            if (inst.tag === HostComponent || inst.tag === HostText) {
              return inst.stateNode;
            }
            throw new Error("getNodeFromInstance: Invalid argument.");
          }
          function getFiberCurrentPropsFromNode(node) {
            return node[internalPropsKey] || null;
          }
          function updateFiberProps(node, props) {
            node[internalPropsKey] = props;
          }
          function getEventListenerSet(node) {
            var elementListenerSet = node[internalEventHandlersKey];
            if (elementListenerSet === void 0) {
              elementListenerSet = node[internalEventHandlersKey] = /* @__PURE__ */ new Set();
            }
            return elementListenerSet;
          }
          var loggedTypeFailures = {};
          var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
          function setCurrentlyValidatingElement(element) {
            {
              if (element) {
                var owner = element._owner;
                var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
                ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
              } else {
                ReactDebugCurrentFrame$1.setExtraStackFrame(null);
              }
            }
          }
          function checkPropTypes(typeSpecs, values, location, componentName, element) {
            {
              var has2 = Function.call.bind(hasOwnProperty);
              for (var typeSpecName in typeSpecs) {
                if (has2(typeSpecs, typeSpecName)) {
                  var error$1 = void 0;
                  try {
                    if (typeof typeSpecs[typeSpecName] !== "function") {
                      var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                      err.name = "Invariant Violation";
                      throw err;
                    }
                    error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
                  } catch (ex) {
                    error$1 = ex;
                  }
                  if (error$1 && !(error$1 instanceof Error)) {
                    setCurrentlyValidatingElement(element);
                    error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
                    setCurrentlyValidatingElement(null);
                  }
                  if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
                    loggedTypeFailures[error$1.message] = true;
                    setCurrentlyValidatingElement(element);
                    error("Failed %s type: %s", location, error$1.message);
                    setCurrentlyValidatingElement(null);
                  }
                }
              }
            }
          }
          var valueStack = [];
          var fiberStack;
          {
            fiberStack = [];
          }
          var index = -1;
          function createCursor(defaultValue) {
            return {
              current: defaultValue
            };
          }
          function pop(cursor, fiber) {
            if (index < 0) {
              {
                error("Unexpected pop.");
              }
              return;
            }
            {
              if (fiber !== fiberStack[index]) {
                error("Unexpected Fiber popped.");
              }
            }
            cursor.current = valueStack[index];
            valueStack[index] = null;
            {
              fiberStack[index] = null;
            }
            index--;
          }
          function push(cursor, value, fiber) {
            index++;
            valueStack[index] = cursor.current;
            {
              fiberStack[index] = fiber;
            }
            cursor.current = value;
          }
          var warnedAboutMissingGetChildContext;
          {
            warnedAboutMissingGetChildContext = {};
          }
          var emptyContextObject = {};
          {
            Object.freeze(emptyContextObject);
          }
          var contextStackCursor = createCursor(emptyContextObject);
          var didPerformWorkStackCursor = createCursor(false);
          var previousContext = emptyContextObject;
          function getUnmaskedContext(workInProgress2, Component2, didPushOwnContextIfProvider) {
            {
              if (didPushOwnContextIfProvider && isContextProvider(Component2)) {
                return previousContext;
              }
              return contextStackCursor.current;
            }
          }
          function cacheContext(workInProgress2, unmaskedContext, maskedContext) {
            {
              var instance = workInProgress2.stateNode;
              instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
              instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
            }
          }
          function getMaskedContext(workInProgress2, unmaskedContext) {
            {
              var type = workInProgress2.type;
              var contextTypes = type.contextTypes;
              if (!contextTypes) {
                return emptyContextObject;
              }
              var instance = workInProgress2.stateNode;
              if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
                return instance.__reactInternalMemoizedMaskedChildContext;
              }
              var context = {};
              for (var key2 in contextTypes) {
                context[key2] = unmaskedContext[key2];
              }
              {
                var name = getComponentNameFromFiber(workInProgress2) || "Unknown";
                checkPropTypes(contextTypes, context, "context", name);
              }
              if (instance) {
                cacheContext(workInProgress2, unmaskedContext, context);
              }
              return context;
            }
          }
          function hasContextChanged() {
            {
              return didPerformWorkStackCursor.current;
            }
          }
          function isContextProvider(type) {
            {
              var childContextTypes = type.childContextTypes;
              return childContextTypes !== null && childContextTypes !== void 0;
            }
          }
          function popContext(fiber) {
            {
              pop(didPerformWorkStackCursor, fiber);
              pop(contextStackCursor, fiber);
            }
          }
          function popTopLevelContextObject(fiber) {
            {
              pop(didPerformWorkStackCursor, fiber);
              pop(contextStackCursor, fiber);
            }
          }
          function pushTopLevelContextObject(fiber, context, didChange) {
            {
              if (contextStackCursor.current !== emptyContextObject) {
                throw new Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");
              }
              push(contextStackCursor, context, fiber);
              push(didPerformWorkStackCursor, didChange, fiber);
            }
          }
          function processChildContext(fiber, type, parentContext) {
            {
              var instance = fiber.stateNode;
              var childContextTypes = type.childContextTypes;
              if (typeof instance.getChildContext !== "function") {
                {
                  var componentName = getComponentNameFromFiber(fiber) || "Unknown";
                  if (!warnedAboutMissingGetChildContext[componentName]) {
                    warnedAboutMissingGetChildContext[componentName] = true;
                    error("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.", componentName, componentName);
                  }
                }
                return parentContext;
              }
              var childContext = instance.getChildContext();
              for (var contextKey in childContext) {
                if (!(contextKey in childContextTypes)) {
                  throw new Error((getComponentNameFromFiber(fiber) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.');
                }
              }
              {
                var name = getComponentNameFromFiber(fiber) || "Unknown";
                checkPropTypes(childContextTypes, childContext, "child context", name);
              }
              return assign({}, parentContext, childContext);
            }
          }
          function pushContextProvider(workInProgress2) {
            {
              var instance = workInProgress2.stateNode;
              var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject;
              previousContext = contextStackCursor.current;
              push(contextStackCursor, memoizedMergedChildContext, workInProgress2);
              push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress2);
              return true;
            }
          }
          function invalidateContextProvider(workInProgress2, type, didChange) {
            {
              var instance = workInProgress2.stateNode;
              if (!instance) {
                throw new Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");
              }
              if (didChange) {
                var mergedContext = processChildContext(workInProgress2, type, previousContext);
                instance.__reactInternalMemoizedMergedChildContext = mergedContext;
                pop(didPerformWorkStackCursor, workInProgress2);
                pop(contextStackCursor, workInProgress2);
                push(contextStackCursor, mergedContext, workInProgress2);
                push(didPerformWorkStackCursor, didChange, workInProgress2);
              } else {
                pop(didPerformWorkStackCursor, workInProgress2);
                push(didPerformWorkStackCursor, didChange, workInProgress2);
              }
            }
          }
          function findCurrentUnmaskedContext(fiber) {
            {
              if (!isFiberMounted(fiber) || fiber.tag !== ClassComponent) {
                throw new Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");
              }
              var node = fiber;
              do {
                switch (node.tag) {
                  case HostRoot:
                    return node.stateNode.context;
                  case ClassComponent: {
                    var Component2 = node.type;
                    if (isContextProvider(Component2)) {
                      return node.stateNode.__reactInternalMemoizedMergedChildContext;
                    }
                    break;
                  }
                }
                node = node.return;
              } while (node !== null);
              throw new Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.");
            }
          }
          var LegacyRoot = 0;
          var ConcurrentRoot = 1;
          var syncQueue = null;
          var includesLegacySyncCallbacks = false;
          var isFlushingSyncQueue = false;
          function scheduleSyncCallback(callback) {
            if (syncQueue === null) {
              syncQueue = [callback];
            } else {
              syncQueue.push(callback);
            }
          }
          function scheduleLegacySyncCallback(callback) {
            includesLegacySyncCallbacks = true;
            scheduleSyncCallback(callback);
          }
          function flushSyncCallbacksOnlyInLegacyMode() {
            if (includesLegacySyncCallbacks) {
              flushSyncCallbacks();
            }
          }
          function flushSyncCallbacks() {
            if (!isFlushingSyncQueue && syncQueue !== null) {
              isFlushingSyncQueue = true;
              var i = 0;
              var previousUpdatePriority = getCurrentUpdatePriority();
              try {
                var isSync = true;
                var queue = syncQueue;
                setCurrentUpdatePriority(DiscreteEventPriority);
                for (; i < queue.length; i++) {
                  var callback = queue[i];
                  do {
                    callback = callback(isSync);
                  } while (callback !== null);
                }
                syncQueue = null;
                includesLegacySyncCallbacks = false;
              } catch (error2) {
                if (syncQueue !== null) {
                  syncQueue = syncQueue.slice(i + 1);
                }
                scheduleCallback(ImmediatePriority, flushSyncCallbacks);
                throw error2;
              } finally {
                setCurrentUpdatePriority(previousUpdatePriority);
                isFlushingSyncQueue = false;
              }
            }
            return null;
          }
          var forkStack = [];
          var forkStackIndex = 0;
          var treeForkProvider = null;
          var treeForkCount = 0;
          var idStack = [];
          var idStackIndex = 0;
          var treeContextProvider = null;
          var treeContextId = 1;
          var treeContextOverflow = "";
          function isForkedChild(workInProgress2) {
            warnIfNotHydrating();
            return (workInProgress2.flags & Forked) !== NoFlags;
          }
          function getForksAtLevel(workInProgress2) {
            warnIfNotHydrating();
            return treeForkCount;
          }
          function getTreeId() {
            var overflow = treeContextOverflow;
            var idWithLeadingBit = treeContextId;
            var id = idWithLeadingBit & ~getLeadingBit(idWithLeadingBit);
            return id.toString(32) + overflow;
          }
          function pushTreeFork(workInProgress2, totalChildren) {
            warnIfNotHydrating();
            forkStack[forkStackIndex++] = treeForkCount;
            forkStack[forkStackIndex++] = treeForkProvider;
            treeForkProvider = workInProgress2;
            treeForkCount = totalChildren;
          }
          function pushTreeId(workInProgress2, totalChildren, index2) {
            warnIfNotHydrating();
            idStack[idStackIndex++] = treeContextId;
            idStack[idStackIndex++] = treeContextOverflow;
            idStack[idStackIndex++] = treeContextProvider;
            treeContextProvider = workInProgress2;
            var baseIdWithLeadingBit = treeContextId;
            var baseOverflow = treeContextOverflow;
            var baseLength = getBitLength(baseIdWithLeadingBit) - 1;
            var baseId = baseIdWithLeadingBit & ~(1 << baseLength);
            var slot = index2 + 1;
            var length = getBitLength(totalChildren) + baseLength;
            if (length > 30) {
              var numberOfOverflowBits = baseLength - baseLength % 5;
              var newOverflowBits = (1 << numberOfOverflowBits) - 1;
              var newOverflow = (baseId & newOverflowBits).toString(32);
              var restOfBaseId = baseId >> numberOfOverflowBits;
              var restOfBaseLength = baseLength - numberOfOverflowBits;
              var restOfLength = getBitLength(totalChildren) + restOfBaseLength;
              var restOfNewBits = slot << restOfBaseLength;
              var id = restOfNewBits | restOfBaseId;
              var overflow = newOverflow + baseOverflow;
              treeContextId = 1 << restOfLength | id;
              treeContextOverflow = overflow;
            } else {
              var newBits = slot << baseLength;
              var _id = newBits | baseId;
              var _overflow = baseOverflow;
              treeContextId = 1 << length | _id;
              treeContextOverflow = _overflow;
            }
          }
          function pushMaterializedTreeId(workInProgress2) {
            warnIfNotHydrating();
            var returnFiber = workInProgress2.return;
            if (returnFiber !== null) {
              var numberOfForks = 1;
              var slotIndex = 0;
              pushTreeFork(workInProgress2, numberOfForks);
              pushTreeId(workInProgress2, numberOfForks, slotIndex);
            }
          }
          function getBitLength(number) {
            return 32 - clz32(number);
          }
          function getLeadingBit(id) {
            return 1 << getBitLength(id) - 1;
          }
          function popTreeContext(workInProgress2) {
            while (workInProgress2 === treeForkProvider) {
              treeForkProvider = forkStack[--forkStackIndex];
              forkStack[forkStackIndex] = null;
              treeForkCount = forkStack[--forkStackIndex];
              forkStack[forkStackIndex] = null;
            }
            while (workInProgress2 === treeContextProvider) {
              treeContextProvider = idStack[--idStackIndex];
              idStack[idStackIndex] = null;
              treeContextOverflow = idStack[--idStackIndex];
              idStack[idStackIndex] = null;
              treeContextId = idStack[--idStackIndex];
              idStack[idStackIndex] = null;
            }
          }
          function getSuspendedTreeContext() {
            warnIfNotHydrating();
            if (treeContextProvider !== null) {
              return {
                id: treeContextId,
                overflow: treeContextOverflow
              };
            } else {
              return null;
            }
          }
          function restoreSuspendedTreeContext(workInProgress2, suspendedContext) {
            warnIfNotHydrating();
            idStack[idStackIndex++] = treeContextId;
            idStack[idStackIndex++] = treeContextOverflow;
            idStack[idStackIndex++] = treeContextProvider;
            treeContextId = suspendedContext.id;
            treeContextOverflow = suspendedContext.overflow;
            treeContextProvider = workInProgress2;
          }
          function warnIfNotHydrating() {
            {
              if (!getIsHydrating()) {
                error("Expected to be hydrating. This is a bug in React. Please file an issue.");
              }
            }
          }
          var hydrationParentFiber = null;
          var nextHydratableInstance = null;
          var isHydrating = false;
          var didSuspendOrErrorDEV = false;
          var hydrationErrors = null;
          function warnIfHydrating() {
            {
              if (isHydrating) {
                error("We should not be hydrating here. This is a bug in React. Please file a bug.");
              }
            }
          }
          function markDidThrowWhileHydratingDEV() {
            {
              didSuspendOrErrorDEV = true;
            }
          }
          function didSuspendOrErrorWhileHydratingDEV() {
            {
              return didSuspendOrErrorDEV;
            }
          }
          function enterHydrationState(fiber) {
            var parentInstance = fiber.stateNode.containerInfo;
            nextHydratableInstance = getFirstHydratableChildWithinContainer(parentInstance);
            hydrationParentFiber = fiber;
            isHydrating = true;
            hydrationErrors = null;
            didSuspendOrErrorDEV = false;
            return true;
          }
          function reenterHydrationStateFromDehydratedSuspenseInstance(fiber, suspenseInstance, treeContext) {
            nextHydratableInstance = getFirstHydratableChildWithinSuspenseInstance(suspenseInstance);
            hydrationParentFiber = fiber;
            isHydrating = true;
            hydrationErrors = null;
            didSuspendOrErrorDEV = false;
            if (treeContext !== null) {
              restoreSuspendedTreeContext(fiber, treeContext);
            }
            return true;
          }
          function warnUnhydratedInstance(returnFiber, instance) {
            {
              switch (returnFiber.tag) {
                case HostRoot: {
                  didNotHydrateInstanceWithinContainer(returnFiber.stateNode.containerInfo, instance);
                  break;
                }
                case HostComponent: {
                  var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
                  didNotHydrateInstance(
                    returnFiber.type,
                    returnFiber.memoizedProps,
                    returnFiber.stateNode,
                    instance,
                    isConcurrentMode
                  );
                  break;
                }
                case SuspenseComponent: {
                  var suspenseState = returnFiber.memoizedState;
                  if (suspenseState.dehydrated !== null)
                    didNotHydrateInstanceWithinSuspenseInstance(suspenseState.dehydrated, instance);
                  break;
                }
              }
            }
          }
          function deleteHydratableInstance(returnFiber, instance) {
            warnUnhydratedInstance(returnFiber, instance);
            var childToDelete = createFiberFromHostInstanceForDeletion();
            childToDelete.stateNode = instance;
            childToDelete.return = returnFiber;
            var deletions = returnFiber.deletions;
            if (deletions === null) {
              returnFiber.deletions = [childToDelete];
              returnFiber.flags |= ChildDeletion;
            } else {
              deletions.push(childToDelete);
            }
          }
          function warnNonhydratedInstance(returnFiber, fiber) {
            {
              if (didSuspendOrErrorDEV) {
                return;
              }
              switch (returnFiber.tag) {
                case HostRoot: {
                  var parentContainer = returnFiber.stateNode.containerInfo;
                  switch (fiber.tag) {
                    case HostComponent:
                      var type = fiber.type;
                      var props = fiber.pendingProps;
                      didNotFindHydratableInstanceWithinContainer(parentContainer, type);
                      break;
                    case HostText:
                      var text = fiber.pendingProps;
                      didNotFindHydratableTextInstanceWithinContainer(parentContainer, text);
                      break;
                  }
                  break;
                }
                case HostComponent: {
                  var parentType = returnFiber.type;
                  var parentProps = returnFiber.memoizedProps;
                  var parentInstance = returnFiber.stateNode;
                  switch (fiber.tag) {
                    case HostComponent: {
                      var _type = fiber.type;
                      var _props = fiber.pendingProps;
                      var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
                      didNotFindHydratableInstance(
                        parentType,
                        parentProps,
                        parentInstance,
                        _type,
                        _props,
                        isConcurrentMode
                      );
                      break;
                    }
                    case HostText: {
                      var _text = fiber.pendingProps;
                      var _isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
                      didNotFindHydratableTextInstance(
                        parentType,
                        parentProps,
                        parentInstance,
                        _text,
                        _isConcurrentMode
                      );
                      break;
                    }
                  }
                  break;
                }
                case SuspenseComponent: {
                  var suspenseState = returnFiber.memoizedState;
                  var _parentInstance = suspenseState.dehydrated;
                  if (_parentInstance !== null)
                    switch (fiber.tag) {
                      case HostComponent:
                        var _type2 = fiber.type;
                        var _props2 = fiber.pendingProps;
                        didNotFindHydratableInstanceWithinSuspenseInstance(_parentInstance, _type2);
                        break;
                      case HostText:
                        var _text2 = fiber.pendingProps;
                        didNotFindHydratableTextInstanceWithinSuspenseInstance(_parentInstance, _text2);
                        break;
                    }
                  break;
                }
                default:
                  return;
              }
            }
          }
          function insertNonHydratedInstance(returnFiber, fiber) {
            fiber.flags = fiber.flags & ~Hydrating | Placement;
            warnNonhydratedInstance(returnFiber, fiber);
          }
          function tryHydrate(fiber, nextInstance) {
            switch (fiber.tag) {
              case HostComponent: {
                var type = fiber.type;
                var props = fiber.pendingProps;
                var instance = canHydrateInstance(nextInstance, type);
                if (instance !== null) {
                  fiber.stateNode = instance;
                  hydrationParentFiber = fiber;
                  nextHydratableInstance = getFirstHydratableChild(instance);
                  return true;
                }
                return false;
              }
              case HostText: {
                var text = fiber.pendingProps;
                var textInstance = canHydrateTextInstance(nextInstance, text);
                if (textInstance !== null) {
                  fiber.stateNode = textInstance;
                  hydrationParentFiber = fiber;
                  nextHydratableInstance = null;
                  return true;
                }
                return false;
              }
              case SuspenseComponent: {
                var suspenseInstance = canHydrateSuspenseInstance(nextInstance);
                if (suspenseInstance !== null) {
                  var suspenseState = {
                    dehydrated: suspenseInstance,
                    treeContext: getSuspendedTreeContext(),
                    retryLane: OffscreenLane
                  };
                  fiber.memoizedState = suspenseState;
                  var dehydratedFragment = createFiberFromDehydratedFragment(suspenseInstance);
                  dehydratedFragment.return = fiber;
                  fiber.child = dehydratedFragment;
                  hydrationParentFiber = fiber;
                  nextHydratableInstance = null;
                  return true;
                }
                return false;
              }
              default:
                return false;
            }
          }
          function shouldClientRenderOnMismatch(fiber) {
            return (fiber.mode & ConcurrentMode) !== NoMode && (fiber.flags & DidCapture) === NoFlags;
          }
          function throwOnHydrationMismatch(fiber) {
            throw new Error("Hydration failed because the initial UI does not match what was rendered on the server.");
          }
          function tryToClaimNextHydratableInstance(fiber) {
            if (!isHydrating) {
              return;
            }
            var nextInstance = nextHydratableInstance;
            if (!nextInstance) {
              if (shouldClientRenderOnMismatch(fiber)) {
                warnNonhydratedInstance(hydrationParentFiber, fiber);
                throwOnHydrationMismatch();
              }
              insertNonHydratedInstance(hydrationParentFiber, fiber);
              isHydrating = false;
              hydrationParentFiber = fiber;
              return;
            }
            var firstAttemptedInstance = nextInstance;
            if (!tryHydrate(fiber, nextInstance)) {
              if (shouldClientRenderOnMismatch(fiber)) {
                warnNonhydratedInstance(hydrationParentFiber, fiber);
                throwOnHydrationMismatch();
              }
              nextInstance = getNextHydratableSibling(firstAttemptedInstance);
              var prevHydrationParentFiber = hydrationParentFiber;
              if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
                insertNonHydratedInstance(hydrationParentFiber, fiber);
                isHydrating = false;
                hydrationParentFiber = fiber;
                return;
              }
              deleteHydratableInstance(prevHydrationParentFiber, firstAttemptedInstance);
            }
          }
          function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {
            var instance = fiber.stateNode;
            var shouldWarnIfMismatchDev = !didSuspendOrErrorDEV;
            var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber, shouldWarnIfMismatchDev);
            fiber.updateQueue = updatePayload;
            if (updatePayload !== null) {
              return true;
            }
            return false;
          }
          function prepareToHydrateHostTextInstance(fiber) {
            var textInstance = fiber.stateNode;
            var textContent = fiber.memoizedProps;
            var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);
            if (shouldUpdate) {
              var returnFiber = hydrationParentFiber;
              if (returnFiber !== null) {
                switch (returnFiber.tag) {
                  case HostRoot: {
                    var parentContainer = returnFiber.stateNode.containerInfo;
                    var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
                    didNotMatchHydratedContainerTextInstance(
                      parentContainer,
                      textInstance,
                      textContent,
                      isConcurrentMode
                    );
                    break;
                  }
                  case HostComponent: {
                    var parentType = returnFiber.type;
                    var parentProps = returnFiber.memoizedProps;
                    var parentInstance = returnFiber.stateNode;
                    var _isConcurrentMode2 = (returnFiber.mode & ConcurrentMode) !== NoMode;
                    didNotMatchHydratedTextInstance(
                      parentType,
                      parentProps,
                      parentInstance,
                      textInstance,
                      textContent,
                      _isConcurrentMode2
                    );
                    break;
                  }
                }
              }
            }
            return shouldUpdate;
          }
          function prepareToHydrateHostSuspenseInstance(fiber) {
            var suspenseState = fiber.memoizedState;
            var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
            if (!suspenseInstance) {
              throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
            }
            hydrateSuspenseInstance(suspenseInstance, fiber);
          }
          function skipPastDehydratedSuspenseInstance(fiber) {
            var suspenseState = fiber.memoizedState;
            var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
            if (!suspenseInstance) {
              throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
            }
            return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);
          }
          function popToNextHostParent(fiber) {
            var parent = fiber.return;
            while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) {
              parent = parent.return;
            }
            hydrationParentFiber = parent;
          }
          function popHydrationState(fiber) {
            if (fiber !== hydrationParentFiber) {
              return false;
            }
            if (!isHydrating) {
              popToNextHostParent(fiber);
              isHydrating = true;
              return false;
            }
            if (fiber.tag !== HostRoot && (fiber.tag !== HostComponent || shouldDeleteUnhydratedTailInstances(fiber.type) && !shouldSetTextContent(fiber.type, fiber.memoizedProps))) {
              var nextInstance = nextHydratableInstance;
              if (nextInstance) {
                if (shouldClientRenderOnMismatch(fiber)) {
                  warnIfUnhydratedTailNodes(fiber);
                  throwOnHydrationMismatch();
                } else {
                  while (nextInstance) {
                    deleteHydratableInstance(fiber, nextInstance);
                    nextInstance = getNextHydratableSibling(nextInstance);
                  }
                }
              }
            }
            popToNextHostParent(fiber);
            if (fiber.tag === SuspenseComponent) {
              nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);
            } else {
              nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;
            }
            return true;
          }
          function hasUnhydratedTailNodes() {
            return isHydrating && nextHydratableInstance !== null;
          }
          function warnIfUnhydratedTailNodes(fiber) {
            var nextInstance = nextHydratableInstance;
            while (nextInstance) {
              warnUnhydratedInstance(fiber, nextInstance);
              nextInstance = getNextHydratableSibling(nextInstance);
            }
          }
          function resetHydrationState() {
            hydrationParentFiber = null;
            nextHydratableInstance = null;
            isHydrating = false;
            didSuspendOrErrorDEV = false;
          }
          function upgradeHydrationErrorsToRecoverable() {
            if (hydrationErrors !== null) {
              queueRecoverableErrors(hydrationErrors);
              hydrationErrors = null;
            }
          }
          function getIsHydrating() {
            return isHydrating;
          }
          function queueHydrationError(error2) {
            if (hydrationErrors === null) {
              hydrationErrors = [error2];
            } else {
              hydrationErrors.push(error2);
            }
          }
          var ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
          var NoTransition = null;
          function requestCurrentTransition() {
            return ReactCurrentBatchConfig$1.transition;
          }
          var ReactStrictModeWarnings = {
            recordUnsafeLifecycleWarnings: function(fiber, instance) {
            },
            flushPendingUnsafeLifecycleWarnings: function() {
            },
            recordLegacyContextWarning: function(fiber, instance) {
            },
            flushLegacyContextWarning: function() {
            },
            discardPendingWarnings: function() {
            }
          };
          {
            var findStrictRoot = function(fiber) {
              var maybeStrictRoot = null;
              var node = fiber;
              while (node !== null) {
                if (node.mode & StrictLegacyMode) {
                  maybeStrictRoot = node;
                }
                node = node.return;
              }
              return maybeStrictRoot;
            };
            var setToSortedString = function(set2) {
              var array = [];
              set2.forEach(function(value) {
                array.push(value);
              });
              return array.sort().join(", ");
            };
            var pendingComponentWillMountWarnings = [];
            var pendingUNSAFE_ComponentWillMountWarnings = [];
            var pendingComponentWillReceivePropsWarnings = [];
            var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
            var pendingComponentWillUpdateWarnings = [];
            var pendingUNSAFE_ComponentWillUpdateWarnings = [];
            var didWarnAboutUnsafeLifecycles = /* @__PURE__ */ new Set();
            ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function(fiber, instance) {
              if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {
                return;
              }
              if (typeof instance.componentWillMount === "function" && instance.componentWillMount.__suppressDeprecationWarning !== true) {
                pendingComponentWillMountWarnings.push(fiber);
              }
              if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillMount === "function") {
                pendingUNSAFE_ComponentWillMountWarnings.push(fiber);
              }
              if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
                pendingComponentWillReceivePropsWarnings.push(fiber);
              }
              if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillReceiveProps === "function") {
                pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);
              }
              if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
                pendingComponentWillUpdateWarnings.push(fiber);
              }
              if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillUpdate === "function") {
                pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);
              }
            };
            ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function() {
              var componentWillMountUniqueNames = /* @__PURE__ */ new Set();
              if (pendingComponentWillMountWarnings.length > 0) {
                pendingComponentWillMountWarnings.forEach(function(fiber) {
                  componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingComponentWillMountWarnings = [];
              }
              var UNSAFE_componentWillMountUniqueNames = /* @__PURE__ */ new Set();
              if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {
                pendingUNSAFE_ComponentWillMountWarnings.forEach(function(fiber) {
                  UNSAFE_componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingUNSAFE_ComponentWillMountWarnings = [];
              }
              var componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set();
              if (pendingComponentWillReceivePropsWarnings.length > 0) {
                pendingComponentWillReceivePropsWarnings.forEach(function(fiber) {
                  componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingComponentWillReceivePropsWarnings = [];
              }
              var UNSAFE_componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set();
              if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {
                pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function(fiber) {
                  UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
              }
              var componentWillUpdateUniqueNames = /* @__PURE__ */ new Set();
              if (pendingComponentWillUpdateWarnings.length > 0) {
                pendingComponentWillUpdateWarnings.forEach(function(fiber) {
                  componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingComponentWillUpdateWarnings = [];
              }
              var UNSAFE_componentWillUpdateUniqueNames = /* @__PURE__ */ new Set();
              if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {
                pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function(fiber) {
                  UNSAFE_componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingUNSAFE_ComponentWillUpdateWarnings = [];
              }
              if (UNSAFE_componentWillMountUniqueNames.size > 0) {
                var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);
                error("Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n\nPlease update the following components: %s", sortedNames);
              }
              if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {
                var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);
                error("Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n\nPlease update the following components: %s", _sortedNames);
              }
              if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {
                var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);
                error("Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n\nPlease update the following components: %s", _sortedNames2);
              }
              if (componentWillMountUniqueNames.size > 0) {
                var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);
                warn("componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames3);
              }
              if (componentWillReceivePropsUniqueNames.size > 0) {
                var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);
                warn("componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames4);
              }
              if (componentWillUpdateUniqueNames.size > 0) {
                var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);
                warn("componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames5);
              }
            };
            var pendingLegacyContextWarning = /* @__PURE__ */ new Map();
            var didWarnAboutLegacyContext = /* @__PURE__ */ new Set();
            ReactStrictModeWarnings.recordLegacyContextWarning = function(fiber, instance) {
              var strictRoot = findStrictRoot(fiber);
              if (strictRoot === null) {
                error("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.");
                return;
              }
              if (didWarnAboutLegacyContext.has(fiber.type)) {
                return;
              }
              var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);
              if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === "function") {
                if (warningsForRoot === void 0) {
                  warningsForRoot = [];
                  pendingLegacyContextWarning.set(strictRoot, warningsForRoot);
                }
                warningsForRoot.push(fiber);
              }
            };
            ReactStrictModeWarnings.flushLegacyContextWarning = function() {
              pendingLegacyContextWarning.forEach(function(fiberArray, strictRoot) {
                if (fiberArray.length === 0) {
                  return;
                }
                var firstFiber = fiberArray[0];
                var uniqueNames = /* @__PURE__ */ new Set();
                fiberArray.forEach(function(fiber) {
                  uniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
                  didWarnAboutLegacyContext.add(fiber.type);
                });
                var sortedNames = setToSortedString(uniqueNames);
                try {
                  setCurrentFiber(firstFiber);
                  error("Legacy context API has been detected within a strict-mode tree.\n\nThe old API will be supported in all 16.x releases, but applications using it should migrate to the new version.\n\nPlease update the following components: %s\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context", sortedNames);
                } finally {
                  resetCurrentFiber();
                }
              });
            };
            ReactStrictModeWarnings.discardPendingWarnings = function() {
              pendingComponentWillMountWarnings = [];
              pendingUNSAFE_ComponentWillMountWarnings = [];
              pendingComponentWillReceivePropsWarnings = [];
              pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
              pendingComponentWillUpdateWarnings = [];
              pendingUNSAFE_ComponentWillUpdateWarnings = [];
              pendingLegacyContextWarning = /* @__PURE__ */ new Map();
            };
          }
          var didWarnAboutMaps;
          var didWarnAboutGenerators;
          var didWarnAboutStringRefs;
          var ownerHasKeyUseWarning;
          var ownerHasFunctionTypeWarning;
          var warnForMissingKey = function(child, returnFiber) {
          };
          {
            didWarnAboutMaps = false;
            didWarnAboutGenerators = false;
            didWarnAboutStringRefs = {};
            ownerHasKeyUseWarning = {};
            ownerHasFunctionTypeWarning = {};
            warnForMissingKey = function(child, returnFiber) {
              if (child === null || typeof child !== "object") {
                return;
              }
              if (!child._store || child._store.validated || child.key != null) {
                return;
              }
              if (typeof child._store !== "object") {
                throw new Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");
              }
              child._store.validated = true;
              var componentName = getComponentNameFromFiber(returnFiber) || "Component";
              if (ownerHasKeyUseWarning[componentName]) {
                return;
              }
              ownerHasKeyUseWarning[componentName] = true;
              error('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.');
            };
          }
          function isReactClass(type) {
            return type.prototype && type.prototype.isReactComponent;
          }
          function coerceRef(returnFiber, current2, element) {
            var mixedRef = element.ref;
            if (mixedRef !== null && typeof mixedRef !== "function" && typeof mixedRef !== "object") {
              {
                if ((returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && !(element._owner && element._self && element._owner.stateNode !== element._self) && !(element._owner && element._owner.tag !== ClassComponent) && !(typeof element.type === "function" && !isReactClass(element.type)) && element._owner) {
                  var componentName = getComponentNameFromFiber(returnFiber) || "Component";
                  if (!didWarnAboutStringRefs[componentName]) {
                    {
                      error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', componentName, mixedRef);
                    }
                    didWarnAboutStringRefs[componentName] = true;
                  }
                }
              }
              if (element._owner) {
                var owner = element._owner;
                var inst;
                if (owner) {
                  var ownerFiber = owner;
                  if (ownerFiber.tag !== ClassComponent) {
                    throw new Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");
                  }
                  inst = ownerFiber.stateNode;
                }
                if (!inst) {
                  throw new Error("Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue.");
                }
                var resolvedInst = inst;
                {
                  checkPropStringCoercion(mixedRef, "ref");
                }
                var stringRef = "" + mixedRef;
                if (current2 !== null && current2.ref !== null && typeof current2.ref === "function" && current2.ref._stringRef === stringRef) {
                  return current2.ref;
                }
                var ref = function(value) {
                  var refs = resolvedInst.refs;
                  if (value === null) {
                    delete refs[stringRef];
                  } else {
                    refs[stringRef] = value;
                  }
                };
                ref._stringRef = stringRef;
                return ref;
              } else {
                if (typeof mixedRef !== "string") {
                  throw new Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");
                }
                if (!element._owner) {
                  throw new Error("Element ref was specified as a string (" + mixedRef + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://reactjs.org/link/refs-must-have-owner for more information.");
                }
              }
            }
            return mixedRef;
          }
          function throwOnInvalidObjectType(returnFiber, newChild) {
            var childString = Object.prototype.toString.call(newChild);
            throw new Error("Objects are not valid as a React child (found: " + (childString === "[object Object]" ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : childString) + "). If you meant to render a collection of children, use an array instead.");
          }
          function warnOnFunctionType(returnFiber) {
            {
              var componentName = getComponentNameFromFiber(returnFiber) || "Component";
              if (ownerHasFunctionTypeWarning[componentName]) {
                return;
              }
              ownerHasFunctionTypeWarning[componentName] = true;
              error("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.");
            }
          }
          function resolveLazy(lazyType) {
            var payload = lazyType._payload;
            var init = lazyType._init;
            return init(payload);
          }
          function ChildReconciler(shouldTrackSideEffects) {
            function deleteChild(returnFiber, childToDelete) {
              if (!shouldTrackSideEffects) {
                return;
              }
              var deletions = returnFiber.deletions;
              if (deletions === null) {
                returnFiber.deletions = [childToDelete];
                returnFiber.flags |= ChildDeletion;
              } else {
                deletions.push(childToDelete);
              }
            }
            function deleteRemainingChildren(returnFiber, currentFirstChild) {
              if (!shouldTrackSideEffects) {
                return null;
              }
              var childToDelete = currentFirstChild;
              while (childToDelete !== null) {
                deleteChild(returnFiber, childToDelete);
                childToDelete = childToDelete.sibling;
              }
              return null;
            }
            function mapRemainingChildren(returnFiber, currentFirstChild) {
              var existingChildren = /* @__PURE__ */ new Map();
              var existingChild = currentFirstChild;
              while (existingChild !== null) {
                if (existingChild.key !== null) {
                  existingChildren.set(existingChild.key, existingChild);
                } else {
                  existingChildren.set(existingChild.index, existingChild);
                }
                existingChild = existingChild.sibling;
              }
              return existingChildren;
            }
            function useFiber(fiber, pendingProps) {
              var clone = createWorkInProgress(fiber, pendingProps);
              clone.index = 0;
              clone.sibling = null;
              return clone;
            }
            function placeChild(newFiber, lastPlacedIndex, newIndex) {
              newFiber.index = newIndex;
              if (!shouldTrackSideEffects) {
                newFiber.flags |= Forked;
                return lastPlacedIndex;
              }
              var current2 = newFiber.alternate;
              if (current2 !== null) {
                var oldIndex = current2.index;
                if (oldIndex < lastPlacedIndex) {
                  newFiber.flags |= Placement;
                  return lastPlacedIndex;
                } else {
                  return oldIndex;
                }
              } else {
                newFiber.flags |= Placement;
                return lastPlacedIndex;
              }
            }
            function placeSingleChild(newFiber) {
              if (shouldTrackSideEffects && newFiber.alternate === null) {
                newFiber.flags |= Placement;
              }
              return newFiber;
            }
            function updateTextNode(returnFiber, current2, textContent, lanes) {
              if (current2 === null || current2.tag !== HostText) {
                var created = createFiberFromText(textContent, returnFiber.mode, lanes);
                created.return = returnFiber;
                return created;
              } else {
                var existing = useFiber(current2, textContent);
                existing.return = returnFiber;
                return existing;
              }
            }
            function updateElement(returnFiber, current2, element, lanes) {
              var elementType = element.type;
              if (elementType === REACT_FRAGMENT_TYPE) {
                return updateFragment2(returnFiber, current2, element.props.children, lanes, element.key);
              }
              if (current2 !== null) {
                if (current2.elementType === elementType || isCompatibleFamilyForHotReloading(current2, element) || typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === current2.type) {
                  var existing = useFiber(current2, element.props);
                  existing.ref = coerceRef(returnFiber, current2, element);
                  existing.return = returnFiber;
                  {
                    existing._debugSource = element._source;
                    existing._debugOwner = element._owner;
                  }
                  return existing;
                }
              }
              var created = createFiberFromElement(element, returnFiber.mode, lanes);
              created.ref = coerceRef(returnFiber, current2, element);
              created.return = returnFiber;
              return created;
            }
            function updatePortal(returnFiber, current2, portal, lanes) {
              if (current2 === null || current2.tag !== HostPortal || current2.stateNode.containerInfo !== portal.containerInfo || current2.stateNode.implementation !== portal.implementation) {
                var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
                created.return = returnFiber;
                return created;
              } else {
                var existing = useFiber(current2, portal.children || []);
                existing.return = returnFiber;
                return existing;
              }
            }
            function updateFragment2(returnFiber, current2, fragment, lanes, key2) {
              if (current2 === null || current2.tag !== Fragment2) {
                var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key2);
                created.return = returnFiber;
                return created;
              } else {
                var existing = useFiber(current2, fragment);
                existing.return = returnFiber;
                return existing;
              }
            }
            function createChild(returnFiber, newChild, lanes) {
              if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
                var created = createFiberFromText("" + newChild, returnFiber.mode, lanes);
                created.return = returnFiber;
                return created;
              }
              if (typeof newChild === "object" && newChild !== null) {
                switch (newChild.$$typeof) {
                  case REACT_ELEMENT_TYPE: {
                    var _created = createFiberFromElement(newChild, returnFiber.mode, lanes);
                    _created.ref = coerceRef(returnFiber, null, newChild);
                    _created.return = returnFiber;
                    return _created;
                  }
                  case REACT_PORTAL_TYPE: {
                    var _created2 = createFiberFromPortal(newChild, returnFiber.mode, lanes);
                    _created2.return = returnFiber;
                    return _created2;
                  }
                  case REACT_LAZY_TYPE: {
                    var payload = newChild._payload;
                    var init = newChild._init;
                    return createChild(returnFiber, init(payload), lanes);
                  }
                }
                if (isArray(newChild) || getIteratorFn(newChild)) {
                  var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null);
                  _created3.return = returnFiber;
                  return _created3;
                }
                throwOnInvalidObjectType(returnFiber, newChild);
              }
              {
                if (typeof newChild === "function") {
                  warnOnFunctionType(returnFiber);
                }
              }
              return null;
            }
            function updateSlot(returnFiber, oldFiber, newChild, lanes) {
              var key2 = oldFiber !== null ? oldFiber.key : null;
              if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
                if (key2 !== null) {
                  return null;
                }
                return updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
              }
              if (typeof newChild === "object" && newChild !== null) {
                switch (newChild.$$typeof) {
                  case REACT_ELEMENT_TYPE: {
                    if (newChild.key === key2) {
                      return updateElement(returnFiber, oldFiber, newChild, lanes);
                    } else {
                      return null;
                    }
                  }
                  case REACT_PORTAL_TYPE: {
                    if (newChild.key === key2) {
                      return updatePortal(returnFiber, oldFiber, newChild, lanes);
                    } else {
                      return null;
                    }
                  }
                  case REACT_LAZY_TYPE: {
                    var payload = newChild._payload;
                    var init = newChild._init;
                    return updateSlot(returnFiber, oldFiber, init(payload), lanes);
                  }
                }
                if (isArray(newChild) || getIteratorFn(newChild)) {
                  if (key2 !== null) {
                    return null;
                  }
                  return updateFragment2(returnFiber, oldFiber, newChild, lanes, null);
                }
                throwOnInvalidObjectType(returnFiber, newChild);
              }
              {
                if (typeof newChild === "function") {
                  warnOnFunctionType(returnFiber);
                }
              }
              return null;
            }
            function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) {
              if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
                var matchedFiber = existingChildren.get(newIdx) || null;
                return updateTextNode(returnFiber, matchedFiber, "" + newChild, lanes);
              }
              if (typeof newChild === "object" && newChild !== null) {
                switch (newChild.$$typeof) {
                  case REACT_ELEMENT_TYPE: {
                    var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
                    return updateElement(returnFiber, _matchedFiber, newChild, lanes);
                  }
                  case REACT_PORTAL_TYPE: {
                    var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
                    return updatePortal(returnFiber, _matchedFiber2, newChild, lanes);
                  }
                  case REACT_LAZY_TYPE:
                    var payload = newChild._payload;
                    var init = newChild._init;
                    return updateFromMap(existingChildren, returnFiber, newIdx, init(payload), lanes);
                }
                if (isArray(newChild) || getIteratorFn(newChild)) {
                  var _matchedFiber3 = existingChildren.get(newIdx) || null;
                  return updateFragment2(returnFiber, _matchedFiber3, newChild, lanes, null);
                }
                throwOnInvalidObjectType(returnFiber, newChild);
              }
              {
                if (typeof newChild === "function") {
                  warnOnFunctionType(returnFiber);
                }
              }
              return null;
            }
            function warnOnInvalidKey(child, knownKeys, returnFiber) {
              {
                if (typeof child !== "object" || child === null) {
                  return knownKeys;
                }
                switch (child.$$typeof) {
                  case REACT_ELEMENT_TYPE:
                  case REACT_PORTAL_TYPE:
                    warnForMissingKey(child, returnFiber);
                    var key2 = child.key;
                    if (typeof key2 !== "string") {
                      break;
                    }
                    if (knownKeys === null) {
                      knownKeys = /* @__PURE__ */ new Set();
                      knownKeys.add(key2);
                      break;
                    }
                    if (!knownKeys.has(key2)) {
                      knownKeys.add(key2);
                      break;
                    }
                    error("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.", key2);
                    break;
                  case REACT_LAZY_TYPE:
                    var payload = child._payload;
                    var init = child._init;
                    warnOnInvalidKey(init(payload), knownKeys, returnFiber);
                    break;
                }
              }
              return knownKeys;
            }
            function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {
              {
                var knownKeys = null;
                for (var i = 0; i < newChildren.length; i++) {
                  var child = newChildren[i];
                  knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
                }
              }
              var resultingFirstChild = null;
              var previousNewFiber = null;
              var oldFiber = currentFirstChild;
              var lastPlacedIndex = 0;
              var newIdx = 0;
              var nextOldFiber = null;
              for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
                if (oldFiber.index > newIdx) {
                  nextOldFiber = oldFiber;
                  oldFiber = null;
                } else {
                  nextOldFiber = oldFiber.sibling;
                }
                var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes);
                if (newFiber === null) {
                  if (oldFiber === null) {
                    oldFiber = nextOldFiber;
                  }
                  break;
                }
                if (shouldTrackSideEffects) {
                  if (oldFiber && newFiber.alternate === null) {
                    deleteChild(returnFiber, oldFiber);
                  }
                }
                lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
                if (previousNewFiber === null) {
                  resultingFirstChild = newFiber;
                } else {
                  previousNewFiber.sibling = newFiber;
                }
                previousNewFiber = newFiber;
                oldFiber = nextOldFiber;
              }
              if (newIdx === newChildren.length) {
                deleteRemainingChildren(returnFiber, oldFiber);
                if (getIsHydrating()) {
                  var numberOfForks = newIdx;
                  pushTreeFork(returnFiber, numberOfForks);
                }
                return resultingFirstChild;
              }
              if (oldFiber === null) {
                for (; newIdx < newChildren.length; newIdx++) {
                  var _newFiber = createChild(returnFiber, newChildren[newIdx], lanes);
                  if (_newFiber === null) {
                    continue;
                  }
                  lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);
                  if (previousNewFiber === null) {
                    resultingFirstChild = _newFiber;
                  } else {
                    previousNewFiber.sibling = _newFiber;
                  }
                  previousNewFiber = _newFiber;
                }
                if (getIsHydrating()) {
                  var _numberOfForks = newIdx;
                  pushTreeFork(returnFiber, _numberOfForks);
                }
                return resultingFirstChild;
              }
              var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
              for (; newIdx < newChildren.length; newIdx++) {
                var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], lanes);
                if (_newFiber2 !== null) {
                  if (shouldTrackSideEffects) {
                    if (_newFiber2.alternate !== null) {
                      existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);
                    }
                  }
                  lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);
                  if (previousNewFiber === null) {
                    resultingFirstChild = _newFiber2;
                  } else {
                    previousNewFiber.sibling = _newFiber2;
                  }
                  previousNewFiber = _newFiber2;
                }
              }
              if (shouldTrackSideEffects) {
                existingChildren.forEach(function(child2) {
                  return deleteChild(returnFiber, child2);
                });
              }
              if (getIsHydrating()) {
                var _numberOfForks2 = newIdx;
                pushTreeFork(returnFiber, _numberOfForks2);
              }
              return resultingFirstChild;
            }
            function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) {
              var iteratorFn = getIteratorFn(newChildrenIterable);
              if (typeof iteratorFn !== "function") {
                throw new Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");
              }
              {
                if (typeof Symbol === "function" && newChildrenIterable[Symbol.toStringTag] === "Generator") {
                  if (!didWarnAboutGenerators) {
                    error("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers.");
                  }
                  didWarnAboutGenerators = true;
                }
                if (newChildrenIterable.entries === iteratorFn) {
                  if (!didWarnAboutMaps) {
                    error("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");
                  }
                  didWarnAboutMaps = true;
                }
                var _newChildren = iteratorFn.call(newChildrenIterable);
                if (_newChildren) {
                  var knownKeys = null;
                  var _step = _newChildren.next();
                  for (; !_step.done; _step = _newChildren.next()) {
                    var child = _step.value;
                    knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
                  }
                }
              }
              var newChildren = iteratorFn.call(newChildrenIterable);
              if (newChildren == null) {
                throw new Error("An iterable object provided no iterator.");
              }
              var resultingFirstChild = null;
              var previousNewFiber = null;
              var oldFiber = currentFirstChild;
              var lastPlacedIndex = 0;
              var newIdx = 0;
              var nextOldFiber = null;
              var step = newChildren.next();
              for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
                if (oldFiber.index > newIdx) {
                  nextOldFiber = oldFiber;
                  oldFiber = null;
                } else {
                  nextOldFiber = oldFiber.sibling;
                }
                var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
                if (newFiber === null) {
                  if (oldFiber === null) {
                    oldFiber = nextOldFiber;
                  }
                  break;
                }
                if (shouldTrackSideEffects) {
                  if (oldFiber && newFiber.alternate === null) {
                    deleteChild(returnFiber, oldFiber);
                  }
                }
                lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
                if (previousNewFiber === null) {
                  resultingFirstChild = newFiber;
                } else {
                  previousNewFiber.sibling = newFiber;
                }
                previousNewFiber = newFiber;
                oldFiber = nextOldFiber;
              }
              if (step.done) {
                deleteRemainingChildren(returnFiber, oldFiber);
                if (getIsHydrating()) {
                  var numberOfForks = newIdx;
                  pushTreeFork(returnFiber, numberOfForks);
                }
                return resultingFirstChild;
              }
              if (oldFiber === null) {
                for (; !step.done; newIdx++, step = newChildren.next()) {
                  var _newFiber3 = createChild(returnFiber, step.value, lanes);
                  if (_newFiber3 === null) {
                    continue;
                  }
                  lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);
                  if (previousNewFiber === null) {
                    resultingFirstChild = _newFiber3;
                  } else {
                    previousNewFiber.sibling = _newFiber3;
                  }
                  previousNewFiber = _newFiber3;
                }
                if (getIsHydrating()) {
                  var _numberOfForks3 = newIdx;
                  pushTreeFork(returnFiber, _numberOfForks3);
                }
                return resultingFirstChild;
              }
              var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
              for (; !step.done; newIdx++, step = newChildren.next()) {
                var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, lanes);
                if (_newFiber4 !== null) {
                  if (shouldTrackSideEffects) {
                    if (_newFiber4.alternate !== null) {
                      existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);
                    }
                  }
                  lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);
                  if (previousNewFiber === null) {
                    resultingFirstChild = _newFiber4;
                  } else {
                    previousNewFiber.sibling = _newFiber4;
                  }
                  previousNewFiber = _newFiber4;
                }
              }
              if (shouldTrackSideEffects) {
                existingChildren.forEach(function(child2) {
                  return deleteChild(returnFiber, child2);
                });
              }
              if (getIsHydrating()) {
                var _numberOfForks4 = newIdx;
                pushTreeFork(returnFiber, _numberOfForks4);
              }
              return resultingFirstChild;
            }
            function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, lanes) {
              if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
                deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
                var existing = useFiber(currentFirstChild, textContent);
                existing.return = returnFiber;
                return existing;
              }
              deleteRemainingChildren(returnFiber, currentFirstChild);
              var created = createFiberFromText(textContent, returnFiber.mode, lanes);
              created.return = returnFiber;
              return created;
            }
            function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) {
              var key2 = element.key;
              var child = currentFirstChild;
              while (child !== null) {
                if (child.key === key2) {
                  var elementType = element.type;
                  if (elementType === REACT_FRAGMENT_TYPE) {
                    if (child.tag === Fragment2) {
                      deleteRemainingChildren(returnFiber, child.sibling);
                      var existing = useFiber(child, element.props.children);
                      existing.return = returnFiber;
                      {
                        existing._debugSource = element._source;
                        existing._debugOwner = element._owner;
                      }
                      return existing;
                    }
                  } else {
                    if (child.elementType === elementType || isCompatibleFamilyForHotReloading(child, element) || typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === child.type) {
                      deleteRemainingChildren(returnFiber, child.sibling);
                      var _existing = useFiber(child, element.props);
                      _existing.ref = coerceRef(returnFiber, child, element);
                      _existing.return = returnFiber;
                      {
                        _existing._debugSource = element._source;
                        _existing._debugOwner = element._owner;
                      }
                      return _existing;
                    }
                  }
                  deleteRemainingChildren(returnFiber, child);
                  break;
                } else {
                  deleteChild(returnFiber, child);
                }
                child = child.sibling;
              }
              if (element.type === REACT_FRAGMENT_TYPE) {
                var created = createFiberFromFragment(element.props.children, returnFiber.mode, lanes, element.key);
                created.return = returnFiber;
                return created;
              } else {
                var _created4 = createFiberFromElement(element, returnFiber.mode, lanes);
                _created4.ref = coerceRef(returnFiber, currentFirstChild, element);
                _created4.return = returnFiber;
                return _created4;
              }
            }
            function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) {
              var key2 = portal.key;
              var child = currentFirstChild;
              while (child !== null) {
                if (child.key === key2) {
                  if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
                    deleteRemainingChildren(returnFiber, child.sibling);
                    var existing = useFiber(child, portal.children || []);
                    existing.return = returnFiber;
                    return existing;
                  } else {
                    deleteRemainingChildren(returnFiber, child);
                    break;
                  }
                } else {
                  deleteChild(returnFiber, child);
                }
                child = child.sibling;
              }
              var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
              created.return = returnFiber;
              return created;
            }
            function reconcileChildFibers2(returnFiber, currentFirstChild, newChild, lanes) {
              var isUnkeyedTopLevelFragment = typeof newChild === "object" && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;
              if (isUnkeyedTopLevelFragment) {
                newChild = newChild.props.children;
              }
              if (typeof newChild === "object" && newChild !== null) {
                switch (newChild.$$typeof) {
                  case REACT_ELEMENT_TYPE:
                    return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, lanes));
                  case REACT_PORTAL_TYPE:
                    return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, lanes));
                  case REACT_LAZY_TYPE:
                    var payload = newChild._payload;
                    var init = newChild._init;
                    return reconcileChildFibers2(returnFiber, currentFirstChild, init(payload), lanes);
                }
                if (isArray(newChild)) {
                  return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes);
                }
                if (getIteratorFn(newChild)) {
                  return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes);
                }
                throwOnInvalidObjectType(returnFiber, newChild);
              }
              if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
                return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, "" + newChild, lanes));
              }
              {
                if (typeof newChild === "function") {
                  warnOnFunctionType(returnFiber);
                }
              }
              return deleteRemainingChildren(returnFiber, currentFirstChild);
            }
            return reconcileChildFibers2;
          }
          var reconcileChildFibers = ChildReconciler(true);
          var mountChildFibers = ChildReconciler(false);
          function cloneChildFibers(current2, workInProgress2) {
            if (current2 !== null && workInProgress2.child !== current2.child) {
              throw new Error("Resuming work not yet implemented.");
            }
            if (workInProgress2.child === null) {
              return;
            }
            var currentChild = workInProgress2.child;
            var newChild = createWorkInProgress(currentChild, currentChild.pendingProps);
            workInProgress2.child = newChild;
            newChild.return = workInProgress2;
            while (currentChild.sibling !== null) {
              currentChild = currentChild.sibling;
              newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps);
              newChild.return = workInProgress2;
            }
            newChild.sibling = null;
          }
          function resetChildFibers(workInProgress2, lanes) {
            var child = workInProgress2.child;
            while (child !== null) {
              resetWorkInProgress(child, lanes);
              child = child.sibling;
            }
          }
          var valueCursor = createCursor(null);
          var rendererSigil;
          {
            rendererSigil = {};
          }
          var currentlyRenderingFiber = null;
          var lastContextDependency = null;
          var lastFullyObservedContext = null;
          var isDisallowedContextReadInDEV = false;
          function resetContextDependencies() {
            currentlyRenderingFiber = null;
            lastContextDependency = null;
            lastFullyObservedContext = null;
            {
              isDisallowedContextReadInDEV = false;
            }
          }
          function enterDisallowedContextReadInDEV() {
            {
              isDisallowedContextReadInDEV = true;
            }
          }
          function exitDisallowedContextReadInDEV() {
            {
              isDisallowedContextReadInDEV = false;
            }
          }
          function pushProvider(providerFiber, context, nextValue) {
            {
              push(valueCursor, context._currentValue, providerFiber);
              context._currentValue = nextValue;
              {
                if (context._currentRenderer !== void 0 && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {
                  error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.");
                }
                context._currentRenderer = rendererSigil;
              }
            }
          }
          function popProvider(context, providerFiber) {
            var currentValue = valueCursor.current;
            pop(valueCursor, providerFiber);
            {
              {
                context._currentValue = currentValue;
              }
            }
          }
          function scheduleContextWorkOnParentPath(parent, renderLanes2, propagationRoot) {
            var node = parent;
            while (node !== null) {
              var alternate = node.alternate;
              if (!isSubsetOfLanes(node.childLanes, renderLanes2)) {
                node.childLanes = mergeLanes(node.childLanes, renderLanes2);
                if (alternate !== null) {
                  alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes2);
                }
              } else if (alternate !== null && !isSubsetOfLanes(alternate.childLanes, renderLanes2)) {
                alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes2);
              }
              if (node === propagationRoot) {
                break;
              }
              node = node.return;
            }
            {
              if (node !== propagationRoot) {
                error("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
          }
          function propagateContextChange(workInProgress2, context, renderLanes2) {
            {
              propagateContextChange_eager(workInProgress2, context, renderLanes2);
            }
          }
          function propagateContextChange_eager(workInProgress2, context, renderLanes2) {
            var fiber = workInProgress2.child;
            if (fiber !== null) {
              fiber.return = workInProgress2;
            }
            while (fiber !== null) {
              var nextFiber = void 0;
              var list = fiber.dependencies;
              if (list !== null) {
                nextFiber = fiber.child;
                var dependency = list.firstContext;
                while (dependency !== null) {
                  if (dependency.context === context) {
                    if (fiber.tag === ClassComponent) {
                      var lane = pickArbitraryLane(renderLanes2);
                      var update = createUpdate(NoTimestamp, lane);
                      update.tag = ForceUpdate;
                      var updateQueue = fiber.updateQueue;
                      if (updateQueue === null)
                        ;
                      else {
                        var sharedQueue = updateQueue.shared;
                        var pending = sharedQueue.pending;
                        if (pending === null) {
                          update.next = update;
                        } else {
                          update.next = pending.next;
                          pending.next = update;
                        }
                        sharedQueue.pending = update;
                      }
                    }
                    fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
                    var alternate = fiber.alternate;
                    if (alternate !== null) {
                      alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
                    }
                    scheduleContextWorkOnParentPath(fiber.return, renderLanes2, workInProgress2);
                    list.lanes = mergeLanes(list.lanes, renderLanes2);
                    break;
                  }
                  dependency = dependency.next;
                }
              } else if (fiber.tag === ContextProvider) {
                nextFiber = fiber.type === workInProgress2.type ? null : fiber.child;
              } else if (fiber.tag === DehydratedFragment) {
                var parentSuspense = fiber.return;
                if (parentSuspense === null) {
                  throw new Error("We just came from a parent so we must have had a parent. This is a bug in React.");
                }
                parentSuspense.lanes = mergeLanes(parentSuspense.lanes, renderLanes2);
                var _alternate = parentSuspense.alternate;
                if (_alternate !== null) {
                  _alternate.lanes = mergeLanes(_alternate.lanes, renderLanes2);
                }
                scheduleContextWorkOnParentPath(parentSuspense, renderLanes2, workInProgress2);
                nextFiber = fiber.sibling;
              } else {
                nextFiber = fiber.child;
              }
              if (nextFiber !== null) {
                nextFiber.return = fiber;
              } else {
                nextFiber = fiber;
                while (nextFiber !== null) {
                  if (nextFiber === workInProgress2) {
                    nextFiber = null;
                    break;
                  }
                  var sibling = nextFiber.sibling;
                  if (sibling !== null) {
                    sibling.return = nextFiber.return;
                    nextFiber = sibling;
                    break;
                  }
                  nextFiber = nextFiber.return;
                }
              }
              fiber = nextFiber;
            }
          }
          function prepareToReadContext(workInProgress2, renderLanes2) {
            currentlyRenderingFiber = workInProgress2;
            lastContextDependency = null;
            lastFullyObservedContext = null;
            var dependencies = workInProgress2.dependencies;
            if (dependencies !== null) {
              {
                var firstContext = dependencies.firstContext;
                if (firstContext !== null) {
                  if (includesSomeLane(dependencies.lanes, renderLanes2)) {
                    markWorkInProgressReceivedUpdate();
                  }
                  dependencies.firstContext = null;
                }
              }
            }
          }
          function readContext(context) {
            {
              if (isDisallowedContextReadInDEV) {
                error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
              }
            }
            var value = context._currentValue;
            if (lastFullyObservedContext === context)
              ;
            else {
              var contextItem = {
                context,
                memoizedValue: value,
                next: null
              };
              if (lastContextDependency === null) {
                if (currentlyRenderingFiber === null) {
                  throw new Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
                }
                lastContextDependency = contextItem;
                currentlyRenderingFiber.dependencies = {
                  lanes: NoLanes,
                  firstContext: contextItem
                };
              } else {
                lastContextDependency = lastContextDependency.next = contextItem;
              }
            }
            return value;
          }
          var concurrentQueues = null;
          function pushConcurrentUpdateQueue(queue) {
            if (concurrentQueues === null) {
              concurrentQueues = [queue];
            } else {
              concurrentQueues.push(queue);
            }
          }
          function finishQueueingConcurrentUpdates() {
            if (concurrentQueues !== null) {
              for (var i = 0; i < concurrentQueues.length; i++) {
                var queue = concurrentQueues[i];
                var lastInterleavedUpdate = queue.interleaved;
                if (lastInterleavedUpdate !== null) {
                  queue.interleaved = null;
                  var firstInterleavedUpdate = lastInterleavedUpdate.next;
                  var lastPendingUpdate = queue.pending;
                  if (lastPendingUpdate !== null) {
                    var firstPendingUpdate = lastPendingUpdate.next;
                    lastPendingUpdate.next = firstInterleavedUpdate;
                    lastInterleavedUpdate.next = firstPendingUpdate;
                  }
                  queue.pending = lastInterleavedUpdate;
                }
              }
              concurrentQueues = null;
            }
          }
          function enqueueConcurrentHookUpdate(fiber, queue, update, lane) {
            var interleaved = queue.interleaved;
            if (interleaved === null) {
              update.next = update;
              pushConcurrentUpdateQueue(queue);
            } else {
              update.next = interleaved.next;
              interleaved.next = update;
            }
            queue.interleaved = update;
            return markUpdateLaneFromFiberToRoot(fiber, lane);
          }
          function enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane) {
            var interleaved = queue.interleaved;
            if (interleaved === null) {
              update.next = update;
              pushConcurrentUpdateQueue(queue);
            } else {
              update.next = interleaved.next;
              interleaved.next = update;
            }
            queue.interleaved = update;
          }
          function enqueueConcurrentClassUpdate(fiber, queue, update, lane) {
            var interleaved = queue.interleaved;
            if (interleaved === null) {
              update.next = update;
              pushConcurrentUpdateQueue(queue);
            } else {
              update.next = interleaved.next;
              interleaved.next = update;
            }
            queue.interleaved = update;
            return markUpdateLaneFromFiberToRoot(fiber, lane);
          }
          function enqueueConcurrentRenderForLane(fiber, lane) {
            return markUpdateLaneFromFiberToRoot(fiber, lane);
          }
          var unsafe_markUpdateLaneFromFiberToRoot = markUpdateLaneFromFiberToRoot;
          function markUpdateLaneFromFiberToRoot(sourceFiber, lane) {
            sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane);
            var alternate = sourceFiber.alternate;
            if (alternate !== null) {
              alternate.lanes = mergeLanes(alternate.lanes, lane);
            }
            {
              if (alternate === null && (sourceFiber.flags & (Placement | Hydrating)) !== NoFlags) {
                warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
              }
            }
            var node = sourceFiber;
            var parent = sourceFiber.return;
            while (parent !== null) {
              parent.childLanes = mergeLanes(parent.childLanes, lane);
              alternate = parent.alternate;
              if (alternate !== null) {
                alternate.childLanes = mergeLanes(alternate.childLanes, lane);
              } else {
                {
                  if ((parent.flags & (Placement | Hydrating)) !== NoFlags) {
                    warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
                  }
                }
              }
              node = parent;
              parent = parent.return;
            }
            if (node.tag === HostRoot) {
              var root2 = node.stateNode;
              return root2;
            } else {
              return null;
            }
          }
          var UpdateState = 0;
          var ReplaceState = 1;
          var ForceUpdate = 2;
          var CaptureUpdate = 3;
          var hasForceUpdate = false;
          var didWarnUpdateInsideUpdate;
          var currentlyProcessingQueue;
          {
            didWarnUpdateInsideUpdate = false;
            currentlyProcessingQueue = null;
          }
          function initializeUpdateQueue(fiber) {
            var queue = {
              baseState: fiber.memoizedState,
              firstBaseUpdate: null,
              lastBaseUpdate: null,
              shared: {
                pending: null,
                interleaved: null,
                lanes: NoLanes
              },
              effects: null
            };
            fiber.updateQueue = queue;
          }
          function cloneUpdateQueue(current2, workInProgress2) {
            var queue = workInProgress2.updateQueue;
            var currentQueue = current2.updateQueue;
            if (queue === currentQueue) {
              var clone = {
                baseState: currentQueue.baseState,
                firstBaseUpdate: currentQueue.firstBaseUpdate,
                lastBaseUpdate: currentQueue.lastBaseUpdate,
                shared: currentQueue.shared,
                effects: currentQueue.effects
              };
              workInProgress2.updateQueue = clone;
            }
          }
          function createUpdate(eventTime, lane) {
            var update = {
              eventTime,
              lane,
              tag: UpdateState,
              payload: null,
              callback: null,
              next: null
            };
            return update;
          }
          function enqueueUpdate(fiber, update, lane) {
            var updateQueue = fiber.updateQueue;
            if (updateQueue === null) {
              return null;
            }
            var sharedQueue = updateQueue.shared;
            {
              if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {
                error("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.");
                didWarnUpdateInsideUpdate = true;
              }
            }
            if (isUnsafeClassRenderPhaseUpdate()) {
              var pending = sharedQueue.pending;
              if (pending === null) {
                update.next = update;
              } else {
                update.next = pending.next;
                pending.next = update;
              }
              sharedQueue.pending = update;
              return unsafe_markUpdateLaneFromFiberToRoot(fiber, lane);
            } else {
              return enqueueConcurrentClassUpdate(fiber, sharedQueue, update, lane);
            }
          }
          function entangleTransitions(root2, fiber, lane) {
            var updateQueue = fiber.updateQueue;
            if (updateQueue === null) {
              return;
            }
            var sharedQueue = updateQueue.shared;
            if (isTransitionLane(lane)) {
              var queueLanes = sharedQueue.lanes;
              queueLanes = intersectLanes(queueLanes, root2.pendingLanes);
              var newQueueLanes = mergeLanes(queueLanes, lane);
              sharedQueue.lanes = newQueueLanes;
              markRootEntangled(root2, newQueueLanes);
            }
          }
          function enqueueCapturedUpdate(workInProgress2, capturedUpdate) {
            var queue = workInProgress2.updateQueue;
            var current2 = workInProgress2.alternate;
            if (current2 !== null) {
              var currentQueue = current2.updateQueue;
              if (queue === currentQueue) {
                var newFirst = null;
                var newLast = null;
                var firstBaseUpdate = queue.firstBaseUpdate;
                if (firstBaseUpdate !== null) {
                  var update = firstBaseUpdate;
                  do {
                    var clone = {
                      eventTime: update.eventTime,
                      lane: update.lane,
                      tag: update.tag,
                      payload: update.payload,
                      callback: update.callback,
                      next: null
                    };
                    if (newLast === null) {
                      newFirst = newLast = clone;
                    } else {
                      newLast.next = clone;
                      newLast = clone;
                    }
                    update = update.next;
                  } while (update !== null);
                  if (newLast === null) {
                    newFirst = newLast = capturedUpdate;
                  } else {
                    newLast.next = capturedUpdate;
                    newLast = capturedUpdate;
                  }
                } else {
                  newFirst = newLast = capturedUpdate;
                }
                queue = {
                  baseState: currentQueue.baseState,
                  firstBaseUpdate: newFirst,
                  lastBaseUpdate: newLast,
                  shared: currentQueue.shared,
                  effects: currentQueue.effects
                };
                workInProgress2.updateQueue = queue;
                return;
              }
            }
            var lastBaseUpdate = queue.lastBaseUpdate;
            if (lastBaseUpdate === null) {
              queue.firstBaseUpdate = capturedUpdate;
            } else {
              lastBaseUpdate.next = capturedUpdate;
            }
            queue.lastBaseUpdate = capturedUpdate;
          }
          function getStateFromUpdate(workInProgress2, queue, update, prevState, nextProps, instance) {
            switch (update.tag) {
              case ReplaceState: {
                var payload = update.payload;
                if (typeof payload === "function") {
                  {
                    enterDisallowedContextReadInDEV();
                  }
                  var nextState = payload.call(instance, prevState, nextProps);
                  {
                    if (workInProgress2.mode & StrictLegacyMode) {
                      setIsStrictModeForDevtools(true);
                      try {
                        payload.call(instance, prevState, nextProps);
                      } finally {
                        setIsStrictModeForDevtools(false);
                      }
                    }
                    exitDisallowedContextReadInDEV();
                  }
                  return nextState;
                }
                return payload;
              }
              case CaptureUpdate: {
                workInProgress2.flags = workInProgress2.flags & ~ShouldCapture | DidCapture;
              }
              case UpdateState: {
                var _payload = update.payload;
                var partialState;
                if (typeof _payload === "function") {
                  {
                    enterDisallowedContextReadInDEV();
                  }
                  partialState = _payload.call(instance, prevState, nextProps);
                  {
                    if (workInProgress2.mode & StrictLegacyMode) {
                      setIsStrictModeForDevtools(true);
                      try {
                        _payload.call(instance, prevState, nextProps);
                      } finally {
                        setIsStrictModeForDevtools(false);
                      }
                    }
                    exitDisallowedContextReadInDEV();
                  }
                } else {
                  partialState = _payload;
                }
                if (partialState === null || partialState === void 0) {
                  return prevState;
                }
                return assign({}, prevState, partialState);
              }
              case ForceUpdate: {
                hasForceUpdate = true;
                return prevState;
              }
            }
            return prevState;
          }
          function processUpdateQueue(workInProgress2, props, instance, renderLanes2) {
            var queue = workInProgress2.updateQueue;
            hasForceUpdate = false;
            {
              currentlyProcessingQueue = queue.shared;
            }
            var firstBaseUpdate = queue.firstBaseUpdate;
            var lastBaseUpdate = queue.lastBaseUpdate;
            var pendingQueue = queue.shared.pending;
            if (pendingQueue !== null) {
              queue.shared.pending = null;
              var lastPendingUpdate = pendingQueue;
              var firstPendingUpdate = lastPendingUpdate.next;
              lastPendingUpdate.next = null;
              if (lastBaseUpdate === null) {
                firstBaseUpdate = firstPendingUpdate;
              } else {
                lastBaseUpdate.next = firstPendingUpdate;
              }
              lastBaseUpdate = lastPendingUpdate;
              var current2 = workInProgress2.alternate;
              if (current2 !== null) {
                var currentQueue = current2.updateQueue;
                var currentLastBaseUpdate = currentQueue.lastBaseUpdate;
                if (currentLastBaseUpdate !== lastBaseUpdate) {
                  if (currentLastBaseUpdate === null) {
                    currentQueue.firstBaseUpdate = firstPendingUpdate;
                  } else {
                    currentLastBaseUpdate.next = firstPendingUpdate;
                  }
                  currentQueue.lastBaseUpdate = lastPendingUpdate;
                }
              }
            }
            if (firstBaseUpdate !== null) {
              var newState = queue.baseState;
              var newLanes = NoLanes;
              var newBaseState = null;
              var newFirstBaseUpdate = null;
              var newLastBaseUpdate = null;
              var update = firstBaseUpdate;
              do {
                var updateLane = update.lane;
                var updateEventTime = update.eventTime;
                if (!isSubsetOfLanes(renderLanes2, updateLane)) {
                  var clone = {
                    eventTime: updateEventTime,
                    lane: updateLane,
                    tag: update.tag,
                    payload: update.payload,
                    callback: update.callback,
                    next: null
                  };
                  if (newLastBaseUpdate === null) {
                    newFirstBaseUpdate = newLastBaseUpdate = clone;
                    newBaseState = newState;
                  } else {
                    newLastBaseUpdate = newLastBaseUpdate.next = clone;
                  }
                  newLanes = mergeLanes(newLanes, updateLane);
                } else {
                  if (newLastBaseUpdate !== null) {
                    var _clone = {
                      eventTime: updateEventTime,
                      lane: NoLane,
                      tag: update.tag,
                      payload: update.payload,
                      callback: update.callback,
                      next: null
                    };
                    newLastBaseUpdate = newLastBaseUpdate.next = _clone;
                  }
                  newState = getStateFromUpdate(workInProgress2, queue, update, newState, props, instance);
                  var callback = update.callback;
                  if (callback !== null && update.lane !== NoLane) {
                    workInProgress2.flags |= Callback;
                    var effects = queue.effects;
                    if (effects === null) {
                      queue.effects = [update];
                    } else {
                      effects.push(update);
                    }
                  }
                }
                update = update.next;
                if (update === null) {
                  pendingQueue = queue.shared.pending;
                  if (pendingQueue === null) {
                    break;
                  } else {
                    var _lastPendingUpdate = pendingQueue;
                    var _firstPendingUpdate = _lastPendingUpdate.next;
                    _lastPendingUpdate.next = null;
                    update = _firstPendingUpdate;
                    queue.lastBaseUpdate = _lastPendingUpdate;
                    queue.shared.pending = null;
                  }
                }
              } while (true);
              if (newLastBaseUpdate === null) {
                newBaseState = newState;
              }
              queue.baseState = newBaseState;
              queue.firstBaseUpdate = newFirstBaseUpdate;
              queue.lastBaseUpdate = newLastBaseUpdate;
              var lastInterleaved = queue.shared.interleaved;
              if (lastInterleaved !== null) {
                var interleaved = lastInterleaved;
                do {
                  newLanes = mergeLanes(newLanes, interleaved.lane);
                  interleaved = interleaved.next;
                } while (interleaved !== lastInterleaved);
              } else if (firstBaseUpdate === null) {
                queue.shared.lanes = NoLanes;
              }
              markSkippedUpdateLanes(newLanes);
              workInProgress2.lanes = newLanes;
              workInProgress2.memoizedState = newState;
            }
            {
              currentlyProcessingQueue = null;
            }
          }
          function callCallback(callback, context) {
            if (typeof callback !== "function") {
              throw new Error("Invalid argument passed as callback. Expected a function. Instead " + ("received: " + callback));
            }
            callback.call(context);
          }
          function resetHasForceUpdateBeforeProcessing() {
            hasForceUpdate = false;
          }
          function checkHasForceUpdateAfterProcessing() {
            return hasForceUpdate;
          }
          function commitUpdateQueue(finishedWork, finishedQueue, instance) {
            var effects = finishedQueue.effects;
            finishedQueue.effects = null;
            if (effects !== null) {
              for (var i = 0; i < effects.length; i++) {
                var effect = effects[i];
                var callback = effect.callback;
                if (callback !== null) {
                  effect.callback = null;
                  callCallback(callback, instance);
                }
              }
            }
          }
          var NO_CONTEXT = {};
          var contextStackCursor$1 = createCursor(NO_CONTEXT);
          var contextFiberStackCursor = createCursor(NO_CONTEXT);
          var rootInstanceStackCursor = createCursor(NO_CONTEXT);
          function requiredContext(c) {
            if (c === NO_CONTEXT) {
              throw new Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");
            }
            return c;
          }
          function getRootHostContainer() {
            var rootInstance = requiredContext(rootInstanceStackCursor.current);
            return rootInstance;
          }
          function pushHostContainer(fiber, nextRootInstance) {
            push(rootInstanceStackCursor, nextRootInstance, fiber);
            push(contextFiberStackCursor, fiber, fiber);
            push(contextStackCursor$1, NO_CONTEXT, fiber);
            var nextRootContext = getRootHostContext(nextRootInstance);
            pop(contextStackCursor$1, fiber);
            push(contextStackCursor$1, nextRootContext, fiber);
          }
          function popHostContainer(fiber) {
            pop(contextStackCursor$1, fiber);
            pop(contextFiberStackCursor, fiber);
            pop(rootInstanceStackCursor, fiber);
          }
          function getHostContext() {
            var context = requiredContext(contextStackCursor$1.current);
            return context;
          }
          function pushHostContext(fiber) {
            var rootInstance = requiredContext(rootInstanceStackCursor.current);
            var context = requiredContext(contextStackCursor$1.current);
            var nextContext = getChildHostContext(context, fiber.type);
            if (context === nextContext) {
              return;
            }
            push(contextFiberStackCursor, fiber, fiber);
            push(contextStackCursor$1, nextContext, fiber);
          }
          function popHostContext(fiber) {
            if (contextFiberStackCursor.current !== fiber) {
              return;
            }
            pop(contextStackCursor$1, fiber);
            pop(contextFiberStackCursor, fiber);
          }
          var DefaultSuspenseContext = 0;
          var SubtreeSuspenseContextMask = 1;
          var InvisibleParentSuspenseContext = 1;
          var ForceSuspenseFallback = 2;
          var suspenseStackCursor = createCursor(DefaultSuspenseContext);
          function hasSuspenseContext(parentContext, flag) {
            return (parentContext & flag) !== 0;
          }
          function setDefaultShallowSuspenseContext(parentContext) {
            return parentContext & SubtreeSuspenseContextMask;
          }
          function setShallowSuspenseContext(parentContext, shallowContext) {
            return parentContext & SubtreeSuspenseContextMask | shallowContext;
          }
          function addSubtreeSuspenseContext(parentContext, subtreeContext) {
            return parentContext | subtreeContext;
          }
          function pushSuspenseContext(fiber, newContext) {
            push(suspenseStackCursor, newContext, fiber);
          }
          function popSuspenseContext(fiber) {
            pop(suspenseStackCursor, fiber);
          }
          function shouldCaptureSuspense(workInProgress2, hasInvisibleParent) {
            var nextState = workInProgress2.memoizedState;
            if (nextState !== null) {
              if (nextState.dehydrated !== null) {
                return true;
              }
              return false;
            }
            var props = workInProgress2.memoizedProps;
            {
              return true;
            }
          }
          function findFirstSuspended(row) {
            var node = row;
            while (node !== null) {
              if (node.tag === SuspenseComponent) {
                var state = node.memoizedState;
                if (state !== null) {
                  var dehydrated = state.dehydrated;
                  if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {
                    return node;
                  }
                }
              } else if (node.tag === SuspenseListComponent && node.memoizedProps.revealOrder !== void 0) {
                var didSuspend = (node.flags & DidCapture) !== NoFlags;
                if (didSuspend) {
                  return node;
                }
              } else if (node.child !== null) {
                node.child.return = node;
                node = node.child;
                continue;
              }
              if (node === row) {
                return null;
              }
              while (node.sibling === null) {
                if (node.return === null || node.return === row) {
                  return null;
                }
                node = node.return;
              }
              node.sibling.return = node.return;
              node = node.sibling;
            }
            return null;
          }
          var NoFlags$1 = 0;
          var HasEffect = 1;
          var Insertion = 2;
          var Layout = 4;
          var Passive$1 = 8;
          var workInProgressSources = [];
          function resetWorkInProgressVersions() {
            for (var i = 0; i < workInProgressSources.length; i++) {
              var mutableSource = workInProgressSources[i];
              {
                mutableSource._workInProgressVersionPrimary = null;
              }
            }
            workInProgressSources.length = 0;
          }
          function registerMutableSourceForHydration(root2, mutableSource) {
            var getVersion = mutableSource._getVersion;
            var version2 = getVersion(mutableSource._source);
            if (root2.mutableSourceEagerHydrationData == null) {
              root2.mutableSourceEagerHydrationData = [mutableSource, version2];
            } else {
              root2.mutableSourceEagerHydrationData.push(mutableSource, version2);
            }
          }
          var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig;
          var didWarnAboutMismatchedHooksForComponent;
          var didWarnUncachedGetSnapshot;
          {
            didWarnAboutMismatchedHooksForComponent = /* @__PURE__ */ new Set();
          }
          var renderLanes = NoLanes;
          var currentlyRenderingFiber$1 = null;
          var currentHook = null;
          var workInProgressHook = null;
          var didScheduleRenderPhaseUpdate = false;
          var didScheduleRenderPhaseUpdateDuringThisPass = false;
          var localIdCounter = 0;
          var globalClientIdCounter = 0;
          var RE_RENDER_LIMIT = 25;
          var currentHookNameInDev = null;
          var hookTypesDev = null;
          var hookTypesUpdateIndexDev = -1;
          var ignorePreviousDependencies = false;
          function mountHookTypesDev() {
            {
              var hookName = currentHookNameInDev;
              if (hookTypesDev === null) {
                hookTypesDev = [hookName];
              } else {
                hookTypesDev.push(hookName);
              }
            }
          }
          function updateHookTypesDev() {
            {
              var hookName = currentHookNameInDev;
              if (hookTypesDev !== null) {
                hookTypesUpdateIndexDev++;
                if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
                  warnOnHookMismatchInDev(hookName);
                }
              }
            }
          }
          function checkDepsAreArrayDev(deps) {
            {
              if (deps !== void 0 && deps !== null && !isArray(deps)) {
                error("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", currentHookNameInDev, typeof deps);
              }
            }
          }
          function warnOnHookMismatchInDev(currentHookName) {
            {
              var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1);
              if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
                didWarnAboutMismatchedHooksForComponent.add(componentName);
                if (hookTypesDev !== null) {
                  var table = "";
                  var secondColumnStart = 30;
                  for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
                    var oldHookName = hookTypesDev[i];
                    var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
                    var row = i + 1 + ". " + oldHookName;
                    while (row.length < secondColumnStart) {
                      row += " ";
                    }
                    row += newHookName + "\n";
                    table += row;
                  }
                  error("React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks\n\n   Previous render            Next render\n   ------------------------------------------------------\n%s   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", componentName, table);
                }
              }
            }
          }
          function throwInvalidHookError() {
            throw new Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");
          }
          function areHookInputsEqual(nextDeps, prevDeps) {
            {
              if (ignorePreviousDependencies) {
                return false;
              }
            }
            if (prevDeps === null) {
              {
                error("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", currentHookNameInDev);
              }
              return false;
            }
            {
              if (nextDeps.length !== prevDeps.length) {
                error("The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + nextDeps.join(", ") + "]");
              }
            }
            for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
              if (objectIs(nextDeps[i], prevDeps[i])) {
                continue;
              }
              return false;
            }
            return true;
          }
          function renderWithHooks(current2, workInProgress2, Component2, props, secondArg, nextRenderLanes) {
            renderLanes = nextRenderLanes;
            currentlyRenderingFiber$1 = workInProgress2;
            {
              hookTypesDev = current2 !== null ? current2._debugHookTypes : null;
              hookTypesUpdateIndexDev = -1;
              ignorePreviousDependencies = current2 !== null && current2.type !== workInProgress2.type;
            }
            workInProgress2.memoizedState = null;
            workInProgress2.updateQueue = null;
            workInProgress2.lanes = NoLanes;
            {
              if (current2 !== null && current2.memoizedState !== null) {
                ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
              } else if (hookTypesDev !== null) {
                ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
              } else {
                ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
              }
            }
            var children = Component2(props, secondArg);
            if (didScheduleRenderPhaseUpdateDuringThisPass) {
              var numberOfReRenders = 0;
              do {
                didScheduleRenderPhaseUpdateDuringThisPass = false;
                localIdCounter = 0;
                if (numberOfReRenders >= RE_RENDER_LIMIT) {
                  throw new Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
                }
                numberOfReRenders += 1;
                {
                  ignorePreviousDependencies = false;
                }
                currentHook = null;
                workInProgressHook = null;
                workInProgress2.updateQueue = null;
                {
                  hookTypesUpdateIndexDev = -1;
                }
                ReactCurrentDispatcher$1.current = HooksDispatcherOnRerenderInDEV;
                children = Component2(props, secondArg);
              } while (didScheduleRenderPhaseUpdateDuringThisPass);
            }
            ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
            {
              workInProgress2._debugHookTypes = hookTypesDev;
            }
            var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
            renderLanes = NoLanes;
            currentlyRenderingFiber$1 = null;
            currentHook = null;
            workInProgressHook = null;
            {
              currentHookNameInDev = null;
              hookTypesDev = null;
              hookTypesUpdateIndexDev = -1;
              if (current2 !== null && (current2.flags & StaticMask) !== (workInProgress2.flags & StaticMask) && (current2.mode & ConcurrentMode) !== NoMode) {
                error("Internal React error: Expected static flag was missing. Please notify the React team.");
              }
            }
            didScheduleRenderPhaseUpdate = false;
            if (didRenderTooFewHooks) {
              throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");
            }
            return children;
          }
          function checkDidRenderIdHook() {
            var didRenderIdHook = localIdCounter !== 0;
            localIdCounter = 0;
            return didRenderIdHook;
          }
          function bailoutHooks(current2, workInProgress2, lanes) {
            workInProgress2.updateQueue = current2.updateQueue;
            if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
              workInProgress2.flags &= ~(MountPassiveDev | MountLayoutDev | Passive | Update);
            } else {
              workInProgress2.flags &= ~(Passive | Update);
            }
            current2.lanes = removeLanes(current2.lanes, lanes);
          }
          function resetHooksAfterThrow() {
            ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
            if (didScheduleRenderPhaseUpdate) {
              var hook = currentlyRenderingFiber$1.memoizedState;
              while (hook !== null) {
                var queue = hook.queue;
                if (queue !== null) {
                  queue.pending = null;
                }
                hook = hook.next;
              }
              didScheduleRenderPhaseUpdate = false;
            }
            renderLanes = NoLanes;
            currentlyRenderingFiber$1 = null;
            currentHook = null;
            workInProgressHook = null;
            {
              hookTypesDev = null;
              hookTypesUpdateIndexDev = -1;
              currentHookNameInDev = null;
              isUpdatingOpaqueValueInRenderPhase = false;
            }
            didScheduleRenderPhaseUpdateDuringThisPass = false;
            localIdCounter = 0;
          }
          function mountWorkInProgressHook() {
            var hook = {
              memoizedState: null,
              baseState: null,
              baseQueue: null,
              queue: null,
              next: null
            };
            if (workInProgressHook === null) {
              currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook;
            } else {
              workInProgressHook = workInProgressHook.next = hook;
            }
            return workInProgressHook;
          }
          function updateWorkInProgressHook() {
            var nextCurrentHook;
            if (currentHook === null) {
              var current2 = currentlyRenderingFiber$1.alternate;
              if (current2 !== null) {
                nextCurrentHook = current2.memoizedState;
              } else {
                nextCurrentHook = null;
              }
            } else {
              nextCurrentHook = currentHook.next;
            }
            var nextWorkInProgressHook;
            if (workInProgressHook === null) {
              nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState;
            } else {
              nextWorkInProgressHook = workInProgressHook.next;
            }
            if (nextWorkInProgressHook !== null) {
              workInProgressHook = nextWorkInProgressHook;
              nextWorkInProgressHook = workInProgressHook.next;
              currentHook = nextCurrentHook;
            } else {
              if (nextCurrentHook === null) {
                throw new Error("Rendered more hooks than during the previous render.");
              }
              currentHook = nextCurrentHook;
              var newHook = {
                memoizedState: currentHook.memoizedState,
                baseState: currentHook.baseState,
                baseQueue: currentHook.baseQueue,
                queue: currentHook.queue,
                next: null
              };
              if (workInProgressHook === null) {
                currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook;
              } else {
                workInProgressHook = workInProgressHook.next = newHook;
              }
            }
            return workInProgressHook;
          }
          function createFunctionComponentUpdateQueue() {
            return {
              lastEffect: null,
              stores: null
            };
          }
          function basicStateReducer(state, action) {
            return typeof action === "function" ? action(state) : action;
          }
          function mountReducer(reducer, initialArg, init) {
            var hook = mountWorkInProgressHook();
            var initialState;
            if (init !== void 0) {
              initialState = init(initialArg);
            } else {
              initialState = initialArg;
            }
            hook.memoizedState = hook.baseState = initialState;
            var queue = {
              pending: null,
              interleaved: null,
              lanes: NoLanes,
              dispatch: null,
              lastRenderedReducer: reducer,
              lastRenderedState: initialState
            };
            hook.queue = queue;
            var dispatch = queue.dispatch = dispatchReducerAction.bind(null, currentlyRenderingFiber$1, queue);
            return [hook.memoizedState, dispatch];
          }
          function updateReducer(reducer, initialArg, init) {
            var hook = updateWorkInProgressHook();
            var queue = hook.queue;
            if (queue === null) {
              throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");
            }
            queue.lastRenderedReducer = reducer;
            var current2 = currentHook;
            var baseQueue = current2.baseQueue;
            var pendingQueue = queue.pending;
            if (pendingQueue !== null) {
              if (baseQueue !== null) {
                var baseFirst = baseQueue.next;
                var pendingFirst = pendingQueue.next;
                baseQueue.next = pendingFirst;
                pendingQueue.next = baseFirst;
              }
              {
                if (current2.baseQueue !== baseQueue) {
                  error("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React.");
                }
              }
              current2.baseQueue = baseQueue = pendingQueue;
              queue.pending = null;
            }
            if (baseQueue !== null) {
              var first = baseQueue.next;
              var newState = current2.baseState;
              var newBaseState = null;
              var newBaseQueueFirst = null;
              var newBaseQueueLast = null;
              var update = first;
              do {
                var updateLane = update.lane;
                if (!isSubsetOfLanes(renderLanes, updateLane)) {
                  var clone = {
                    lane: updateLane,
                    action: update.action,
                    hasEagerState: update.hasEagerState,
                    eagerState: update.eagerState,
                    next: null
                  };
                  if (newBaseQueueLast === null) {
                    newBaseQueueFirst = newBaseQueueLast = clone;
                    newBaseState = newState;
                  } else {
                    newBaseQueueLast = newBaseQueueLast.next = clone;
                  }
                  currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane);
                  markSkippedUpdateLanes(updateLane);
                } else {
                  if (newBaseQueueLast !== null) {
                    var _clone = {
                      lane: NoLane,
                      action: update.action,
                      hasEagerState: update.hasEagerState,
                      eagerState: update.eagerState,
                      next: null
                    };
                    newBaseQueueLast = newBaseQueueLast.next = _clone;
                  }
                  if (update.hasEagerState) {
                    newState = update.eagerState;
                  } else {
                    var action = update.action;
                    newState = reducer(newState, action);
                  }
                }
                update = update.next;
              } while (update !== null && update !== first);
              if (newBaseQueueLast === null) {
                newBaseState = newState;
              } else {
                newBaseQueueLast.next = newBaseQueueFirst;
              }
              if (!objectIs(newState, hook.memoizedState)) {
                markWorkInProgressReceivedUpdate();
              }
              hook.memoizedState = newState;
              hook.baseState = newBaseState;
              hook.baseQueue = newBaseQueueLast;
              queue.lastRenderedState = newState;
            }
            var lastInterleaved = queue.interleaved;
            if (lastInterleaved !== null) {
              var interleaved = lastInterleaved;
              do {
                var interleavedLane = interleaved.lane;
                currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, interleavedLane);
                markSkippedUpdateLanes(interleavedLane);
                interleaved = interleaved.next;
              } while (interleaved !== lastInterleaved);
            } else if (baseQueue === null) {
              queue.lanes = NoLanes;
            }
            var dispatch = queue.dispatch;
            return [hook.memoizedState, dispatch];
          }
          function rerenderReducer(reducer, initialArg, init) {
            var hook = updateWorkInProgressHook();
            var queue = hook.queue;
            if (queue === null) {
              throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");
            }
            queue.lastRenderedReducer = reducer;
            var dispatch = queue.dispatch;
            var lastRenderPhaseUpdate = queue.pending;
            var newState = hook.memoizedState;
            if (lastRenderPhaseUpdate !== null) {
              queue.pending = null;
              var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next;
              var update = firstRenderPhaseUpdate;
              do {
                var action = update.action;
                newState = reducer(newState, action);
                update = update.next;
              } while (update !== firstRenderPhaseUpdate);
              if (!objectIs(newState, hook.memoizedState)) {
                markWorkInProgressReceivedUpdate();
              }
              hook.memoizedState = newState;
              if (hook.baseQueue === null) {
                hook.baseState = newState;
              }
              queue.lastRenderedState = newState;
            }
            return [newState, dispatch];
          }
          function mountMutableSource(source, getSnapshot, subscribe) {
            {
              return void 0;
            }
          }
          function updateMutableSource(source, getSnapshot, subscribe) {
            {
              return void 0;
            }
          }
          function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
            var fiber = currentlyRenderingFiber$1;
            var hook = mountWorkInProgressHook();
            var nextSnapshot;
            var isHydrating2 = getIsHydrating();
            if (isHydrating2) {
              if (getServerSnapshot === void 0) {
                throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");
              }
              nextSnapshot = getServerSnapshot();
              {
                if (!didWarnUncachedGetSnapshot) {
                  if (nextSnapshot !== getServerSnapshot()) {
                    error("The result of getServerSnapshot should be cached to avoid an infinite loop");
                    didWarnUncachedGetSnapshot = true;
                  }
                }
              }
            } else {
              nextSnapshot = getSnapshot();
              {
                if (!didWarnUncachedGetSnapshot) {
                  var cachedSnapshot = getSnapshot();
                  if (!objectIs(nextSnapshot, cachedSnapshot)) {
                    error("The result of getSnapshot should be cached to avoid an infinite loop");
                    didWarnUncachedGetSnapshot = true;
                  }
                }
              }
              var root2 = getWorkInProgressRoot();
              if (root2 === null) {
                throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
              }
              if (!includesBlockingLane(root2, renderLanes)) {
                pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
              }
            }
            hook.memoizedState = nextSnapshot;
            var inst = {
              value: nextSnapshot,
              getSnapshot
            };
            hook.queue = inst;
            mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]);
            fiber.flags |= Passive;
            pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null);
            return nextSnapshot;
          }
          function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
            var fiber = currentlyRenderingFiber$1;
            var hook = updateWorkInProgressHook();
            var nextSnapshot = getSnapshot();
            {
              if (!didWarnUncachedGetSnapshot) {
                var cachedSnapshot = getSnapshot();
                if (!objectIs(nextSnapshot, cachedSnapshot)) {
                  error("The result of getSnapshot should be cached to avoid an infinite loop");
                  didWarnUncachedGetSnapshot = true;
                }
              }
            }
            var prevSnapshot = hook.memoizedState;
            var snapshotChanged = !objectIs(prevSnapshot, nextSnapshot);
            if (snapshotChanged) {
              hook.memoizedState = nextSnapshot;
              markWorkInProgressReceivedUpdate();
            }
            var inst = hook.queue;
            updateEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]);
            if (inst.getSnapshot !== getSnapshot || snapshotChanged || workInProgressHook !== null && workInProgressHook.memoizedState.tag & HasEffect) {
              fiber.flags |= Passive;
              pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null);
              var root2 = getWorkInProgressRoot();
              if (root2 === null) {
                throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
              }
              if (!includesBlockingLane(root2, renderLanes)) {
                pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
              }
            }
            return nextSnapshot;
          }
          function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
            fiber.flags |= StoreConsistency;
            var check = {
              getSnapshot,
              value: renderedSnapshot
            };
            var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
            if (componentUpdateQueue === null) {
              componentUpdateQueue = createFunctionComponentUpdateQueue();
              currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
              componentUpdateQueue.stores = [check];
            } else {
              var stores = componentUpdateQueue.stores;
              if (stores === null) {
                componentUpdateQueue.stores = [check];
              } else {
                stores.push(check);
              }
            }
          }
          function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
            inst.value = nextSnapshot;
            inst.getSnapshot = getSnapshot;
            if (checkIfSnapshotChanged(inst)) {
              forceStoreRerender(fiber);
            }
          }
          function subscribeToStore(fiber, inst, subscribe) {
            var handleStoreChange = function() {
              if (checkIfSnapshotChanged(inst)) {
                forceStoreRerender(fiber);
              }
            };
            return subscribe(handleStoreChange);
          }
          function checkIfSnapshotChanged(inst) {
            var latestGetSnapshot = inst.getSnapshot;
            var prevValue = inst.value;
            try {
              var nextValue = latestGetSnapshot();
              return !objectIs(prevValue, nextValue);
            } catch (error2) {
              return true;
            }
          }
          function forceStoreRerender(fiber) {
            var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
            if (root2 !== null) {
              scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
            }
          }
          function mountState(initialState) {
            var hook = mountWorkInProgressHook();
            if (typeof initialState === "function") {
              initialState = initialState();
            }
            hook.memoizedState = hook.baseState = initialState;
            var queue = {
              pending: null,
              interleaved: null,
              lanes: NoLanes,
              dispatch: null,
              lastRenderedReducer: basicStateReducer,
              lastRenderedState: initialState
            };
            hook.queue = queue;
            var dispatch = queue.dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue);
            return [hook.memoizedState, dispatch];
          }
          function updateState(initialState) {
            return updateReducer(basicStateReducer);
          }
          function rerenderState(initialState) {
            return rerenderReducer(basicStateReducer);
          }
          function pushEffect(tag, create, destroy, deps) {
            var effect = {
              tag,
              create,
              destroy,
              deps,
              next: null
            };
            var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
            if (componentUpdateQueue === null) {
              componentUpdateQueue = createFunctionComponentUpdateQueue();
              currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
              componentUpdateQueue.lastEffect = effect.next = effect;
            } else {
              var lastEffect = componentUpdateQueue.lastEffect;
              if (lastEffect === null) {
                componentUpdateQueue.lastEffect = effect.next = effect;
              } else {
                var firstEffect = lastEffect.next;
                lastEffect.next = effect;
                effect.next = firstEffect;
                componentUpdateQueue.lastEffect = effect;
              }
            }
            return effect;
          }
          function mountRef(initialValue) {
            var hook = mountWorkInProgressHook();
            {
              var _ref2 = {
                current: initialValue
              };
              hook.memoizedState = _ref2;
              return _ref2;
            }
          }
          function updateRef(initialValue) {
            var hook = updateWorkInProgressHook();
            return hook.memoizedState;
          }
          function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
            var hook = mountWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            currentlyRenderingFiber$1.flags |= fiberFlags;
            hook.memoizedState = pushEffect(HasEffect | hookFlags, create, void 0, nextDeps);
          }
          function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
            var hook = updateWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            var destroy = void 0;
            if (currentHook !== null) {
              var prevEffect = currentHook.memoizedState;
              destroy = prevEffect.destroy;
              if (nextDeps !== null) {
                var prevDeps = prevEffect.deps;
                if (areHookInputsEqual(nextDeps, prevDeps)) {
                  hook.memoizedState = pushEffect(hookFlags, create, destroy, nextDeps);
                  return;
                }
              }
            }
            currentlyRenderingFiber$1.flags |= fiberFlags;
            hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps);
          }
          function mountEffect(create, deps) {
            if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
              return mountEffectImpl(MountPassiveDev | Passive | PassiveStatic, Passive$1, create, deps);
            } else {
              return mountEffectImpl(Passive | PassiveStatic, Passive$1, create, deps);
            }
          }
          function updateEffect(create, deps) {
            return updateEffectImpl(Passive, Passive$1, create, deps);
          }
          function mountInsertionEffect(create, deps) {
            return mountEffectImpl(Update, Insertion, create, deps);
          }
          function updateInsertionEffect(create, deps) {
            return updateEffectImpl(Update, Insertion, create, deps);
          }
          function mountLayoutEffect(create, deps) {
            var fiberFlags = Update;
            {
              fiberFlags |= LayoutStatic;
            }
            if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
              fiberFlags |= MountLayoutDev;
            }
            return mountEffectImpl(fiberFlags, Layout, create, deps);
          }
          function updateLayoutEffect(create, deps) {
            return updateEffectImpl(Update, Layout, create, deps);
          }
          function imperativeHandleEffect(create, ref) {
            if (typeof ref === "function") {
              var refCallback = ref;
              var _inst = create();
              refCallback(_inst);
              return function() {
                refCallback(null);
              };
            } else if (ref !== null && ref !== void 0) {
              var refObject = ref;
              {
                if (!refObject.hasOwnProperty("current")) {
                  error("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", "an object with keys {" + Object.keys(refObject).join(", ") + "}");
                }
              }
              var _inst2 = create();
              refObject.current = _inst2;
              return function() {
                refObject.current = null;
              };
            }
          }
          function mountImperativeHandle(ref, create, deps) {
            {
              if (typeof create !== "function") {
                error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create !== null ? typeof create : "null");
              }
            }
            var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
            var fiberFlags = Update;
            {
              fiberFlags |= LayoutStatic;
            }
            if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
              fiberFlags |= MountLayoutDev;
            }
            return mountEffectImpl(fiberFlags, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
          }
          function updateImperativeHandle(ref, create, deps) {
            {
              if (typeof create !== "function") {
                error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create !== null ? typeof create : "null");
              }
            }
            var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
            return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
          }
          function mountDebugValue(value, formatterFn) {
          }
          var updateDebugValue = mountDebugValue;
          function mountCallback(callback, deps) {
            var hook = mountWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            hook.memoizedState = [callback, nextDeps];
            return callback;
          }
          function updateCallback(callback, deps) {
            var hook = updateWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            var prevState = hook.memoizedState;
            if (prevState !== null) {
              if (nextDeps !== null) {
                var prevDeps = prevState[1];
                if (areHookInputsEqual(nextDeps, prevDeps)) {
                  return prevState[0];
                }
              }
            }
            hook.memoizedState = [callback, nextDeps];
            return callback;
          }
          function mountMemo(nextCreate, deps) {
            var hook = mountWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            var nextValue = nextCreate();
            hook.memoizedState = [nextValue, nextDeps];
            return nextValue;
          }
          function updateMemo(nextCreate, deps) {
            var hook = updateWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            var prevState = hook.memoizedState;
            if (prevState !== null) {
              if (nextDeps !== null) {
                var prevDeps = prevState[1];
                if (areHookInputsEqual(nextDeps, prevDeps)) {
                  return prevState[0];
                }
              }
            }
            var nextValue = nextCreate();
            hook.memoizedState = [nextValue, nextDeps];
            return nextValue;
          }
          function mountDeferredValue(value) {
            var hook = mountWorkInProgressHook();
            hook.memoizedState = value;
            return value;
          }
          function updateDeferredValue(value) {
            var hook = updateWorkInProgressHook();
            var resolvedCurrentHook = currentHook;
            var prevValue = resolvedCurrentHook.memoizedState;
            return updateDeferredValueImpl(hook, prevValue, value);
          }
          function rerenderDeferredValue(value) {
            var hook = updateWorkInProgressHook();
            if (currentHook === null) {
              hook.memoizedState = value;
              return value;
            } else {
              var prevValue = currentHook.memoizedState;
              return updateDeferredValueImpl(hook, prevValue, value);
            }
          }
          function updateDeferredValueImpl(hook, prevValue, value) {
            var shouldDeferValue = !includesOnlyNonUrgentLanes(renderLanes);
            if (shouldDeferValue) {
              if (!objectIs(value, prevValue)) {
                var deferredLane = claimNextTransitionLane();
                currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, deferredLane);
                markSkippedUpdateLanes(deferredLane);
                hook.baseState = true;
              }
              return prevValue;
            } else {
              if (hook.baseState) {
                hook.baseState = false;
                markWorkInProgressReceivedUpdate();
              }
              hook.memoizedState = value;
              return value;
            }
          }
          function startTransition2(setPending, callback, options2) {
            var previousPriority = getCurrentUpdatePriority();
            setCurrentUpdatePriority(higherEventPriority(previousPriority, ContinuousEventPriority));
            setPending(true);
            var prevTransition = ReactCurrentBatchConfig$2.transition;
            ReactCurrentBatchConfig$2.transition = {};
            var currentTransition = ReactCurrentBatchConfig$2.transition;
            {
              ReactCurrentBatchConfig$2.transition._updatedFibers = /* @__PURE__ */ new Set();
            }
            try {
              setPending(false);
              callback();
            } finally {
              setCurrentUpdatePriority(previousPriority);
              ReactCurrentBatchConfig$2.transition = prevTransition;
              {
                if (prevTransition === null && currentTransition._updatedFibers) {
                  var updatedFibersCount = currentTransition._updatedFibers.size;
                  if (updatedFibersCount > 10) {
                    warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");
                  }
                  currentTransition._updatedFibers.clear();
                }
              }
            }
          }
          function mountTransition() {
            var _mountState = mountState(false), isPending = _mountState[0], setPending = _mountState[1];
            var start = startTransition2.bind(null, setPending);
            var hook = mountWorkInProgressHook();
            hook.memoizedState = start;
            return [isPending, start];
          }
          function updateTransition() {
            var _updateState = updateState(), isPending = _updateState[0];
            var hook = updateWorkInProgressHook();
            var start = hook.memoizedState;
            return [isPending, start];
          }
          function rerenderTransition() {
            var _rerenderState = rerenderState(), isPending = _rerenderState[0];
            var hook = updateWorkInProgressHook();
            var start = hook.memoizedState;
            return [isPending, start];
          }
          var isUpdatingOpaqueValueInRenderPhase = false;
          function getIsUpdatingOpaqueValueInRenderPhaseInDEV() {
            {
              return isUpdatingOpaqueValueInRenderPhase;
            }
          }
          function mountId() {
            var hook = mountWorkInProgressHook();
            var root2 = getWorkInProgressRoot();
            var identifierPrefix = root2.identifierPrefix;
            var id;
            if (getIsHydrating()) {
              var treeId = getTreeId();
              id = ":" + identifierPrefix + "R" + treeId;
              var localId = localIdCounter++;
              if (localId > 0) {
                id += "H" + localId.toString(32);
              }
              id += ":";
            } else {
              var globalClientId = globalClientIdCounter++;
              id = ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":";
            }
            hook.memoizedState = id;
            return id;
          }
          function updateId() {
            var hook = updateWorkInProgressHook();
            var id = hook.memoizedState;
            return id;
          }
          function dispatchReducerAction(fiber, queue, action) {
            {
              if (typeof arguments[3] === "function") {
                error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");
              }
            }
            var lane = requestUpdateLane(fiber);
            var update = {
              lane,
              action,
              hasEagerState: false,
              eagerState: null,
              next: null
            };
            if (isRenderPhaseUpdate(fiber)) {
              enqueueRenderPhaseUpdate(queue, update);
            } else {
              var root2 = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
              if (root2 !== null) {
                var eventTime = requestEventTime();
                scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
                entangleTransitionUpdate(root2, queue, lane);
              }
            }
            markUpdateInDevTools(fiber, lane);
          }
          function dispatchSetState(fiber, queue, action) {
            {
              if (typeof arguments[3] === "function") {
                error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");
              }
            }
            var lane = requestUpdateLane(fiber);
            var update = {
              lane,
              action,
              hasEagerState: false,
              eagerState: null,
              next: null
            };
            if (isRenderPhaseUpdate(fiber)) {
              enqueueRenderPhaseUpdate(queue, update);
            } else {
              var alternate = fiber.alternate;
              if (fiber.lanes === NoLanes && (alternate === null || alternate.lanes === NoLanes)) {
                var lastRenderedReducer = queue.lastRenderedReducer;
                if (lastRenderedReducer !== null) {
                  var prevDispatcher;
                  {
                    prevDispatcher = ReactCurrentDispatcher$1.current;
                    ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                  }
                  try {
                    var currentState = queue.lastRenderedState;
                    var eagerState = lastRenderedReducer(currentState, action);
                    update.hasEagerState = true;
                    update.eagerState = eagerState;
                    if (objectIs(eagerState, currentState)) {
                      enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane);
                      return;
                    }
                  } catch (error2) {
                  } finally {
                    {
                      ReactCurrentDispatcher$1.current = prevDispatcher;
                    }
                  }
                }
              }
              var root2 = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
              if (root2 !== null) {
                var eventTime = requestEventTime();
                scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
                entangleTransitionUpdate(root2, queue, lane);
              }
            }
            markUpdateInDevTools(fiber, lane);
          }
          function isRenderPhaseUpdate(fiber) {
            var alternate = fiber.alternate;
            return fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1;
          }
          function enqueueRenderPhaseUpdate(queue, update) {
            didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
            var pending = queue.pending;
            if (pending === null) {
              update.next = update;
            } else {
              update.next = pending.next;
              pending.next = update;
            }
            queue.pending = update;
          }
          function entangleTransitionUpdate(root2, queue, lane) {
            if (isTransitionLane(lane)) {
              var queueLanes = queue.lanes;
              queueLanes = intersectLanes(queueLanes, root2.pendingLanes);
              var newQueueLanes = mergeLanes(queueLanes, lane);
              queue.lanes = newQueueLanes;
              markRootEntangled(root2, newQueueLanes);
            }
          }
          function markUpdateInDevTools(fiber, lane, action) {
            {
              markStateUpdateScheduled(fiber, lane);
            }
          }
          var ContextOnlyDispatcher = {
            readContext,
            useCallback: throwInvalidHookError,
            useContext: throwInvalidHookError,
            useEffect: throwInvalidHookError,
            useImperativeHandle: throwInvalidHookError,
            useInsertionEffect: throwInvalidHookError,
            useLayoutEffect: throwInvalidHookError,
            useMemo: throwInvalidHookError,
            useReducer: throwInvalidHookError,
            useRef: throwInvalidHookError,
            useState: throwInvalidHookError,
            useDebugValue: throwInvalidHookError,
            useDeferredValue: throwInvalidHookError,
            useTransition: throwInvalidHookError,
            useMutableSource: throwInvalidHookError,
            useSyncExternalStore: throwInvalidHookError,
            useId: throwInvalidHookError,
            unstable_isNewReconciler: enableNewReconciler
          };
          var HooksDispatcherOnMountInDEV = null;
          var HooksDispatcherOnMountWithHookTypesInDEV = null;
          var HooksDispatcherOnUpdateInDEV = null;
          var HooksDispatcherOnRerenderInDEV = null;
          var InvalidNestedHooksDispatcherOnMountInDEV = null;
          var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
          var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
          {
            var warnInvalidContextAccess = function() {
              error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
            };
            var warnInvalidHookAccess = function() {
              error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks");
            };
            HooksDispatcherOnMountInDEV = {
              readContext: function(context) {
                return readContext(context);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                return mountCallback(callback, deps);
              },
              useContext: function(context) {
                currentHookNameInDev = "useContext";
                mountHookTypesDev();
                return readContext(context);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                return mountEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                return mountImperativeHandle(ref, create, deps);
              },
              useInsertionEffect: function(create, deps) {
                currentHookNameInDev = "useInsertionEffect";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                return mountInsertionEffect(create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                return mountLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                mountHookTypesDev();
                return mountRef(initialValue);
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                mountHookTypesDev();
                return mountDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                mountHookTypesDev();
                return mountDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                mountHookTypesDev();
                return mountTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                mountHookTypesDev();
                return mountMutableSource();
              },
              useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
                currentHookNameInDev = "useSyncExternalStore";
                mountHookTypesDev();
                return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
              },
              useId: function() {
                currentHookNameInDev = "useId";
                mountHookTypesDev();
                return mountId();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            HooksDispatcherOnMountWithHookTypesInDEV = {
              readContext: function(context) {
                return readContext(context);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                updateHookTypesDev();
                return mountCallback(callback, deps);
              },
              useContext: function(context) {
                currentHookNameInDev = "useContext";
                updateHookTypesDev();
                return readContext(context);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                updateHookTypesDev();
                return mountEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                updateHookTypesDev();
                return mountImperativeHandle(ref, create, deps);
              },
              useInsertionEffect: function(create, deps) {
                currentHookNameInDev = "useInsertionEffect";
                updateHookTypesDev();
                return mountInsertionEffect(create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                updateHookTypesDev();
                return mountLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                updateHookTypesDev();
                return mountRef(initialValue);
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                updateHookTypesDev();
                return mountDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                updateHookTypesDev();
                return mountDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                updateHookTypesDev();
                return mountTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                updateHookTypesDev();
                return mountMutableSource();
              },
              useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
                currentHookNameInDev = "useSyncExternalStore";
                updateHookTypesDev();
                return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
              },
              useId: function() {
                currentHookNameInDev = "useId";
                updateHookTypesDev();
                return mountId();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            HooksDispatcherOnUpdateInDEV = {
              readContext: function(context) {
                return readContext(context);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                updateHookTypesDev();
                return updateCallback(callback, deps);
              },
              useContext: function(context) {
                currentHookNameInDev = "useContext";
                updateHookTypesDev();
                return readContext(context);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                updateHookTypesDev();
                return updateEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                updateHookTypesDev();
                return updateImperativeHandle(ref, create, deps);
              },
              useInsertionEffect: function(create, deps) {
                currentHookNameInDev = "useInsertionEffect";
                updateHookTypesDev();
                return updateInsertionEffect(create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                updateHookTypesDev();
                return updateLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                updateHookTypesDev();
                return updateRef();
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                updateHookTypesDev();
                return updateDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                updateHookTypesDev();
                return updateDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                updateHookTypesDev();
                return updateTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                updateHookTypesDev();
                return updateMutableSource();
              },
              useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
                currentHookNameInDev = "useSyncExternalStore";
                updateHookTypesDev();
                return updateSyncExternalStore(subscribe, getSnapshot);
              },
              useId: function() {
                currentHookNameInDev = "useId";
                updateHookTypesDev();
                return updateId();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            HooksDispatcherOnRerenderInDEV = {
              readContext: function(context) {
                return readContext(context);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                updateHookTypesDev();
                return updateCallback(callback, deps);
              },
              useContext: function(context) {
                currentHookNameInDev = "useContext";
                updateHookTypesDev();
                return readContext(context);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                updateHookTypesDev();
                return updateEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                updateHookTypesDev();
                return updateImperativeHandle(ref, create, deps);
              },
              useInsertionEffect: function(create, deps) {
                currentHookNameInDev = "useInsertionEffect";
                updateHookTypesDev();
                return updateInsertionEffect(create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                updateHookTypesDev();
                return updateLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
                try {
                  return updateMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
                try {
                  return rerenderReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                updateHookTypesDev();
                return updateRef();
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
                try {
                  return rerenderState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                updateHookTypesDev();
                return updateDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                updateHookTypesDev();
                return rerenderDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                updateHookTypesDev();
                return rerenderTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                updateHookTypesDev();
                return updateMutableSource();
              },
              useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
                currentHookNameInDev = "useSyncExternalStore";
                updateHookTypesDev();
                return updateSyncExternalStore(subscribe, getSnapshot);
              },
              useId: function() {
                currentHookNameInDev = "useId";
                updateHookTypesDev();
                return updateId();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            InvalidNestedHooksDispatcherOnMountInDEV = {
              readContext: function(context) {
                warnInvalidContextAccess();
                return readContext(context);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountCallback(callback, deps);
              },
              useContext: function(context) {
                currentHookNameInDev = "useContext";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return readContext(context);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountImperativeHandle(ref, create, deps);
              },
              useInsertionEffect: function(create, deps) {
                currentHookNameInDev = "useInsertionEffect";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountInsertionEffect(create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                warnInvalidHookAccess();
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                warnInvalidHookAccess();
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountRef(initialValue);
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                warnInvalidHookAccess();
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountMutableSource();
              },
              useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
                currentHookNameInDev = "useSyncExternalStore";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
              },
              useId: function() {
                currentHookNameInDev = "useId";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountId();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            InvalidNestedHooksDispatcherOnUpdateInDEV = {
              readContext: function(context) {
                warnInvalidContextAccess();
                return readContext(context);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateCallback(callback, deps);
              },
              useContext: function(context) {
                currentHookNameInDev = "useContext";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return readContext(context);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateImperativeHandle(ref, create, deps);
              },
              useInsertionEffect: function(create, deps) {
                currentHookNameInDev = "useInsertionEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateInsertionEffect(create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateRef();
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateMutableSource();
              },
              useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
                currentHookNameInDev = "useSyncExternalStore";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateSyncExternalStore(subscribe, getSnapshot);
              },
              useId: function() {
                currentHookNameInDev = "useId";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateId();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            InvalidNestedHooksDispatcherOnRerenderInDEV = {
              readContext: function(context) {
                warnInvalidContextAccess();
                return readContext(context);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateCallback(callback, deps);
              },
              useContext: function(context) {
                currentHookNameInDev = "useContext";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return readContext(context);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateImperativeHandle(ref, create, deps);
              },
              useInsertionEffect: function(create, deps) {
                currentHookNameInDev = "useInsertionEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateInsertionEffect(create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return rerenderReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateRef();
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return rerenderState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return rerenderDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return rerenderTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateMutableSource();
              },
              useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
                currentHookNameInDev = "useSyncExternalStore";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateSyncExternalStore(subscribe, getSnapshot);
              },
              useId: function() {
                currentHookNameInDev = "useId";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateId();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
          }
          var now$1 = Scheduler.unstable_now;
          var commitTime = 0;
          var layoutEffectStartTime = -1;
          var profilerStartTime = -1;
          var passiveEffectStartTime = -1;
          var currentUpdateIsNested = false;
          var nestedUpdateScheduled = false;
          function isCurrentUpdateNested() {
            return currentUpdateIsNested;
          }
          function markNestedUpdateScheduled() {
            {
              nestedUpdateScheduled = true;
            }
          }
          function resetNestedUpdateFlag() {
            {
              currentUpdateIsNested = false;
              nestedUpdateScheduled = false;
            }
          }
          function syncNestedUpdateFlag() {
            {
              currentUpdateIsNested = nestedUpdateScheduled;
              nestedUpdateScheduled = false;
            }
          }
          function getCommitTime() {
            return commitTime;
          }
          function recordCommitTime() {
            commitTime = now$1();
          }
          function startProfilerTimer(fiber) {
            profilerStartTime = now$1();
            if (fiber.actualStartTime < 0) {
              fiber.actualStartTime = now$1();
            }
          }
          function stopProfilerTimerIfRunning(fiber) {
            profilerStartTime = -1;
          }
          function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {
            if (profilerStartTime >= 0) {
              var elapsedTime = now$1() - profilerStartTime;
              fiber.actualDuration += elapsedTime;
              if (overrideBaseTime) {
                fiber.selfBaseDuration = elapsedTime;
              }
              profilerStartTime = -1;
            }
          }
          function recordLayoutEffectDuration(fiber) {
            if (layoutEffectStartTime >= 0) {
              var elapsedTime = now$1() - layoutEffectStartTime;
              layoutEffectStartTime = -1;
              var parentFiber = fiber.return;
              while (parentFiber !== null) {
                switch (parentFiber.tag) {
                  case HostRoot:
                    var root2 = parentFiber.stateNode;
                    root2.effectDuration += elapsedTime;
                    return;
                  case Profiler2:
                    var parentStateNode = parentFiber.stateNode;
                    parentStateNode.effectDuration += elapsedTime;
                    return;
                }
                parentFiber = parentFiber.return;
              }
            }
          }
          function recordPassiveEffectDuration(fiber) {
            if (passiveEffectStartTime >= 0) {
              var elapsedTime = now$1() - passiveEffectStartTime;
              passiveEffectStartTime = -1;
              var parentFiber = fiber.return;
              while (parentFiber !== null) {
                switch (parentFiber.tag) {
                  case HostRoot:
                    var root2 = parentFiber.stateNode;
                    if (root2 !== null) {
                      root2.passiveEffectDuration += elapsedTime;
                    }
                    return;
                  case Profiler2:
                    var parentStateNode = parentFiber.stateNode;
                    if (parentStateNode !== null) {
                      parentStateNode.passiveEffectDuration += elapsedTime;
                    }
                    return;
                }
                parentFiber = parentFiber.return;
              }
            }
          }
          function startLayoutEffectTimer() {
            layoutEffectStartTime = now$1();
          }
          function startPassiveEffectTimer() {
            passiveEffectStartTime = now$1();
          }
          function transferActualDuration(fiber) {
            var child = fiber.child;
            while (child) {
              fiber.actualDuration += child.actualDuration;
              child = child.sibling;
            }
          }
          function resolveDefaultProps(Component2, baseProps) {
            if (Component2 && Component2.defaultProps) {
              var props = assign({}, baseProps);
              var defaultProps = Component2.defaultProps;
              for (var propName in defaultProps) {
                if (props[propName] === void 0) {
                  props[propName] = defaultProps[propName];
                }
              }
              return props;
            }
            return baseProps;
          }
          var fakeInternalInstance = {};
          var didWarnAboutStateAssignmentForComponent;
          var didWarnAboutUninitializedState;
          var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
          var didWarnAboutLegacyLifecyclesAndDerivedState;
          var didWarnAboutUndefinedDerivedState;
          var warnOnUndefinedDerivedState;
          var warnOnInvalidCallback;
          var didWarnAboutDirectlyAssigningPropsToState;
          var didWarnAboutContextTypeAndContextTypes;
          var didWarnAboutInvalidateContextType;
          var didWarnAboutLegacyContext$1;
          {
            didWarnAboutStateAssignmentForComponent = /* @__PURE__ */ new Set();
            didWarnAboutUninitializedState = /* @__PURE__ */ new Set();
            didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = /* @__PURE__ */ new Set();
            didWarnAboutLegacyLifecyclesAndDerivedState = /* @__PURE__ */ new Set();
            didWarnAboutDirectlyAssigningPropsToState = /* @__PURE__ */ new Set();
            didWarnAboutUndefinedDerivedState = /* @__PURE__ */ new Set();
            didWarnAboutContextTypeAndContextTypes = /* @__PURE__ */ new Set();
            didWarnAboutInvalidateContextType = /* @__PURE__ */ new Set();
            didWarnAboutLegacyContext$1 = /* @__PURE__ */ new Set();
            var didWarnOnInvalidCallback = /* @__PURE__ */ new Set();
            warnOnInvalidCallback = function(callback, callerName) {
              if (callback === null || typeof callback === "function") {
                return;
              }
              var key2 = callerName + "_" + callback;
              if (!didWarnOnInvalidCallback.has(key2)) {
                didWarnOnInvalidCallback.add(key2);
                error("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callerName, callback);
              }
            };
            warnOnUndefinedDerivedState = function(type, partialState) {
              if (partialState === void 0) {
                var componentName = getComponentNameFromType(type) || "Component";
                if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
                  didWarnAboutUndefinedDerivedState.add(componentName);
                  error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", componentName);
                }
              }
            };
            Object.defineProperty(fakeInternalInstance, "_processChildContext", {
              enumerable: false,
              value: function() {
                throw new Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).");
              }
            });
            Object.freeze(fakeInternalInstance);
          }
          function applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, nextProps) {
            var prevState = workInProgress2.memoizedState;
            var partialState = getDerivedStateFromProps(nextProps, prevState);
            {
              if (workInProgress2.mode & StrictLegacyMode) {
                setIsStrictModeForDevtools(true);
                try {
                  partialState = getDerivedStateFromProps(nextProps, prevState);
                } finally {
                  setIsStrictModeForDevtools(false);
                }
              }
              warnOnUndefinedDerivedState(ctor, partialState);
            }
            var memoizedState = partialState === null || partialState === void 0 ? prevState : assign({}, prevState, partialState);
            workInProgress2.memoizedState = memoizedState;
            if (workInProgress2.lanes === NoLanes) {
              var updateQueue = workInProgress2.updateQueue;
              updateQueue.baseState = memoizedState;
            }
          }
          var classComponentUpdater = {
            isMounted,
            enqueueSetState: function(inst, payload, callback) {
              var fiber = get(inst);
              var eventTime = requestEventTime();
              var lane = requestUpdateLane(fiber);
              var update = createUpdate(eventTime, lane);
              update.payload = payload;
              if (callback !== void 0 && callback !== null) {
                {
                  warnOnInvalidCallback(callback, "setState");
                }
                update.callback = callback;
              }
              var root2 = enqueueUpdate(fiber, update, lane);
              if (root2 !== null) {
                scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
                entangleTransitions(root2, fiber, lane);
              }
              {
                markStateUpdateScheduled(fiber, lane);
              }
            },
            enqueueReplaceState: function(inst, payload, callback) {
              var fiber = get(inst);
              var eventTime = requestEventTime();
              var lane = requestUpdateLane(fiber);
              var update = createUpdate(eventTime, lane);
              update.tag = ReplaceState;
              update.payload = payload;
              if (callback !== void 0 && callback !== null) {
                {
                  warnOnInvalidCallback(callback, "replaceState");
                }
                update.callback = callback;
              }
              var root2 = enqueueUpdate(fiber, update, lane);
              if (root2 !== null) {
                scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
                entangleTransitions(root2, fiber, lane);
              }
              {
                markStateUpdateScheduled(fiber, lane);
              }
            },
            enqueueForceUpdate: function(inst, callback) {
              var fiber = get(inst);
              var eventTime = requestEventTime();
              var lane = requestUpdateLane(fiber);
              var update = createUpdate(eventTime, lane);
              update.tag = ForceUpdate;
              if (callback !== void 0 && callback !== null) {
                {
                  warnOnInvalidCallback(callback, "forceUpdate");
                }
                update.callback = callback;
              }
              var root2 = enqueueUpdate(fiber, update, lane);
              if (root2 !== null) {
                scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
                entangleTransitions(root2, fiber, lane);
              }
              {
                markForceUpdateScheduled(fiber, lane);
              }
            }
          };
          function checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) {
            var instance = workInProgress2.stateNode;
            if (typeof instance.shouldComponentUpdate === "function") {
              var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
              {
                if (workInProgress2.mode & StrictLegacyMode) {
                  setIsStrictModeForDevtools(true);
                  try {
                    shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
                  } finally {
                    setIsStrictModeForDevtools(false);
                  }
                }
                if (shouldUpdate === void 0) {
                  error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", getComponentNameFromType(ctor) || "Component");
                }
              }
              return shouldUpdate;
            }
            if (ctor.prototype && ctor.prototype.isPureReactComponent) {
              return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
            }
            return true;
          }
          function checkClassInstance(workInProgress2, ctor, newProps) {
            var instance = workInProgress2.stateNode;
            {
              var name = getComponentNameFromType(ctor) || "Component";
              var renderPresent = instance.render;
              if (!renderPresent) {
                if (ctor.prototype && typeof ctor.prototype.render === "function") {
                  error("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?", name);
                } else {
                  error("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.", name);
                }
              }
              if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) {
                error("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", name);
              }
              if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) {
                error("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", name);
              }
              if (instance.propTypes) {
                error("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", name);
              }
              if (instance.contextType) {
                error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.", name);
              }
              {
                if (ctor.childContextTypes && !didWarnAboutLegacyContext$1.has(ctor) && (workInProgress2.mode & StrictLegacyMode) === NoMode) {
                  didWarnAboutLegacyContext$1.add(ctor);
                  error("%s uses the legacy childContextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() instead\n\n.Learn more about this warning here: https://reactjs.org/link/legacy-context", name);
                }
                if (ctor.contextTypes && !didWarnAboutLegacyContext$1.has(ctor) && (workInProgress2.mode & StrictLegacyMode) === NoMode) {
                  didWarnAboutLegacyContext$1.add(ctor);
                  error("%s uses the legacy contextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() with static contextType instead.\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context", name);
                }
                if (instance.contextTypes) {
                  error("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", name);
                }
                if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {
                  didWarnAboutContextTypeAndContextTypes.add(ctor);
                  error("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", name);
                }
              }
              if (typeof instance.componentShouldUpdate === "function") {
                error("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", name);
              }
              if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== "undefined") {
                error("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", getComponentNameFromType(ctor) || "A pure component");
              }
              if (typeof instance.componentDidUnmount === "function") {
                error("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", name);
              }
              if (typeof instance.componentDidReceiveProps === "function") {
                error("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", name);
              }
              if (typeof instance.componentWillRecieveProps === "function") {
                error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", name);
              }
              if (typeof instance.UNSAFE_componentWillRecieveProps === "function") {
                error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", name);
              }
              var hasMutatedProps = instance.props !== newProps;
              if (instance.props !== void 0 && hasMutatedProps) {
                error("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", name, name);
              }
              if (instance.defaultProps) {
                error("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", name, name);
              }
              if (typeof instance.getSnapshotBeforeUpdate === "function" && typeof instance.componentDidUpdate !== "function" && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {
                didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);
                error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", getComponentNameFromType(ctor));
              }
              if (typeof instance.getDerivedStateFromProps === "function") {
                error("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name);
              }
              if (typeof instance.getDerivedStateFromError === "function") {
                error("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name);
              }
              if (typeof ctor.getSnapshotBeforeUpdate === "function") {
                error("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", name);
              }
              var _state = instance.state;
              if (_state && (typeof _state !== "object" || isArray(_state))) {
                error("%s.state: must be set to an object or null", name);
              }
              if (typeof instance.getChildContext === "function" && typeof ctor.childContextTypes !== "object") {
                error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", name);
              }
            }
          }
          function adoptClassInstance(workInProgress2, instance) {
            instance.updater = classComponentUpdater;
            workInProgress2.stateNode = instance;
            set(instance, workInProgress2);
            {
              instance._reactInternalInstance = fakeInternalInstance;
            }
          }
          function constructClassInstance(workInProgress2, ctor, props) {
            var isLegacyContextConsumer = false;
            var unmaskedContext = emptyContextObject;
            var context = emptyContextObject;
            var contextType = ctor.contextType;
            {
              if ("contextType" in ctor) {
                var isValid = contextType === null || contextType !== void 0 && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === void 0;
                if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {
                  didWarnAboutInvalidateContextType.add(ctor);
                  var addendum = "";
                  if (contextType === void 0) {
                    addendum = " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.";
                  } else if (typeof contextType !== "object") {
                    addendum = " However, it is set to a " + typeof contextType + ".";
                  } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
                    addendum = " Did you accidentally pass the Context.Provider instead?";
                  } else if (contextType._context !== void 0) {
                    addendum = " Did you accidentally pass the Context.Consumer instead?";
                  } else {
                    addendum = " However, it is set to an object with keys {" + Object.keys(contextType).join(", ") + "}.";
                  }
                  error("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", getComponentNameFromType(ctor) || "Component", addendum);
                }
              }
            }
            if (typeof contextType === "object" && contextType !== null) {
              context = readContext(contextType);
            } else {
              unmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
              var contextTypes = ctor.contextTypes;
              isLegacyContextConsumer = contextTypes !== null && contextTypes !== void 0;
              context = isLegacyContextConsumer ? getMaskedContext(workInProgress2, unmaskedContext) : emptyContextObject;
            }
            var instance = new ctor(props, context);
            {
              if (workInProgress2.mode & StrictLegacyMode) {
                setIsStrictModeForDevtools(true);
                try {
                  instance = new ctor(props, context);
                } finally {
                  setIsStrictModeForDevtools(false);
                }
              }
            }
            var state = workInProgress2.memoizedState = instance.state !== null && instance.state !== void 0 ? instance.state : null;
            adoptClassInstance(workInProgress2, instance);
            {
              if (typeof ctor.getDerivedStateFromProps === "function" && state === null) {
                var componentName = getComponentNameFromType(ctor) || "Component";
                if (!didWarnAboutUninitializedState.has(componentName)) {
                  didWarnAboutUninitializedState.add(componentName);
                  error("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", componentName, instance.state === null ? "null" : "undefined", componentName);
                }
              }
              if (typeof ctor.getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function") {
                var foundWillMountName = null;
                var foundWillReceivePropsName = null;
                var foundWillUpdateName = null;
                if (typeof instance.componentWillMount === "function" && instance.componentWillMount.__suppressDeprecationWarning !== true) {
                  foundWillMountName = "componentWillMount";
                } else if (typeof instance.UNSAFE_componentWillMount === "function") {
                  foundWillMountName = "UNSAFE_componentWillMount";
                }
                if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
                  foundWillReceivePropsName = "componentWillReceiveProps";
                } else if (typeof instance.UNSAFE_componentWillReceiveProps === "function") {
                  foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps";
                }
                if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
                  foundWillUpdateName = "componentWillUpdate";
                } else if (typeof instance.UNSAFE_componentWillUpdate === "function") {
                  foundWillUpdateName = "UNSAFE_componentWillUpdate";
                }
                if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
                  var _componentName = getComponentNameFromType(ctor) || "Component";
                  var newApiName = typeof ctor.getDerivedStateFromProps === "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
                  if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {
                    didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);
                    error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://reactjs.org/link/unsafe-component-lifecycles", _componentName, newApiName, foundWillMountName !== null ? "\n  " + foundWillMountName : "", foundWillReceivePropsName !== null ? "\n  " + foundWillReceivePropsName : "", foundWillUpdateName !== null ? "\n  " + foundWillUpdateName : "");
                  }
                }
              }
            }
            if (isLegacyContextConsumer) {
              cacheContext(workInProgress2, unmaskedContext, context);
            }
            return instance;
          }
          function callComponentWillMount(workInProgress2, instance) {
            var oldState = instance.state;
            if (typeof instance.componentWillMount === "function") {
              instance.componentWillMount();
            }
            if (typeof instance.UNSAFE_componentWillMount === "function") {
              instance.UNSAFE_componentWillMount();
            }
            if (oldState !== instance.state) {
              {
                error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", getComponentNameFromFiber(workInProgress2) || "Component");
              }
              classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
            }
          }
          function callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext) {
            var oldState = instance.state;
            if (typeof instance.componentWillReceiveProps === "function") {
              instance.componentWillReceiveProps(newProps, nextContext);
            }
            if (typeof instance.UNSAFE_componentWillReceiveProps === "function") {
              instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
            }
            if (instance.state !== oldState) {
              {
                var componentName = getComponentNameFromFiber(workInProgress2) || "Component";
                if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {
                  didWarnAboutStateAssignmentForComponent.add(componentName);
                  error("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", componentName);
                }
              }
              classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
            }
          }
          function mountClassInstance(workInProgress2, ctor, newProps, renderLanes2) {
            {
              checkClassInstance(workInProgress2, ctor, newProps);
            }
            var instance = workInProgress2.stateNode;
            instance.props = newProps;
            instance.state = workInProgress2.memoizedState;
            instance.refs = {};
            initializeUpdateQueue(workInProgress2);
            var contextType = ctor.contextType;
            if (typeof contextType === "object" && contextType !== null) {
              instance.context = readContext(contextType);
            } else {
              var unmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
              instance.context = getMaskedContext(workInProgress2, unmaskedContext);
            }
            {
              if (instance.state === newProps) {
                var componentName = getComponentNameFromType(ctor) || "Component";
                if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {
                  didWarnAboutDirectlyAssigningPropsToState.add(componentName);
                  error("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", componentName);
                }
              }
              if (workInProgress2.mode & StrictLegacyMode) {
                ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, instance);
              }
              {
                ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress2, instance);
              }
            }
            instance.state = workInProgress2.memoizedState;
            var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
            if (typeof getDerivedStateFromProps === "function") {
              applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
              instance.state = workInProgress2.memoizedState;
            }
            if (typeof ctor.getDerivedStateFromProps !== "function" && typeof instance.getSnapshotBeforeUpdate !== "function" && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) {
              callComponentWillMount(workInProgress2, instance);
              processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
              instance.state = workInProgress2.memoizedState;
            }
            if (typeof instance.componentDidMount === "function") {
              var fiberFlags = Update;
              {
                fiberFlags |= LayoutStatic;
              }
              if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
                fiberFlags |= MountLayoutDev;
              }
              workInProgress2.flags |= fiberFlags;
            }
          }
          function resumeMountClassInstance(workInProgress2, ctor, newProps, renderLanes2) {
            var instance = workInProgress2.stateNode;
            var oldProps = workInProgress2.memoizedProps;
            instance.props = oldProps;
            var oldContext = instance.context;
            var contextType = ctor.contextType;
            var nextContext = emptyContextObject;
            if (typeof contextType === "object" && contextType !== null) {
              nextContext = readContext(contextType);
            } else {
              var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
              nextContext = getMaskedContext(workInProgress2, nextLegacyUnmaskedContext);
            }
            var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
            var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function";
            if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) {
              if (oldProps !== newProps || oldContext !== nextContext) {
                callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext);
              }
            }
            resetHasForceUpdateBeforeProcessing();
            var oldState = workInProgress2.memoizedState;
            var newState = instance.state = oldState;
            processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
            newState = workInProgress2.memoizedState;
            if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
              if (typeof instance.componentDidMount === "function") {
                var fiberFlags = Update;
                {
                  fiberFlags |= LayoutStatic;
                }
                if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
                  fiberFlags |= MountLayoutDev;
                }
                workInProgress2.flags |= fiberFlags;
              }
              return false;
            }
            if (typeof getDerivedStateFromProps === "function") {
              applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
              newState = workInProgress2.memoizedState;
            }
            var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext);
            if (shouldUpdate) {
              if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) {
                if (typeof instance.componentWillMount === "function") {
                  instance.componentWillMount();
                }
                if (typeof instance.UNSAFE_componentWillMount === "function") {
                  instance.UNSAFE_componentWillMount();
                }
              }
              if (typeof instance.componentDidMount === "function") {
                var _fiberFlags = Update;
                {
                  _fiberFlags |= LayoutStatic;
                }
                if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
                  _fiberFlags |= MountLayoutDev;
                }
                workInProgress2.flags |= _fiberFlags;
              }
            } else {
              if (typeof instance.componentDidMount === "function") {
                var _fiberFlags2 = Update;
                {
                  _fiberFlags2 |= LayoutStatic;
                }
                if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
                  _fiberFlags2 |= MountLayoutDev;
                }
                workInProgress2.flags |= _fiberFlags2;
              }
              workInProgress2.memoizedProps = newProps;
              workInProgress2.memoizedState = newState;
            }
            instance.props = newProps;
            instance.state = newState;
            instance.context = nextContext;
            return shouldUpdate;
          }
          function updateClassInstance(current2, workInProgress2, ctor, newProps, renderLanes2) {
            var instance = workInProgress2.stateNode;
            cloneUpdateQueue(current2, workInProgress2);
            var unresolvedOldProps = workInProgress2.memoizedProps;
            var oldProps = workInProgress2.type === workInProgress2.elementType ? unresolvedOldProps : resolveDefaultProps(workInProgress2.type, unresolvedOldProps);
            instance.props = oldProps;
            var unresolvedNewProps = workInProgress2.pendingProps;
            var oldContext = instance.context;
            var contextType = ctor.contextType;
            var nextContext = emptyContextObject;
            if (typeof contextType === "object" && contextType !== null) {
              nextContext = readContext(contextType);
            } else {
              var nextUnmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
              nextContext = getMaskedContext(workInProgress2, nextUnmaskedContext);
            }
            var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
            var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function";
            if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) {
              if (unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext) {
                callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext);
              }
            }
            resetHasForceUpdateBeforeProcessing();
            var oldState = workInProgress2.memoizedState;
            var newState = instance.state = oldState;
            processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
            newState = workInProgress2.memoizedState;
            if (unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing() && !enableLazyContextPropagation) {
              if (typeof instance.componentDidUpdate === "function") {
                if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
                  workInProgress2.flags |= Update;
                }
              }
              if (typeof instance.getSnapshotBeforeUpdate === "function") {
                if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
                  workInProgress2.flags |= Snapshot;
                }
              }
              return false;
            }
            if (typeof getDerivedStateFromProps === "function") {
              applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
              newState = workInProgress2.memoizedState;
            }
            var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) || enableLazyContextPropagation;
            if (shouldUpdate) {
              if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === "function" || typeof instance.componentWillUpdate === "function")) {
                if (typeof instance.componentWillUpdate === "function") {
                  instance.componentWillUpdate(newProps, newState, nextContext);
                }
                if (typeof instance.UNSAFE_componentWillUpdate === "function") {
                  instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
                }
              }
              if (typeof instance.componentDidUpdate === "function") {
                workInProgress2.flags |= Update;
              }
              if (typeof instance.getSnapshotBeforeUpdate === "function") {
                workInProgress2.flags |= Snapshot;
              }
            } else {
              if (typeof instance.componentDidUpdate === "function") {
                if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
                  workInProgress2.flags |= Update;
                }
              }
              if (typeof instance.getSnapshotBeforeUpdate === "function") {
                if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
                  workInProgress2.flags |= Snapshot;
                }
              }
              workInProgress2.memoizedProps = newProps;
              workInProgress2.memoizedState = newState;
            }
            instance.props = newProps;
            instance.state = newState;
            instance.context = nextContext;
            return shouldUpdate;
          }
          function createCapturedValueAtFiber(value, source) {
            return {
              value,
              source,
              stack: getStackByFiberInDevAndProd(source),
              digest: null
            };
          }
          function createCapturedValue(value, digest, stack) {
            return {
              value,
              source: null,
              stack: stack != null ? stack : null,
              digest: digest != null ? digest : null
            };
          }
          function showErrorDialog(boundary, errorInfo) {
            return true;
          }
          function logCapturedError(boundary, errorInfo) {
            try {
              var logError = showErrorDialog(boundary, errorInfo);
              if (logError === false) {
                return;
              }
              var error2 = errorInfo.value;
              if (true) {
                var source = errorInfo.source;
                var stack = errorInfo.stack;
                var componentStack = stack !== null ? stack : "";
                if (error2 != null && error2._suppressLogging) {
                  if (boundary.tag === ClassComponent) {
                    return;
                  }
                  console["error"](error2);
                }
                var componentName = source ? getComponentNameFromFiber(source) : null;
                var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : "The above error occurred in one of your React components:";
                var errorBoundaryMessage;
                if (boundary.tag === HostRoot) {
                  errorBoundaryMessage = "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://reactjs.org/link/error-boundaries to learn more about error boundaries.";
                } else {
                  var errorBoundaryName = getComponentNameFromFiber(boundary) || "Anonymous";
                  errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + ".");
                }
                var combinedMessage = componentNameMessage + "\n" + componentStack + "\n\n" + ("" + errorBoundaryMessage);
                console["error"](combinedMessage);
              } else {
                console["error"](error2);
              }
            } catch (e) {
              setTimeout(function() {
                throw e;
              });
            }
          }
          var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map;
          function createRootErrorUpdate(fiber, errorInfo, lane) {
            var update = createUpdate(NoTimestamp, lane);
            update.tag = CaptureUpdate;
            update.payload = {
              element: null
            };
            var error2 = errorInfo.value;
            update.callback = function() {
              onUncaughtError(error2);
              logCapturedError(fiber, errorInfo);
            };
            return update;
          }
          function createClassErrorUpdate(fiber, errorInfo, lane) {
            var update = createUpdate(NoTimestamp, lane);
            update.tag = CaptureUpdate;
            var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
            if (typeof getDerivedStateFromError === "function") {
              var error$1 = errorInfo.value;
              update.payload = function() {
                return getDerivedStateFromError(error$1);
              };
              update.callback = function() {
                {
                  markFailedErrorBoundaryForHotReloading(fiber);
                }
                logCapturedError(fiber, errorInfo);
              };
            }
            var inst = fiber.stateNode;
            if (inst !== null && typeof inst.componentDidCatch === "function") {
              update.callback = function callback() {
                {
                  markFailedErrorBoundaryForHotReloading(fiber);
                }
                logCapturedError(fiber, errorInfo);
                if (typeof getDerivedStateFromError !== "function") {
                  markLegacyErrorBoundaryAsFailed(this);
                }
                var error$12 = errorInfo.value;
                var stack = errorInfo.stack;
                this.componentDidCatch(error$12, {
                  componentStack: stack !== null ? stack : ""
                });
                {
                  if (typeof getDerivedStateFromError !== "function") {
                    if (!includesSomeLane(fiber.lanes, SyncLane)) {
                      error("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", getComponentNameFromFiber(fiber) || "Unknown");
                    }
                  }
                }
              };
            }
            return update;
          }
          function attachPingListener(root2, wakeable, lanes) {
            var pingCache = root2.pingCache;
            var threadIDs;
            if (pingCache === null) {
              pingCache = root2.pingCache = new PossiblyWeakMap$1();
              threadIDs = /* @__PURE__ */ new Set();
              pingCache.set(wakeable, threadIDs);
            } else {
              threadIDs = pingCache.get(wakeable);
              if (threadIDs === void 0) {
                threadIDs = /* @__PURE__ */ new Set();
                pingCache.set(wakeable, threadIDs);
              }
            }
            if (!threadIDs.has(lanes)) {
              threadIDs.add(lanes);
              var ping = pingSuspendedRoot.bind(null, root2, wakeable, lanes);
              {
                if (isDevToolsPresent) {
                  restorePendingUpdaters(root2, lanes);
                }
              }
              wakeable.then(ping, ping);
            }
          }
          function attachRetryListener(suspenseBoundary, root2, wakeable, lanes) {
            var wakeables = suspenseBoundary.updateQueue;
            if (wakeables === null) {
              var updateQueue = /* @__PURE__ */ new Set();
              updateQueue.add(wakeable);
              suspenseBoundary.updateQueue = updateQueue;
            } else {
              wakeables.add(wakeable);
            }
          }
          function resetSuspendedComponent(sourceFiber, rootRenderLanes) {
            var tag = sourceFiber.tag;
            if ((sourceFiber.mode & ConcurrentMode) === NoMode && (tag === FunctionComponent || tag === ForwardRef || tag === SimpleMemoComponent)) {
              var currentSource = sourceFiber.alternate;
              if (currentSource) {
                sourceFiber.updateQueue = currentSource.updateQueue;
                sourceFiber.memoizedState = currentSource.memoizedState;
                sourceFiber.lanes = currentSource.lanes;
              } else {
                sourceFiber.updateQueue = null;
                sourceFiber.memoizedState = null;
              }
            }
          }
          function getNearestSuspenseBoundaryToCapture(returnFiber) {
            var node = returnFiber;
            do {
              if (node.tag === SuspenseComponent && shouldCaptureSuspense(node)) {
                return node;
              }
              node = node.return;
            } while (node !== null);
            return null;
          }
          function markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root2, rootRenderLanes) {
            if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) {
              if (suspenseBoundary === returnFiber) {
                suspenseBoundary.flags |= ShouldCapture;
              } else {
                suspenseBoundary.flags |= DidCapture;
                sourceFiber.flags |= ForceUpdateForLegacySuspense;
                sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);
                if (sourceFiber.tag === ClassComponent) {
                  var currentSourceFiber = sourceFiber.alternate;
                  if (currentSourceFiber === null) {
                    sourceFiber.tag = IncompleteClassComponent;
                  } else {
                    var update = createUpdate(NoTimestamp, SyncLane);
                    update.tag = ForceUpdate;
                    enqueueUpdate(sourceFiber, update, SyncLane);
                  }
                }
                sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane);
              }
              return suspenseBoundary;
            }
            suspenseBoundary.flags |= ShouldCapture;
            suspenseBoundary.lanes = rootRenderLanes;
            return suspenseBoundary;
          }
          function throwException(root2, returnFiber, sourceFiber, value, rootRenderLanes) {
            sourceFiber.flags |= Incomplete;
            {
              if (isDevToolsPresent) {
                restorePendingUpdaters(root2, rootRenderLanes);
              }
            }
            if (value !== null && typeof value === "object" && typeof value.then === "function") {
              var wakeable = value;
              resetSuspendedComponent(sourceFiber);
              {
                if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) {
                  markDidThrowWhileHydratingDEV();
                }
              }
              var suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber);
              if (suspenseBoundary !== null) {
                suspenseBoundary.flags &= ~ForceClientRender;
                markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root2, rootRenderLanes);
                if (suspenseBoundary.mode & ConcurrentMode) {
                  attachPingListener(root2, wakeable, rootRenderLanes);
                }
                attachRetryListener(suspenseBoundary, root2, wakeable);
                return;
              } else {
                if (!includesSyncLane(rootRenderLanes)) {
                  attachPingListener(root2, wakeable, rootRenderLanes);
                  renderDidSuspendDelayIfPossible();
                  return;
                }
                var uncaughtSuspenseError = new Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.");
                value = uncaughtSuspenseError;
              }
            } else {
              if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) {
                markDidThrowWhileHydratingDEV();
                var _suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber);
                if (_suspenseBoundary !== null) {
                  if ((_suspenseBoundary.flags & ShouldCapture) === NoFlags) {
                    _suspenseBoundary.flags |= ForceClientRender;
                  }
                  markSuspenseBoundaryShouldCapture(_suspenseBoundary, returnFiber, sourceFiber, root2, rootRenderLanes);
                  queueHydrationError(createCapturedValueAtFiber(value, sourceFiber));
                  return;
                }
              }
            }
            value = createCapturedValueAtFiber(value, sourceFiber);
            renderDidError(value);
            var workInProgress2 = returnFiber;
            do {
              switch (workInProgress2.tag) {
                case HostRoot: {
                  var _errorInfo = value;
                  workInProgress2.flags |= ShouldCapture;
                  var lane = pickArbitraryLane(rootRenderLanes);
                  workInProgress2.lanes = mergeLanes(workInProgress2.lanes, lane);
                  var update = createRootErrorUpdate(workInProgress2, _errorInfo, lane);
                  enqueueCapturedUpdate(workInProgress2, update);
                  return;
                }
                case ClassComponent:
                  var errorInfo = value;
                  var ctor = workInProgress2.type;
                  var instance = workInProgress2.stateNode;
                  if ((workInProgress2.flags & DidCapture) === NoFlags && (typeof ctor.getDerivedStateFromError === "function" || instance !== null && typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance))) {
                    workInProgress2.flags |= ShouldCapture;
                    var _lane = pickArbitraryLane(rootRenderLanes);
                    workInProgress2.lanes = mergeLanes(workInProgress2.lanes, _lane);
                    var _update = createClassErrorUpdate(workInProgress2, errorInfo, _lane);
                    enqueueCapturedUpdate(workInProgress2, _update);
                    return;
                  }
                  break;
              }
              workInProgress2 = workInProgress2.return;
            } while (workInProgress2 !== null);
          }
          function getSuspendedCache() {
            {
              return null;
            }
          }
          var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
          var didReceiveUpdate = false;
          var didWarnAboutBadClass;
          var didWarnAboutModulePatternComponent;
          var didWarnAboutContextTypeOnFunctionComponent;
          var didWarnAboutGetDerivedStateOnFunctionComponent;
          var didWarnAboutFunctionRefs;
          var didWarnAboutReassigningProps;
          var didWarnAboutRevealOrder;
          var didWarnAboutTailOptions;
          var didWarnAboutDefaultPropsOnFunctionComponent;
          {
            didWarnAboutBadClass = {};
            didWarnAboutModulePatternComponent = {};
            didWarnAboutContextTypeOnFunctionComponent = {};
            didWarnAboutGetDerivedStateOnFunctionComponent = {};
            didWarnAboutFunctionRefs = {};
            didWarnAboutReassigningProps = false;
            didWarnAboutRevealOrder = {};
            didWarnAboutTailOptions = {};
            didWarnAboutDefaultPropsOnFunctionComponent = {};
          }
          function reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2) {
            if (current2 === null) {
              workInProgress2.child = mountChildFibers(workInProgress2, null, nextChildren, renderLanes2);
            } else {
              workInProgress2.child = reconcileChildFibers(workInProgress2, current2.child, nextChildren, renderLanes2);
            }
          }
          function forceUnmountCurrentAndReconcile(current2, workInProgress2, nextChildren, renderLanes2) {
            workInProgress2.child = reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
            workInProgress2.child = reconcileChildFibers(workInProgress2, null, nextChildren, renderLanes2);
          }
          function updateForwardRef(current2, workInProgress2, Component2, nextProps, renderLanes2) {
            {
              if (workInProgress2.type !== workInProgress2.elementType) {
                var innerPropTypes = Component2.propTypes;
                if (innerPropTypes) {
                  checkPropTypes(
                    innerPropTypes,
                    nextProps,
                    "prop",
                    getComponentNameFromType(Component2)
                  );
                }
              }
            }
            var render2 = Component2.render;
            var ref = workInProgress2.ref;
            var nextChildren;
            var hasId;
            prepareToReadContext(workInProgress2, renderLanes2);
            {
              markComponentRenderStarted(workInProgress2);
            }
            {
              ReactCurrentOwner$1.current = workInProgress2;
              setIsRendering(true);
              nextChildren = renderWithHooks(current2, workInProgress2, render2, nextProps, ref, renderLanes2);
              hasId = checkDidRenderIdHook();
              if (workInProgress2.mode & StrictLegacyMode) {
                setIsStrictModeForDevtools(true);
                try {
                  nextChildren = renderWithHooks(current2, workInProgress2, render2, nextProps, ref, renderLanes2);
                  hasId = checkDidRenderIdHook();
                } finally {
                  setIsStrictModeForDevtools(false);
                }
              }
              setIsRendering(false);
            }
            {
              markComponentRenderStopped();
            }
            if (current2 !== null && !didReceiveUpdate) {
              bailoutHooks(current2, workInProgress2, renderLanes2);
              return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
            }
            if (getIsHydrating() && hasId) {
              pushMaterializedTreeId(workInProgress2);
            }
            workInProgress2.flags |= PerformedWork;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateMemoComponent(current2, workInProgress2, Component2, nextProps, renderLanes2) {
            if (current2 === null) {
              var type = Component2.type;
              if (isSimpleFunctionComponent(type) && Component2.compare === null && Component2.defaultProps === void 0) {
                var resolvedType = type;
                {
                  resolvedType = resolveFunctionForHotReloading(type);
                }
                workInProgress2.tag = SimpleMemoComponent;
                workInProgress2.type = resolvedType;
                {
                  validateFunctionComponentInDev(workInProgress2, type);
                }
                return updateSimpleMemoComponent(current2, workInProgress2, resolvedType, nextProps, renderLanes2);
              }
              {
                var innerPropTypes = type.propTypes;
                if (innerPropTypes) {
                  checkPropTypes(
                    innerPropTypes,
                    nextProps,
                    "prop",
                    getComponentNameFromType(type)
                  );
                }
                if (Component2.defaultProps !== void 0) {
                  var componentName = getComponentNameFromType(type) || "Unknown";
                  if (!didWarnAboutDefaultPropsOnFunctionComponent[componentName]) {
                    error("%s: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.", componentName);
                    didWarnAboutDefaultPropsOnFunctionComponent[componentName] = true;
                  }
                }
              }
              var child = createFiberFromTypeAndProps(Component2.type, null, nextProps, workInProgress2, workInProgress2.mode, renderLanes2);
              child.ref = workInProgress2.ref;
              child.return = workInProgress2;
              workInProgress2.child = child;
              return child;
            }
            {
              var _type = Component2.type;
              var _innerPropTypes = _type.propTypes;
              if (_innerPropTypes) {
                checkPropTypes(
                  _innerPropTypes,
                  nextProps,
                  "prop",
                  getComponentNameFromType(_type)
                );
              }
            }
            var currentChild = current2.child;
            var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current2, renderLanes2);
            if (!hasScheduledUpdateOrContext) {
              var prevProps = currentChild.memoizedProps;
              var compare = Component2.compare;
              compare = compare !== null ? compare : shallowEqual;
              if (compare(prevProps, nextProps) && current2.ref === workInProgress2.ref) {
                return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
              }
            }
            workInProgress2.flags |= PerformedWork;
            var newChild = createWorkInProgress(currentChild, nextProps);
            newChild.ref = workInProgress2.ref;
            newChild.return = workInProgress2;
            workInProgress2.child = newChild;
            return newChild;
          }
          function updateSimpleMemoComponent(current2, workInProgress2, Component2, nextProps, renderLanes2) {
            {
              if (workInProgress2.type !== workInProgress2.elementType) {
                var outerMemoType = workInProgress2.elementType;
                if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
                  var lazyComponent = outerMemoType;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    outerMemoType = init(payload);
                  } catch (x) {
                    outerMemoType = null;
                  }
                  var outerPropTypes = outerMemoType && outerMemoType.propTypes;
                  if (outerPropTypes) {
                    checkPropTypes(
                      outerPropTypes,
                      nextProps,
                      "prop",
                      getComponentNameFromType(outerMemoType)
                    );
                  }
                }
              }
            }
            if (current2 !== null) {
              var prevProps = current2.memoizedProps;
              if (shallowEqual(prevProps, nextProps) && current2.ref === workInProgress2.ref && workInProgress2.type === current2.type) {
                didReceiveUpdate = false;
                workInProgress2.pendingProps = nextProps = prevProps;
                if (!checkScheduledUpdateOrContext(current2, renderLanes2)) {
                  workInProgress2.lanes = current2.lanes;
                  return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
                } else if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
                  didReceiveUpdate = true;
                }
              }
            }
            return updateFunctionComponent(current2, workInProgress2, Component2, nextProps, renderLanes2);
          }
          function updateOffscreenComponent(current2, workInProgress2, renderLanes2) {
            var nextProps = workInProgress2.pendingProps;
            var nextChildren = nextProps.children;
            var prevState = current2 !== null ? current2.memoizedState : null;
            if (nextProps.mode === "hidden" || enableLegacyHidden) {
              if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
                var nextState = {
                  baseLanes: NoLanes,
                  cachePool: null,
                  transitions: null
                };
                workInProgress2.memoizedState = nextState;
                pushRenderLanes(workInProgress2, renderLanes2);
              } else if (!includesSomeLane(renderLanes2, OffscreenLane)) {
                var spawnedCachePool = null;
                var nextBaseLanes;
                if (prevState !== null) {
                  var prevBaseLanes = prevState.baseLanes;
                  nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes2);
                } else {
                  nextBaseLanes = renderLanes2;
                }
                workInProgress2.lanes = workInProgress2.childLanes = laneToLanes(OffscreenLane);
                var _nextState = {
                  baseLanes: nextBaseLanes,
                  cachePool: spawnedCachePool,
                  transitions: null
                };
                workInProgress2.memoizedState = _nextState;
                workInProgress2.updateQueue = null;
                pushRenderLanes(workInProgress2, nextBaseLanes);
                return null;
              } else {
                var _nextState2 = {
                  baseLanes: NoLanes,
                  cachePool: null,
                  transitions: null
                };
                workInProgress2.memoizedState = _nextState2;
                var subtreeRenderLanes2 = prevState !== null ? prevState.baseLanes : renderLanes2;
                pushRenderLanes(workInProgress2, subtreeRenderLanes2);
              }
            } else {
              var _subtreeRenderLanes;
              if (prevState !== null) {
                _subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes2);
                workInProgress2.memoizedState = null;
              } else {
                _subtreeRenderLanes = renderLanes2;
              }
              pushRenderLanes(workInProgress2, _subtreeRenderLanes);
            }
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateFragment(current2, workInProgress2, renderLanes2) {
            var nextChildren = workInProgress2.pendingProps;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateMode(current2, workInProgress2, renderLanes2) {
            var nextChildren = workInProgress2.pendingProps.children;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateProfiler(current2, workInProgress2, renderLanes2) {
            {
              workInProgress2.flags |= Update;
              {
                var stateNode = workInProgress2.stateNode;
                stateNode.effectDuration = 0;
                stateNode.passiveEffectDuration = 0;
              }
            }
            var nextProps = workInProgress2.pendingProps;
            var nextChildren = nextProps.children;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function markRef(current2, workInProgress2) {
            var ref = workInProgress2.ref;
            if (current2 === null && ref !== null || current2 !== null && current2.ref !== ref) {
              workInProgress2.flags |= Ref;
              {
                workInProgress2.flags |= RefStatic;
              }
            }
          }
          function updateFunctionComponent(current2, workInProgress2, Component2, nextProps, renderLanes2) {
            {
              if (workInProgress2.type !== workInProgress2.elementType) {
                var innerPropTypes = Component2.propTypes;
                if (innerPropTypes) {
                  checkPropTypes(
                    innerPropTypes,
                    nextProps,
                    "prop",
                    getComponentNameFromType(Component2)
                  );
                }
              }
            }
            var context;
            {
              var unmaskedContext = getUnmaskedContext(workInProgress2, Component2, true);
              context = getMaskedContext(workInProgress2, unmaskedContext);
            }
            var nextChildren;
            var hasId;
            prepareToReadContext(workInProgress2, renderLanes2);
            {
              markComponentRenderStarted(workInProgress2);
            }
            {
              ReactCurrentOwner$1.current = workInProgress2;
              setIsRendering(true);
              nextChildren = renderWithHooks(current2, workInProgress2, Component2, nextProps, context, renderLanes2);
              hasId = checkDidRenderIdHook();
              if (workInProgress2.mode & StrictLegacyMode) {
                setIsStrictModeForDevtools(true);
                try {
                  nextChildren = renderWithHooks(current2, workInProgress2, Component2, nextProps, context, renderLanes2);
                  hasId = checkDidRenderIdHook();
                } finally {
                  setIsStrictModeForDevtools(false);
                }
              }
              setIsRendering(false);
            }
            {
              markComponentRenderStopped();
            }
            if (current2 !== null && !didReceiveUpdate) {
              bailoutHooks(current2, workInProgress2, renderLanes2);
              return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
            }
            if (getIsHydrating() && hasId) {
              pushMaterializedTreeId(workInProgress2);
            }
            workInProgress2.flags |= PerformedWork;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateClassComponent(current2, workInProgress2, Component2, nextProps, renderLanes2) {
            {
              switch (shouldError(workInProgress2)) {
                case false: {
                  var _instance = workInProgress2.stateNode;
                  var ctor = workInProgress2.type;
                  var tempInstance = new ctor(workInProgress2.memoizedProps, _instance.context);
                  var state = tempInstance.state;
                  _instance.updater.enqueueSetState(_instance, state, null);
                  break;
                }
                case true: {
                  workInProgress2.flags |= DidCapture;
                  workInProgress2.flags |= ShouldCapture;
                  var error$1 = new Error("Simulated error coming from DevTools");
                  var lane = pickArbitraryLane(renderLanes2);
                  workInProgress2.lanes = mergeLanes(workInProgress2.lanes, lane);
                  var update = createClassErrorUpdate(workInProgress2, createCapturedValueAtFiber(error$1, workInProgress2), lane);
                  enqueueCapturedUpdate(workInProgress2, update);
                  break;
                }
              }
              if (workInProgress2.type !== workInProgress2.elementType) {
                var innerPropTypes = Component2.propTypes;
                if (innerPropTypes) {
                  checkPropTypes(
                    innerPropTypes,
                    nextProps,
                    "prop",
                    getComponentNameFromType(Component2)
                  );
                }
              }
            }
            var hasContext;
            if (isContextProvider(Component2)) {
              hasContext = true;
              pushContextProvider(workInProgress2);
            } else {
              hasContext = false;
            }
            prepareToReadContext(workInProgress2, renderLanes2);
            var instance = workInProgress2.stateNode;
            var shouldUpdate;
            if (instance === null) {
              resetSuspendedCurrentOnMountInLegacyMode(current2, workInProgress2);
              constructClassInstance(workInProgress2, Component2, nextProps);
              mountClassInstance(workInProgress2, Component2, nextProps, renderLanes2);
              shouldUpdate = true;
            } else if (current2 === null) {
              shouldUpdate = resumeMountClassInstance(workInProgress2, Component2, nextProps, renderLanes2);
            } else {
              shouldUpdate = updateClassInstance(current2, workInProgress2, Component2, nextProps, renderLanes2);
            }
            var nextUnitOfWork = finishClassComponent(current2, workInProgress2, Component2, shouldUpdate, hasContext, renderLanes2);
            {
              var inst = workInProgress2.stateNode;
              if (shouldUpdate && inst.props !== nextProps) {
                if (!didWarnAboutReassigningProps) {
                  error("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", getComponentNameFromFiber(workInProgress2) || "a component");
                }
                didWarnAboutReassigningProps = true;
              }
            }
            return nextUnitOfWork;
          }
          function finishClassComponent(current2, workInProgress2, Component2, shouldUpdate, hasContext, renderLanes2) {
            markRef(current2, workInProgress2);
            var didCaptureError = (workInProgress2.flags & DidCapture) !== NoFlags;
            if (!shouldUpdate && !didCaptureError) {
              if (hasContext) {
                invalidateContextProvider(workInProgress2, Component2, false);
              }
              return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
            }
            var instance = workInProgress2.stateNode;
            ReactCurrentOwner$1.current = workInProgress2;
            var nextChildren;
            if (didCaptureError && typeof Component2.getDerivedStateFromError !== "function") {
              nextChildren = null;
              {
                stopProfilerTimerIfRunning();
              }
            } else {
              {
                markComponentRenderStarted(workInProgress2);
              }
              {
                setIsRendering(true);
                nextChildren = instance.render();
                if (workInProgress2.mode & StrictLegacyMode) {
                  setIsStrictModeForDevtools(true);
                  try {
                    instance.render();
                  } finally {
                    setIsStrictModeForDevtools(false);
                  }
                }
                setIsRendering(false);
              }
              {
                markComponentRenderStopped();
              }
            }
            workInProgress2.flags |= PerformedWork;
            if (current2 !== null && didCaptureError) {
              forceUnmountCurrentAndReconcile(current2, workInProgress2, nextChildren, renderLanes2);
            } else {
              reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            }
            workInProgress2.memoizedState = instance.state;
            if (hasContext) {
              invalidateContextProvider(workInProgress2, Component2, true);
            }
            return workInProgress2.child;
          }
          function pushHostRootContext(workInProgress2) {
            var root2 = workInProgress2.stateNode;
            if (root2.pendingContext) {
              pushTopLevelContextObject(workInProgress2, root2.pendingContext, root2.pendingContext !== root2.context);
            } else if (root2.context) {
              pushTopLevelContextObject(workInProgress2, root2.context, false);
            }
            pushHostContainer(workInProgress2, root2.containerInfo);
          }
          function updateHostRoot(current2, workInProgress2, renderLanes2) {
            pushHostRootContext(workInProgress2);
            if (current2 === null) {
              throw new Error("Should have a current fiber. This is a bug in React.");
            }
            var nextProps = workInProgress2.pendingProps;
            var prevState = workInProgress2.memoizedState;
            var prevChildren = prevState.element;
            cloneUpdateQueue(current2, workInProgress2);
            processUpdateQueue(workInProgress2, nextProps, null, renderLanes2);
            var nextState = workInProgress2.memoizedState;
            var root2 = workInProgress2.stateNode;
            var nextChildren = nextState.element;
            if (prevState.isDehydrated) {
              var overrideState = {
                element: nextChildren,
                isDehydrated: false,
                cache: nextState.cache,
                pendingSuspenseBoundaries: nextState.pendingSuspenseBoundaries,
                transitions: nextState.transitions
              };
              var updateQueue = workInProgress2.updateQueue;
              updateQueue.baseState = overrideState;
              workInProgress2.memoizedState = overrideState;
              if (workInProgress2.flags & ForceClientRender) {
                var recoverableError = createCapturedValueAtFiber(new Error("There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering."), workInProgress2);
                return mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, recoverableError);
              } else if (nextChildren !== prevChildren) {
                var _recoverableError = createCapturedValueAtFiber(new Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."), workInProgress2);
                return mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, _recoverableError);
              } else {
                enterHydrationState(workInProgress2);
                var child = mountChildFibers(workInProgress2, null, nextChildren, renderLanes2);
                workInProgress2.child = child;
                var node = child;
                while (node) {
                  node.flags = node.flags & ~Placement | Hydrating;
                  node = node.sibling;
                }
              }
            } else {
              resetHydrationState();
              if (nextChildren === prevChildren) {
                return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
              }
              reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            }
            return workInProgress2.child;
          }
          function mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, recoverableError) {
            resetHydrationState();
            queueHydrationError(recoverableError);
            workInProgress2.flags |= ForceClientRender;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateHostComponent(current2, workInProgress2, renderLanes2) {
            pushHostContext(workInProgress2);
            if (current2 === null) {
              tryToClaimNextHydratableInstance(workInProgress2);
            }
            var type = workInProgress2.type;
            var nextProps = workInProgress2.pendingProps;
            var prevProps = current2 !== null ? current2.memoizedProps : null;
            var nextChildren = nextProps.children;
            var isDirectTextChild = shouldSetTextContent(type, nextProps);
            if (isDirectTextChild) {
              nextChildren = null;
            } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
              workInProgress2.flags |= ContentReset;
            }
            markRef(current2, workInProgress2);
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateHostText(current2, workInProgress2) {
            if (current2 === null) {
              tryToClaimNextHydratableInstance(workInProgress2);
            }
            return null;
          }
          function mountLazyComponent(_current, workInProgress2, elementType, renderLanes2) {
            resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress2);
            var props = workInProgress2.pendingProps;
            var lazyComponent = elementType;
            var payload = lazyComponent._payload;
            var init = lazyComponent._init;
            var Component2 = init(payload);
            workInProgress2.type = Component2;
            var resolvedTag = workInProgress2.tag = resolveLazyComponentTag(Component2);
            var resolvedProps = resolveDefaultProps(Component2, props);
            var child;
            switch (resolvedTag) {
              case FunctionComponent: {
                {
                  validateFunctionComponentInDev(workInProgress2, Component2);
                  workInProgress2.type = Component2 = resolveFunctionForHotReloading(Component2);
                }
                child = updateFunctionComponent(null, workInProgress2, Component2, resolvedProps, renderLanes2);
                return child;
              }
              case ClassComponent: {
                {
                  workInProgress2.type = Component2 = resolveClassForHotReloading(Component2);
                }
                child = updateClassComponent(null, workInProgress2, Component2, resolvedProps, renderLanes2);
                return child;
              }
              case ForwardRef: {
                {
                  workInProgress2.type = Component2 = resolveForwardRefForHotReloading(Component2);
                }
                child = updateForwardRef(null, workInProgress2, Component2, resolvedProps, renderLanes2);
                return child;
              }
              case MemoComponent: {
                {
                  if (workInProgress2.type !== workInProgress2.elementType) {
                    var outerPropTypes = Component2.propTypes;
                    if (outerPropTypes) {
                      checkPropTypes(
                        outerPropTypes,
                        resolvedProps,
                        "prop",
                        getComponentNameFromType(Component2)
                      );
                    }
                  }
                }
                child = updateMemoComponent(
                  null,
                  workInProgress2,
                  Component2,
                  resolveDefaultProps(Component2.type, resolvedProps),
                  renderLanes2
                );
                return child;
              }
            }
            var hint = "";
            {
              if (Component2 !== null && typeof Component2 === "object" && Component2.$$typeof === REACT_LAZY_TYPE) {
                hint = " Did you wrap a component in React.lazy() more than once?";
              }
            }
            throw new Error("Element type is invalid. Received a promise that resolves to: " + Component2 + ". " + ("Lazy element type must resolve to a class or function." + hint));
          }
          function mountIncompleteClassComponent(_current, workInProgress2, Component2, nextProps, renderLanes2) {
            resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress2);
            workInProgress2.tag = ClassComponent;
            var hasContext;
            if (isContextProvider(Component2)) {
              hasContext = true;
              pushContextProvider(workInProgress2);
            } else {
              hasContext = false;
            }
            prepareToReadContext(workInProgress2, renderLanes2);
            constructClassInstance(workInProgress2, Component2, nextProps);
            mountClassInstance(workInProgress2, Component2, nextProps, renderLanes2);
            return finishClassComponent(null, workInProgress2, Component2, true, hasContext, renderLanes2);
          }
          function mountIndeterminateComponent(_current, workInProgress2, Component2, renderLanes2) {
            resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress2);
            var props = workInProgress2.pendingProps;
            var context;
            {
              var unmaskedContext = getUnmaskedContext(workInProgress2, Component2, false);
              context = getMaskedContext(workInProgress2, unmaskedContext);
            }
            prepareToReadContext(workInProgress2, renderLanes2);
            var value;
            var hasId;
            {
              markComponentRenderStarted(workInProgress2);
            }
            {
              if (Component2.prototype && typeof Component2.prototype.render === "function") {
                var componentName = getComponentNameFromType(Component2) || "Unknown";
                if (!didWarnAboutBadClass[componentName]) {
                  error("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", componentName, componentName);
                  didWarnAboutBadClass[componentName] = true;
                }
              }
              if (workInProgress2.mode & StrictLegacyMode) {
                ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, null);
              }
              setIsRendering(true);
              ReactCurrentOwner$1.current = workInProgress2;
              value = renderWithHooks(null, workInProgress2, Component2, props, context, renderLanes2);
              hasId = checkDidRenderIdHook();
              setIsRendering(false);
            }
            {
              markComponentRenderStopped();
            }
            workInProgress2.flags |= PerformedWork;
            {
              if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) {
                var _componentName = getComponentNameFromType(Component2) || "Unknown";
                if (!didWarnAboutModulePatternComponent[_componentName]) {
                  error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName, _componentName, _componentName);
                  didWarnAboutModulePatternComponent[_componentName] = true;
                }
              }
            }
            if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) {
              {
                var _componentName2 = getComponentNameFromType(Component2) || "Unknown";
                if (!didWarnAboutModulePatternComponent[_componentName2]) {
                  error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName2, _componentName2, _componentName2);
                  didWarnAboutModulePatternComponent[_componentName2] = true;
                }
              }
              workInProgress2.tag = ClassComponent;
              workInProgress2.memoizedState = null;
              workInProgress2.updateQueue = null;
              var hasContext = false;
              if (isContextProvider(Component2)) {
                hasContext = true;
                pushContextProvider(workInProgress2);
              } else {
                hasContext = false;
              }
              workInProgress2.memoizedState = value.state !== null && value.state !== void 0 ? value.state : null;
              initializeUpdateQueue(workInProgress2);
              adoptClassInstance(workInProgress2, value);
              mountClassInstance(workInProgress2, Component2, props, renderLanes2);
              return finishClassComponent(null, workInProgress2, Component2, true, hasContext, renderLanes2);
            } else {
              workInProgress2.tag = FunctionComponent;
              {
                if (workInProgress2.mode & StrictLegacyMode) {
                  setIsStrictModeForDevtools(true);
                  try {
                    value = renderWithHooks(null, workInProgress2, Component2, props, context, renderLanes2);
                    hasId = checkDidRenderIdHook();
                  } finally {
                    setIsStrictModeForDevtools(false);
                  }
                }
              }
              if (getIsHydrating() && hasId) {
                pushMaterializedTreeId(workInProgress2);
              }
              reconcileChildren(null, workInProgress2, value, renderLanes2);
              {
                validateFunctionComponentInDev(workInProgress2, Component2);
              }
              return workInProgress2.child;
            }
          }
          function validateFunctionComponentInDev(workInProgress2, Component2) {
            {
              if (Component2) {
                if (Component2.childContextTypes) {
                  error("%s(...): childContextTypes cannot be defined on a function component.", Component2.displayName || Component2.name || "Component");
                }
              }
              if (workInProgress2.ref !== null) {
                var info = "";
                var ownerName = getCurrentFiberOwnerNameInDevOrNull();
                if (ownerName) {
                  info += "\n\nCheck the render method of `" + ownerName + "`.";
                }
                var warningKey = ownerName || "";
                var debugSource = workInProgress2._debugSource;
                if (debugSource) {
                  warningKey = debugSource.fileName + ":" + debugSource.lineNumber;
                }
                if (!didWarnAboutFunctionRefs[warningKey]) {
                  didWarnAboutFunctionRefs[warningKey] = true;
                  error("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s", info);
                }
              }
              if (Component2.defaultProps !== void 0) {
                var componentName = getComponentNameFromType(Component2) || "Unknown";
                if (!didWarnAboutDefaultPropsOnFunctionComponent[componentName]) {
                  error("%s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.", componentName);
                  didWarnAboutDefaultPropsOnFunctionComponent[componentName] = true;
                }
              }
              if (typeof Component2.getDerivedStateFromProps === "function") {
                var _componentName3 = getComponentNameFromType(Component2) || "Unknown";
                if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) {
                  error("%s: Function components do not support getDerivedStateFromProps.", _componentName3);
                  didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true;
                }
              }
              if (typeof Component2.contextType === "object" && Component2.contextType !== null) {
                var _componentName4 = getComponentNameFromType(Component2) || "Unknown";
                if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) {
                  error("%s: Function components do not support contextType.", _componentName4);
                  didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true;
                }
              }
            }
          }
          var SUSPENDED_MARKER = {
            dehydrated: null,
            treeContext: null,
            retryLane: NoLane
          };
          function mountSuspenseOffscreenState(renderLanes2) {
            return {
              baseLanes: renderLanes2,
              cachePool: getSuspendedCache(),
              transitions: null
            };
          }
          function updateSuspenseOffscreenState(prevOffscreenState, renderLanes2) {
            var cachePool = null;
            return {
              baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes2),
              cachePool,
              transitions: prevOffscreenState.transitions
            };
          }
          function shouldRemainOnFallback(suspenseContext, current2, workInProgress2, renderLanes2) {
            if (current2 !== null) {
              var suspenseState = current2.memoizedState;
              if (suspenseState === null) {
                return false;
              }
            }
            return hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
          }
          function getRemainingWorkInPrimaryTree(current2, renderLanes2) {
            return removeLanes(current2.childLanes, renderLanes2);
          }
          function updateSuspenseComponent(current2, workInProgress2, renderLanes2) {
            var nextProps = workInProgress2.pendingProps;
            {
              if (shouldSuspend(workInProgress2)) {
                workInProgress2.flags |= DidCapture;
              }
            }
            var suspenseContext = suspenseStackCursor.current;
            var showFallback = false;
            var didSuspend = (workInProgress2.flags & DidCapture) !== NoFlags;
            if (didSuspend || shouldRemainOnFallback(suspenseContext, current2)) {
              showFallback = true;
              workInProgress2.flags &= ~DidCapture;
            } else {
              if (current2 === null || current2.memoizedState !== null) {
                {
                  suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);
                }
              }
            }
            suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
            pushSuspenseContext(workInProgress2, suspenseContext);
            if (current2 === null) {
              tryToClaimNextHydratableInstance(workInProgress2);
              var suspenseState = workInProgress2.memoizedState;
              if (suspenseState !== null) {
                var dehydrated = suspenseState.dehydrated;
                if (dehydrated !== null) {
                  return mountDehydratedSuspenseComponent(workInProgress2, dehydrated);
                }
              }
              var nextPrimaryChildren = nextProps.children;
              var nextFallbackChildren = nextProps.fallback;
              if (showFallback) {
                var fallbackFragment = mountSuspenseFallbackChildren(workInProgress2, nextPrimaryChildren, nextFallbackChildren, renderLanes2);
                var primaryChildFragment = workInProgress2.child;
                primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes2);
                workInProgress2.memoizedState = SUSPENDED_MARKER;
                return fallbackFragment;
              } else {
                return mountSuspensePrimaryChildren(workInProgress2, nextPrimaryChildren);
              }
            } else {
              var prevState = current2.memoizedState;
              if (prevState !== null) {
                var _dehydrated = prevState.dehydrated;
                if (_dehydrated !== null) {
                  return updateDehydratedSuspenseComponent(current2, workInProgress2, didSuspend, nextProps, _dehydrated, prevState, renderLanes2);
                }
              }
              if (showFallback) {
                var _nextFallbackChildren = nextProps.fallback;
                var _nextPrimaryChildren = nextProps.children;
                var fallbackChildFragment = updateSuspenseFallbackChildren(current2, workInProgress2, _nextPrimaryChildren, _nextFallbackChildren, renderLanes2);
                var _primaryChildFragment2 = workInProgress2.child;
                var prevOffscreenState = current2.child.memoizedState;
                _primaryChildFragment2.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes2) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes2);
                _primaryChildFragment2.childLanes = getRemainingWorkInPrimaryTree(current2, renderLanes2);
                workInProgress2.memoizedState = SUSPENDED_MARKER;
                return fallbackChildFragment;
              } else {
                var _nextPrimaryChildren2 = nextProps.children;
                var _primaryChildFragment3 = updateSuspensePrimaryChildren(current2, workInProgress2, _nextPrimaryChildren2, renderLanes2);
                workInProgress2.memoizedState = null;
                return _primaryChildFragment3;
              }
            }
          }
          function mountSuspensePrimaryChildren(workInProgress2, primaryChildren, renderLanes2) {
            var mode = workInProgress2.mode;
            var primaryChildProps = {
              mode: "visible",
              children: primaryChildren
            };
            var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode);
            primaryChildFragment.return = workInProgress2;
            workInProgress2.child = primaryChildFragment;
            return primaryChildFragment;
          }
          function mountSuspenseFallbackChildren(workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
            var mode = workInProgress2.mode;
            var progressedPrimaryFragment = workInProgress2.child;
            var primaryChildProps = {
              mode: "hidden",
              children: primaryChildren
            };
            var primaryChildFragment;
            var fallbackChildFragment;
            if ((mode & ConcurrentMode) === NoMode && progressedPrimaryFragment !== null) {
              primaryChildFragment = progressedPrimaryFragment;
              primaryChildFragment.childLanes = NoLanes;
              primaryChildFragment.pendingProps = primaryChildProps;
              if (workInProgress2.mode & ProfileMode) {
                primaryChildFragment.actualDuration = 0;
                primaryChildFragment.actualStartTime = -1;
                primaryChildFragment.selfBaseDuration = 0;
                primaryChildFragment.treeBaseDuration = 0;
              }
              fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
            } else {
              primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode);
              fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
            }
            primaryChildFragment.return = workInProgress2;
            fallbackChildFragment.return = workInProgress2;
            primaryChildFragment.sibling = fallbackChildFragment;
            workInProgress2.child = primaryChildFragment;
            return fallbackChildFragment;
          }
          function mountWorkInProgressOffscreenFiber(offscreenProps, mode, renderLanes2) {
            return createFiberFromOffscreen(offscreenProps, mode, NoLanes, null);
          }
          function updateWorkInProgressOffscreenFiber(current2, offscreenProps) {
            return createWorkInProgress(current2, offscreenProps);
          }
          function updateSuspensePrimaryChildren(current2, workInProgress2, primaryChildren, renderLanes2) {
            var currentPrimaryChildFragment = current2.child;
            var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
            var primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, {
              mode: "visible",
              children: primaryChildren
            });
            if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
              primaryChildFragment.lanes = renderLanes2;
            }
            primaryChildFragment.return = workInProgress2;
            primaryChildFragment.sibling = null;
            if (currentFallbackChildFragment !== null) {
              var deletions = workInProgress2.deletions;
              if (deletions === null) {
                workInProgress2.deletions = [currentFallbackChildFragment];
                workInProgress2.flags |= ChildDeletion;
              } else {
                deletions.push(currentFallbackChildFragment);
              }
            }
            workInProgress2.child = primaryChildFragment;
            return primaryChildFragment;
          }
          function updateSuspenseFallbackChildren(current2, workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
            var mode = workInProgress2.mode;
            var currentPrimaryChildFragment = current2.child;
            var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
            var primaryChildProps = {
              mode: "hidden",
              children: primaryChildren
            };
            var primaryChildFragment;
            if ((mode & ConcurrentMode) === NoMode && workInProgress2.child !== currentPrimaryChildFragment) {
              var progressedPrimaryFragment = workInProgress2.child;
              primaryChildFragment = progressedPrimaryFragment;
              primaryChildFragment.childLanes = NoLanes;
              primaryChildFragment.pendingProps = primaryChildProps;
              if (workInProgress2.mode & ProfileMode) {
                primaryChildFragment.actualDuration = 0;
                primaryChildFragment.actualStartTime = -1;
                primaryChildFragment.selfBaseDuration = currentPrimaryChildFragment.selfBaseDuration;
                primaryChildFragment.treeBaseDuration = currentPrimaryChildFragment.treeBaseDuration;
              }
              workInProgress2.deletions = null;
            } else {
              primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps);
              primaryChildFragment.subtreeFlags = currentPrimaryChildFragment.subtreeFlags & StaticMask;
            }
            var fallbackChildFragment;
            if (currentFallbackChildFragment !== null) {
              fallbackChildFragment = createWorkInProgress(currentFallbackChildFragment, fallbackChildren);
            } else {
              fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
              fallbackChildFragment.flags |= Placement;
            }
            fallbackChildFragment.return = workInProgress2;
            primaryChildFragment.return = workInProgress2;
            primaryChildFragment.sibling = fallbackChildFragment;
            workInProgress2.child = primaryChildFragment;
            return fallbackChildFragment;
          }
          function retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, recoverableError) {
            if (recoverableError !== null) {
              queueHydrationError(recoverableError);
            }
            reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
            var nextProps = workInProgress2.pendingProps;
            var primaryChildren = nextProps.children;
            var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress2, primaryChildren);
            primaryChildFragment.flags |= Placement;
            workInProgress2.memoizedState = null;
            return primaryChildFragment;
          }
          function mountSuspenseFallbackAfterRetryWithoutHydrating(current2, workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
            var fiberMode = workInProgress2.mode;
            var primaryChildProps = {
              mode: "visible",
              children: primaryChildren
            };
            var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, fiberMode);
            var fallbackChildFragment = createFiberFromFragment(fallbackChildren, fiberMode, renderLanes2, null);
            fallbackChildFragment.flags |= Placement;
            primaryChildFragment.return = workInProgress2;
            fallbackChildFragment.return = workInProgress2;
            primaryChildFragment.sibling = fallbackChildFragment;
            workInProgress2.child = primaryChildFragment;
            if ((workInProgress2.mode & ConcurrentMode) !== NoMode) {
              reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
            }
            return fallbackChildFragment;
          }
          function mountDehydratedSuspenseComponent(workInProgress2, suspenseInstance, renderLanes2) {
            if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
              {
                error("Cannot hydrate Suspense in legacy mode. Switch from ReactDOM.hydrate(element, container) to ReactDOMClient.hydrateRoot(container, <App />).render(element) or remove the Suspense components from the server rendered components.");
              }
              workInProgress2.lanes = laneToLanes(SyncLane);
            } else if (isSuspenseInstanceFallback(suspenseInstance)) {
              workInProgress2.lanes = laneToLanes(DefaultHydrationLane);
            } else {
              workInProgress2.lanes = laneToLanes(OffscreenLane);
            }
            return null;
          }
          function updateDehydratedSuspenseComponent(current2, workInProgress2, didSuspend, nextProps, suspenseInstance, suspenseState, renderLanes2) {
            if (!didSuspend) {
              warnIfHydrating();
              if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
                return retrySuspenseComponentWithoutHydrating(
                  current2,
                  workInProgress2,
                  renderLanes2,
                  null
                );
              }
              if (isSuspenseInstanceFallback(suspenseInstance)) {
                var digest, message, stack;
                {
                  var _getSuspenseInstanceF = getSuspenseInstanceFallbackErrorDetails(suspenseInstance);
                  digest = _getSuspenseInstanceF.digest;
                  message = _getSuspenseInstanceF.message;
                  stack = _getSuspenseInstanceF.stack;
                }
                var error2;
                if (message) {
                  error2 = new Error(message);
                } else {
                  error2 = new Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.");
                }
                var capturedValue = createCapturedValue(error2, digest, stack);
                return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, capturedValue);
              }
              var hasContextChanged2 = includesSomeLane(renderLanes2, current2.childLanes);
              if (didReceiveUpdate || hasContextChanged2) {
                var root2 = getWorkInProgressRoot();
                if (root2 !== null) {
                  var attemptHydrationAtLane = getBumpedLaneForHydration(root2, renderLanes2);
                  if (attemptHydrationAtLane !== NoLane && attemptHydrationAtLane !== suspenseState.retryLane) {
                    suspenseState.retryLane = attemptHydrationAtLane;
                    var eventTime = NoTimestamp;
                    enqueueConcurrentRenderForLane(current2, attemptHydrationAtLane);
                    scheduleUpdateOnFiber(root2, current2, attemptHydrationAtLane, eventTime);
                  }
                }
                renderDidSuspendDelayIfPossible();
                var _capturedValue = createCapturedValue(new Error("This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition."));
                return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, _capturedValue);
              } else if (isSuspenseInstancePending(suspenseInstance)) {
                workInProgress2.flags |= DidCapture;
                workInProgress2.child = current2.child;
                var retry = retryDehydratedSuspenseBoundary.bind(null, current2);
                registerSuspenseInstanceRetry(suspenseInstance, retry);
                return null;
              } else {
                reenterHydrationStateFromDehydratedSuspenseInstance(workInProgress2, suspenseInstance, suspenseState.treeContext);
                var primaryChildren = nextProps.children;
                var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress2, primaryChildren);
                primaryChildFragment.flags |= Hydrating;
                return primaryChildFragment;
              }
            } else {
              if (workInProgress2.flags & ForceClientRender) {
                workInProgress2.flags &= ~ForceClientRender;
                var _capturedValue2 = createCapturedValue(new Error("There was an error while hydrating this Suspense boundary. Switched to client rendering."));
                return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, _capturedValue2);
              } else if (workInProgress2.memoizedState !== null) {
                workInProgress2.child = current2.child;
                workInProgress2.flags |= DidCapture;
                return null;
              } else {
                var nextPrimaryChildren = nextProps.children;
                var nextFallbackChildren = nextProps.fallback;
                var fallbackChildFragment = mountSuspenseFallbackAfterRetryWithoutHydrating(current2, workInProgress2, nextPrimaryChildren, nextFallbackChildren, renderLanes2);
                var _primaryChildFragment4 = workInProgress2.child;
                _primaryChildFragment4.memoizedState = mountSuspenseOffscreenState(renderLanes2);
                workInProgress2.memoizedState = SUSPENDED_MARKER;
                return fallbackChildFragment;
              }
            }
          }
          function scheduleSuspenseWorkOnFiber(fiber, renderLanes2, propagationRoot) {
            fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
            var alternate = fiber.alternate;
            if (alternate !== null) {
              alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
            }
            scheduleContextWorkOnParentPath(fiber.return, renderLanes2, propagationRoot);
          }
          function propagateSuspenseContextChange(workInProgress2, firstChild, renderLanes2) {
            var node = firstChild;
            while (node !== null) {
              if (node.tag === SuspenseComponent) {
                var state = node.memoizedState;
                if (state !== null) {
                  scheduleSuspenseWorkOnFiber(node, renderLanes2, workInProgress2);
                }
              } else if (node.tag === SuspenseListComponent) {
                scheduleSuspenseWorkOnFiber(node, renderLanes2, workInProgress2);
              } else if (node.child !== null) {
                node.child.return = node;
                node = node.child;
                continue;
              }
              if (node === workInProgress2) {
                return;
              }
              while (node.sibling === null) {
                if (node.return === null || node.return === workInProgress2) {
                  return;
                }
                node = node.return;
              }
              node.sibling.return = node.return;
              node = node.sibling;
            }
          }
          function findLastContentRow(firstChild) {
            var row = firstChild;
            var lastContentRow = null;
            while (row !== null) {
              var currentRow = row.alternate;
              if (currentRow !== null && findFirstSuspended(currentRow) === null) {
                lastContentRow = row;
              }
              row = row.sibling;
            }
            return lastContentRow;
          }
          function validateRevealOrder(revealOrder) {
            {
              if (revealOrder !== void 0 && revealOrder !== "forwards" && revealOrder !== "backwards" && revealOrder !== "together" && !didWarnAboutRevealOrder[revealOrder]) {
                didWarnAboutRevealOrder[revealOrder] = true;
                if (typeof revealOrder === "string") {
                  switch (revealOrder.toLowerCase()) {
                    case "together":
                    case "forwards":
                    case "backwards": {
                      error('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase());
                      break;
                    }
                    case "forward":
                    case "backward": {
                      error('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.', revealOrder, revealOrder.toLowerCase());
                      break;
                    }
                    default:
                      error('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', revealOrder);
                      break;
                  }
                } else {
                  error('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', revealOrder);
                }
              }
            }
          }
          function validateTailOptions(tailMode, revealOrder) {
            {
              if (tailMode !== void 0 && !didWarnAboutTailOptions[tailMode]) {
                if (tailMode !== "collapsed" && tailMode !== "hidden") {
                  didWarnAboutTailOptions[tailMode] = true;
                  error('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?', tailMode);
                } else if (revealOrder !== "forwards" && revealOrder !== "backwards") {
                  didWarnAboutTailOptions[tailMode] = true;
                  error('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', tailMode);
                }
              }
            }
          }
          function validateSuspenseListNestedChild(childSlot, index2) {
            {
              var isAnArray = isArray(childSlot);
              var isIterable = !isAnArray && typeof getIteratorFn(childSlot) === "function";
              if (isAnArray || isIterable) {
                var type = isAnArray ? "array" : "iterable";
                error("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>", type, index2, type);
                return false;
              }
            }
            return true;
          }
          function validateSuspenseListChildren(children, revealOrder) {
            {
              if ((revealOrder === "forwards" || revealOrder === "backwards") && children !== void 0 && children !== null && children !== false) {
                if (isArray(children)) {
                  for (var i = 0; i < children.length; i++) {
                    if (!validateSuspenseListNestedChild(children[i], i)) {
                      return;
                    }
                  }
                } else {
                  var iteratorFn = getIteratorFn(children);
                  if (typeof iteratorFn === "function") {
                    var childrenIterator = iteratorFn.call(children);
                    if (childrenIterator) {
                      var step = childrenIterator.next();
                      var _i = 0;
                      for (; !step.done; step = childrenIterator.next()) {
                        if (!validateSuspenseListNestedChild(step.value, _i)) {
                          return;
                        }
                        _i++;
                      }
                    }
                  } else {
                    error('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', revealOrder);
                  }
                }
              }
            }
          }
          function initSuspenseListRenderState(workInProgress2, isBackwards, tail, lastContentRow, tailMode) {
            var renderState = workInProgress2.memoizedState;
            if (renderState === null) {
              workInProgress2.memoizedState = {
                isBackwards,
                rendering: null,
                renderingStartTime: 0,
                last: lastContentRow,
                tail,
                tailMode
              };
            } else {
              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;
            var revealOrder = nextProps.revealOrder;
            var tailMode = nextProps.tail;
            var newChildren = nextProps.children;
            validateRevealOrder(revealOrder);
            validateTailOptions(tailMode, revealOrder);
            validateSuspenseListChildren(newChildren, revealOrder);
            reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
            var suspenseContext = suspenseStackCursor.current;
            var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
            if (shouldForceFallback) {
              suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
              workInProgress2.flags |= DidCapture;
            } else {
              var didSuspendBefore = current2 !== null && (current2.flags & DidCapture) !== NoFlags;
              if (didSuspendBefore) {
                propagateSuspenseContextChange(workInProgress2, workInProgress2.child, renderLanes2);
              }
              suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
            }
            pushSuspenseContext(workInProgress2, suspenseContext);
            if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
              workInProgress2.memoizedState = null;
            } else {
              switch (revealOrder) {
                case "forwards": {
                  var lastContentRow = findLastContentRow(workInProgress2.child);
                  var tail;
                  if (lastContentRow === null) {
                    tail = workInProgress2.child;
                    workInProgress2.child = null;
                  } else {
                    tail = lastContentRow.sibling;
                    lastContentRow.sibling = null;
                  }
                  initSuspenseListRenderState(
                    workInProgress2,
                    false,
                    tail,
                    lastContentRow,
                    tailMode
                  );
                  break;
                }
                case "backwards": {
                  var _tail = null;
                  var row = workInProgress2.child;
                  workInProgress2.child = null;
                  while (row !== null) {
                    var currentRow = row.alternate;
                    if (currentRow !== null && findFirstSuspended(currentRow) === null) {
                      workInProgress2.child = row;
                      break;
                    }
                    var nextRow = row.sibling;
                    row.sibling = _tail;
                    _tail = row;
                    row = nextRow;
                  }
                  initSuspenseListRenderState(
                    workInProgress2,
                    true,
                    _tail,
                    null,
                    tailMode
                  );
                  break;
                }
                case "together": {
                  initSuspenseListRenderState(
                    workInProgress2,
                    false,
                    null,
                    null,
                    void 0
                  );
                  break;
                }
                default: {
                  workInProgress2.memoizedState = null;
                }
              }
            }
            return workInProgress2.child;
          }
          function updatePortalComponent(current2, workInProgress2, renderLanes2) {
            pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
            var nextChildren = workInProgress2.pendingProps;
            if (current2 === null) {
              workInProgress2.child = reconcileChildFibers(workInProgress2, null, nextChildren, renderLanes2);
            } else {
              reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            }
            return workInProgress2.child;
          }
          var hasWarnedAboutUsingNoValuePropOnContextProvider = false;
          function updateContextProvider(current2, workInProgress2, renderLanes2) {
            var providerType = workInProgress2.type;
            var context = providerType._context;
            var newProps = workInProgress2.pendingProps;
            var oldProps = workInProgress2.memoizedProps;
            var newValue = newProps.value;
            {
              if (!("value" in newProps)) {
                if (!hasWarnedAboutUsingNoValuePropOnContextProvider) {
                  hasWarnedAboutUsingNoValuePropOnContextProvider = true;
                  error("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?");
                }
              }
              var providerPropTypes = workInProgress2.type.propTypes;
              if (providerPropTypes) {
                checkPropTypes(providerPropTypes, newProps, "prop", "Context.Provider");
              }
            }
            pushProvider(workInProgress2, context, newValue);
            {
              if (oldProps !== null) {
                var oldValue = oldProps.value;
                if (objectIs(oldValue, newValue)) {
                  if (oldProps.children === newProps.children && !hasContextChanged()) {
                    return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
                  }
                } else {
                  propagateContextChange(workInProgress2, context, renderLanes2);
                }
              }
            }
            var newChildren = newProps.children;
            reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
            return workInProgress2.child;
          }
          var hasWarnedAboutUsingContextAsConsumer = false;
          function updateContextConsumer(current2, workInProgress2, renderLanes2) {
            var context = workInProgress2.type;
            {
              if (context._context === void 0) {
                if (context !== context.Consumer) {
                  if (!hasWarnedAboutUsingContextAsConsumer) {
                    hasWarnedAboutUsingContextAsConsumer = true;
                    error("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");
                  }
                }
              } else {
                context = context._context;
              }
            }
            var newProps = workInProgress2.pendingProps;
            var render2 = newProps.children;
            {
              if (typeof render2 !== "function") {
                error("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it.");
              }
            }
            prepareToReadContext(workInProgress2, renderLanes2);
            var newValue = readContext(context);
            {
              markComponentRenderStarted(workInProgress2);
            }
            var newChildren;
            {
              ReactCurrentOwner$1.current = workInProgress2;
              setIsRendering(true);
              newChildren = render2(newValue);
              setIsRendering(false);
            }
            {
              markComponentRenderStopped();
            }
            workInProgress2.flags |= PerformedWork;
            reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
            return workInProgress2.child;
          }
          function markWorkInProgressReceivedUpdate() {
            didReceiveUpdate = true;
          }
          function resetSuspendedCurrentOnMountInLegacyMode(current2, workInProgress2) {
            if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
              if (current2 !== null) {
                current2.alternate = null;
                workInProgress2.alternate = null;
                workInProgress2.flags |= Placement;
              }
            }
          }
          function bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2) {
            if (current2 !== null) {
              workInProgress2.dependencies = current2.dependencies;
            }
            {
              stopProfilerTimerIfRunning();
            }
            markSkippedUpdateLanes(workInProgress2.lanes);
            if (!includesSomeLane(renderLanes2, workInProgress2.childLanes)) {
              {
                return null;
              }
            }
            cloneChildFibers(current2, workInProgress2);
            return workInProgress2.child;
          }
          function remountFiber(current2, oldWorkInProgress, newWorkInProgress) {
            {
              var returnFiber = oldWorkInProgress.return;
              if (returnFiber === null) {
                throw new Error("Cannot swap the root fiber.");
              }
              current2.alternate = null;
              oldWorkInProgress.alternate = null;
              newWorkInProgress.index = oldWorkInProgress.index;
              newWorkInProgress.sibling = oldWorkInProgress.sibling;
              newWorkInProgress.return = oldWorkInProgress.return;
              newWorkInProgress.ref = oldWorkInProgress.ref;
              if (oldWorkInProgress === returnFiber.child) {
                returnFiber.child = newWorkInProgress;
              } else {
                var prevSibling = returnFiber.child;
                if (prevSibling === null) {
                  throw new Error("Expected parent to have a child.");
                }
                while (prevSibling.sibling !== oldWorkInProgress) {
                  prevSibling = prevSibling.sibling;
                  if (prevSibling === null) {
                    throw new Error("Expected to find the previous sibling.");
                  }
                }
                prevSibling.sibling = newWorkInProgress;
              }
              var deletions = returnFiber.deletions;
              if (deletions === null) {
                returnFiber.deletions = [current2];
                returnFiber.flags |= ChildDeletion;
              } else {
                deletions.push(current2);
              }
              newWorkInProgress.flags |= Placement;
              return newWorkInProgress;
            }
          }
          function checkScheduledUpdateOrContext(current2, renderLanes2) {
            var updateLanes = current2.lanes;
            if (includesSomeLane(updateLanes, renderLanes2)) {
              return true;
            }
            return false;
          }
          function attemptEarlyBailoutIfNoScheduledUpdate(current2, workInProgress2, renderLanes2) {
            switch (workInProgress2.tag) {
              case HostRoot:
                pushHostRootContext(workInProgress2);
                var root2 = workInProgress2.stateNode;
                resetHydrationState();
                break;
              case HostComponent:
                pushHostContext(workInProgress2);
                break;
              case ClassComponent: {
                var Component2 = workInProgress2.type;
                if (isContextProvider(Component2)) {
                  pushContextProvider(workInProgress2);
                }
                break;
              }
              case HostPortal:
                pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
                break;
              case ContextProvider: {
                var newValue = workInProgress2.memoizedProps.value;
                var context = workInProgress2.type._context;
                pushProvider(workInProgress2, context, newValue);
                break;
              }
              case Profiler2:
                {
                  var hasChildWork = includesSomeLane(renderLanes2, workInProgress2.childLanes);
                  if (hasChildWork) {
                    workInProgress2.flags |= Update;
                  }
                  {
                    var stateNode = workInProgress2.stateNode;
                    stateNode.effectDuration = 0;
                    stateNode.passiveEffectDuration = 0;
                  }
                }
                break;
              case SuspenseComponent: {
                var state = workInProgress2.memoizedState;
                if (state !== null) {
                  if (state.dehydrated !== null) {
                    pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
                    workInProgress2.flags |= DidCapture;
                    return null;
                  }
                  var primaryChildFragment = workInProgress2.child;
                  var primaryChildLanes = primaryChildFragment.childLanes;
                  if (includesSomeLane(renderLanes2, primaryChildLanes)) {
                    return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
                  } else {
                    pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
                    var child = bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
                    if (child !== null) {
                      return child.sibling;
                    } else {
                      return null;
                    }
                  }
                } else {
                  pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
                }
                break;
              }
              case SuspenseListComponent: {
                var didSuspendBefore = (current2.flags & DidCapture) !== NoFlags;
                var _hasChildWork = includesSomeLane(renderLanes2, workInProgress2.childLanes);
                if (didSuspendBefore) {
                  if (_hasChildWork) {
                    return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
                  }
                  workInProgress2.flags |= DidCapture;
                }
                var renderState = workInProgress2.memoizedState;
                if (renderState !== null) {
                  renderState.rendering = null;
                  renderState.tail = null;
                  renderState.lastEffect = null;
                }
                pushSuspenseContext(workInProgress2, suspenseStackCursor.current);
                if (_hasChildWork) {
                  break;
                } else {
                  return null;
                }
              }
              case OffscreenComponent:
              case LegacyHiddenComponent: {
                workInProgress2.lanes = NoLanes;
                return updateOffscreenComponent(current2, workInProgress2, renderLanes2);
              }
            }
            return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
          }
          function beginWork(current2, workInProgress2, renderLanes2) {
            {
              if (workInProgress2._debugNeedsRemount && current2 !== null) {
                return remountFiber(current2, workInProgress2, createFiberFromTypeAndProps(workInProgress2.type, workInProgress2.key, workInProgress2.pendingProps, workInProgress2._debugOwner || null, workInProgress2.mode, workInProgress2.lanes));
              }
            }
            if (current2 !== null) {
              var oldProps = current2.memoizedProps;
              var newProps = workInProgress2.pendingProps;
              if (oldProps !== newProps || hasContextChanged() || workInProgress2.type !== current2.type) {
                didReceiveUpdate = true;
              } else {
                var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current2, renderLanes2);
                if (!hasScheduledUpdateOrContext && (workInProgress2.flags & DidCapture) === NoFlags) {
                  didReceiveUpdate = false;
                  return attemptEarlyBailoutIfNoScheduledUpdate(current2, workInProgress2, renderLanes2);
                }
                if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
                  didReceiveUpdate = true;
                } else {
                  didReceiveUpdate = false;
                }
              }
            } else {
              didReceiveUpdate = false;
              if (getIsHydrating() && isForkedChild(workInProgress2)) {
                var slotIndex = workInProgress2.index;
                var numberOfForks = getForksAtLevel();
                pushTreeId(workInProgress2, numberOfForks, slotIndex);
              }
            }
            workInProgress2.lanes = NoLanes;
            switch (workInProgress2.tag) {
              case IndeterminateComponent: {
                return mountIndeterminateComponent(current2, workInProgress2, workInProgress2.type, renderLanes2);
              }
              case LazyComponent: {
                var elementType = workInProgress2.elementType;
                return mountLazyComponent(current2, workInProgress2, elementType, renderLanes2);
              }
              case FunctionComponent: {
                var Component2 = workInProgress2.type;
                var unresolvedProps = workInProgress2.pendingProps;
                var resolvedProps = workInProgress2.elementType === Component2 ? unresolvedProps : resolveDefaultProps(Component2, unresolvedProps);
                return updateFunctionComponent(current2, workInProgress2, Component2, resolvedProps, renderLanes2);
              }
              case ClassComponent: {
                var _Component = workInProgress2.type;
                var _unresolvedProps = workInProgress2.pendingProps;
                var _resolvedProps = workInProgress2.elementType === _Component ? _unresolvedProps : resolveDefaultProps(_Component, _unresolvedProps);
                return updateClassComponent(current2, workInProgress2, _Component, _resolvedProps, renderLanes2);
              }
              case HostRoot:
                return updateHostRoot(current2, workInProgress2, renderLanes2);
              case HostComponent:
                return updateHostComponent(current2, workInProgress2, renderLanes2);
              case HostText:
                return updateHostText(current2, workInProgress2);
              case SuspenseComponent:
                return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
              case HostPortal:
                return updatePortalComponent(current2, workInProgress2, renderLanes2);
              case ForwardRef: {
                var type = workInProgress2.type;
                var _unresolvedProps2 = workInProgress2.pendingProps;
                var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
                return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2);
              }
              case Fragment2:
                return updateFragment(current2, workInProgress2, renderLanes2);
              case Mode:
                return updateMode(current2, workInProgress2, renderLanes2);
              case Profiler2:
                return updateProfiler(current2, workInProgress2, renderLanes2);
              case ContextProvider:
                return updateContextProvider(current2, workInProgress2, renderLanes2);
              case ContextConsumer:
                return updateContextConsumer(current2, workInProgress2, renderLanes2);
              case MemoComponent: {
                var _type2 = workInProgress2.type;
                var _unresolvedProps3 = workInProgress2.pendingProps;
                var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);
                {
                  if (workInProgress2.type !== workInProgress2.elementType) {
                    var outerPropTypes = _type2.propTypes;
                    if (outerPropTypes) {
                      checkPropTypes(
                        outerPropTypes,
                        _resolvedProps3,
                        "prop",
                        getComponentNameFromType(_type2)
                      );
                    }
                  }
                }
                _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
                return updateMemoComponent(current2, workInProgress2, _type2, _resolvedProps3, renderLanes2);
              }
              case SimpleMemoComponent: {
                return updateSimpleMemoComponent(current2, workInProgress2, workInProgress2.type, workInProgress2.pendingProps, renderLanes2);
              }
              case IncompleteClassComponent: {
                var _Component2 = workInProgress2.type;
                var _unresolvedProps4 = workInProgress2.pendingProps;
                var _resolvedProps4 = workInProgress2.elementType === _Component2 ? _unresolvedProps4 : resolveDefaultProps(_Component2, _unresolvedProps4);
                return mountIncompleteClassComponent(current2, workInProgress2, _Component2, _resolvedProps4, renderLanes2);
              }
              case SuspenseListComponent: {
                return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
              }
              case ScopeComponent: {
                break;
              }
              case OffscreenComponent: {
                return updateOffscreenComponent(current2, workInProgress2, renderLanes2);
              }
            }
            throw new Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
          }
          function markUpdate(workInProgress2) {
            workInProgress2.flags |= Update;
          }
          function markRef$1(workInProgress2) {
            workInProgress2.flags |= Ref;
            {
              workInProgress2.flags |= RefStatic;
            }
          }
          var appendAllChildren;
          var updateHostContainer;
          var updateHostComponent$1;
          var updateHostText$1;
          {
            appendAllChildren = function(parent, workInProgress2, needsVisibilityToggle, isHidden) {
              var node = workInProgress2.child;
              while (node !== null) {
                if (node.tag === HostComponent || node.tag === HostText) {
                  appendInitialChild(parent, node.stateNode);
                } else if (node.tag === HostPortal)
                  ;
                else if (node.child !== null) {
                  node.child.return = node;
                  node = node.child;
                  continue;
                }
                if (node === workInProgress2) {
                  return;
                }
                while (node.sibling === null) {
                  if (node.return === null || node.return === workInProgress2) {
                    return;
                  }
                  node = node.return;
                }
                node.sibling.return = node.return;
                node = node.sibling;
              }
            };
            updateHostContainer = function(current2, workInProgress2) {
            };
            updateHostComponent$1 = function(current2, workInProgress2, type, newProps, rootContainerInstance) {
              var oldProps = current2.memoizedProps;
              if (oldProps === newProps) {
                return;
              }
              var instance = workInProgress2.stateNode;
              var currentHostContext = getHostContext();
              var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
              workInProgress2.updateQueue = updatePayload;
              if (updatePayload) {
                markUpdate(workInProgress2);
              }
            };
            updateHostText$1 = function(current2, workInProgress2, oldText, newText) {
              if (oldText !== newText) {
                markUpdate(workInProgress2);
              }
            };
          }
          function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
            if (getIsHydrating()) {
              return;
            }
            switch (renderState.tailMode) {
              case "hidden": {
                var tailNode = renderState.tail;
                var lastTailNode = null;
                while (tailNode !== null) {
                  if (tailNode.alternate !== null) {
                    lastTailNode = tailNode;
                  }
                  tailNode = tailNode.sibling;
                }
                if (lastTailNode === null) {
                  renderState.tail = null;
                } else {
                  lastTailNode.sibling = null;
                }
                break;
              }
              case "collapsed": {
                var _tailNode = renderState.tail;
                var _lastTailNode = null;
                while (_tailNode !== null) {
                  if (_tailNode.alternate !== null) {
                    _lastTailNode = _tailNode;
                  }
                  _tailNode = _tailNode.sibling;
                }
                if (_lastTailNode === null) {
                  if (!hasRenderedATailFallback && renderState.tail !== null) {
                    renderState.tail.sibling = null;
                  } else {
                    renderState.tail = null;
                  }
                } else {
                  _lastTailNode.sibling = null;
                }
                break;
              }
            }
          }
          function bubbleProperties(completedWork) {
            var didBailout = completedWork.alternate !== null && completedWork.alternate.child === completedWork.child;
            var newChildLanes = NoLanes;
            var subtreeFlags = NoFlags;
            if (!didBailout) {
              if ((completedWork.mode & ProfileMode) !== NoMode) {
                var actualDuration = completedWork.actualDuration;
                var treeBaseDuration = completedWork.selfBaseDuration;
                var child = completedWork.child;
                while (child !== null) {
                  newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes));
                  subtreeFlags |= child.subtreeFlags;
                  subtreeFlags |= child.flags;
                  actualDuration += child.actualDuration;
                  treeBaseDuration += child.treeBaseDuration;
                  child = child.sibling;
                }
                completedWork.actualDuration = actualDuration;
                completedWork.treeBaseDuration = treeBaseDuration;
              } else {
                var _child = completedWork.child;
                while (_child !== null) {
                  newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes));
                  subtreeFlags |= _child.subtreeFlags;
                  subtreeFlags |= _child.flags;
                  _child.return = completedWork;
                  _child = _child.sibling;
                }
              }
              completedWork.subtreeFlags |= subtreeFlags;
            } else {
              if ((completedWork.mode & ProfileMode) !== NoMode) {
                var _treeBaseDuration = completedWork.selfBaseDuration;
                var _child2 = completedWork.child;
                while (_child2 !== null) {
                  newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child2.lanes, _child2.childLanes));
                  subtreeFlags |= _child2.subtreeFlags & StaticMask;
                  subtreeFlags |= _child2.flags & StaticMask;
                  _treeBaseDuration += _child2.treeBaseDuration;
                  _child2 = _child2.sibling;
                }
                completedWork.treeBaseDuration = _treeBaseDuration;
              } else {
                var _child3 = completedWork.child;
                while (_child3 !== null) {
                  newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child3.lanes, _child3.childLanes));
                  subtreeFlags |= _child3.subtreeFlags & StaticMask;
                  subtreeFlags |= _child3.flags & StaticMask;
                  _child3.return = completedWork;
                  _child3 = _child3.sibling;
                }
              }
              completedWork.subtreeFlags |= subtreeFlags;
            }
            completedWork.childLanes = newChildLanes;
            return didBailout;
          }
          function completeDehydratedSuspenseBoundary(current2, workInProgress2, nextState) {
            if (hasUnhydratedTailNodes() && (workInProgress2.mode & ConcurrentMode) !== NoMode && (workInProgress2.flags & DidCapture) === NoFlags) {
              warnIfUnhydratedTailNodes(workInProgress2);
              resetHydrationState();
              workInProgress2.flags |= ForceClientRender | Incomplete | ShouldCapture;
              return false;
            }
            var wasHydrated = popHydrationState(workInProgress2);
            if (nextState !== null && nextState.dehydrated !== null) {
              if (current2 === null) {
                if (!wasHydrated) {
                  throw new Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");
                }
                prepareToHydrateHostSuspenseInstance(workInProgress2);
                bubbleProperties(workInProgress2);
                {
                  if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                    var isTimedOutSuspense = nextState !== null;
                    if (isTimedOutSuspense) {
                      var primaryChildFragment = workInProgress2.child;
                      if (primaryChildFragment !== null) {
                        workInProgress2.treeBaseDuration -= primaryChildFragment.treeBaseDuration;
                      }
                    }
                  }
                }
                return false;
              } else {
                resetHydrationState();
                if ((workInProgress2.flags & DidCapture) === NoFlags) {
                  workInProgress2.memoizedState = null;
                }
                workInProgress2.flags |= Update;
                bubbleProperties(workInProgress2);
                {
                  if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                    var _isTimedOutSuspense = nextState !== null;
                    if (_isTimedOutSuspense) {
                      var _primaryChildFragment = workInProgress2.child;
                      if (_primaryChildFragment !== null) {
                        workInProgress2.treeBaseDuration -= _primaryChildFragment.treeBaseDuration;
                      }
                    }
                  }
                }
                return false;
              }
            } else {
              upgradeHydrationErrorsToRecoverable();
              return true;
            }
          }
          function completeWork(current2, workInProgress2, renderLanes2) {
            var newProps = workInProgress2.pendingProps;
            popTreeContext(workInProgress2);
            switch (workInProgress2.tag) {
              case IndeterminateComponent:
              case LazyComponent:
              case SimpleMemoComponent:
              case FunctionComponent:
              case ForwardRef:
              case Fragment2:
              case Mode:
              case Profiler2:
              case ContextConsumer:
              case MemoComponent:
                bubbleProperties(workInProgress2);
                return null;
              case ClassComponent: {
                var Component2 = workInProgress2.type;
                if (isContextProvider(Component2)) {
                  popContext(workInProgress2);
                }
                bubbleProperties(workInProgress2);
                return null;
              }
              case HostRoot: {
                var fiberRoot = workInProgress2.stateNode;
                popHostContainer(workInProgress2);
                popTopLevelContextObject(workInProgress2);
                resetWorkInProgressVersions();
                if (fiberRoot.pendingContext) {
                  fiberRoot.context = fiberRoot.pendingContext;
                  fiberRoot.pendingContext = null;
                }
                if (current2 === null || current2.child === null) {
                  var wasHydrated = popHydrationState(workInProgress2);
                  if (wasHydrated) {
                    markUpdate(workInProgress2);
                  } else {
                    if (current2 !== null) {
                      var prevState = current2.memoizedState;
                      if (!prevState.isDehydrated || (workInProgress2.flags & ForceClientRender) !== NoFlags) {
                        workInProgress2.flags |= Snapshot;
                        upgradeHydrationErrorsToRecoverable();
                      }
                    }
                  }
                }
                updateHostContainer(current2, workInProgress2);
                bubbleProperties(workInProgress2);
                return null;
              }
              case HostComponent: {
                popHostContext(workInProgress2);
                var rootContainerInstance = getRootHostContainer();
                var type = workInProgress2.type;
                if (current2 !== null && workInProgress2.stateNode != null) {
                  updateHostComponent$1(current2, workInProgress2, type, newProps, rootContainerInstance);
                  if (current2.ref !== workInProgress2.ref) {
                    markRef$1(workInProgress2);
                  }
                } else {
                  if (!newProps) {
                    if (workInProgress2.stateNode === null) {
                      throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
                    }
                    bubbleProperties(workInProgress2);
                    return null;
                  }
                  var currentHostContext = getHostContext();
                  var _wasHydrated = popHydrationState(workInProgress2);
                  if (_wasHydrated) {
                    if (prepareToHydrateHostInstance(workInProgress2, rootContainerInstance, currentHostContext)) {
                      markUpdate(workInProgress2);
                    }
                  } else {
                    var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress2);
                    appendAllChildren(instance, workInProgress2, false, false);
                    workInProgress2.stateNode = instance;
                    if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) {
                      markUpdate(workInProgress2);
                    }
                  }
                  if (workInProgress2.ref !== null) {
                    markRef$1(workInProgress2);
                  }
                }
                bubbleProperties(workInProgress2);
                return null;
              }
              case HostText: {
                var newText = newProps;
                if (current2 && workInProgress2.stateNode != null) {
                  var oldText = current2.memoizedProps;
                  updateHostText$1(current2, workInProgress2, oldText, newText);
                } else {
                  if (typeof newText !== "string") {
                    if (workInProgress2.stateNode === null) {
                      throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
                    }
                  }
                  var _rootContainerInstance = getRootHostContainer();
                  var _currentHostContext = getHostContext();
                  var _wasHydrated2 = popHydrationState(workInProgress2);
                  if (_wasHydrated2) {
                    if (prepareToHydrateHostTextInstance(workInProgress2)) {
                      markUpdate(workInProgress2);
                    }
                  } else {
                    workInProgress2.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress2);
                  }
                }
                bubbleProperties(workInProgress2);
                return null;
              }
              case SuspenseComponent: {
                popSuspenseContext(workInProgress2);
                var nextState = workInProgress2.memoizedState;
                if (current2 === null || current2.memoizedState !== null && current2.memoizedState.dehydrated !== null) {
                  var fallthroughToNormalSuspensePath = completeDehydratedSuspenseBoundary(current2, workInProgress2, nextState);
                  if (!fallthroughToNormalSuspensePath) {
                    if (workInProgress2.flags & ShouldCapture) {
                      return workInProgress2;
                    } else {
                      return null;
                    }
                  }
                }
                if ((workInProgress2.flags & DidCapture) !== NoFlags) {
                  workInProgress2.lanes = renderLanes2;
                  if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                    transferActualDuration(workInProgress2);
                  }
                  return workInProgress2;
                }
                var nextDidTimeout = nextState !== null;
                var prevDidTimeout = current2 !== null && current2.memoizedState !== null;
                if (nextDidTimeout !== prevDidTimeout) {
                  if (nextDidTimeout) {
                    var _offscreenFiber2 = workInProgress2.child;
                    _offscreenFiber2.flags |= Visibility;
                    if ((workInProgress2.mode & ConcurrentMode) !== NoMode) {
                      var hasInvisibleChildContext = current2 === null && (workInProgress2.memoizedProps.unstable_avoidThisFallback !== true || !enableSuspenseAvoidThisFallback);
                      if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {
                        renderDidSuspend();
                      } else {
                        renderDidSuspendDelayIfPossible();
                      }
                    }
                  }
                }
                var wakeables = workInProgress2.updateQueue;
                if (wakeables !== null) {
                  workInProgress2.flags |= Update;
                }
                bubbleProperties(workInProgress2);
                {
                  if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                    if (nextDidTimeout) {
                      var primaryChildFragment = workInProgress2.child;
                      if (primaryChildFragment !== null) {
                        workInProgress2.treeBaseDuration -= primaryChildFragment.treeBaseDuration;
                      }
                    }
                  }
                }
                return null;
              }
              case HostPortal:
                popHostContainer(workInProgress2);
                updateHostContainer(current2, workInProgress2);
                if (current2 === null) {
                  preparePortalMount(workInProgress2.stateNode.containerInfo);
                }
                bubbleProperties(workInProgress2);
                return null;
              case ContextProvider:
                var context = workInProgress2.type._context;
                popProvider(context, workInProgress2);
                bubbleProperties(workInProgress2);
                return null;
              case IncompleteClassComponent: {
                var _Component = workInProgress2.type;
                if (isContextProvider(_Component)) {
                  popContext(workInProgress2);
                }
                bubbleProperties(workInProgress2);
                return null;
              }
              case SuspenseListComponent: {
                popSuspenseContext(workInProgress2);
                var renderState = workInProgress2.memoizedState;
                if (renderState === null) {
                  bubbleProperties(workInProgress2);
                  return null;
                }
                var didSuspendAlready = (workInProgress2.flags & DidCapture) !== NoFlags;
                var renderedTail = renderState.rendering;
                if (renderedTail === null) {
                  if (!didSuspendAlready) {
                    var cannotBeSuspended = renderHasNotSuspendedYet() && (current2 === null || (current2.flags & DidCapture) === NoFlags);
                    if (!cannotBeSuspended) {
                      var row = workInProgress2.child;
                      while (row !== null) {
                        var suspended = findFirstSuspended(row);
                        if (suspended !== null) {
                          didSuspendAlready = true;
                          workInProgress2.flags |= DidCapture;
                          cutOffTailIfNeeded(renderState, false);
                          var newThenables = suspended.updateQueue;
                          if (newThenables !== null) {
                            workInProgress2.updateQueue = newThenables;
                            workInProgress2.flags |= Update;
                          }
                          workInProgress2.subtreeFlags = NoFlags;
                          resetChildFibers(workInProgress2, renderLanes2);
                          pushSuspenseContext(workInProgress2, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));
                          return workInProgress2.child;
                        }
                        row = row.sibling;
                      }
                    }
                    if (renderState.tail !== null && now() > getRenderTargetTime()) {
                      workInProgress2.flags |= DidCapture;
                      didSuspendAlready = true;
                      cutOffTailIfNeeded(renderState, false);
                      workInProgress2.lanes = SomeRetryLane;
                    }
                  } else {
                    cutOffTailIfNeeded(renderState, false);
                  }
                } else {
                  if (!didSuspendAlready) {
                    var _suspended = findFirstSuspended(renderedTail);
                    if (_suspended !== null) {
                      workInProgress2.flags |= DidCapture;
                      didSuspendAlready = true;
                      var _newThenables = _suspended.updateQueue;
                      if (_newThenables !== null) {
                        workInProgress2.updateQueue = _newThenables;
                        workInProgress2.flags |= Update;
                      }
                      cutOffTailIfNeeded(renderState, true);
                      if (renderState.tail === null && renderState.tailMode === "hidden" && !renderedTail.alternate && !getIsHydrating()) {
                        bubbleProperties(workInProgress2);
                        return null;
                      }
                    } else if (now() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes2 !== OffscreenLane) {
                      workInProgress2.flags |= DidCapture;
                      didSuspendAlready = true;
                      cutOffTailIfNeeded(renderState, false);
                      workInProgress2.lanes = SomeRetryLane;
                    }
                  }
                  if (renderState.isBackwards) {
                    renderedTail.sibling = workInProgress2.child;
                    workInProgress2.child = renderedTail;
                  } else {
                    var previousSibling = renderState.last;
                    if (previousSibling !== null) {
                      previousSibling.sibling = renderedTail;
                    } else {
                      workInProgress2.child = renderedTail;
                    }
                    renderState.last = renderedTail;
                  }
                }
                if (renderState.tail !== null) {
                  var next = renderState.tail;
                  renderState.rendering = next;
                  renderState.tail = next.sibling;
                  renderState.renderingStartTime = now();
                  next.sibling = null;
                  var suspenseContext = suspenseStackCursor.current;
                  if (didSuspendAlready) {
                    suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
                  } else {
                    suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
                  }
                  pushSuspenseContext(workInProgress2, suspenseContext);
                  return next;
                }
                bubbleProperties(workInProgress2);
                return null;
              }
              case ScopeComponent: {
                break;
              }
              case OffscreenComponent:
              case LegacyHiddenComponent: {
                popRenderLanes(workInProgress2);
                var _nextState = workInProgress2.memoizedState;
                var nextIsHidden = _nextState !== null;
                if (current2 !== null) {
                  var _prevState = current2.memoizedState;
                  var prevIsHidden = _prevState !== null;
                  if (prevIsHidden !== nextIsHidden && !enableLegacyHidden) {
                    workInProgress2.flags |= Visibility;
                  }
                }
                if (!nextIsHidden || (workInProgress2.mode & ConcurrentMode) === NoMode) {
                  bubbleProperties(workInProgress2);
                } else {
                  if (includesSomeLane(subtreeRenderLanes, OffscreenLane)) {
                    bubbleProperties(workInProgress2);
                    {
                      if (workInProgress2.subtreeFlags & (Placement | Update)) {
                        workInProgress2.flags |= Visibility;
                      }
                    }
                  }
                }
                return null;
              }
              case CacheComponent: {
                return null;
              }
              case TracingMarkerComponent: {
                return null;
              }
            }
            throw new Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
          }
          function unwindWork(current2, workInProgress2, renderLanes2) {
            popTreeContext(workInProgress2);
            switch (workInProgress2.tag) {
              case ClassComponent: {
                var Component2 = workInProgress2.type;
                if (isContextProvider(Component2)) {
                  popContext(workInProgress2);
                }
                var flags = workInProgress2.flags;
                if (flags & ShouldCapture) {
                  workInProgress2.flags = flags & ~ShouldCapture | DidCapture;
                  if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                    transferActualDuration(workInProgress2);
                  }
                  return workInProgress2;
                }
                return null;
              }
              case HostRoot: {
                var root2 = workInProgress2.stateNode;
                popHostContainer(workInProgress2);
                popTopLevelContextObject(workInProgress2);
                resetWorkInProgressVersions();
                var _flags = workInProgress2.flags;
                if ((_flags & ShouldCapture) !== NoFlags && (_flags & DidCapture) === NoFlags) {
                  workInProgress2.flags = _flags & ~ShouldCapture | DidCapture;
                  return workInProgress2;
                }
                return null;
              }
              case HostComponent: {
                popHostContext(workInProgress2);
                return null;
              }
              case SuspenseComponent: {
                popSuspenseContext(workInProgress2);
                var suspenseState = workInProgress2.memoizedState;
                if (suspenseState !== null && suspenseState.dehydrated !== null) {
                  if (workInProgress2.alternate === null) {
                    throw new Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");
                  }
                  resetHydrationState();
                }
                var _flags2 = workInProgress2.flags;
                if (_flags2 & ShouldCapture) {
                  workInProgress2.flags = _flags2 & ~ShouldCapture | DidCapture;
                  if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                    transferActualDuration(workInProgress2);
                  }
                  return workInProgress2;
                }
                return null;
              }
              case SuspenseListComponent: {
                popSuspenseContext(workInProgress2);
                return null;
              }
              case HostPortal:
                popHostContainer(workInProgress2);
                return null;
              case ContextProvider:
                var context = workInProgress2.type._context;
                popProvider(context, workInProgress2);
                return null;
              case OffscreenComponent:
              case LegacyHiddenComponent:
                popRenderLanes(workInProgress2);
                return null;
              case CacheComponent:
                return null;
              default:
                return null;
            }
          }
          function unwindInterruptedWork(current2, interruptedWork, renderLanes2) {
            popTreeContext(interruptedWork);
            switch (interruptedWork.tag) {
              case ClassComponent: {
                var childContextTypes = interruptedWork.type.childContextTypes;
                if (childContextTypes !== null && childContextTypes !== void 0) {
                  popContext(interruptedWork);
                }
                break;
              }
              case HostRoot: {
                var root2 = interruptedWork.stateNode;
                popHostContainer(interruptedWork);
                popTopLevelContextObject(interruptedWork);
                resetWorkInProgressVersions();
                break;
              }
              case HostComponent: {
                popHostContext(interruptedWork);
                break;
              }
              case HostPortal:
                popHostContainer(interruptedWork);
                break;
              case SuspenseComponent:
                popSuspenseContext(interruptedWork);
                break;
              case SuspenseListComponent:
                popSuspenseContext(interruptedWork);
                break;
              case ContextProvider:
                var context = interruptedWork.type._context;
                popProvider(context, interruptedWork);
                break;
              case OffscreenComponent:
              case LegacyHiddenComponent:
                popRenderLanes(interruptedWork);
                break;
            }
          }
          var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
          {
            didWarnAboutUndefinedSnapshotBeforeUpdate = /* @__PURE__ */ new Set();
          }
          var offscreenSubtreeIsHidden = false;
          var offscreenSubtreeWasHidden = false;
          var PossiblyWeakSet = typeof WeakSet === "function" ? WeakSet : Set;
          var nextEffect = null;
          var inProgressLanes = null;
          var inProgressRoot = null;
          function reportUncaughtErrorInDEV(error2) {
            {
              invokeGuardedCallback(null, function() {
                throw error2;
              });
              clearCaughtError();
            }
          }
          var callComponentWillUnmountWithTimer = function(current2, instance) {
            instance.props = current2.memoizedProps;
            instance.state = current2.memoizedState;
            if (current2.mode & ProfileMode) {
              try {
                startLayoutEffectTimer();
                instance.componentWillUnmount();
              } finally {
                recordLayoutEffectDuration(current2);
              }
            } else {
              instance.componentWillUnmount();
            }
          };
          function safelyCallCommitHookLayoutEffectListMount(current2, nearestMountedAncestor) {
            try {
              commitHookEffectListMount(Layout, current2);
            } catch (error2) {
              captureCommitPhaseError(current2, nearestMountedAncestor, error2);
            }
          }
          function safelyCallComponentWillUnmount(current2, nearestMountedAncestor, instance) {
            try {
              callComponentWillUnmountWithTimer(current2, instance);
            } catch (error2) {
              captureCommitPhaseError(current2, nearestMountedAncestor, error2);
            }
          }
          function safelyCallComponentDidMount(current2, nearestMountedAncestor, instance) {
            try {
              instance.componentDidMount();
            } catch (error2) {
              captureCommitPhaseError(current2, nearestMountedAncestor, error2);
            }
          }
          function safelyAttachRef(current2, nearestMountedAncestor) {
            try {
              commitAttachRef(current2);
            } catch (error2) {
              captureCommitPhaseError(current2, nearestMountedAncestor, error2);
            }
          }
          function safelyDetachRef(current2, nearestMountedAncestor) {
            var ref = current2.ref;
            if (ref !== null) {
              if (typeof ref === "function") {
                var retVal;
                try {
                  if (enableProfilerTimer && enableProfilerCommitHooks && current2.mode & ProfileMode) {
                    try {
                      startLayoutEffectTimer();
                      retVal = ref(null);
                    } finally {
                      recordLayoutEffectDuration(current2);
                    }
                  } else {
                    retVal = ref(null);
                  }
                } catch (error2) {
                  captureCommitPhaseError(current2, nearestMountedAncestor, error2);
                }
                {
                  if (typeof retVal === "function") {
                    error("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", getComponentNameFromFiber(current2));
                  }
                }
              } else {
                ref.current = null;
              }
            }
          }
          function safelyCallDestroy(current2, nearestMountedAncestor, destroy) {
            try {
              destroy();
            } catch (error2) {
              captureCommitPhaseError(current2, nearestMountedAncestor, error2);
            }
          }
          var focusedInstanceHandle = null;
          var shouldFireAfterActiveInstanceBlur = false;
          function commitBeforeMutationEffects(root2, firstChild) {
            focusedInstanceHandle = prepareForCommit(root2.containerInfo);
            nextEffect = firstChild;
            commitBeforeMutationEffects_begin();
            var shouldFire = shouldFireAfterActiveInstanceBlur;
            shouldFireAfterActiveInstanceBlur = false;
            focusedInstanceHandle = null;
            return shouldFire;
          }
          function commitBeforeMutationEffects_begin() {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              var child = fiber.child;
              if ((fiber.subtreeFlags & BeforeMutationMask) !== NoFlags && child !== null) {
                child.return = fiber;
                nextEffect = child;
              } else {
                commitBeforeMutationEffects_complete();
              }
            }
          }
          function commitBeforeMutationEffects_complete() {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              setCurrentFiber(fiber);
              try {
                commitBeforeMutationEffectsOnFiber(fiber);
              } catch (error2) {
                captureCommitPhaseError(fiber, fiber.return, error2);
              }
              resetCurrentFiber();
              var sibling = fiber.sibling;
              if (sibling !== null) {
                sibling.return = fiber.return;
                nextEffect = sibling;
                return;
              }
              nextEffect = fiber.return;
            }
          }
          function commitBeforeMutationEffectsOnFiber(finishedWork) {
            var current2 = finishedWork.alternate;
            var flags = finishedWork.flags;
            if ((flags & Snapshot) !== NoFlags) {
              setCurrentFiber(finishedWork);
              switch (finishedWork.tag) {
                case FunctionComponent:
                case ForwardRef:
                case SimpleMemoComponent: {
                  break;
                }
                case ClassComponent: {
                  if (current2 !== null) {
                    var prevProps = current2.memoizedProps;
                    var prevState = current2.memoizedState;
                    var instance = finishedWork.stateNode;
                    {
                      if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                        if (instance.props !== finishedWork.memoizedProps) {
                          error("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
                        }
                        if (instance.state !== finishedWork.memoizedState) {
                          error("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
                        }
                      }
                    }
                    var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);
                    {
                      var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;
                      if (snapshot === void 0 && !didWarnSet.has(finishedWork.type)) {
                        didWarnSet.add(finishedWork.type);
                        error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", getComponentNameFromFiber(finishedWork));
                      }
                    }
                    instance.__reactInternalSnapshotBeforeUpdate = snapshot;
                  }
                  break;
                }
                case HostRoot: {
                  {
                    var root2 = finishedWork.stateNode;
                    clearContainer(root2.containerInfo);
                  }
                  break;
                }
                case HostComponent:
                case HostText:
                case HostPortal:
                case IncompleteClassComponent:
                  break;
                default: {
                  throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
              resetCurrentFiber();
            }
          }
          function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor) {
            var updateQueue = finishedWork.updateQueue;
            var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
            if (lastEffect !== null) {
              var firstEffect = lastEffect.next;
              var effect = firstEffect;
              do {
                if ((effect.tag & flags) === flags) {
                  var destroy = effect.destroy;
                  effect.destroy = void 0;
                  if (destroy !== void 0) {
                    {
                      if ((flags & Passive$1) !== NoFlags$1) {
                        markComponentPassiveEffectUnmountStarted(finishedWork);
                      } else if ((flags & Layout) !== NoFlags$1) {
                        markComponentLayoutEffectUnmountStarted(finishedWork);
                      }
                    }
                    {
                      if ((flags & Insertion) !== NoFlags$1) {
                        setIsRunningInsertionEffect(true);
                      }
                    }
                    safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy);
                    {
                      if ((flags & Insertion) !== NoFlags$1) {
                        setIsRunningInsertionEffect(false);
                      }
                    }
                    {
                      if ((flags & Passive$1) !== NoFlags$1) {
                        markComponentPassiveEffectUnmountStopped();
                      } else if ((flags & Layout) !== NoFlags$1) {
                        markComponentLayoutEffectUnmountStopped();
                      }
                    }
                  }
                }
                effect = effect.next;
              } while (effect !== firstEffect);
            }
          }
          function commitHookEffectListMount(flags, finishedWork) {
            var updateQueue = finishedWork.updateQueue;
            var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
            if (lastEffect !== null) {
              var firstEffect = lastEffect.next;
              var effect = firstEffect;
              do {
                if ((effect.tag & flags) === flags) {
                  {
                    if ((flags & Passive$1) !== NoFlags$1) {
                      markComponentPassiveEffectMountStarted(finishedWork);
                    } else if ((flags & Layout) !== NoFlags$1) {
                      markComponentLayoutEffectMountStarted(finishedWork);
                    }
                  }
                  var create = effect.create;
                  {
                    if ((flags & Insertion) !== NoFlags$1) {
                      setIsRunningInsertionEffect(true);
                    }
                  }
                  effect.destroy = create();
                  {
                    if ((flags & Insertion) !== NoFlags$1) {
                      setIsRunningInsertionEffect(false);
                    }
                  }
                  {
                    if ((flags & Passive$1) !== NoFlags$1) {
                      markComponentPassiveEffectMountStopped();
                    } else if ((flags & Layout) !== NoFlags$1) {
                      markComponentLayoutEffectMountStopped();
                    }
                  }
                  {
                    var destroy = effect.destroy;
                    if (destroy !== void 0 && typeof destroy !== "function") {
                      var hookName = void 0;
                      if ((effect.tag & Layout) !== NoFlags) {
                        hookName = "useLayoutEffect";
                      } else if ((effect.tag & Insertion) !== NoFlags) {
                        hookName = "useInsertionEffect";
                      } else {
                        hookName = "useEffect";
                      }
                      var addendum = void 0;
                      if (destroy === null) {
                        addendum = " You returned null. If your effect does not require clean up, return undefined (or nothing).";
                      } else if (typeof destroy.then === "function") {
                        addendum = "\n\nIt looks like you wrote " + hookName + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + hookName + "(() => {\n  async function fetchData() {\n    // You can await here\n    const response = await MyAPI.getData(someId);\n    // ...\n  }\n  fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching";
                      } else {
                        addendum = " You returned: " + destroy;
                      }
                      error("%s must not return anything besides a function, which is used for clean-up.%s", hookName, addendum);
                    }
                  }
                }
                effect = effect.next;
              } while (effect !== firstEffect);
            }
          }
          function commitPassiveEffectDurations(finishedRoot, finishedWork) {
            {
              if ((finishedWork.flags & Update) !== NoFlags) {
                switch (finishedWork.tag) {
                  case Profiler2: {
                    var passiveEffectDuration = finishedWork.stateNode.passiveEffectDuration;
                    var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, onPostCommit = _finishedWork$memoize.onPostCommit;
                    var commitTime2 = getCommitTime();
                    var phase = finishedWork.alternate === null ? "mount" : "update";
                    {
                      if (isCurrentUpdateNested()) {
                        phase = "nested-update";
                      }
                    }
                    if (typeof onPostCommit === "function") {
                      onPostCommit(id, phase, passiveEffectDuration, commitTime2);
                    }
                    var parentFiber = finishedWork.return;
                    outer:
                      while (parentFiber !== null) {
                        switch (parentFiber.tag) {
                          case HostRoot:
                            var root2 = parentFiber.stateNode;
                            root2.passiveEffectDuration += passiveEffectDuration;
                            break outer;
                          case Profiler2:
                            var parentStateNode = parentFiber.stateNode;
                            parentStateNode.passiveEffectDuration += passiveEffectDuration;
                            break outer;
                        }
                        parentFiber = parentFiber.return;
                      }
                    break;
                  }
                }
              }
            }
          }
          function commitLayoutEffectOnFiber(finishedRoot, current2, finishedWork, committedLanes) {
            if ((finishedWork.flags & LayoutMask) !== NoFlags) {
              switch (finishedWork.tag) {
                case FunctionComponent:
                case ForwardRef:
                case SimpleMemoComponent: {
                  if (!offscreenSubtreeWasHidden) {
                    if (finishedWork.mode & ProfileMode) {
                      try {
                        startLayoutEffectTimer();
                        commitHookEffectListMount(Layout | HasEffect, finishedWork);
                      } finally {
                        recordLayoutEffectDuration(finishedWork);
                      }
                    } else {
                      commitHookEffectListMount(Layout | HasEffect, finishedWork);
                    }
                  }
                  break;
                }
                case ClassComponent: {
                  var instance = finishedWork.stateNode;
                  if (finishedWork.flags & Update) {
                    if (!offscreenSubtreeWasHidden) {
                      if (current2 === null) {
                        {
                          if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                            if (instance.props !== finishedWork.memoizedProps) {
                              error("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
                            }
                            if (instance.state !== finishedWork.memoizedState) {
                              error("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
                            }
                          }
                        }
                        if (finishedWork.mode & ProfileMode) {
                          try {
                            startLayoutEffectTimer();
                            instance.componentDidMount();
                          } finally {
                            recordLayoutEffectDuration(finishedWork);
                          }
                        } else {
                          instance.componentDidMount();
                        }
                      } else {
                        var prevProps = finishedWork.elementType === finishedWork.type ? current2.memoizedProps : resolveDefaultProps(finishedWork.type, current2.memoizedProps);
                        var prevState = current2.memoizedState;
                        {
                          if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                            if (instance.props !== finishedWork.memoizedProps) {
                              error("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
                            }
                            if (instance.state !== finishedWork.memoizedState) {
                              error("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
                            }
                          }
                        }
                        if (finishedWork.mode & ProfileMode) {
                          try {
                            startLayoutEffectTimer();
                            instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
                          } finally {
                            recordLayoutEffectDuration(finishedWork);
                          }
                        } else {
                          instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
                        }
                      }
                    }
                  }
                  var updateQueue = finishedWork.updateQueue;
                  if (updateQueue !== null) {
                    {
                      if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                        if (instance.props !== finishedWork.memoizedProps) {
                          error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
                        }
                        if (instance.state !== finishedWork.memoizedState) {
                          error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
                        }
                      }
                    }
                    commitUpdateQueue(finishedWork, updateQueue, instance);
                  }
                  break;
                }
                case HostRoot: {
                  var _updateQueue = finishedWork.updateQueue;
                  if (_updateQueue !== null) {
                    var _instance = null;
                    if (finishedWork.child !== null) {
                      switch (finishedWork.child.tag) {
                        case HostComponent:
                          _instance = getPublicInstance(finishedWork.child.stateNode);
                          break;
                        case ClassComponent:
                          _instance = finishedWork.child.stateNode;
                          break;
                      }
                    }
                    commitUpdateQueue(finishedWork, _updateQueue, _instance);
                  }
                  break;
                }
                case HostComponent: {
                  var _instance2 = finishedWork.stateNode;
                  if (current2 === null && finishedWork.flags & Update) {
                    var type = finishedWork.type;
                    var props = finishedWork.memoizedProps;
                    commitMount(_instance2, type, props);
                  }
                  break;
                }
                case HostText: {
                  break;
                }
                case HostPortal: {
                  break;
                }
                case Profiler2: {
                  {
                    var _finishedWork$memoize2 = finishedWork.memoizedProps, onCommit = _finishedWork$memoize2.onCommit, onRender = _finishedWork$memoize2.onRender;
                    var effectDuration = finishedWork.stateNode.effectDuration;
                    var commitTime2 = getCommitTime();
                    var phase = current2 === null ? "mount" : "update";
                    {
                      if (isCurrentUpdateNested()) {
                        phase = "nested-update";
                      }
                    }
                    if (typeof onRender === "function") {
                      onRender(finishedWork.memoizedProps.id, phase, finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime2);
                    }
                    {
                      if (typeof onCommit === "function") {
                        onCommit(finishedWork.memoizedProps.id, phase, effectDuration, commitTime2);
                      }
                      enqueuePendingPassiveProfilerEffect(finishedWork);
                      var parentFiber = finishedWork.return;
                      outer:
                        while (parentFiber !== null) {
                          switch (parentFiber.tag) {
                            case HostRoot:
                              var root2 = parentFiber.stateNode;
                              root2.effectDuration += effectDuration;
                              break outer;
                            case Profiler2:
                              var parentStateNode = parentFiber.stateNode;
                              parentStateNode.effectDuration += effectDuration;
                              break outer;
                          }
                          parentFiber = parentFiber.return;
                        }
                    }
                  }
                  break;
                }
                case SuspenseComponent: {
                  commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
                  break;
                }
                case SuspenseListComponent:
                case IncompleteClassComponent:
                case ScopeComponent:
                case OffscreenComponent:
                case LegacyHiddenComponent:
                case TracingMarkerComponent: {
                  break;
                }
                default:
                  throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            if (!offscreenSubtreeWasHidden) {
              {
                if (finishedWork.flags & Ref) {
                  commitAttachRef(finishedWork);
                }
              }
            }
          }
          function reappearLayoutEffectsOnFiber(node) {
            switch (node.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent: {
                if (node.mode & ProfileMode) {
                  try {
                    startLayoutEffectTimer();
                    safelyCallCommitHookLayoutEffectListMount(node, node.return);
                  } finally {
                    recordLayoutEffectDuration(node);
                  }
                } else {
                  safelyCallCommitHookLayoutEffectListMount(node, node.return);
                }
                break;
              }
              case ClassComponent: {
                var instance = node.stateNode;
                if (typeof instance.componentDidMount === "function") {
                  safelyCallComponentDidMount(node, node.return, instance);
                }
                safelyAttachRef(node, node.return);
                break;
              }
              case HostComponent: {
                safelyAttachRef(node, node.return);
                break;
              }
            }
          }
          function hideOrUnhideAllChildren(finishedWork, isHidden) {
            var hostSubtreeRoot = null;
            {
              var node = finishedWork;
              while (true) {
                if (node.tag === HostComponent) {
                  if (hostSubtreeRoot === null) {
                    hostSubtreeRoot = node;
                    try {
                      var instance = node.stateNode;
                      if (isHidden) {
                        hideInstance(instance);
                      } else {
                        unhideInstance(node.stateNode, node.memoizedProps);
                      }
                    } catch (error2) {
                      captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                    }
                  }
                } else if (node.tag === HostText) {
                  if (hostSubtreeRoot === null) {
                    try {
                      var _instance3 = node.stateNode;
                      if (isHidden) {
                        hideTextInstance(_instance3);
                      } else {
                        unhideTextInstance(_instance3, node.memoizedProps);
                      }
                    } catch (error2) {
                      captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                    }
                  }
                } else if ((node.tag === OffscreenComponent || node.tag === LegacyHiddenComponent) && node.memoizedState !== null && node !== finishedWork)
                  ;
                else if (node.child !== null) {
                  node.child.return = node;
                  node = node.child;
                  continue;
                }
                if (node === finishedWork) {
                  return;
                }
                while (node.sibling === null) {
                  if (node.return === null || node.return === finishedWork) {
                    return;
                  }
                  if (hostSubtreeRoot === node) {
                    hostSubtreeRoot = null;
                  }
                  node = node.return;
                }
                if (hostSubtreeRoot === node) {
                  hostSubtreeRoot = null;
                }
                node.sibling.return = node.return;
                node = node.sibling;
              }
            }
          }
          function commitAttachRef(finishedWork) {
            var ref = finishedWork.ref;
            if (ref !== null) {
              var instance = finishedWork.stateNode;
              var instanceToUse;
              switch (finishedWork.tag) {
                case HostComponent:
                  instanceToUse = getPublicInstance(instance);
                  break;
                default:
                  instanceToUse = instance;
              }
              if (typeof ref === "function") {
                var retVal;
                if (finishedWork.mode & ProfileMode) {
                  try {
                    startLayoutEffectTimer();
                    retVal = ref(instanceToUse);
                  } finally {
                    recordLayoutEffectDuration(finishedWork);
                  }
                } else {
                  retVal = ref(instanceToUse);
                }
                {
                  if (typeof retVal === "function") {
                    error("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", getComponentNameFromFiber(finishedWork));
                  }
                }
              } else {
                {
                  if (!ref.hasOwnProperty("current")) {
                    error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", getComponentNameFromFiber(finishedWork));
                  }
                }
                ref.current = instanceToUse;
              }
            }
          }
          function detachFiberMutation(fiber) {
            var alternate = fiber.alternate;
            if (alternate !== null) {
              alternate.return = null;
            }
            fiber.return = null;
          }
          function detachFiberAfterEffects(fiber) {
            var alternate = fiber.alternate;
            if (alternate !== null) {
              fiber.alternate = null;
              detachFiberAfterEffects(alternate);
            }
            {
              fiber.child = null;
              fiber.deletions = null;
              fiber.sibling = null;
              if (fiber.tag === HostComponent) {
                var hostInstance = fiber.stateNode;
                if (hostInstance !== null) {
                  detachDeletedInstance(hostInstance);
                }
              }
              fiber.stateNode = null;
              {
                fiber._debugOwner = null;
              }
              {
                fiber.return = null;
                fiber.dependencies = null;
                fiber.memoizedProps = null;
                fiber.memoizedState = null;
                fiber.pendingProps = null;
                fiber.stateNode = null;
                fiber.updateQueue = null;
              }
            }
          }
          function getHostParentFiber(fiber) {
            var parent = fiber.return;
            while (parent !== null) {
              if (isHostParent(parent)) {
                return parent;
              }
              parent = parent.return;
            }
            throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
          }
          function isHostParent(fiber) {
            return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;
          }
          function getHostSibling(fiber) {
            var node = fiber;
            siblings:
              while (true) {
                while (node.sibling === null) {
                  if (node.return === null || isHostParent(node.return)) {
                    return null;
                  }
                  node = node.return;
                }
                node.sibling.return = node.return;
                node = node.sibling;
                while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {
                  if (node.flags & Placement) {
                    continue siblings;
                  }
                  if (node.child === null || node.tag === HostPortal) {
                    continue siblings;
                  } else {
                    node.child.return = node;
                    node = node.child;
                  }
                }
                if (!(node.flags & Placement)) {
                  return node.stateNode;
                }
              }
          }
          function commitPlacement(finishedWork) {
            var parentFiber = getHostParentFiber(finishedWork);
            switch (parentFiber.tag) {
              case HostComponent: {
                var parent = parentFiber.stateNode;
                if (parentFiber.flags & ContentReset) {
                  resetTextContent(parent);
                  parentFiber.flags &= ~ContentReset;
                }
                var before = getHostSibling(finishedWork);
                insertOrAppendPlacementNode(finishedWork, before, parent);
                break;
              }
              case HostRoot:
              case HostPortal: {
                var _parent = parentFiber.stateNode.containerInfo;
                var _before = getHostSibling(finishedWork);
                insertOrAppendPlacementNodeIntoContainer(finishedWork, _before, _parent);
                break;
              }
              default:
                throw new Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.");
            }
          }
          function insertOrAppendPlacementNodeIntoContainer(node, before, parent) {
            var tag = node.tag;
            var isHost = tag === HostComponent || tag === HostText;
            if (isHost) {
              var stateNode = node.stateNode;
              if (before) {
                insertInContainerBefore(parent, stateNode, before);
              } else {
                appendChildToContainer(parent, stateNode);
              }
            } else if (tag === HostPortal)
              ;
            else {
              var child = node.child;
              if (child !== null) {
                insertOrAppendPlacementNodeIntoContainer(child, before, parent);
                var sibling = child.sibling;
                while (sibling !== null) {
                  insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);
                  sibling = sibling.sibling;
                }
              }
            }
          }
          function insertOrAppendPlacementNode(node, before, parent) {
            var tag = node.tag;
            var isHost = tag === HostComponent || tag === HostText;
            if (isHost) {
              var stateNode = node.stateNode;
              if (before) {
                insertBefore(parent, stateNode, before);
              } else {
                appendChild(parent, stateNode);
              }
            } else if (tag === HostPortal)
              ;
            else {
              var child = node.child;
              if (child !== null) {
                insertOrAppendPlacementNode(child, before, parent);
                var sibling = child.sibling;
                while (sibling !== null) {
                  insertOrAppendPlacementNode(sibling, before, parent);
                  sibling = sibling.sibling;
                }
              }
            }
          }
          var hostParent = null;
          var hostParentIsContainer = false;
          function commitDeletionEffects(root2, returnFiber, deletedFiber) {
            {
              var parent = returnFiber;
              findParent:
                while (parent !== null) {
                  switch (parent.tag) {
                    case HostComponent: {
                      hostParent = parent.stateNode;
                      hostParentIsContainer = false;
                      break findParent;
                    }
                    case HostRoot: {
                      hostParent = parent.stateNode.containerInfo;
                      hostParentIsContainer = true;
                      break findParent;
                    }
                    case HostPortal: {
                      hostParent = parent.stateNode.containerInfo;
                      hostParentIsContainer = true;
                      break findParent;
                    }
                  }
                  parent = parent.return;
                }
              if (hostParent === null) {
                throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
              }
              commitDeletionEffectsOnFiber(root2, returnFiber, deletedFiber);
              hostParent = null;
              hostParentIsContainer = false;
            }
            detachFiberMutation(deletedFiber);
          }
          function recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, parent) {
            var child = parent.child;
            while (child !== null) {
              commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, child);
              child = child.sibling;
            }
          }
          function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, deletedFiber) {
            onCommitUnmount(deletedFiber);
            switch (deletedFiber.tag) {
              case HostComponent: {
                if (!offscreenSubtreeWasHidden) {
                  safelyDetachRef(deletedFiber, nearestMountedAncestor);
                }
              }
              case HostText: {
                {
                  var prevHostParent = hostParent;
                  var prevHostParentIsContainer = hostParentIsContainer;
                  hostParent = null;
                  recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
                  hostParent = prevHostParent;
                  hostParentIsContainer = prevHostParentIsContainer;
                  if (hostParent !== null) {
                    if (hostParentIsContainer) {
                      removeChildFromContainer(hostParent, deletedFiber.stateNode);
                    } else {
                      removeChild(hostParent, deletedFiber.stateNode);
                    }
                  }
                }
                return;
              }
              case DehydratedFragment: {
                {
                  if (hostParent !== null) {
                    if (hostParentIsContainer) {
                      clearSuspenseBoundaryFromContainer(hostParent, deletedFiber.stateNode);
                    } else {
                      clearSuspenseBoundary(hostParent, deletedFiber.stateNode);
                    }
                  }
                }
                return;
              }
              case HostPortal: {
                {
                  var _prevHostParent = hostParent;
                  var _prevHostParentIsContainer = hostParentIsContainer;
                  hostParent = deletedFiber.stateNode.containerInfo;
                  hostParentIsContainer = true;
                  recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
                  hostParent = _prevHostParent;
                  hostParentIsContainer = _prevHostParentIsContainer;
                }
                return;
              }
              case FunctionComponent:
              case ForwardRef:
              case MemoComponent:
              case SimpleMemoComponent: {
                if (!offscreenSubtreeWasHidden) {
                  var updateQueue = deletedFiber.updateQueue;
                  if (updateQueue !== null) {
                    var lastEffect = updateQueue.lastEffect;
                    if (lastEffect !== null) {
                      var firstEffect = lastEffect.next;
                      var effect = firstEffect;
                      do {
                        var _effect = effect, destroy = _effect.destroy, tag = _effect.tag;
                        if (destroy !== void 0) {
                          if ((tag & Insertion) !== NoFlags$1) {
                            safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);
                          } else if ((tag & Layout) !== NoFlags$1) {
                            {
                              markComponentLayoutEffectUnmountStarted(deletedFiber);
                            }
                            if (deletedFiber.mode & ProfileMode) {
                              startLayoutEffectTimer();
                              safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);
                              recordLayoutEffectDuration(deletedFiber);
                            } else {
                              safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);
                            }
                            {
                              markComponentLayoutEffectUnmountStopped();
                            }
                          }
                        }
                        effect = effect.next;
                      } while (effect !== firstEffect);
                    }
                  }
                }
                recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
                return;
              }
              case ClassComponent: {
                if (!offscreenSubtreeWasHidden) {
                  safelyDetachRef(deletedFiber, nearestMountedAncestor);
                  var instance = deletedFiber.stateNode;
                  if (typeof instance.componentWillUnmount === "function") {
                    safelyCallComponentWillUnmount(deletedFiber, nearestMountedAncestor, instance);
                  }
                }
                recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
                return;
              }
              case ScopeComponent: {
                recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
                return;
              }
              case OffscreenComponent: {
                if (deletedFiber.mode & ConcurrentMode) {
                  var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
                  offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || deletedFiber.memoizedState !== null;
                  recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
                  offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
                } else {
                  recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
                }
                break;
              }
              default: {
                recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
                return;
              }
            }
          }
          function commitSuspenseCallback(finishedWork) {
            var newState = finishedWork.memoizedState;
          }
          function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
            var newState = finishedWork.memoizedState;
            if (newState === null) {
              var current2 = finishedWork.alternate;
              if (current2 !== null) {
                var prevState = current2.memoizedState;
                if (prevState !== null) {
                  var suspenseInstance = prevState.dehydrated;
                  if (suspenseInstance !== null) {
                    commitHydratedSuspenseInstance(suspenseInstance);
                  }
                }
              }
            }
          }
          function attachSuspenseRetryListeners(finishedWork) {
            var wakeables = finishedWork.updateQueue;
            if (wakeables !== null) {
              finishedWork.updateQueue = null;
              var retryCache = finishedWork.stateNode;
              if (retryCache === null) {
                retryCache = finishedWork.stateNode = new PossiblyWeakSet();
              }
              wakeables.forEach(function(wakeable) {
                var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
                if (!retryCache.has(wakeable)) {
                  retryCache.add(wakeable);
                  {
                    if (isDevToolsPresent) {
                      if (inProgressLanes !== null && inProgressRoot !== null) {
                        restorePendingUpdaters(inProgressRoot, inProgressLanes);
                      } else {
                        throw Error("Expected finished root and lanes to be set. This is a bug in React.");
                      }
                    }
                  }
                  wakeable.then(retry, retry);
                }
              });
            }
          }
          function commitMutationEffects(root2, finishedWork, committedLanes) {
            inProgressLanes = committedLanes;
            inProgressRoot = root2;
            setCurrentFiber(finishedWork);
            commitMutationEffectsOnFiber(finishedWork, root2);
            setCurrentFiber(finishedWork);
            inProgressLanes = null;
            inProgressRoot = null;
          }
          function recursivelyTraverseMutationEffects(root2, parentFiber, lanes) {
            var deletions = parentFiber.deletions;
            if (deletions !== null) {
              for (var i = 0; i < deletions.length; i++) {
                var childToDelete = deletions[i];
                try {
                  commitDeletionEffects(root2, parentFiber, childToDelete);
                } catch (error2) {
                  captureCommitPhaseError(childToDelete, parentFiber, error2);
                }
              }
            }
            var prevDebugFiber = getCurrentFiber();
            if (parentFiber.subtreeFlags & MutationMask) {
              var child = parentFiber.child;
              while (child !== null) {
                setCurrentFiber(child);
                commitMutationEffectsOnFiber(child, root2);
                child = child.sibling;
              }
            }
            setCurrentFiber(prevDebugFiber);
          }
          function commitMutationEffectsOnFiber(finishedWork, root2, lanes) {
            var current2 = finishedWork.alternate;
            var flags = finishedWork.flags;
            switch (finishedWork.tag) {
              case FunctionComponent:
              case ForwardRef:
              case MemoComponent:
              case SimpleMemoComponent: {
                recursivelyTraverseMutationEffects(root2, finishedWork);
                commitReconciliationEffects(finishedWork);
                if (flags & Update) {
                  try {
                    commitHookEffectListUnmount(Insertion | HasEffect, finishedWork, finishedWork.return);
                    commitHookEffectListMount(Insertion | HasEffect, finishedWork);
                  } catch (error2) {
                    captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                  }
                  if (finishedWork.mode & ProfileMode) {
                    try {
                      startLayoutEffectTimer();
                      commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return);
                    } catch (error2) {
                      captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                    }
                    recordLayoutEffectDuration(finishedWork);
                  } else {
                    try {
                      commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return);
                    } catch (error2) {
                      captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                    }
                  }
                }
                return;
              }
              case ClassComponent: {
                recursivelyTraverseMutationEffects(root2, finishedWork);
                commitReconciliationEffects(finishedWork);
                if (flags & Ref) {
                  if (current2 !== null) {
                    safelyDetachRef(current2, current2.return);
                  }
                }
                return;
              }
              case HostComponent: {
                recursivelyTraverseMutationEffects(root2, finishedWork);
                commitReconciliationEffects(finishedWork);
                if (flags & Ref) {
                  if (current2 !== null) {
                    safelyDetachRef(current2, current2.return);
                  }
                }
                {
                  if (finishedWork.flags & ContentReset) {
                    var instance = finishedWork.stateNode;
                    try {
                      resetTextContent(instance);
                    } catch (error2) {
                      captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                    }
                  }
                  if (flags & Update) {
                    var _instance4 = finishedWork.stateNode;
                    if (_instance4 != null) {
                      var newProps = finishedWork.memoizedProps;
                      var oldProps = current2 !== null ? current2.memoizedProps : newProps;
                      var type = finishedWork.type;
                      var updatePayload = finishedWork.updateQueue;
                      finishedWork.updateQueue = null;
                      if (updatePayload !== null) {
                        try {
                          commitUpdate(_instance4, updatePayload, type, oldProps, newProps, finishedWork);
                        } catch (error2) {
                          captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                        }
                      }
                    }
                  }
                }
                return;
              }
              case HostText: {
                recursivelyTraverseMutationEffects(root2, finishedWork);
                commitReconciliationEffects(finishedWork);
                if (flags & Update) {
                  {
                    if (finishedWork.stateNode === null) {
                      throw new Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");
                    }
                    var textInstance = finishedWork.stateNode;
                    var newText = finishedWork.memoizedProps;
                    var oldText = current2 !== null ? current2.memoizedProps : newText;
                    try {
                      commitTextUpdate(textInstance, oldText, newText);
                    } catch (error2) {
                      captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                    }
                  }
                }
                return;
              }
              case HostRoot: {
                recursivelyTraverseMutationEffects(root2, finishedWork);
                commitReconciliationEffects(finishedWork);
                if (flags & Update) {
                  {
                    if (current2 !== null) {
                      var prevRootState = current2.memoizedState;
                      if (prevRootState.isDehydrated) {
                        try {
                          commitHydratedContainer(root2.containerInfo);
                        } catch (error2) {
                          captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                        }
                      }
                    }
                  }
                }
                return;
              }
              case HostPortal: {
                recursivelyTraverseMutationEffects(root2, finishedWork);
                commitReconciliationEffects(finishedWork);
                return;
              }
              case SuspenseComponent: {
                recursivelyTraverseMutationEffects(root2, finishedWork);
                commitReconciliationEffects(finishedWork);
                var offscreenFiber = finishedWork.child;
                if (offscreenFiber.flags & Visibility) {
                  var offscreenInstance = offscreenFiber.stateNode;
                  var newState = offscreenFiber.memoizedState;
                  var isHidden = newState !== null;
                  offscreenInstance.isHidden = isHidden;
                  if (isHidden) {
                    var wasHidden = offscreenFiber.alternate !== null && offscreenFiber.alternate.memoizedState !== null;
                    if (!wasHidden) {
                      markCommitTimeOfFallback();
                    }
                  }
                }
                if (flags & Update) {
                  try {
                    commitSuspenseCallback(finishedWork);
                  } catch (error2) {
                    captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                  }
                  attachSuspenseRetryListeners(finishedWork);
                }
                return;
              }
              case OffscreenComponent: {
                var _wasHidden = current2 !== null && current2.memoizedState !== null;
                if (finishedWork.mode & ConcurrentMode) {
                  var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
                  offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || _wasHidden;
                  recursivelyTraverseMutationEffects(root2, finishedWork);
                  offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
                } else {
                  recursivelyTraverseMutationEffects(root2, finishedWork);
                }
                commitReconciliationEffects(finishedWork);
                if (flags & Visibility) {
                  var _offscreenInstance = finishedWork.stateNode;
                  var _newState = finishedWork.memoizedState;
                  var _isHidden = _newState !== null;
                  var offscreenBoundary = finishedWork;
                  _offscreenInstance.isHidden = _isHidden;
                  {
                    if (_isHidden) {
                      if (!_wasHidden) {
                        if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) {
                          nextEffect = offscreenBoundary;
                          var offscreenChild = offscreenBoundary.child;
                          while (offscreenChild !== null) {
                            nextEffect = offscreenChild;
                            disappearLayoutEffects_begin(offscreenChild);
                            offscreenChild = offscreenChild.sibling;
                          }
                        }
                      }
                    }
                  }
                  {
                    hideOrUnhideAllChildren(offscreenBoundary, _isHidden);
                  }
                }
                return;
              }
              case SuspenseListComponent: {
                recursivelyTraverseMutationEffects(root2, finishedWork);
                commitReconciliationEffects(finishedWork);
                if (flags & Update) {
                  attachSuspenseRetryListeners(finishedWork);
                }
                return;
              }
              case ScopeComponent: {
                return;
              }
              default: {
                recursivelyTraverseMutationEffects(root2, finishedWork);
                commitReconciliationEffects(finishedWork);
                return;
              }
            }
          }
          function commitReconciliationEffects(finishedWork) {
            var flags = finishedWork.flags;
            if (flags & Placement) {
              try {
                commitPlacement(finishedWork);
              } catch (error2) {
                captureCommitPhaseError(finishedWork, finishedWork.return, error2);
              }
              finishedWork.flags &= ~Placement;
            }
            if (flags & Hydrating) {
              finishedWork.flags &= ~Hydrating;
            }
          }
          function commitLayoutEffects(finishedWork, root2, committedLanes) {
            inProgressLanes = committedLanes;
            inProgressRoot = root2;
            nextEffect = finishedWork;
            commitLayoutEffects_begin(finishedWork, root2, committedLanes);
            inProgressLanes = null;
            inProgressRoot = null;
          }
          function commitLayoutEffects_begin(subtreeRoot, root2, committedLanes) {
            var isModernRoot = (subtreeRoot.mode & ConcurrentMode) !== NoMode;
            while (nextEffect !== null) {
              var fiber = nextEffect;
              var firstChild = fiber.child;
              if (fiber.tag === OffscreenComponent && isModernRoot) {
                var isHidden = fiber.memoizedState !== null;
                var newOffscreenSubtreeIsHidden = isHidden || offscreenSubtreeIsHidden;
                if (newOffscreenSubtreeIsHidden) {
                  commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes);
                  continue;
                } else {
                  var current2 = fiber.alternate;
                  var wasHidden = current2 !== null && current2.memoizedState !== null;
                  var newOffscreenSubtreeWasHidden = wasHidden || offscreenSubtreeWasHidden;
                  var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden;
                  var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
                  offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden;
                  offscreenSubtreeWasHidden = newOffscreenSubtreeWasHidden;
                  if (offscreenSubtreeWasHidden && !prevOffscreenSubtreeWasHidden) {
                    nextEffect = fiber;
                    reappearLayoutEffects_begin(fiber);
                  }
                  var child = firstChild;
                  while (child !== null) {
                    nextEffect = child;
                    commitLayoutEffects_begin(
                      child,
                      root2,
                      committedLanes
                    );
                    child = child.sibling;
                  }
                  nextEffect = fiber;
                  offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden;
                  offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
                  commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes);
                  continue;
                }
              }
              if ((fiber.subtreeFlags & LayoutMask) !== NoFlags && firstChild !== null) {
                firstChild.return = fiber;
                nextEffect = firstChild;
              } else {
                commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes);
              }
            }
          }
          function commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes) {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              if ((fiber.flags & LayoutMask) !== NoFlags) {
                var current2 = fiber.alternate;
                setCurrentFiber(fiber);
                try {
                  commitLayoutEffectOnFiber(root2, current2, fiber, committedLanes);
                } catch (error2) {
                  captureCommitPhaseError(fiber, fiber.return, error2);
                }
                resetCurrentFiber();
              }
              if (fiber === subtreeRoot) {
                nextEffect = null;
                return;
              }
              var sibling = fiber.sibling;
              if (sibling !== null) {
                sibling.return = fiber.return;
                nextEffect = sibling;
                return;
              }
              nextEffect = fiber.return;
            }
          }
          function disappearLayoutEffects_begin(subtreeRoot) {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              var firstChild = fiber.child;
              switch (fiber.tag) {
                case FunctionComponent:
                case ForwardRef:
                case MemoComponent:
                case SimpleMemoComponent: {
                  if (fiber.mode & ProfileMode) {
                    try {
                      startLayoutEffectTimer();
                      commitHookEffectListUnmount(Layout, fiber, fiber.return);
                    } finally {
                      recordLayoutEffectDuration(fiber);
                    }
                  } else {
                    commitHookEffectListUnmount(Layout, fiber, fiber.return);
                  }
                  break;
                }
                case ClassComponent: {
                  safelyDetachRef(fiber, fiber.return);
                  var instance = fiber.stateNode;
                  if (typeof instance.componentWillUnmount === "function") {
                    safelyCallComponentWillUnmount(fiber, fiber.return, instance);
                  }
                  break;
                }
                case HostComponent: {
                  safelyDetachRef(fiber, fiber.return);
                  break;
                }
                case OffscreenComponent: {
                  var isHidden = fiber.memoizedState !== null;
                  if (isHidden) {
                    disappearLayoutEffects_complete(subtreeRoot);
                    continue;
                  }
                  break;
                }
              }
              if (firstChild !== null) {
                firstChild.return = fiber;
                nextEffect = firstChild;
              } else {
                disappearLayoutEffects_complete(subtreeRoot);
              }
            }
          }
          function disappearLayoutEffects_complete(subtreeRoot) {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              if (fiber === subtreeRoot) {
                nextEffect = null;
                return;
              }
              var sibling = fiber.sibling;
              if (sibling !== null) {
                sibling.return = fiber.return;
                nextEffect = sibling;
                return;
              }
              nextEffect = fiber.return;
            }
          }
          function reappearLayoutEffects_begin(subtreeRoot) {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              var firstChild = fiber.child;
              if (fiber.tag === OffscreenComponent) {
                var isHidden = fiber.memoizedState !== null;
                if (isHidden) {
                  reappearLayoutEffects_complete(subtreeRoot);
                  continue;
                }
              }
              if (firstChild !== null) {
                firstChild.return = fiber;
                nextEffect = firstChild;
              } else {
                reappearLayoutEffects_complete(subtreeRoot);
              }
            }
          }
          function reappearLayoutEffects_complete(subtreeRoot) {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              setCurrentFiber(fiber);
              try {
                reappearLayoutEffectsOnFiber(fiber);
              } catch (error2) {
                captureCommitPhaseError(fiber, fiber.return, error2);
              }
              resetCurrentFiber();
              if (fiber === subtreeRoot) {
                nextEffect = null;
                return;
              }
              var sibling = fiber.sibling;
              if (sibling !== null) {
                sibling.return = fiber.return;
                nextEffect = sibling;
                return;
              }
              nextEffect = fiber.return;
            }
          }
          function commitPassiveMountEffects(root2, finishedWork, committedLanes, committedTransitions) {
            nextEffect = finishedWork;
            commitPassiveMountEffects_begin(finishedWork, root2, committedLanes, committedTransitions);
          }
          function commitPassiveMountEffects_begin(subtreeRoot, root2, committedLanes, committedTransitions) {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              var firstChild = fiber.child;
              if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && firstChild !== null) {
                firstChild.return = fiber;
                nextEffect = firstChild;
              } else {
                commitPassiveMountEffects_complete(subtreeRoot, root2, committedLanes, committedTransitions);
              }
            }
          }
          function commitPassiveMountEffects_complete(subtreeRoot, root2, committedLanes, committedTransitions) {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              if ((fiber.flags & Passive) !== NoFlags) {
                setCurrentFiber(fiber);
                try {
                  commitPassiveMountOnFiber(root2, fiber, committedLanes, committedTransitions);
                } catch (error2) {
                  captureCommitPhaseError(fiber, fiber.return, error2);
                }
                resetCurrentFiber();
              }
              if (fiber === subtreeRoot) {
                nextEffect = null;
                return;
              }
              var sibling = fiber.sibling;
              if (sibling !== null) {
                sibling.return = fiber.return;
                nextEffect = sibling;
                return;
              }
              nextEffect = fiber.return;
            }
          }
          function commitPassiveMountOnFiber(finishedRoot, finishedWork, committedLanes, committedTransitions) {
            switch (finishedWork.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent: {
                if (finishedWork.mode & ProfileMode) {
                  startPassiveEffectTimer();
                  try {
                    commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);
                  } finally {
                    recordPassiveEffectDuration(finishedWork);
                  }
                } else {
                  commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);
                }
                break;
              }
            }
          }
          function commitPassiveUnmountEffects(firstChild) {
            nextEffect = firstChild;
            commitPassiveUnmountEffects_begin();
          }
          function commitPassiveUnmountEffects_begin() {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              var child = fiber.child;
              if ((nextEffect.flags & ChildDeletion) !== NoFlags) {
                var deletions = fiber.deletions;
                if (deletions !== null) {
                  for (var i = 0; i < deletions.length; i++) {
                    var fiberToDelete = deletions[i];
                    nextEffect = fiberToDelete;
                    commitPassiveUnmountEffectsInsideOfDeletedTree_begin(fiberToDelete, fiber);
                  }
                  {
                    var previousFiber = fiber.alternate;
                    if (previousFiber !== null) {
                      var detachedChild = previousFiber.child;
                      if (detachedChild !== null) {
                        previousFiber.child = null;
                        do {
                          var detachedSibling = detachedChild.sibling;
                          detachedChild.sibling = null;
                          detachedChild = detachedSibling;
                        } while (detachedChild !== null);
                      }
                    }
                  }
                  nextEffect = fiber;
                }
              }
              if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && child !== null) {
                child.return = fiber;
                nextEffect = child;
              } else {
                commitPassiveUnmountEffects_complete();
              }
            }
          }
          function commitPassiveUnmountEffects_complete() {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              if ((fiber.flags & Passive) !== NoFlags) {
                setCurrentFiber(fiber);
                commitPassiveUnmountOnFiber(fiber);
                resetCurrentFiber();
              }
              var sibling = fiber.sibling;
              if (sibling !== null) {
                sibling.return = fiber.return;
                nextEffect = sibling;
                return;
              }
              nextEffect = fiber.return;
            }
          }
          function commitPassiveUnmountOnFiber(finishedWork) {
            switch (finishedWork.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent: {
                if (finishedWork.mode & ProfileMode) {
                  startPassiveEffectTimer();
                  commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return);
                  recordPassiveEffectDuration(finishedWork);
                } else {
                  commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return);
                }
                break;
              }
            }
          }
          function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(deletedSubtreeRoot, nearestMountedAncestor) {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              setCurrentFiber(fiber);
              commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor);
              resetCurrentFiber();
              var child = fiber.child;
              if (child !== null) {
                child.return = fiber;
                nextEffect = child;
              } else {
                commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot);
              }
            }
          }
          function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot) {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              var sibling = fiber.sibling;
              var returnFiber = fiber.return;
              {
                detachFiberAfterEffects(fiber);
                if (fiber === deletedSubtreeRoot) {
                  nextEffect = null;
                  return;
                }
              }
              if (sibling !== null) {
                sibling.return = returnFiber;
                nextEffect = sibling;
                return;
              }
              nextEffect = returnFiber;
            }
          }
          function commitPassiveUnmountInsideDeletedTreeOnFiber(current2, nearestMountedAncestor) {
            switch (current2.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent: {
                if (current2.mode & ProfileMode) {
                  startPassiveEffectTimer();
                  commitHookEffectListUnmount(Passive$1, current2, nearestMountedAncestor);
                  recordPassiveEffectDuration(current2);
                } else {
                  commitHookEffectListUnmount(Passive$1, current2, nearestMountedAncestor);
                }
                break;
              }
            }
          }
          function invokeLayoutEffectMountInDEV(fiber) {
            {
              switch (fiber.tag) {
                case FunctionComponent:
                case ForwardRef:
                case SimpleMemoComponent: {
                  try {
                    commitHookEffectListMount(Layout | HasEffect, fiber);
                  } catch (error2) {
                    captureCommitPhaseError(fiber, fiber.return, error2);
                  }
                  break;
                }
                case ClassComponent: {
                  var instance = fiber.stateNode;
                  try {
                    instance.componentDidMount();
                  } catch (error2) {
                    captureCommitPhaseError(fiber, fiber.return, error2);
                  }
                  break;
                }
              }
            }
          }
          function invokePassiveEffectMountInDEV(fiber) {
            {
              switch (fiber.tag) {
                case FunctionComponent:
                case ForwardRef:
                case SimpleMemoComponent: {
                  try {
                    commitHookEffectListMount(Passive$1 | HasEffect, fiber);
                  } catch (error2) {
                    captureCommitPhaseError(fiber, fiber.return, error2);
                  }
                  break;
                }
              }
            }
          }
          function invokeLayoutEffectUnmountInDEV(fiber) {
            {
              switch (fiber.tag) {
                case FunctionComponent:
                case ForwardRef:
                case SimpleMemoComponent: {
                  try {
                    commitHookEffectListUnmount(Layout | HasEffect, fiber, fiber.return);
                  } catch (error2) {
                    captureCommitPhaseError(fiber, fiber.return, error2);
                  }
                  break;
                }
                case ClassComponent: {
                  var instance = fiber.stateNode;
                  if (typeof instance.componentWillUnmount === "function") {
                    safelyCallComponentWillUnmount(fiber, fiber.return, instance);
                  }
                  break;
                }
              }
            }
          }
          function invokePassiveEffectUnmountInDEV(fiber) {
            {
              switch (fiber.tag) {
                case FunctionComponent:
                case ForwardRef:
                case SimpleMemoComponent: {
                  try {
                    commitHookEffectListUnmount(Passive$1 | HasEffect, fiber, fiber.return);
                  } catch (error2) {
                    captureCommitPhaseError(fiber, fiber.return, error2);
                  }
                }
              }
            }
          }
          var COMPONENT_TYPE = 0;
          var HAS_PSEUDO_CLASS_TYPE = 1;
          var ROLE_TYPE = 2;
          var TEST_NAME_TYPE = 3;
          var TEXT_TYPE = 4;
          if (typeof Symbol === "function" && Symbol.for) {
            var symbolFor = Symbol.for;
            COMPONENT_TYPE = symbolFor("selector.component");
            HAS_PSEUDO_CLASS_TYPE = symbolFor("selector.has_pseudo_class");
            ROLE_TYPE = symbolFor("selector.role");
            TEST_NAME_TYPE = symbolFor("selector.test_id");
            TEXT_TYPE = symbolFor("selector.text");
          }
          var commitHooks = [];
          function onCommitRoot$1() {
            {
              commitHooks.forEach(function(commitHook) {
                return commitHook();
              });
            }
          }
          var ReactCurrentActQueue = ReactSharedInternals.ReactCurrentActQueue;
          function isLegacyActEnvironment(fiber) {
            {
              var isReactActEnvironmentGlobal = typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : void 0;
              var jestIsDefined = typeof jest !== "undefined";
              return jestIsDefined && isReactActEnvironmentGlobal !== false;
            }
          }
          function isConcurrentActEnvironment() {
            {
              var isReactActEnvironmentGlobal = typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : void 0;
              if (!isReactActEnvironmentGlobal && ReactCurrentActQueue.current !== null) {
                error("The current testing environment is not configured to support act(...)");
              }
              return isReactActEnvironmentGlobal;
            }
          }
          var ceil = Math.ceil;
          var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, ReactCurrentBatchConfig$3 = ReactSharedInternals.ReactCurrentBatchConfig, ReactCurrentActQueue$1 = ReactSharedInternals.ReactCurrentActQueue;
          var NoContext = 0;
          var BatchedContext = 1;
          var RenderContext = 2;
          var CommitContext = 4;
          var RootInProgress = 0;
          var RootFatalErrored = 1;
          var RootErrored = 2;
          var RootSuspended = 3;
          var RootSuspendedWithDelay = 4;
          var RootCompleted = 5;
          var RootDidNotComplete = 6;
          var executionContext = NoContext;
          var workInProgressRoot = null;
          var workInProgress = null;
          var workInProgressRootRenderLanes = NoLanes;
          var subtreeRenderLanes = NoLanes;
          var subtreeRenderLanesCursor = createCursor(NoLanes);
          var workInProgressRootExitStatus = RootInProgress;
          var workInProgressRootFatalError = null;
          var workInProgressRootIncludedLanes = NoLanes;
          var workInProgressRootSkippedLanes = NoLanes;
          var workInProgressRootInterleavedUpdatedLanes = NoLanes;
          var workInProgressRootPingedLanes = NoLanes;
          var workInProgressRootConcurrentErrors = null;
          var workInProgressRootRecoverableErrors = null;
          var globalMostRecentFallbackTime = 0;
          var FALLBACK_THROTTLE_MS = 500;
          var workInProgressRootRenderTargetTime = Infinity;
          var RENDER_TIMEOUT_MS = 500;
          var workInProgressTransitions = null;
          function resetRenderTimer() {
            workInProgressRootRenderTargetTime = now() + RENDER_TIMEOUT_MS;
          }
          function getRenderTargetTime() {
            return workInProgressRootRenderTargetTime;
          }
          var hasUncaughtError = false;
          var firstUncaughtError = null;
          var legacyErrorBoundariesThatAlreadyFailed = null;
          var rootDoesHavePassiveEffects = false;
          var rootWithPendingPassiveEffects = null;
          var pendingPassiveEffectsLanes = NoLanes;
          var pendingPassiveProfilerEffects = [];
          var pendingPassiveTransitions = null;
          var NESTED_UPDATE_LIMIT = 50;
          var nestedUpdateCount = 0;
          var rootWithNestedUpdates = null;
          var isFlushingPassiveEffects = false;
          var didScheduleUpdateDuringPassiveEffects = false;
          var NESTED_PASSIVE_UPDATE_LIMIT = 50;
          var nestedPassiveUpdateCount = 0;
          var rootWithPassiveNestedUpdates = null;
          var currentEventTime = NoTimestamp;
          var currentEventTransitionLane = NoLanes;
          var isRunningInsertionEffect = false;
          function getWorkInProgressRoot() {
            return workInProgressRoot;
          }
          function requestEventTime() {
            if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
              return now();
            }
            if (currentEventTime !== NoTimestamp) {
              return currentEventTime;
            }
            currentEventTime = now();
            return currentEventTime;
          }
          function requestUpdateLane(fiber) {
            var mode = fiber.mode;
            if ((mode & ConcurrentMode) === NoMode) {
              return SyncLane;
            } else if ((executionContext & RenderContext) !== NoContext && workInProgressRootRenderLanes !== NoLanes) {
              return pickArbitraryLane(workInProgressRootRenderLanes);
            }
            var isTransition = requestCurrentTransition() !== NoTransition;
            if (isTransition) {
              if (ReactCurrentBatchConfig$3.transition !== null) {
                var transition = ReactCurrentBatchConfig$3.transition;
                if (!transition._updatedFibers) {
                  transition._updatedFibers = /* @__PURE__ */ new Set();
                }
                transition._updatedFibers.add(fiber);
              }
              if (currentEventTransitionLane === NoLane) {
                currentEventTransitionLane = claimNextTransitionLane();
              }
              return currentEventTransitionLane;
            }
            var updateLane = getCurrentUpdatePriority();
            if (updateLane !== NoLane) {
              return updateLane;
            }
            var eventLane = getCurrentEventPriority();
            return eventLane;
          }
          function requestRetryLane(fiber) {
            var mode = fiber.mode;
            if ((mode & ConcurrentMode) === NoMode) {
              return SyncLane;
            }
            return claimNextRetryLane();
          }
          function scheduleUpdateOnFiber(root2, fiber, lane, eventTime) {
            checkForNestedUpdates();
            {
              if (isRunningInsertionEffect) {
                error("useInsertionEffect must not schedule updates.");
              }
            }
            {
              if (isFlushingPassiveEffects) {
                didScheduleUpdateDuringPassiveEffects = true;
              }
            }
            markRootUpdated(root2, lane, eventTime);
            if ((executionContext & RenderContext) !== NoLanes && root2 === workInProgressRoot) {
              warnAboutRenderPhaseUpdatesInDEV(fiber);
            } else {
              {
                if (isDevToolsPresent) {
                  addFiberToLanesMap(root2, fiber, lane);
                }
              }
              warnIfUpdatesNotWrappedWithActDEV(fiber);
              if (root2 === workInProgressRoot) {
                if ((executionContext & RenderContext) === NoContext) {
                  workInProgressRootInterleavedUpdatedLanes = mergeLanes(workInProgressRootInterleavedUpdatedLanes, lane);
                }
                if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
                  markRootSuspended$1(root2, workInProgressRootRenderLanes);
                }
              }
              ensureRootIsScheduled(root2, eventTime);
              if (lane === SyncLane && executionContext === NoContext && (fiber.mode & ConcurrentMode) === NoMode && !ReactCurrentActQueue$1.isBatchingLegacy) {
                resetRenderTimer();
                flushSyncCallbacksOnlyInLegacyMode();
              }
            }
          }
          function scheduleInitialHydrationOnRoot(root2, lane, eventTime) {
            var current2 = root2.current;
            current2.lanes = lane;
            markRootUpdated(root2, lane, eventTime);
            ensureRootIsScheduled(root2, eventTime);
          }
          function isUnsafeClassRenderPhaseUpdate(fiber) {
            return (executionContext & RenderContext) !== NoContext;
          }
          function ensureRootIsScheduled(root2, currentTime) {
            var existingCallbackNode = root2.callbackNode;
            markStarvedLanesAsExpired(root2, currentTime);
            var nextLanes = getNextLanes(root2, root2 === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);
            if (nextLanes === NoLanes) {
              if (existingCallbackNode !== null) {
                cancelCallback$1(existingCallbackNode);
              }
              root2.callbackNode = null;
              root2.callbackPriority = NoLane;
              return;
            }
            var newCallbackPriority = getHighestPriorityLane(nextLanes);
            var existingCallbackPriority = root2.callbackPriority;
            if (existingCallbackPriority === newCallbackPriority && !(ReactCurrentActQueue$1.current !== null && existingCallbackNode !== fakeActCallbackNode)) {
              {
                if (existingCallbackNode == null && existingCallbackPriority !== SyncLane) {
                  error("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
              return;
            }
            if (existingCallbackNode != null) {
              cancelCallback$1(existingCallbackNode);
            }
            var newCallbackNode;
            if (newCallbackPriority === SyncLane) {
              if (root2.tag === LegacyRoot) {
                if (ReactCurrentActQueue$1.isBatchingLegacy !== null) {
                  ReactCurrentActQueue$1.didScheduleLegacyUpdate = true;
                }
                scheduleLegacySyncCallback(performSyncWorkOnRoot.bind(null, root2));
              } else {
                scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root2));
              }
              {
                if (ReactCurrentActQueue$1.current !== null) {
                  ReactCurrentActQueue$1.current.push(flushSyncCallbacks);
                } else {
                  scheduleMicrotask(function() {
                    if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
                      flushSyncCallbacks();
                    }
                  });
                }
              }
              newCallbackNode = null;
            } else {
              var schedulerPriorityLevel;
              switch (lanesToEventPriority(nextLanes)) {
                case DiscreteEventPriority:
                  schedulerPriorityLevel = ImmediatePriority;
                  break;
                case ContinuousEventPriority:
                  schedulerPriorityLevel = UserBlockingPriority;
                  break;
                case DefaultEventPriority:
                  schedulerPriorityLevel = NormalPriority;
                  break;
                case IdleEventPriority:
                  schedulerPriorityLevel = IdlePriority;
                  break;
                default:
                  schedulerPriorityLevel = NormalPriority;
                  break;
              }
              newCallbackNode = scheduleCallback$1(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root2));
            }
            root2.callbackPriority = newCallbackPriority;
            root2.callbackNode = newCallbackNode;
          }
          function performConcurrentWorkOnRoot(root2, didTimeout) {
            {
              resetNestedUpdateFlag();
            }
            currentEventTime = NoTimestamp;
            currentEventTransitionLane = NoLanes;
            if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
              throw new Error("Should not already be working.");
            }
            var originalCallbackNode = root2.callbackNode;
            var didFlushPassiveEffects = flushPassiveEffects();
            if (didFlushPassiveEffects) {
              if (root2.callbackNode !== originalCallbackNode) {
                return null;
              }
            }
            var lanes = getNextLanes(root2, root2 === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);
            if (lanes === NoLanes) {
              return null;
            }
            var shouldTimeSlice = !includesBlockingLane(root2, lanes) && !includesExpiredLane(root2, lanes) && !didTimeout;
            var exitStatus = shouldTimeSlice ? renderRootConcurrent(root2, lanes) : renderRootSync(root2, lanes);
            if (exitStatus !== RootInProgress) {
              if (exitStatus === RootErrored) {
                var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root2);
                if (errorRetryLanes !== NoLanes) {
                  lanes = errorRetryLanes;
                  exitStatus = recoverFromConcurrentError(root2, errorRetryLanes);
                }
              }
              if (exitStatus === RootFatalErrored) {
                var fatalError = workInProgressRootFatalError;
                prepareFreshStack(root2, NoLanes);
                markRootSuspended$1(root2, lanes);
                ensureRootIsScheduled(root2, now());
                throw fatalError;
              }
              if (exitStatus === RootDidNotComplete) {
                markRootSuspended$1(root2, lanes);
              } else {
                var renderWasConcurrent = !includesBlockingLane(root2, lanes);
                var finishedWork = root2.current.alternate;
                if (renderWasConcurrent && !isRenderConsistentWithExternalStores(finishedWork)) {
                  exitStatus = renderRootSync(root2, lanes);
                  if (exitStatus === RootErrored) {
                    var _errorRetryLanes = getLanesToRetrySynchronouslyOnError(root2);
                    if (_errorRetryLanes !== NoLanes) {
                      lanes = _errorRetryLanes;
                      exitStatus = recoverFromConcurrentError(root2, _errorRetryLanes);
                    }
                  }
                  if (exitStatus === RootFatalErrored) {
                    var _fatalError = workInProgressRootFatalError;
                    prepareFreshStack(root2, NoLanes);
                    markRootSuspended$1(root2, lanes);
                    ensureRootIsScheduled(root2, now());
                    throw _fatalError;
                  }
                }
                root2.finishedWork = finishedWork;
                root2.finishedLanes = lanes;
                finishConcurrentRender(root2, exitStatus, lanes);
              }
            }
            ensureRootIsScheduled(root2, now());
            if (root2.callbackNode === originalCallbackNode) {
              return performConcurrentWorkOnRoot.bind(null, root2);
            }
            return null;
          }
          function recoverFromConcurrentError(root2, errorRetryLanes) {
            var errorsFromFirstAttempt = workInProgressRootConcurrentErrors;
            if (isRootDehydrated(root2)) {
              var rootWorkInProgress = prepareFreshStack(root2, errorRetryLanes);
              rootWorkInProgress.flags |= ForceClientRender;
              {
                errorHydratingContainer(root2.containerInfo);
              }
            }
            var exitStatus = renderRootSync(root2, errorRetryLanes);
            if (exitStatus !== RootErrored) {
              var errorsFromSecondAttempt = workInProgressRootRecoverableErrors;
              workInProgressRootRecoverableErrors = errorsFromFirstAttempt;
              if (errorsFromSecondAttempt !== null) {
                queueRecoverableErrors(errorsFromSecondAttempt);
              }
            }
            return exitStatus;
          }
          function queueRecoverableErrors(errors) {
            if (workInProgressRootRecoverableErrors === null) {
              workInProgressRootRecoverableErrors = errors;
            } else {
              workInProgressRootRecoverableErrors.push.apply(workInProgressRootRecoverableErrors, errors);
            }
          }
          function finishConcurrentRender(root2, exitStatus, lanes) {
            switch (exitStatus) {
              case RootInProgress:
              case RootFatalErrored: {
                throw new Error("Root did not complete. This is a bug in React.");
              }
              case RootErrored: {
                commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
                break;
              }
              case RootSuspended: {
                markRootSuspended$1(root2, lanes);
                if (includesOnlyRetries(lanes) && !shouldForceFlushFallbacksInDEV()) {
                  var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now();
                  if (msUntilTimeout > 10) {
                    var nextLanes = getNextLanes(root2, NoLanes);
                    if (nextLanes !== NoLanes) {
                      break;
                    }
                    var suspendedLanes = root2.suspendedLanes;
                    if (!isSubsetOfLanes(suspendedLanes, lanes)) {
                      var eventTime = requestEventTime();
                      markRootPinged(root2, suspendedLanes);
                      break;
                    }
                    root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2, workInProgressRootRecoverableErrors, workInProgressTransitions), msUntilTimeout);
                    break;
                  }
                }
                commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
                break;
              }
              case RootSuspendedWithDelay: {
                markRootSuspended$1(root2, lanes);
                if (includesOnlyTransitions(lanes)) {
                  break;
                }
                if (!shouldForceFlushFallbacksInDEV()) {
                  var mostRecentEventTime = getMostRecentEventTime(root2, lanes);
                  var eventTimeMs = mostRecentEventTime;
                  var timeElapsedMs = now() - eventTimeMs;
                  var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs;
                  if (_msUntilTimeout > 10) {
                    root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2, workInProgressRootRecoverableErrors, workInProgressTransitions), _msUntilTimeout);
                    break;
                  }
                }
                commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
                break;
              }
              case RootCompleted: {
                commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
                break;
              }
              default: {
                throw new Error("Unknown root exit status.");
              }
            }
          }
          function isRenderConsistentWithExternalStores(finishedWork) {
            var node = finishedWork;
            while (true) {
              if (node.flags & StoreConsistency) {
                var updateQueue = node.updateQueue;
                if (updateQueue !== null) {
                  var checks = updateQueue.stores;
                  if (checks !== null) {
                    for (var i = 0; i < checks.length; i++) {
                      var check = checks[i];
                      var getSnapshot = check.getSnapshot;
                      var renderedValue = check.value;
                      try {
                        if (!objectIs(getSnapshot(), renderedValue)) {
                          return false;
                        }
                      } catch (error2) {
                        return false;
                      }
                    }
                  }
                }
              }
              var child = node.child;
              if (node.subtreeFlags & StoreConsistency && child !== null) {
                child.return = node;
                node = child;
                continue;
              }
              if (node === finishedWork) {
                return true;
              }
              while (node.sibling === null) {
                if (node.return === null || node.return === finishedWork) {
                  return true;
                }
                node = node.return;
              }
              node.sibling.return = node.return;
              node = node.sibling;
            }
            return true;
          }
          function markRootSuspended$1(root2, suspendedLanes) {
            suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes);
            suspendedLanes = removeLanes(suspendedLanes, workInProgressRootInterleavedUpdatedLanes);
            markRootSuspended(root2, suspendedLanes);
          }
          function performSyncWorkOnRoot(root2) {
            {
              syncNestedUpdateFlag();
            }
            if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
              throw new Error("Should not already be working.");
            }
            flushPassiveEffects();
            var lanes = getNextLanes(root2, NoLanes);
            if (!includesSomeLane(lanes, SyncLane)) {
              ensureRootIsScheduled(root2, now());
              return null;
            }
            var exitStatus = renderRootSync(root2, lanes);
            if (root2.tag !== LegacyRoot && exitStatus === RootErrored) {
              var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root2);
              if (errorRetryLanes !== NoLanes) {
                lanes = errorRetryLanes;
                exitStatus = recoverFromConcurrentError(root2, errorRetryLanes);
              }
            }
            if (exitStatus === RootFatalErrored) {
              var fatalError = workInProgressRootFatalError;
              prepareFreshStack(root2, NoLanes);
              markRootSuspended$1(root2, lanes);
              ensureRootIsScheduled(root2, now());
              throw fatalError;
            }
            if (exitStatus === RootDidNotComplete) {
              throw new Error("Root did not complete. This is a bug in React.");
            }
            var finishedWork = root2.current.alternate;
            root2.finishedWork = finishedWork;
            root2.finishedLanes = lanes;
            commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
            ensureRootIsScheduled(root2, now());
            return null;
          }
          function flushRoot(root2, lanes) {
            if (lanes !== NoLanes) {
              markRootEntangled(root2, mergeLanes(lanes, SyncLane));
              ensureRootIsScheduled(root2, now());
              if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
                resetRenderTimer();
                flushSyncCallbacks();
              }
            }
          }
          function batchedUpdates$1(fn, a) {
            var prevExecutionContext = executionContext;
            executionContext |= BatchedContext;
            try {
              return fn(a);
            } finally {
              executionContext = prevExecutionContext;
              if (executionContext === NoContext && !ReactCurrentActQueue$1.isBatchingLegacy) {
                resetRenderTimer();
                flushSyncCallbacksOnlyInLegacyMode();
              }
            }
          }
          function discreteUpdates(fn, a, b, c, d) {
            var previousPriority = getCurrentUpdatePriority();
            var prevTransition = ReactCurrentBatchConfig$3.transition;
            try {
              ReactCurrentBatchConfig$3.transition = null;
              setCurrentUpdatePriority(DiscreteEventPriority);
              return fn(a, b, c, d);
            } finally {
              setCurrentUpdatePriority(previousPriority);
              ReactCurrentBatchConfig$3.transition = prevTransition;
              if (executionContext === NoContext) {
                resetRenderTimer();
              }
            }
          }
          function flushSync(fn) {
            if (rootWithPendingPassiveEffects !== null && rootWithPendingPassiveEffects.tag === LegacyRoot && (executionContext & (RenderContext | CommitContext)) === NoContext) {
              flushPassiveEffects();
            }
            var prevExecutionContext = executionContext;
            executionContext |= BatchedContext;
            var prevTransition = ReactCurrentBatchConfig$3.transition;
            var previousPriority = getCurrentUpdatePriority();
            try {
              ReactCurrentBatchConfig$3.transition = null;
              setCurrentUpdatePriority(DiscreteEventPriority);
              if (fn) {
                return fn();
              } else {
                return void 0;
              }
            } finally {
              setCurrentUpdatePriority(previousPriority);
              ReactCurrentBatchConfig$3.transition = prevTransition;
              executionContext = prevExecutionContext;
              if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
                flushSyncCallbacks();
              }
            }
          }
          function isAlreadyRendering() {
            return (executionContext & (RenderContext | CommitContext)) !== NoContext;
          }
          function pushRenderLanes(fiber, lanes) {
            push(subtreeRenderLanesCursor, subtreeRenderLanes, fiber);
            subtreeRenderLanes = mergeLanes(subtreeRenderLanes, lanes);
            workInProgressRootIncludedLanes = mergeLanes(workInProgressRootIncludedLanes, lanes);
          }
          function popRenderLanes(fiber) {
            subtreeRenderLanes = subtreeRenderLanesCursor.current;
            pop(subtreeRenderLanesCursor, fiber);
          }
          function prepareFreshStack(root2, lanes) {
            root2.finishedWork = null;
            root2.finishedLanes = NoLanes;
            var timeoutHandle = root2.timeoutHandle;
            if (timeoutHandle !== noTimeout) {
              root2.timeoutHandle = noTimeout;
              cancelTimeout(timeoutHandle);
            }
            if (workInProgress !== null) {
              var interruptedWork = workInProgress.return;
              while (interruptedWork !== null) {
                var current2 = interruptedWork.alternate;
                unwindInterruptedWork(current2, interruptedWork);
                interruptedWork = interruptedWork.return;
              }
            }
            workInProgressRoot = root2;
            var rootWorkInProgress = createWorkInProgress(root2.current, null);
            workInProgress = rootWorkInProgress;
            workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes;
            workInProgressRootExitStatus = RootInProgress;
            workInProgressRootFatalError = null;
            workInProgressRootSkippedLanes = NoLanes;
            workInProgressRootInterleavedUpdatedLanes = NoLanes;
            workInProgressRootPingedLanes = NoLanes;
            workInProgressRootConcurrentErrors = null;
            workInProgressRootRecoverableErrors = null;
            finishQueueingConcurrentUpdates();
            {
              ReactStrictModeWarnings.discardPendingWarnings();
            }
            return rootWorkInProgress;
          }
          function handleError(root2, thrownValue) {
            do {
              var erroredWork = workInProgress;
              try {
                resetContextDependencies();
                resetHooksAfterThrow();
                resetCurrentFiber();
                ReactCurrentOwner$2.current = null;
                if (erroredWork === null || erroredWork.return === null) {
                  workInProgressRootExitStatus = RootFatalErrored;
                  workInProgressRootFatalError = thrownValue;
                  workInProgress = null;
                  return;
                }
                if (enableProfilerTimer && erroredWork.mode & ProfileMode) {
                  stopProfilerTimerIfRunningAndRecordDelta(erroredWork, true);
                }
                if (enableSchedulingProfiler) {
                  markComponentRenderStopped();
                  if (thrownValue !== null && typeof thrownValue === "object" && typeof thrownValue.then === "function") {
                    var wakeable = thrownValue;
                    markComponentSuspended(erroredWork, wakeable, workInProgressRootRenderLanes);
                  } else {
                    markComponentErrored(erroredWork, thrownValue, workInProgressRootRenderLanes);
                  }
                }
                throwException(root2, erroredWork.return, erroredWork, thrownValue, workInProgressRootRenderLanes);
                completeUnitOfWork(erroredWork);
              } catch (yetAnotherThrownValue) {
                thrownValue = yetAnotherThrownValue;
                if (workInProgress === erroredWork && erroredWork !== null) {
                  erroredWork = erroredWork.return;
                  workInProgress = erroredWork;
                } else {
                  erroredWork = workInProgress;
                }
                continue;
              }
              return;
            } while (true);
          }
          function pushDispatcher() {
            var prevDispatcher = ReactCurrentDispatcher$2.current;
            ReactCurrentDispatcher$2.current = ContextOnlyDispatcher;
            if (prevDispatcher === null) {
              return ContextOnlyDispatcher;
            } else {
              return prevDispatcher;
            }
          }
          function popDispatcher(prevDispatcher) {
            ReactCurrentDispatcher$2.current = prevDispatcher;
          }
          function markCommitTimeOfFallback() {
            globalMostRecentFallbackTime = now();
          }
          function markSkippedUpdateLanes(lane) {
            workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes);
          }
          function renderDidSuspend() {
            if (workInProgressRootExitStatus === RootInProgress) {
              workInProgressRootExitStatus = RootSuspended;
            }
          }
          function renderDidSuspendDelayIfPossible() {
            if (workInProgressRootExitStatus === RootInProgress || workInProgressRootExitStatus === RootSuspended || workInProgressRootExitStatus === RootErrored) {
              workInProgressRootExitStatus = RootSuspendedWithDelay;
            }
            if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootInterleavedUpdatedLanes))) {
              markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes);
            }
          }
          function renderDidError(error2) {
            if (workInProgressRootExitStatus !== RootSuspendedWithDelay) {
              workInProgressRootExitStatus = RootErrored;
            }
            if (workInProgressRootConcurrentErrors === null) {
              workInProgressRootConcurrentErrors = [error2];
            } else {
              workInProgressRootConcurrentErrors.push(error2);
            }
          }
          function renderHasNotSuspendedYet() {
            return workInProgressRootExitStatus === RootInProgress;
          }
          function renderRootSync(root2, lanes) {
            var prevExecutionContext = executionContext;
            executionContext |= RenderContext;
            var prevDispatcher = pushDispatcher();
            if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes) {
              {
                if (isDevToolsPresent) {
                  var memoizedUpdaters = root2.memoizedUpdaters;
                  if (memoizedUpdaters.size > 0) {
                    restorePendingUpdaters(root2, workInProgressRootRenderLanes);
                    memoizedUpdaters.clear();
                  }
                  movePendingFibersToMemoized(root2, lanes);
                }
              }
              workInProgressTransitions = getTransitionsForLanes();
              prepareFreshStack(root2, lanes);
            }
            {
              markRenderStarted(lanes);
            }
            do {
              try {
                workLoopSync();
                break;
              } catch (thrownValue) {
                handleError(root2, thrownValue);
              }
            } while (true);
            resetContextDependencies();
            executionContext = prevExecutionContext;
            popDispatcher(prevDispatcher);
            if (workInProgress !== null) {
              throw new Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");
            }
            {
              markRenderStopped();
            }
            workInProgressRoot = null;
            workInProgressRootRenderLanes = NoLanes;
            return workInProgressRootExitStatus;
          }
          function workLoopSync() {
            while (workInProgress !== null) {
              performUnitOfWork(workInProgress);
            }
          }
          function renderRootConcurrent(root2, lanes) {
            var prevExecutionContext = executionContext;
            executionContext |= RenderContext;
            var prevDispatcher = pushDispatcher();
            if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes) {
              {
                if (isDevToolsPresent) {
                  var memoizedUpdaters = root2.memoizedUpdaters;
                  if (memoizedUpdaters.size > 0) {
                    restorePendingUpdaters(root2, workInProgressRootRenderLanes);
                    memoizedUpdaters.clear();
                  }
                  movePendingFibersToMemoized(root2, lanes);
                }
              }
              workInProgressTransitions = getTransitionsForLanes();
              resetRenderTimer();
              prepareFreshStack(root2, lanes);
            }
            {
              markRenderStarted(lanes);
            }
            do {
              try {
                workLoopConcurrent();
                break;
              } catch (thrownValue) {
                handleError(root2, thrownValue);
              }
            } while (true);
            resetContextDependencies();
            popDispatcher(prevDispatcher);
            executionContext = prevExecutionContext;
            if (workInProgress !== null) {
              {
                markRenderYielded();
              }
              return RootInProgress;
            } else {
              {
                markRenderStopped();
              }
              workInProgressRoot = null;
              workInProgressRootRenderLanes = NoLanes;
              return workInProgressRootExitStatus;
            }
          }
          function workLoopConcurrent() {
            while (workInProgress !== null && !shouldYield()) {
              performUnitOfWork(workInProgress);
            }
          }
          function performUnitOfWork(unitOfWork) {
            var current2 = unitOfWork.alternate;
            setCurrentFiber(unitOfWork);
            var next;
            if ((unitOfWork.mode & ProfileMode) !== NoMode) {
              startProfilerTimer(unitOfWork);
              next = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
              stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
            } else {
              next = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
            }
            resetCurrentFiber();
            unitOfWork.memoizedProps = unitOfWork.pendingProps;
            if (next === null) {
              completeUnitOfWork(unitOfWork);
            } else {
              workInProgress = next;
            }
            ReactCurrentOwner$2.current = null;
          }
          function completeUnitOfWork(unitOfWork) {
            var completedWork = unitOfWork;
            do {
              var current2 = completedWork.alternate;
              var returnFiber = completedWork.return;
              if ((completedWork.flags & Incomplete) === NoFlags) {
                setCurrentFiber(completedWork);
                var next = void 0;
                if ((completedWork.mode & ProfileMode) === NoMode) {
                  next = completeWork(current2, completedWork, subtreeRenderLanes);
                } else {
                  startProfilerTimer(completedWork);
                  next = completeWork(current2, completedWork, subtreeRenderLanes);
                  stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
                }
                resetCurrentFiber();
                if (next !== null) {
                  workInProgress = next;
                  return;
                }
              } else {
                var _next = unwindWork(current2, completedWork);
                if (_next !== null) {
                  _next.flags &= HostEffectMask;
                  workInProgress = _next;
                  return;
                }
                if ((completedWork.mode & ProfileMode) !== NoMode) {
                  stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
                  var actualDuration = completedWork.actualDuration;
                  var child = completedWork.child;
                  while (child !== null) {
                    actualDuration += child.actualDuration;
                    child = child.sibling;
                  }
                  completedWork.actualDuration = actualDuration;
                }
                if (returnFiber !== null) {
                  returnFiber.flags |= Incomplete;
                  returnFiber.subtreeFlags = NoFlags;
                  returnFiber.deletions = null;
                } else {
                  workInProgressRootExitStatus = RootDidNotComplete;
                  workInProgress = null;
                  return;
                }
              }
              var siblingFiber = completedWork.sibling;
              if (siblingFiber !== null) {
                workInProgress = siblingFiber;
                return;
              }
              completedWork = returnFiber;
              workInProgress = completedWork;
            } while (completedWork !== null);
            if (workInProgressRootExitStatus === RootInProgress) {
              workInProgressRootExitStatus = RootCompleted;
            }
          }
          function commitRoot(root2, recoverableErrors, transitions) {
            var previousUpdateLanePriority = getCurrentUpdatePriority();
            var prevTransition = ReactCurrentBatchConfig$3.transition;
            try {
              ReactCurrentBatchConfig$3.transition = null;
              setCurrentUpdatePriority(DiscreteEventPriority);
              commitRootImpl(root2, recoverableErrors, transitions, previousUpdateLanePriority);
            } finally {
              ReactCurrentBatchConfig$3.transition = prevTransition;
              setCurrentUpdatePriority(previousUpdateLanePriority);
            }
            return null;
          }
          function commitRootImpl(root2, recoverableErrors, transitions, renderPriorityLevel) {
            do {
              flushPassiveEffects();
            } while (rootWithPendingPassiveEffects !== null);
            flushRenderPhaseStrictModeWarningsInDEV();
            if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
              throw new Error("Should not already be working.");
            }
            var finishedWork = root2.finishedWork;
            var lanes = root2.finishedLanes;
            {
              markCommitStarted(lanes);
            }
            if (finishedWork === null) {
              {
                markCommitStopped();
              }
              return null;
            } else {
              {
                if (lanes === NoLanes) {
                  error("root.finishedLanes should not be empty during a commit. This is a bug in React.");
                }
              }
            }
            root2.finishedWork = null;
            root2.finishedLanes = NoLanes;
            if (finishedWork === root2.current) {
              throw new Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");
            }
            root2.callbackNode = null;
            root2.callbackPriority = NoLane;
            var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes);
            markRootFinished(root2, remainingLanes);
            if (root2 === workInProgressRoot) {
              workInProgressRoot = null;
              workInProgress = null;
              workInProgressRootRenderLanes = NoLanes;
            }
            if ((finishedWork.subtreeFlags & PassiveMask) !== NoFlags || (finishedWork.flags & PassiveMask) !== NoFlags) {
              if (!rootDoesHavePassiveEffects) {
                rootDoesHavePassiveEffects = true;
                pendingPassiveTransitions = transitions;
                scheduleCallback$1(NormalPriority, function() {
                  flushPassiveEffects();
                  return null;
                });
              }
            }
            var subtreeHasEffects = (finishedWork.subtreeFlags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags;
            var rootHasEffect = (finishedWork.flags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags;
            if (subtreeHasEffects || rootHasEffect) {
              var prevTransition = ReactCurrentBatchConfig$3.transition;
              ReactCurrentBatchConfig$3.transition = null;
              var previousPriority = getCurrentUpdatePriority();
              setCurrentUpdatePriority(DiscreteEventPriority);
              var prevExecutionContext = executionContext;
              executionContext |= CommitContext;
              ReactCurrentOwner$2.current = null;
              var shouldFireAfterActiveInstanceBlur2 = commitBeforeMutationEffects(root2, finishedWork);
              {
                recordCommitTime();
              }
              commitMutationEffects(root2, finishedWork, lanes);
              resetAfterCommit(root2.containerInfo);
              root2.current = finishedWork;
              {
                markLayoutEffectsStarted(lanes);
              }
              commitLayoutEffects(finishedWork, root2, lanes);
              {
                markLayoutEffectsStopped();
              }
              requestPaint();
              executionContext = prevExecutionContext;
              setCurrentUpdatePriority(previousPriority);
              ReactCurrentBatchConfig$3.transition = prevTransition;
            } else {
              root2.current = finishedWork;
              {
                recordCommitTime();
              }
            }
            var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;
            if (rootDoesHavePassiveEffects) {
              rootDoesHavePassiveEffects = false;
              rootWithPendingPassiveEffects = root2;
              pendingPassiveEffectsLanes = lanes;
            } else {
              {
                nestedPassiveUpdateCount = 0;
                rootWithPassiveNestedUpdates = null;
              }
            }
            remainingLanes = root2.pendingLanes;
            if (remainingLanes === NoLanes) {
              legacyErrorBoundariesThatAlreadyFailed = null;
            }
            {
              if (!rootDidHavePassiveEffects) {
                commitDoubleInvokeEffectsInDEV(root2.current, false);
              }
            }
            onCommitRoot(finishedWork.stateNode, renderPriorityLevel);
            {
              if (isDevToolsPresent) {
                root2.memoizedUpdaters.clear();
              }
            }
            {
              onCommitRoot$1();
            }
            ensureRootIsScheduled(root2, now());
            if (recoverableErrors !== null) {
              var onRecoverableError = root2.onRecoverableError;
              for (var i = 0; i < recoverableErrors.length; i++) {
                var recoverableError = recoverableErrors[i];
                var componentStack = recoverableError.stack;
                var digest = recoverableError.digest;
                onRecoverableError(recoverableError.value, {
                  componentStack,
                  digest
                });
              }
            }
            if (hasUncaughtError) {
              hasUncaughtError = false;
              var error$1 = firstUncaughtError;
              firstUncaughtError = null;
              throw error$1;
            }
            if (includesSomeLane(pendingPassiveEffectsLanes, SyncLane) && root2.tag !== LegacyRoot) {
              flushPassiveEffects();
            }
            remainingLanes = root2.pendingLanes;
            if (includesSomeLane(remainingLanes, SyncLane)) {
              {
                markNestedUpdateScheduled();
              }
              if (root2 === rootWithNestedUpdates) {
                nestedUpdateCount++;
              } else {
                nestedUpdateCount = 0;
                rootWithNestedUpdates = root2;
              }
            } else {
              nestedUpdateCount = 0;
            }
            flushSyncCallbacks();
            {
              markCommitStopped();
            }
            return null;
          }
          function flushPassiveEffects() {
            if (rootWithPendingPassiveEffects !== null) {
              var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes);
              var priority = lowerEventPriority(DefaultEventPriority, renderPriority);
              var prevTransition = ReactCurrentBatchConfig$3.transition;
              var previousPriority = getCurrentUpdatePriority();
              try {
                ReactCurrentBatchConfig$3.transition = null;
                setCurrentUpdatePriority(priority);
                return flushPassiveEffectsImpl();
              } finally {
                setCurrentUpdatePriority(previousPriority);
                ReactCurrentBatchConfig$3.transition = prevTransition;
              }
            }
            return false;
          }
          function enqueuePendingPassiveProfilerEffect(fiber) {
            {
              pendingPassiveProfilerEffects.push(fiber);
              if (!rootDoesHavePassiveEffects) {
                rootDoesHavePassiveEffects = true;
                scheduleCallback$1(NormalPriority, function() {
                  flushPassiveEffects();
                  return null;
                });
              }
            }
          }
          function flushPassiveEffectsImpl() {
            if (rootWithPendingPassiveEffects === null) {
              return false;
            }
            var transitions = pendingPassiveTransitions;
            pendingPassiveTransitions = null;
            var root2 = rootWithPendingPassiveEffects;
            var lanes = pendingPassiveEffectsLanes;
            rootWithPendingPassiveEffects = null;
            pendingPassiveEffectsLanes = NoLanes;
            if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
              throw new Error("Cannot flush passive effects while already rendering.");
            }
            {
              isFlushingPassiveEffects = true;
              didScheduleUpdateDuringPassiveEffects = false;
            }
            {
              markPassiveEffectsStarted(lanes);
            }
            var prevExecutionContext = executionContext;
            executionContext |= CommitContext;
            commitPassiveUnmountEffects(root2.current);
            commitPassiveMountEffects(root2, root2.current, lanes, transitions);
            {
              var profilerEffects = pendingPassiveProfilerEffects;
              pendingPassiveProfilerEffects = [];
              for (var i = 0; i < profilerEffects.length; i++) {
                var _fiber = profilerEffects[i];
                commitPassiveEffectDurations(root2, _fiber);
              }
            }
            {
              markPassiveEffectsStopped();
            }
            {
              commitDoubleInvokeEffectsInDEV(root2.current, true);
            }
            executionContext = prevExecutionContext;
            flushSyncCallbacks();
            {
              if (didScheduleUpdateDuringPassiveEffects) {
                if (root2 === rootWithPassiveNestedUpdates) {
                  nestedPassiveUpdateCount++;
                } else {
                  nestedPassiveUpdateCount = 0;
                  rootWithPassiveNestedUpdates = root2;
                }
              } else {
                nestedPassiveUpdateCount = 0;
              }
              isFlushingPassiveEffects = false;
              didScheduleUpdateDuringPassiveEffects = false;
            }
            onPostCommitRoot(root2);
            {
              var stateNode = root2.current.stateNode;
              stateNode.effectDuration = 0;
              stateNode.passiveEffectDuration = 0;
            }
            return true;
          }
          function isAlreadyFailedLegacyErrorBoundary(instance) {
            return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);
          }
          function markLegacyErrorBoundaryAsFailed(instance) {
            if (legacyErrorBoundariesThatAlreadyFailed === null) {
              legacyErrorBoundariesThatAlreadyFailed = /* @__PURE__ */ new Set([instance]);
            } else {
              legacyErrorBoundariesThatAlreadyFailed.add(instance);
            }
          }
          function prepareToThrowUncaughtError(error2) {
            if (!hasUncaughtError) {
              hasUncaughtError = true;
              firstUncaughtError = error2;
            }
          }
          var onUncaughtError = prepareToThrowUncaughtError;
          function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error2) {
            var errorInfo = createCapturedValueAtFiber(error2, sourceFiber);
            var update = createRootErrorUpdate(rootFiber, errorInfo, SyncLane);
            var root2 = enqueueUpdate(rootFiber, update, SyncLane);
            var eventTime = requestEventTime();
            if (root2 !== null) {
              markRootUpdated(root2, SyncLane, eventTime);
              ensureRootIsScheduled(root2, eventTime);
            }
          }
          function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) {
            {
              reportUncaughtErrorInDEV(error$1);
              setIsRunningInsertionEffect(false);
            }
            if (sourceFiber.tag === HostRoot) {
              captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error$1);
              return;
            }
            var fiber = null;
            {
              fiber = nearestMountedAncestor;
            }
            while (fiber !== null) {
              if (fiber.tag === HostRoot) {
                captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error$1);
                return;
              } else if (fiber.tag === ClassComponent) {
                var ctor = fiber.type;
                var instance = fiber.stateNode;
                if (typeof ctor.getDerivedStateFromError === "function" || typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance)) {
                  var errorInfo = createCapturedValueAtFiber(error$1, sourceFiber);
                  var update = createClassErrorUpdate(fiber, errorInfo, SyncLane);
                  var root2 = enqueueUpdate(fiber, update, SyncLane);
                  var eventTime = requestEventTime();
                  if (root2 !== null) {
                    markRootUpdated(root2, SyncLane, eventTime);
                    ensureRootIsScheduled(root2, eventTime);
                  }
                  return;
                }
              }
              fiber = fiber.return;
            }
            {
              error("Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.\n\nError message:\n\n%s", error$1);
            }
          }
          function pingSuspendedRoot(root2, wakeable, pingedLanes) {
            var pingCache = root2.pingCache;
            if (pingCache !== null) {
              pingCache.delete(wakeable);
            }
            var eventTime = requestEventTime();
            markRootPinged(root2, pingedLanes);
            warnIfSuspenseResolutionNotWrappedWithActDEV(root2);
            if (workInProgressRoot === root2 && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) {
              if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {
                prepareFreshStack(root2, NoLanes);
              } else {
                workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes);
              }
            }
            ensureRootIsScheduled(root2, eventTime);
          }
          function retryTimedOutBoundary(boundaryFiber, retryLane) {
            if (retryLane === NoLane) {
              retryLane = requestRetryLane(boundaryFiber);
            }
            var eventTime = requestEventTime();
            var root2 = enqueueConcurrentRenderForLane(boundaryFiber, retryLane);
            if (root2 !== null) {
              markRootUpdated(root2, retryLane, eventTime);
              ensureRootIsScheduled(root2, eventTime);
            }
          }
          function retryDehydratedSuspenseBoundary(boundaryFiber) {
            var suspenseState = boundaryFiber.memoizedState;
            var retryLane = NoLane;
            if (suspenseState !== null) {
              retryLane = suspenseState.retryLane;
            }
            retryTimedOutBoundary(boundaryFiber, retryLane);
          }
          function resolveRetryWakeable(boundaryFiber, wakeable) {
            var retryLane = NoLane;
            var retryCache;
            switch (boundaryFiber.tag) {
              case SuspenseComponent:
                retryCache = boundaryFiber.stateNode;
                var suspenseState = boundaryFiber.memoizedState;
                if (suspenseState !== null) {
                  retryLane = suspenseState.retryLane;
                }
                break;
              case SuspenseListComponent:
                retryCache = boundaryFiber.stateNode;
                break;
              default:
                throw new Error("Pinged unknown suspense boundary type. This is probably a bug in React.");
            }
            if (retryCache !== null) {
              retryCache.delete(wakeable);
            }
            retryTimedOutBoundary(boundaryFiber, retryLane);
          }
          function jnd(timeElapsed) {
            return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3e3 ? 3e3 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;
          }
          function checkForNestedUpdates() {
            if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
              nestedUpdateCount = 0;
              rootWithNestedUpdates = null;
              throw new Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");
            }
            {
              if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {
                nestedPassiveUpdateCount = 0;
                rootWithPassiveNestedUpdates = null;
                error("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.");
              }
            }
          }
          function flushRenderPhaseStrictModeWarningsInDEV() {
            {
              ReactStrictModeWarnings.flushLegacyContextWarning();
              {
                ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
              }
            }
          }
          function commitDoubleInvokeEffectsInDEV(fiber, hasPassiveEffects) {
            {
              setCurrentFiber(fiber);
              invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectUnmountInDEV);
              if (hasPassiveEffects) {
                invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectUnmountInDEV);
              }
              invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectMountInDEV);
              if (hasPassiveEffects) {
                invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectMountInDEV);
              }
              resetCurrentFiber();
            }
          }
          function invokeEffectsInDev(firstChild, fiberFlags, invokeEffectFn) {
            {
              var current2 = firstChild;
              var subtreeRoot = null;
              while (current2 !== null) {
                var primarySubtreeFlag = current2.subtreeFlags & fiberFlags;
                if (current2 !== subtreeRoot && current2.child !== null && primarySubtreeFlag !== NoFlags) {
                  current2 = current2.child;
                } else {
                  if ((current2.flags & fiberFlags) !== NoFlags) {
                    invokeEffectFn(current2);
                  }
                  if (current2.sibling !== null) {
                    current2 = current2.sibling;
                  } else {
                    current2 = subtreeRoot = current2.return;
                  }
                }
              }
            }
          }
          var didWarnStateUpdateForNotYetMountedComponent = null;
          function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) {
            {
              if ((executionContext & RenderContext) !== NoContext) {
                return;
              }
              if (!(fiber.mode & ConcurrentMode)) {
                return;
              }
              var tag = fiber.tag;
              if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent) {
                return;
              }
              var componentName = getComponentNameFromFiber(fiber) || "ReactComponent";
              if (didWarnStateUpdateForNotYetMountedComponent !== null) {
                if (didWarnStateUpdateForNotYetMountedComponent.has(componentName)) {
                  return;
                }
                didWarnStateUpdateForNotYetMountedComponent.add(componentName);
              } else {
                didWarnStateUpdateForNotYetMountedComponent = /* @__PURE__ */ new Set([componentName]);
              }
              var previousFiber = current;
              try {
                setCurrentFiber(fiber);
                error("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.");
              } finally {
                if (previousFiber) {
                  setCurrentFiber(fiber);
                } else {
                  resetCurrentFiber();
                }
              }
            }
          }
          var beginWork$1;
          {
            var dummyFiber = null;
            beginWork$1 = function(current2, unitOfWork, lanes) {
              var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);
              try {
                return beginWork(current2, unitOfWork, lanes);
              } catch (originalError) {
                if (didSuspendOrErrorWhileHydratingDEV() || originalError !== null && typeof originalError === "object" && typeof originalError.then === "function") {
                  throw originalError;
                }
                resetContextDependencies();
                resetHooksAfterThrow();
                unwindInterruptedWork(current2, unitOfWork);
                assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
                if (unitOfWork.mode & ProfileMode) {
                  startProfilerTimer(unitOfWork);
                }
                invokeGuardedCallback(null, beginWork, null, current2, unitOfWork, lanes);
                if (hasCaughtError()) {
                  var replayError = clearCaughtError();
                  if (typeof replayError === "object" && replayError !== null && replayError._suppressLogging && typeof originalError === "object" && originalError !== null && !originalError._suppressLogging) {
                    originalError._suppressLogging = true;
                  }
                }
                throw originalError;
              }
            };
          }
          var didWarnAboutUpdateInRender = false;
          var didWarnAboutUpdateInRenderForAnotherComponent;
          {
            didWarnAboutUpdateInRenderForAnotherComponent = /* @__PURE__ */ new Set();
          }
          function warnAboutRenderPhaseUpdatesInDEV(fiber) {
            {
              if (isRendering && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) {
                switch (fiber.tag) {
                  case FunctionComponent:
                  case ForwardRef:
                  case SimpleMemoComponent: {
                    var renderingComponentName = workInProgress && getComponentNameFromFiber(workInProgress) || "Unknown";
                    var dedupeKey = renderingComponentName;
                    if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {
                      didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);
                      var setStateComponentName = getComponentNameFromFiber(fiber) || "Unknown";
                      error("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render", setStateComponentName, renderingComponentName, renderingComponentName);
                    }
                    break;
                  }
                  case ClassComponent: {
                    if (!didWarnAboutUpdateInRender) {
                      error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state.");
                      didWarnAboutUpdateInRender = true;
                    }
                    break;
                  }
                }
              }
            }
          }
          function restorePendingUpdaters(root2, lanes) {
            {
              if (isDevToolsPresent) {
                var memoizedUpdaters = root2.memoizedUpdaters;
                memoizedUpdaters.forEach(function(schedulingFiber) {
                  addFiberToLanesMap(root2, schedulingFiber, lanes);
                });
              }
            }
          }
          var fakeActCallbackNode = {};
          function scheduleCallback$1(priorityLevel, callback) {
            {
              var actQueue = ReactCurrentActQueue$1.current;
              if (actQueue !== null) {
                actQueue.push(callback);
                return fakeActCallbackNode;
              } else {
                return scheduleCallback(priorityLevel, callback);
              }
            }
          }
          function cancelCallback$1(callbackNode) {
            if (callbackNode === fakeActCallbackNode) {
              return;
            }
            return cancelCallback(callbackNode);
          }
          function shouldForceFlushFallbacksInDEV() {
            return ReactCurrentActQueue$1.current !== null;
          }
          function warnIfUpdatesNotWrappedWithActDEV(fiber) {
            {
              if (fiber.mode & ConcurrentMode) {
                if (!isConcurrentActEnvironment()) {
                  return;
                }
              } else {
                if (!isLegacyActEnvironment()) {
                  return;
                }
                if (executionContext !== NoContext) {
                  return;
                }
                if (fiber.tag !== FunctionComponent && fiber.tag !== ForwardRef && fiber.tag !== SimpleMemoComponent) {
                  return;
                }
              }
              if (ReactCurrentActQueue$1.current === null) {
                var previousFiber = current;
                try {
                  setCurrentFiber(fiber);
                  error("An update to %s inside a test was not wrapped in act(...).\n\nWhen testing, code that causes React state updates should be wrapped into act(...):\n\nact(() => {\n  /* fire events that update state */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act", getComponentNameFromFiber(fiber));
                } finally {
                  if (previousFiber) {
                    setCurrentFiber(fiber);
                  } else {
                    resetCurrentFiber();
                  }
                }
              }
            }
          }
          function warnIfSuspenseResolutionNotWrappedWithActDEV(root2) {
            {
              if (root2.tag !== LegacyRoot && isConcurrentActEnvironment() && ReactCurrentActQueue$1.current === null) {
                error("A suspended resource finished loading inside a test, but the event was not wrapped in act(...).\n\nWhen testing, code that resolves suspended data should be wrapped into act(...):\n\nact(() => {\n  /* finish loading suspended data */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act");
              }
            }
          }
          function setIsRunningInsertionEffect(isRunning) {
            {
              isRunningInsertionEffect = isRunning;
            }
          }
          var resolveFamily = null;
          var failedBoundaries = null;
          var setRefreshHandler = function(handler) {
            {
              resolveFamily = handler;
            }
          };
          function resolveFunctionForHotReloading(type) {
            {
              if (resolveFamily === null) {
                return type;
              }
              var family = resolveFamily(type);
              if (family === void 0) {
                return type;
              }
              return family.current;
            }
          }
          function resolveClassForHotReloading(type) {
            return resolveFunctionForHotReloading(type);
          }
          function resolveForwardRefForHotReloading(type) {
            {
              if (resolveFamily === null) {
                return type;
              }
              var family = resolveFamily(type);
              if (family === void 0) {
                if (type !== null && type !== void 0 && typeof type.render === "function") {
                  var currentRender = resolveFunctionForHotReloading(type.render);
                  if (type.render !== currentRender) {
                    var syntheticType = {
                      $$typeof: REACT_FORWARD_REF_TYPE,
                      render: currentRender
                    };
                    if (type.displayName !== void 0) {
                      syntheticType.displayName = type.displayName;
                    }
                    return syntheticType;
                  }
                }
                return type;
              }
              return family.current;
            }
          }
          function isCompatibleFamilyForHotReloading(fiber, element) {
            {
              if (resolveFamily === null) {
                return false;
              }
              var prevType = fiber.elementType;
              var nextType = element.type;
              var needsCompareFamilies = false;
              var $$typeofNextType = typeof nextType === "object" && nextType !== null ? nextType.$$typeof : null;
              switch (fiber.tag) {
                case ClassComponent: {
                  if (typeof nextType === "function") {
                    needsCompareFamilies = true;
                  }
                  break;
                }
                case FunctionComponent: {
                  if (typeof nextType === "function") {
                    needsCompareFamilies = true;
                  } else if ($$typeofNextType === REACT_LAZY_TYPE) {
                    needsCompareFamilies = true;
                  }
                  break;
                }
                case ForwardRef: {
                  if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {
                    needsCompareFamilies = true;
                  } else if ($$typeofNextType === REACT_LAZY_TYPE) {
                    needsCompareFamilies = true;
                  }
                  break;
                }
                case MemoComponent:
                case SimpleMemoComponent: {
                  if ($$typeofNextType === REACT_MEMO_TYPE) {
                    needsCompareFamilies = true;
                  } else if ($$typeofNextType === REACT_LAZY_TYPE) {
                    needsCompareFamilies = true;
                  }
                  break;
                }
                default:
                  return false;
              }
              if (needsCompareFamilies) {
                var prevFamily = resolveFamily(prevType);
                if (prevFamily !== void 0 && prevFamily === resolveFamily(nextType)) {
                  return true;
                }
              }
              return false;
            }
          }
          function markFailedErrorBoundaryForHotReloading(fiber) {
            {
              if (resolveFamily === null) {
                return;
              }
              if (typeof WeakSet !== "function") {
                return;
              }
              if (failedBoundaries === null) {
                failedBoundaries = /* @__PURE__ */ new WeakSet();
              }
              failedBoundaries.add(fiber);
            }
          }
          var scheduleRefresh = function(root2, update) {
            {
              if (resolveFamily === null) {
                return;
              }
              var staleFamilies = update.staleFamilies, updatedFamilies = update.updatedFamilies;
              flushPassiveEffects();
              flushSync(function() {
                scheduleFibersWithFamiliesRecursively(root2.current, updatedFamilies, staleFamilies);
              });
            }
          };
          var scheduleRoot = function(root2, element) {
            {
              if (root2.context !== emptyContextObject) {
                return;
              }
              flushPassiveEffects();
              flushSync(function() {
                updateContainer(element, root2, null, null);
              });
            }
          };
          function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {
            {
              var alternate = fiber.alternate, child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type;
              var candidateType = null;
              switch (tag) {
                case FunctionComponent:
                case SimpleMemoComponent:
                case ClassComponent:
                  candidateType = type;
                  break;
                case ForwardRef:
                  candidateType = type.render;
                  break;
              }
              if (resolveFamily === null) {
                throw new Error("Expected resolveFamily to be set during hot reload.");
              }
              var needsRender = false;
              var needsRemount = false;
              if (candidateType !== null) {
                var family = resolveFamily(candidateType);
                if (family !== void 0) {
                  if (staleFamilies.has(family)) {
                    needsRemount = true;
                  } else if (updatedFamilies.has(family)) {
                    if (tag === ClassComponent) {
                      needsRemount = true;
                    } else {
                      needsRender = true;
                    }
                  }
                }
              }
              if (failedBoundaries !== null) {
                if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {
                  needsRemount = true;
                }
              }
              if (needsRemount) {
                fiber._debugNeedsRemount = true;
              }
              if (needsRemount || needsRender) {
                var _root = enqueueConcurrentRenderForLane(fiber, SyncLane);
                if (_root !== null) {
                  scheduleUpdateOnFiber(_root, fiber, SyncLane, NoTimestamp);
                }
              }
              if (child !== null && !needsRemount) {
                scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);
              }
              if (sibling !== null) {
                scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);
              }
            }
          }
          var findHostInstancesForRefresh = function(root2, families) {
            {
              var hostInstances = /* @__PURE__ */ new Set();
              var types = new Set(families.map(function(family) {
                return family.current;
              }));
              findHostInstancesForMatchingFibersRecursively(root2.current, types, hostInstances);
              return hostInstances;
            }
          };
          function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {
            {
              var child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type;
              var candidateType = null;
              switch (tag) {
                case FunctionComponent:
                case SimpleMemoComponent:
                case ClassComponent:
                  candidateType = type;
                  break;
                case ForwardRef:
                  candidateType = type.render;
                  break;
              }
              var didMatch = false;
              if (candidateType !== null) {
                if (types.has(candidateType)) {
                  didMatch = true;
                }
              }
              if (didMatch) {
                findHostInstancesForFiberShallowly(fiber, hostInstances);
              } else {
                if (child !== null) {
                  findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);
                }
              }
              if (sibling !== null) {
                findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);
              }
            }
          }
          function findHostInstancesForFiberShallowly(fiber, hostInstances) {
            {
              var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);
              if (foundHostInstances) {
                return;
              }
              var node = fiber;
              while (true) {
                switch (node.tag) {
                  case HostComponent:
                    hostInstances.add(node.stateNode);
                    return;
                  case HostPortal:
                    hostInstances.add(node.stateNode.containerInfo);
                    return;
                  case HostRoot:
                    hostInstances.add(node.stateNode.containerInfo);
                    return;
                }
                if (node.return === null) {
                  throw new Error("Expected to reach root first.");
                }
                node = node.return;
              }
            }
          }
          function findChildHostInstancesForFiberShallowly(fiber, hostInstances) {
            {
              var node = fiber;
              var foundHostInstances = false;
              while (true) {
                if (node.tag === HostComponent) {
                  foundHostInstances = true;
                  hostInstances.add(node.stateNode);
                } else if (node.child !== null) {
                  node.child.return = node;
                  node = node.child;
                  continue;
                }
                if (node === fiber) {
                  return foundHostInstances;
                }
                while (node.sibling === null) {
                  if (node.return === null || node.return === fiber) {
                    return foundHostInstances;
                  }
                  node = node.return;
                }
                node.sibling.return = node.return;
                node = node.sibling;
              }
            }
            return false;
          }
          var hasBadMapPolyfill;
          {
            hasBadMapPolyfill = false;
            try {
              var nonExtensibleObject = Object.preventExtensions({});
              /* @__PURE__ */ new Map([[nonExtensibleObject, null]]);
              /* @__PURE__ */ new Set([nonExtensibleObject]);
            } catch (e) {
              hasBadMapPolyfill = true;
            }
          }
          function FiberNode(tag, pendingProps, key2, mode) {
            this.tag = tag;
            this.key = key2;
            this.elementType = null;
            this.type = null;
            this.stateNode = null;
            this.return = null;
            this.child = null;
            this.sibling = null;
            this.index = 0;
            this.ref = null;
            this.pendingProps = pendingProps;
            this.memoizedProps = null;
            this.updateQueue = null;
            this.memoizedState = null;
            this.dependencies = null;
            this.mode = mode;
            this.flags = NoFlags;
            this.subtreeFlags = NoFlags;
            this.deletions = null;
            this.lanes = NoLanes;
            this.childLanes = NoLanes;
            this.alternate = null;
            {
              this.actualDuration = Number.NaN;
              this.actualStartTime = Number.NaN;
              this.selfBaseDuration = Number.NaN;
              this.treeBaseDuration = Number.NaN;
              this.actualDuration = 0;
              this.actualStartTime = -1;
              this.selfBaseDuration = 0;
              this.treeBaseDuration = 0;
            }
            {
              this._debugSource = null;
              this._debugOwner = null;
              this._debugNeedsRemount = false;
              this._debugHookTypes = null;
              if (!hasBadMapPolyfill && typeof Object.preventExtensions === "function") {
                Object.preventExtensions(this);
              }
            }
          }
          var createFiber = function(tag, pendingProps, key2, mode) {
            return new FiberNode(tag, pendingProps, key2, mode);
          };
          function shouldConstruct$1(Component2) {
            var prototype = Component2.prototype;
            return !!(prototype && prototype.isReactComponent);
          }
          function isSimpleFunctionComponent(type) {
            return typeof type === "function" && !shouldConstruct$1(type) && type.defaultProps === void 0;
          }
          function resolveLazyComponentTag(Component2) {
            if (typeof Component2 === "function") {
              return shouldConstruct$1(Component2) ? ClassComponent : FunctionComponent;
            } else if (Component2 !== void 0 && Component2 !== null) {
              var $$typeof = Component2.$$typeof;
              if ($$typeof === REACT_FORWARD_REF_TYPE) {
                return ForwardRef;
              }
              if ($$typeof === REACT_MEMO_TYPE) {
                return MemoComponent;
              }
            }
            return IndeterminateComponent;
          }
          function createWorkInProgress(current2, pendingProps) {
            var workInProgress2 = current2.alternate;
            if (workInProgress2 === null) {
              workInProgress2 = createFiber(current2.tag, pendingProps, current2.key, current2.mode);
              workInProgress2.elementType = current2.elementType;
              workInProgress2.type = current2.type;
              workInProgress2.stateNode = current2.stateNode;
              {
                workInProgress2._debugSource = current2._debugSource;
                workInProgress2._debugOwner = current2._debugOwner;
                workInProgress2._debugHookTypes = current2._debugHookTypes;
              }
              workInProgress2.alternate = current2;
              current2.alternate = workInProgress2;
            } else {
              workInProgress2.pendingProps = pendingProps;
              workInProgress2.type = current2.type;
              workInProgress2.flags = NoFlags;
              workInProgress2.subtreeFlags = NoFlags;
              workInProgress2.deletions = null;
              {
                workInProgress2.actualDuration = 0;
                workInProgress2.actualStartTime = -1;
              }
            }
            workInProgress2.flags = current2.flags & StaticMask;
            workInProgress2.childLanes = current2.childLanes;
            workInProgress2.lanes = current2.lanes;
            workInProgress2.child = current2.child;
            workInProgress2.memoizedProps = current2.memoizedProps;
            workInProgress2.memoizedState = current2.memoizedState;
            workInProgress2.updateQueue = current2.updateQueue;
            var currentDependencies = current2.dependencies;
            workInProgress2.dependencies = currentDependencies === null ? null : {
              lanes: currentDependencies.lanes,
              firstContext: currentDependencies.firstContext
            };
            workInProgress2.sibling = current2.sibling;
            workInProgress2.index = current2.index;
            workInProgress2.ref = current2.ref;
            {
              workInProgress2.selfBaseDuration = current2.selfBaseDuration;
              workInProgress2.treeBaseDuration = current2.treeBaseDuration;
            }
            {
              workInProgress2._debugNeedsRemount = current2._debugNeedsRemount;
              switch (workInProgress2.tag) {
                case IndeterminateComponent:
                case FunctionComponent:
                case SimpleMemoComponent:
                  workInProgress2.type = resolveFunctionForHotReloading(current2.type);
                  break;
                case ClassComponent:
                  workInProgress2.type = resolveClassForHotReloading(current2.type);
                  break;
                case ForwardRef:
                  workInProgress2.type = resolveForwardRefForHotReloading(current2.type);
                  break;
              }
            }
            return workInProgress2;
          }
          function resetWorkInProgress(workInProgress2, renderLanes2) {
            workInProgress2.flags &= StaticMask | Placement;
            var current2 = workInProgress2.alternate;
            if (current2 === null) {
              workInProgress2.childLanes = NoLanes;
              workInProgress2.lanes = renderLanes2;
              workInProgress2.child = null;
              workInProgress2.subtreeFlags = NoFlags;
              workInProgress2.memoizedProps = null;
              workInProgress2.memoizedState = null;
              workInProgress2.updateQueue = null;
              workInProgress2.dependencies = null;
              workInProgress2.stateNode = null;
              {
                workInProgress2.selfBaseDuration = 0;
                workInProgress2.treeBaseDuration = 0;
              }
            } else {
              workInProgress2.childLanes = current2.childLanes;
              workInProgress2.lanes = current2.lanes;
              workInProgress2.child = current2.child;
              workInProgress2.subtreeFlags = NoFlags;
              workInProgress2.deletions = null;
              workInProgress2.memoizedProps = current2.memoizedProps;
              workInProgress2.memoizedState = current2.memoizedState;
              workInProgress2.updateQueue = current2.updateQueue;
              workInProgress2.type = current2.type;
              var currentDependencies = current2.dependencies;
              workInProgress2.dependencies = currentDependencies === null ? null : {
                lanes: currentDependencies.lanes,
                firstContext: currentDependencies.firstContext
              };
              {
                workInProgress2.selfBaseDuration = current2.selfBaseDuration;
                workInProgress2.treeBaseDuration = current2.treeBaseDuration;
              }
            }
            return workInProgress2;
          }
          function createHostRootFiber(tag, isStrictMode, concurrentUpdatesByDefaultOverride) {
            var mode;
            if (tag === ConcurrentRoot) {
              mode = ConcurrentMode;
              if (isStrictMode === true) {
                mode |= StrictLegacyMode;
                {
                  mode |= StrictEffectsMode;
                }
              }
            } else {
              mode = NoMode;
            }
            if (isDevToolsPresent) {
              mode |= ProfileMode;
            }
            return createFiber(HostRoot, null, null, mode);
          }
          function createFiberFromTypeAndProps(type, key2, pendingProps, owner, mode, lanes) {
            var fiberTag = IndeterminateComponent;
            var resolvedType = type;
            if (typeof type === "function") {
              if (shouldConstruct$1(type)) {
                fiberTag = ClassComponent;
                {
                  resolvedType = resolveClassForHotReloading(resolvedType);
                }
              } else {
                {
                  resolvedType = resolveFunctionForHotReloading(resolvedType);
                }
              }
            } else if (typeof type === "string") {
              fiberTag = HostComponent;
            } else {
              getTag:
                switch (type) {
                  case REACT_FRAGMENT_TYPE:
                    return createFiberFromFragment(pendingProps.children, mode, lanes, key2);
                  case REACT_STRICT_MODE_TYPE:
                    fiberTag = Mode;
                    mode |= StrictLegacyMode;
                    if ((mode & ConcurrentMode) !== NoMode) {
                      mode |= StrictEffectsMode;
                    }
                    break;
                  case REACT_PROFILER_TYPE:
                    return createFiberFromProfiler(pendingProps, mode, lanes, key2);
                  case REACT_SUSPENSE_TYPE:
                    return createFiberFromSuspense(pendingProps, mode, lanes, key2);
                  case REACT_SUSPENSE_LIST_TYPE:
                    return createFiberFromSuspenseList(pendingProps, mode, lanes, key2);
                  case REACT_OFFSCREEN_TYPE:
                    return createFiberFromOffscreen(pendingProps, mode, lanes, key2);
                  case REACT_LEGACY_HIDDEN_TYPE:
                  case REACT_SCOPE_TYPE:
                  case REACT_CACHE_TYPE:
                  case REACT_TRACING_MARKER_TYPE:
                  case REACT_DEBUG_TRACING_MODE_TYPE:
                  default: {
                    if (typeof type === "object" && type !== null) {
                      switch (type.$$typeof) {
                        case REACT_PROVIDER_TYPE:
                          fiberTag = ContextProvider;
                          break getTag;
                        case REACT_CONTEXT_TYPE:
                          fiberTag = ContextConsumer;
                          break getTag;
                        case REACT_FORWARD_REF_TYPE:
                          fiberTag = ForwardRef;
                          {
                            resolvedType = resolveForwardRefForHotReloading(resolvedType);
                          }
                          break getTag;
                        case REACT_MEMO_TYPE:
                          fiberTag = MemoComponent;
                          break getTag;
                        case REACT_LAZY_TYPE:
                          fiberTag = LazyComponent;
                          resolvedType = null;
                          break getTag;
                      }
                    }
                    var info = "";
                    {
                      if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
                        info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
                      }
                      var ownerName = owner ? getComponentNameFromFiber(owner) : null;
                      if (ownerName) {
                        info += "\n\nCheck the render method of `" + ownerName + "`.";
                      }
                    }
                    throw new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) " + ("but got: " + (type == null ? type : typeof type) + "." + info));
                  }
                }
            }
            var fiber = createFiber(fiberTag, pendingProps, key2, mode);
            fiber.elementType = type;
            fiber.type = resolvedType;
            fiber.lanes = lanes;
            {
              fiber._debugOwner = owner;
            }
            return fiber;
          }
          function createFiberFromElement(element, mode, lanes) {
            var owner = null;
            {
              owner = element._owner;
            }
            var type = element.type;
            var key2 = element.key;
            var pendingProps = element.props;
            var fiber = createFiberFromTypeAndProps(type, key2, pendingProps, owner, mode, lanes);
            {
              fiber._debugSource = element._source;
              fiber._debugOwner = element._owner;
            }
            return fiber;
          }
          function createFiberFromFragment(elements, mode, lanes, key2) {
            var fiber = createFiber(Fragment2, elements, key2, mode);
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromProfiler(pendingProps, mode, lanes, key2) {
            {
              if (typeof pendingProps.id !== "string") {
                error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', typeof pendingProps.id);
              }
            }
            var fiber = createFiber(Profiler2, pendingProps, key2, mode | ProfileMode);
            fiber.elementType = REACT_PROFILER_TYPE;
            fiber.lanes = lanes;
            {
              fiber.stateNode = {
                effectDuration: 0,
                passiveEffectDuration: 0
              };
            }
            return fiber;
          }
          function createFiberFromSuspense(pendingProps, mode, lanes, key2) {
            var fiber = createFiber(SuspenseComponent, pendingProps, key2, mode);
            fiber.elementType = REACT_SUSPENSE_TYPE;
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromSuspenseList(pendingProps, mode, lanes, key2) {
            var fiber = createFiber(SuspenseListComponent, pendingProps, key2, mode);
            fiber.elementType = REACT_SUSPENSE_LIST_TYPE;
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromOffscreen(pendingProps, mode, lanes, key2) {
            var fiber = createFiber(OffscreenComponent, pendingProps, key2, mode);
            fiber.elementType = REACT_OFFSCREEN_TYPE;
            fiber.lanes = lanes;
            var primaryChildInstance = {
              isHidden: false
            };
            fiber.stateNode = primaryChildInstance;
            return fiber;
          }
          function createFiberFromText(content, mode, lanes) {
            var fiber = createFiber(HostText, content, null, mode);
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromHostInstanceForDeletion() {
            var fiber = createFiber(HostComponent, null, null, NoMode);
            fiber.elementType = "DELETED";
            return fiber;
          }
          function createFiberFromDehydratedFragment(dehydratedNode) {
            var fiber = createFiber(DehydratedFragment, null, null, NoMode);
            fiber.stateNode = dehydratedNode;
            return fiber;
          }
          function createFiberFromPortal(portal, mode, lanes) {
            var pendingProps = portal.children !== null ? portal.children : [];
            var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);
            fiber.lanes = lanes;
            fiber.stateNode = {
              containerInfo: portal.containerInfo,
              pendingChildren: null,
              implementation: portal.implementation
            };
            return fiber;
          }
          function assignFiberPropertiesInDEV(target, source) {
            if (target === null) {
              target = createFiber(IndeterminateComponent, null, null, NoMode);
            }
            target.tag = source.tag;
            target.key = source.key;
            target.elementType = source.elementType;
            target.type = source.type;
            target.stateNode = source.stateNode;
            target.return = source.return;
            target.child = source.child;
            target.sibling = source.sibling;
            target.index = source.index;
            target.ref = source.ref;
            target.pendingProps = source.pendingProps;
            target.memoizedProps = source.memoizedProps;
            target.updateQueue = source.updateQueue;
            target.memoizedState = source.memoizedState;
            target.dependencies = source.dependencies;
            target.mode = source.mode;
            target.flags = source.flags;
            target.subtreeFlags = source.subtreeFlags;
            target.deletions = source.deletions;
            target.lanes = source.lanes;
            target.childLanes = source.childLanes;
            target.alternate = source.alternate;
            {
              target.actualDuration = source.actualDuration;
              target.actualStartTime = source.actualStartTime;
              target.selfBaseDuration = source.selfBaseDuration;
              target.treeBaseDuration = source.treeBaseDuration;
            }
            target._debugSource = source._debugSource;
            target._debugOwner = source._debugOwner;
            target._debugNeedsRemount = source._debugNeedsRemount;
            target._debugHookTypes = source._debugHookTypes;
            return target;
          }
          function FiberRootNode(containerInfo, tag, hydrate2, identifierPrefix, onRecoverableError) {
            this.tag = tag;
            this.containerInfo = containerInfo;
            this.pendingChildren = null;
            this.current = null;
            this.pingCache = null;
            this.finishedWork = null;
            this.timeoutHandle = noTimeout;
            this.context = null;
            this.pendingContext = null;
            this.callbackNode = null;
            this.callbackPriority = NoLane;
            this.eventTimes = createLaneMap(NoLanes);
            this.expirationTimes = createLaneMap(NoTimestamp);
            this.pendingLanes = NoLanes;
            this.suspendedLanes = NoLanes;
            this.pingedLanes = NoLanes;
            this.expiredLanes = NoLanes;
            this.mutableReadLanes = NoLanes;
            this.finishedLanes = NoLanes;
            this.entangledLanes = NoLanes;
            this.entanglements = createLaneMap(NoLanes);
            this.identifierPrefix = identifierPrefix;
            this.onRecoverableError = onRecoverableError;
            {
              this.mutableSourceEagerHydrationData = null;
            }
            {
              this.effectDuration = 0;
              this.passiveEffectDuration = 0;
            }
            {
              this.memoizedUpdaters = /* @__PURE__ */ new Set();
              var pendingUpdatersLaneMap = this.pendingUpdatersLaneMap = [];
              for (var _i = 0; _i < TotalLanes; _i++) {
                pendingUpdatersLaneMap.push(/* @__PURE__ */ new Set());
              }
            }
            {
              switch (tag) {
                case ConcurrentRoot:
                  this._debugRootType = hydrate2 ? "hydrateRoot()" : "createRoot()";
                  break;
                case LegacyRoot:
                  this._debugRootType = hydrate2 ? "hydrate()" : "render()";
                  break;
              }
            }
          }
          function createFiberRoot(containerInfo, tag, hydrate2, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
            var root2 = new FiberRootNode(containerInfo, tag, hydrate2, identifierPrefix, onRecoverableError);
            var uninitializedFiber = createHostRootFiber(tag, isStrictMode);
            root2.current = uninitializedFiber;
            uninitializedFiber.stateNode = root2;
            {
              var _initialState = {
                element: initialChildren,
                isDehydrated: hydrate2,
                cache: null,
                transitions: null,
                pendingSuspenseBoundaries: null
              };
              uninitializedFiber.memoizedState = _initialState;
            }
            initializeUpdateQueue(uninitializedFiber);
            return root2;
          }
          var ReactVersion = "18.3.1";
          function createPortal(children, containerInfo, implementation) {
            var key2 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
            {
              checkKeyStringCoercion(key2);
            }
            return {
              $$typeof: REACT_PORTAL_TYPE,
              key: key2 == null ? null : "" + key2,
              children,
              containerInfo,
              implementation
            };
          }
          var didWarnAboutNestedUpdates;
          var didWarnAboutFindNodeInStrictMode;
          {
            didWarnAboutNestedUpdates = false;
            didWarnAboutFindNodeInStrictMode = {};
          }
          function getContextForSubtree(parentComponent) {
            if (!parentComponent) {
              return emptyContextObject;
            }
            var fiber = get(parentComponent);
            var parentContext = findCurrentUnmaskedContext(fiber);
            if (fiber.tag === ClassComponent) {
              var Component2 = fiber.type;
              if (isContextProvider(Component2)) {
                return processChildContext(fiber, Component2, parentContext);
              }
            }
            return parentContext;
          }
          function findHostInstanceWithWarning(component, methodName) {
            {
              var fiber = get(component);
              if (fiber === void 0) {
                if (typeof component.render === "function") {
                  throw new Error("Unable to find node on an unmounted component.");
                } else {
                  var keys = Object.keys(component).join(",");
                  throw new Error("Argument appears to not be a ReactComponent. Keys: " + keys);
                }
              }
              var hostFiber = findCurrentHostFiber(fiber);
              if (hostFiber === null) {
                return null;
              }
              if (hostFiber.mode & StrictLegacyMode) {
                var componentName = getComponentNameFromFiber(fiber) || "Component";
                if (!didWarnAboutFindNodeInStrictMode[componentName]) {
                  didWarnAboutFindNodeInStrictMode[componentName] = true;
                  var previousFiber = current;
                  try {
                    setCurrentFiber(hostFiber);
                    if (fiber.mode & StrictLegacyMode) {
                      error("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", methodName, methodName, componentName);
                    } else {
                      error("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", methodName, methodName, componentName);
                    }
                  } finally {
                    if (previousFiber) {
                      setCurrentFiber(previousFiber);
                    } else {
                      resetCurrentFiber();
                    }
                  }
                }
              }
              return hostFiber.stateNode;
            }
          }
          function createContainer(containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
            var hydrate2 = false;
            var initialChildren = null;
            return createFiberRoot(containerInfo, tag, hydrate2, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
          }
          function createHydrationContainer(initialChildren, callback, containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
            var hydrate2 = true;
            var root2 = createFiberRoot(containerInfo, tag, hydrate2, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
            root2.context = getContextForSubtree(null);
            var current2 = root2.current;
            var eventTime = requestEventTime();
            var lane = requestUpdateLane(current2);
            var update = createUpdate(eventTime, lane);
            update.callback = callback !== void 0 && callback !== null ? callback : null;
            enqueueUpdate(current2, update, lane);
            scheduleInitialHydrationOnRoot(root2, lane, eventTime);
            return root2;
          }
          function updateContainer(element, container, parentComponent, callback) {
            {
              onScheduleRoot(container, element);
            }
            var current$1 = container.current;
            var eventTime = requestEventTime();
            var lane = requestUpdateLane(current$1);
            {
              markRenderScheduled(lane);
            }
            var context = getContextForSubtree(parentComponent);
            if (container.context === null) {
              container.context = context;
            } else {
              container.pendingContext = context;
            }
            {
              if (isRendering && current !== null && !didWarnAboutNestedUpdates) {
                didWarnAboutNestedUpdates = true;
                error("Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.\n\nCheck the render method of %s.", getComponentNameFromFiber(current) || "Unknown");
              }
            }
            var update = createUpdate(eventTime, lane);
            update.payload = {
              element
            };
            callback = callback === void 0 ? null : callback;
            if (callback !== null) {
              {
                if (typeof callback !== "function") {
                  error("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callback);
                }
              }
              update.callback = callback;
            }
            var root2 = enqueueUpdate(current$1, update, lane);
            if (root2 !== null) {
              scheduleUpdateOnFiber(root2, current$1, lane, eventTime);
              entangleTransitions(root2, current$1, lane);
            }
            return lane;
          }
          function getPublicRootInstance(container) {
            var containerFiber = container.current;
            if (!containerFiber.child) {
              return null;
            }
            switch (containerFiber.child.tag) {
              case HostComponent:
                return getPublicInstance(containerFiber.child.stateNode);
              default:
                return containerFiber.child.stateNode;
            }
          }
          function attemptSynchronousHydration$1(fiber) {
            switch (fiber.tag) {
              case HostRoot: {
                var root2 = fiber.stateNode;
                if (isRootDehydrated(root2)) {
                  var lanes = getHighestPriorityPendingLanes(root2);
                  flushRoot(root2, lanes);
                }
                break;
              }
              case SuspenseComponent: {
                flushSync(function() {
                  var root3 = enqueueConcurrentRenderForLane(fiber, SyncLane);
                  if (root3 !== null) {
                    var eventTime = requestEventTime();
                    scheduleUpdateOnFiber(root3, fiber, SyncLane, eventTime);
                  }
                });
                var retryLane = SyncLane;
                markRetryLaneIfNotHydrated(fiber, retryLane);
                break;
              }
            }
          }
          function markRetryLaneImpl(fiber, retryLane) {
            var suspenseState = fiber.memoizedState;
            if (suspenseState !== null && suspenseState.dehydrated !== null) {
              suspenseState.retryLane = higherPriorityLane(suspenseState.retryLane, retryLane);
            }
          }
          function markRetryLaneIfNotHydrated(fiber, retryLane) {
            markRetryLaneImpl(fiber, retryLane);
            var alternate = fiber.alternate;
            if (alternate) {
              markRetryLaneImpl(alternate, retryLane);
            }
          }
          function attemptContinuousHydration$1(fiber) {
            if (fiber.tag !== SuspenseComponent) {
              return;
            }
            var lane = SelectiveHydrationLane;
            var root2 = enqueueConcurrentRenderForLane(fiber, lane);
            if (root2 !== null) {
              var eventTime = requestEventTime();
              scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
            }
            markRetryLaneIfNotHydrated(fiber, lane);
          }
          function attemptHydrationAtCurrentPriority$1(fiber) {
            if (fiber.tag !== SuspenseComponent) {
              return;
            }
            var lane = requestUpdateLane(fiber);
            var root2 = enqueueConcurrentRenderForLane(fiber, lane);
            if (root2 !== null) {
              var eventTime = requestEventTime();
              scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
            }
            markRetryLaneIfNotHydrated(fiber, lane);
          }
          function findHostInstanceWithNoPortals(fiber) {
            var hostFiber = findCurrentHostFiberWithNoPortals(fiber);
            if (hostFiber === null) {
              return null;
            }
            return hostFiber.stateNode;
          }
          var shouldErrorImpl = function(fiber) {
            return null;
          };
          function shouldError(fiber) {
            return shouldErrorImpl(fiber);
          }
          var shouldSuspendImpl = function(fiber) {
            return false;
          };
          function shouldSuspend(fiber) {
            return shouldSuspendImpl(fiber);
          }
          var overrideHookState = null;
          var overrideHookStateDeletePath = null;
          var overrideHookStateRenamePath = null;
          var overrideProps = null;
          var overridePropsDeletePath = null;
          var overridePropsRenamePath = null;
          var scheduleUpdate = null;
          var setErrorHandler = null;
          var setSuspenseHandler = null;
          {
            var copyWithDeleteImpl = function(obj, path, index2) {
              var key2 = path[index2];
              var updated = isArray(obj) ? obj.slice() : assign({}, obj);
              if (index2 + 1 === path.length) {
                if (isArray(updated)) {
                  updated.splice(key2, 1);
                } else {
                  delete updated[key2];
                }
                return updated;
              }
              updated[key2] = copyWithDeleteImpl(obj[key2], path, index2 + 1);
              return updated;
            };
            var copyWithDelete = function(obj, path) {
              return copyWithDeleteImpl(obj, path, 0);
            };
            var copyWithRenameImpl = function(obj, oldPath, newPath, index2) {
              var oldKey = oldPath[index2];
              var updated = isArray(obj) ? obj.slice() : assign({}, obj);
              if (index2 + 1 === oldPath.length) {
                var newKey = newPath[index2];
                updated[newKey] = updated[oldKey];
                if (isArray(updated)) {
                  updated.splice(oldKey, 1);
                } else {
                  delete updated[oldKey];
                }
              } else {
                updated[oldKey] = copyWithRenameImpl(
                  obj[oldKey],
                  oldPath,
                  newPath,
                  index2 + 1
                );
              }
              return updated;
            };
            var copyWithRename = function(obj, oldPath, newPath) {
              if (oldPath.length !== newPath.length) {
                warn("copyWithRename() expects paths of the same length");
                return;
              } else {
                for (var i = 0; i < newPath.length - 1; i++) {
                  if (oldPath[i] !== newPath[i]) {
                    warn("copyWithRename() expects paths to be the same except for the deepest key");
                    return;
                  }
                }
              }
              return copyWithRenameImpl(obj, oldPath, newPath, 0);
            };
            var copyWithSetImpl = function(obj, path, index2, value) {
              if (index2 >= path.length) {
                return value;
              }
              var key2 = path[index2];
              var updated = isArray(obj) ? obj.slice() : assign({}, obj);
              updated[key2] = copyWithSetImpl(obj[key2], path, index2 + 1, value);
              return updated;
            };
            var copyWithSet = function(obj, path, value) {
              return copyWithSetImpl(obj, path, 0, value);
            };
            var findHook = function(fiber, id) {
              var currentHook2 = fiber.memoizedState;
              while (currentHook2 !== null && id > 0) {
                currentHook2 = currentHook2.next;
                id--;
              }
              return currentHook2;
            };
            overrideHookState = function(fiber, id, path, value) {
              var hook = findHook(fiber, id);
              if (hook !== null) {
                var newState = copyWithSet(hook.memoizedState, path, value);
                hook.memoizedState = newState;
                hook.baseState = newState;
                fiber.memoizedProps = assign({}, fiber.memoizedProps);
                var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
                if (root2 !== null) {
                  scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
                }
              }
            };
            overrideHookStateDeletePath = function(fiber, id, path) {
              var hook = findHook(fiber, id);
              if (hook !== null) {
                var newState = copyWithDelete(hook.memoizedState, path);
                hook.memoizedState = newState;
                hook.baseState = newState;
                fiber.memoizedProps = assign({}, fiber.memoizedProps);
                var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
                if (root2 !== null) {
                  scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
                }
              }
            };
            overrideHookStateRenamePath = function(fiber, id, oldPath, newPath) {
              var hook = findHook(fiber, id);
              if (hook !== null) {
                var newState = copyWithRename(hook.memoizedState, oldPath, newPath);
                hook.memoizedState = newState;
                hook.baseState = newState;
                fiber.memoizedProps = assign({}, fiber.memoizedProps);
                var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
                if (root2 !== null) {
                  scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
                }
              }
            };
            overrideProps = function(fiber, path, value) {
              fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);
              if (fiber.alternate) {
                fiber.alternate.pendingProps = fiber.pendingProps;
              }
              var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
              if (root2 !== null) {
                scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
              }
            };
            overridePropsDeletePath = function(fiber, path) {
              fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path);
              if (fiber.alternate) {
                fiber.alternate.pendingProps = fiber.pendingProps;
              }
              var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
              if (root2 !== null) {
                scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
              }
            };
            overridePropsRenamePath = function(fiber, oldPath, newPath) {
              fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath);
              if (fiber.alternate) {
                fiber.alternate.pendingProps = fiber.pendingProps;
              }
              var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
              if (root2 !== null) {
                scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
              }
            };
            scheduleUpdate = function(fiber) {
              var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
              if (root2 !== null) {
                scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
              }
            };
            setErrorHandler = function(newShouldErrorImpl) {
              shouldErrorImpl = newShouldErrorImpl;
            };
            setSuspenseHandler = function(newShouldSuspendImpl) {
              shouldSuspendImpl = newShouldSuspendImpl;
            };
          }
          function findHostInstanceByFiber(fiber) {
            var hostFiber = findCurrentHostFiber(fiber);
            if (hostFiber === null) {
              return null;
            }
            return hostFiber.stateNode;
          }
          function emptyFindFiberByHostInstance(instance) {
            return null;
          }
          function getCurrentFiberForDevTools() {
            return current;
          }
          function injectIntoDevTools(devToolsConfig) {
            var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
            var ReactCurrentDispatcher2 = ReactSharedInternals.ReactCurrentDispatcher;
            return injectInternals({
              bundleType: devToolsConfig.bundleType,
              version: devToolsConfig.version,
              rendererPackageName: devToolsConfig.rendererPackageName,
              rendererConfig: devToolsConfig.rendererConfig,
              overrideHookState,
              overrideHookStateDeletePath,
              overrideHookStateRenamePath,
              overrideProps,
              overridePropsDeletePath,
              overridePropsRenamePath,
              setErrorHandler,
              setSuspenseHandler,
              scheduleUpdate,
              currentDispatcherRef: ReactCurrentDispatcher2,
              findHostInstanceByFiber,
              findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance,
              findHostInstancesForRefresh,
              scheduleRefresh,
              scheduleRoot,
              setRefreshHandler,
              getCurrentFiber: getCurrentFiberForDevTools,
              reconcilerVersion: ReactVersion
            });
          }
          var defaultOnRecoverableError = typeof reportError === "function" ? reportError : function(error2) {
            console["error"](error2);
          };
          function ReactDOMRoot(internalRoot) {
            this._internalRoot = internalRoot;
          }
          ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function(children) {
            var root2 = this._internalRoot;
            if (root2 === null) {
              throw new Error("Cannot update an unmounted root.");
            }
            {
              if (typeof arguments[1] === "function") {
                error("render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
              } else if (isValidContainer(arguments[1])) {
                error("You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root.");
              } else if (typeof arguments[1] !== "undefined") {
                error("You passed a second argument to root.render(...) but it only accepts one argument.");
              }
              var container = root2.containerInfo;
              if (container.nodeType !== COMMENT_NODE) {
                var hostInstance = findHostInstanceWithNoPortals(root2.current);
                if (hostInstance) {
                  if (hostInstance.parentNode !== container) {
                    error("render(...): It looks like the React-rendered content of the root container was removed without using React. This is not supported and will cause errors. Instead, call root.unmount() to empty a root's container.");
                  }
                }
              }
            }
            updateContainer(children, root2, null, null);
          };
          ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function() {
            {
              if (typeof arguments[0] === "function") {
                error("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
              }
            }
            var root2 = this._internalRoot;
            if (root2 !== null) {
              this._internalRoot = null;
              var container = root2.containerInfo;
              {
                if (isAlreadyRendering()) {
                  error("Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition.");
                }
              }
              flushSync(function() {
                updateContainer(null, root2, null, null);
              });
              unmarkContainerAsRoot(container);
            }
          };
          function createRoot(container, options2) {
            if (!isValidContainer(container)) {
              throw new Error("createRoot(...): Target container is not a DOM element.");
            }
            warnIfReactDOMContainerInDEV(container);
            var isStrictMode = false;
            var concurrentUpdatesByDefaultOverride = false;
            var identifierPrefix = "";
            var onRecoverableError = defaultOnRecoverableError;
            var transitionCallbacks = null;
            if (options2 !== null && options2 !== void 0) {
              {
                if (options2.hydrate) {
                  warn("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead.");
                } else {
                  if (typeof options2 === "object" && options2 !== null && options2.$$typeof === REACT_ELEMENT_TYPE) {
                    error("You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:\n\n  let root = createRoot(domContainer);\n  root.render(<App />);");
                  }
                }
              }
              if (options2.unstable_strictMode === true) {
                isStrictMode = true;
              }
              if (options2.identifierPrefix !== void 0) {
                identifierPrefix = options2.identifierPrefix;
              }
              if (options2.onRecoverableError !== void 0) {
                onRecoverableError = options2.onRecoverableError;
              }
              if (options2.transitionCallbacks !== void 0) {
                transitionCallbacks = options2.transitionCallbacks;
              }
            }
            var root2 = createContainer(container, ConcurrentRoot, null, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
            markContainerAsRoot(root2.current, container);
            var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
            listenToAllSupportedEvents(rootContainerElement);
            return new ReactDOMRoot(root2);
          }
          function ReactDOMHydrationRoot(internalRoot) {
            this._internalRoot = internalRoot;
          }
          function scheduleHydration(target) {
            if (target) {
              queueExplicitHydrationTarget(target);
            }
          }
          ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = scheduleHydration;
          function hydrateRoot(container, initialChildren, options2) {
            if (!isValidContainer(container)) {
              throw new Error("hydrateRoot(...): Target container is not a DOM element.");
            }
            warnIfReactDOMContainerInDEV(container);
            {
              if (initialChildren === void 0) {
                error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");
              }
            }
            var hydrationCallbacks = options2 != null ? options2 : null;
            var mutableSources = options2 != null && options2.hydratedSources || null;
            var isStrictMode = false;
            var concurrentUpdatesByDefaultOverride = false;
            var identifierPrefix = "";
            var onRecoverableError = defaultOnRecoverableError;
            if (options2 !== null && options2 !== void 0) {
              if (options2.unstable_strictMode === true) {
                isStrictMode = true;
              }
              if (options2.identifierPrefix !== void 0) {
                identifierPrefix = options2.identifierPrefix;
              }
              if (options2.onRecoverableError !== void 0) {
                onRecoverableError = options2.onRecoverableError;
              }
            }
            var root2 = createHydrationContainer(initialChildren, null, container, ConcurrentRoot, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
            markContainerAsRoot(root2.current, container);
            listenToAllSupportedEvents(container);
            if (mutableSources) {
              for (var i = 0; i < mutableSources.length; i++) {
                var mutableSource = mutableSources[i];
                registerMutableSourceForHydration(root2, mutableSource);
              }
            }
            return new ReactDOMHydrationRoot(root2);
          }
          function isValidContainer(node) {
            return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || !disableCommentsAsDOMContainers));
          }
          function isValidContainerLegacy(node) {
            return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === " react-mount-point-unstable "));
          }
          function warnIfReactDOMContainerInDEV(container) {
            {
              if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === "BODY") {
                error("createRoot(): Creating roots directly with document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try using a container element created for your app.");
              }
              if (isContainerMarkedAsRoot(container)) {
                if (container._reactRootContainer) {
                  error("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported.");
                } else {
                  error("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it.");
                }
              }
            }
          }
          var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;
          var topLevelUpdateWarnings;
          {
            topLevelUpdateWarnings = function(container) {
              if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
                var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer.current);
                if (hostInstance) {
                  if (hostInstance.parentNode !== container) {
                    error("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.");
                  }
                }
              }
              var isRootRenderedBySomeReact = !!container._reactRootContainer;
              var rootEl = getReactRootElementInContainer(container);
              var hasNonRootReactChild = !!(rootEl && getInstanceFromNode(rootEl));
              if (hasNonRootReactChild && !isRootRenderedBySomeReact) {
                error("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render.");
              }
              if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === "BODY") {
                error("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.");
              }
            };
          }
          function getReactRootElementInContainer(container) {
            if (!container) {
              return null;
            }
            if (container.nodeType === DOCUMENT_NODE) {
              return container.documentElement;
            } else {
              return container.firstChild;
            }
          }
          function noopOnRecoverableError() {
          }
          function legacyCreateRootFromDOMContainer(container, initialChildren, parentComponent, callback, isHydrationContainer) {
            if (isHydrationContainer) {
              if (typeof callback === "function") {
                var originalCallback = callback;
                callback = function() {
                  var instance = getPublicRootInstance(root2);
                  originalCallback.call(instance);
                };
              }
              var root2 = createHydrationContainer(
                initialChildren,
                callback,
                container,
                LegacyRoot,
                null,
                false,
                false,
                "",
                noopOnRecoverableError
              );
              container._reactRootContainer = root2;
              markContainerAsRoot(root2.current, container);
              var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
              listenToAllSupportedEvents(rootContainerElement);
              flushSync();
              return root2;
            } else {
              var rootSibling;
              while (rootSibling = container.lastChild) {
                container.removeChild(rootSibling);
              }
              if (typeof callback === "function") {
                var _originalCallback = callback;
                callback = function() {
                  var instance = getPublicRootInstance(_root);
                  _originalCallback.call(instance);
                };
              }
              var _root = createContainer(
                container,
                LegacyRoot,
                null,
                false,
                false,
                "",
                noopOnRecoverableError
              );
              container._reactRootContainer = _root;
              markContainerAsRoot(_root.current, container);
              var _rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
              listenToAllSupportedEvents(_rootContainerElement);
              flushSync(function() {
                updateContainer(initialChildren, _root, parentComponent, callback);
              });
              return _root;
            }
          }
          function warnOnInvalidCallback$1(callback, callerName) {
            {
              if (callback !== null && typeof callback !== "function") {
                error("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callerName, callback);
              }
            }
          }
          function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {
            {
              topLevelUpdateWarnings(container);
              warnOnInvalidCallback$1(callback === void 0 ? null : callback, "render");
            }
            var maybeRoot = container._reactRootContainer;
            var root2;
            if (!maybeRoot) {
              root2 = legacyCreateRootFromDOMContainer(container, children, parentComponent, callback, forceHydrate);
            } else {
              root2 = maybeRoot;
              if (typeof callback === "function") {
                var originalCallback = callback;
                callback = function() {
                  var instance = getPublicRootInstance(root2);
                  originalCallback.call(instance);
                };
              }
              updateContainer(children, root2, parentComponent, callback);
            }
            return getPublicRootInstance(root2);
          }
          var didWarnAboutFindDOMNode = false;
          function findDOMNode(componentOrElement) {
            {
              if (!didWarnAboutFindDOMNode) {
                didWarnAboutFindDOMNode = true;
                error("findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node");
              }
              var owner = ReactCurrentOwner$3.current;
              if (owner !== null && owner.stateNode !== null) {
                var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;
                if (!warnedAboutRefsInRender) {
                  error("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", getComponentNameFromType(owner.type) || "A component");
                }
                owner.stateNode._warnedAboutRefsInRender = true;
              }
            }
            if (componentOrElement == null) {
              return null;
            }
            if (componentOrElement.nodeType === ELEMENT_NODE) {
              return componentOrElement;
            }
            {
              return findHostInstanceWithWarning(componentOrElement, "findDOMNode");
            }
          }
          function hydrate(element, container, callback) {
            {
              error("ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot");
            }
            if (!isValidContainerLegacy(container)) {
              throw new Error("Target container is not a DOM element.");
            }
            {
              var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
              if (isModernRoot) {
                error("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call hydrateRoot(container, element)?");
              }
            }
            return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);
          }
          function render(element, container, callback) {
            {
              error("ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot");
            }
            if (!isValidContainerLegacy(container)) {
              throw new Error("Target container is not a DOM element.");
            }
            {
              var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
              if (isModernRoot) {
                error("You are calling ReactDOM.render() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?");
              }
            }
            return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);
          }
          function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
            {
              error("ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported in React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot");
            }
            if (!isValidContainerLegacy(containerNode)) {
              throw new Error("Target container is not a DOM element.");
            }
            if (parentComponent == null || !has(parentComponent)) {
              throw new Error("parentComponent must be a valid React Component");
            }
            return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);
          }
          var didWarnAboutUnmountComponentAtNode = false;
          function unmountComponentAtNode(container) {
            {
              if (!didWarnAboutUnmountComponentAtNode) {
                didWarnAboutUnmountComponentAtNode = true;
                error("unmountComponentAtNode is deprecated and will be removed in the next major release. Switch to the createRoot API. Learn more: https://reactjs.org/link/switch-to-createroot");
              }
            }
            if (!isValidContainerLegacy(container)) {
              throw new Error("unmountComponentAtNode(...): Target container is not a DOM element.");
            }
            {
              var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
              if (isModernRoot) {
                error("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?");
              }
            }
            if (container._reactRootContainer) {
              {
                var rootEl = getReactRootElementInContainer(container);
                var renderedByDifferentReact = rootEl && !getInstanceFromNode(rootEl);
                if (renderedByDifferentReact) {
                  error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.");
                }
              }
              flushSync(function() {
                legacyRenderSubtreeIntoContainer(null, null, container, false, function() {
                  container._reactRootContainer = null;
                  unmarkContainerAsRoot(container);
                });
              });
              return true;
            } else {
              {
                var _rootEl = getReactRootElementInContainer(container);
                var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode(_rootEl));
                var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainerLegacy(container.parentNode) && !!container.parentNode._reactRootContainer;
                if (hasNonRootReactChild) {
                  error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s", isContainerReactRoot ? "You may have accidentally passed in a React root node instead of its container." : "Instead, have the parent component update its state and rerender in order to remove this component.");
                }
              }
              return false;
            }
          }
          setAttemptSynchronousHydration(attemptSynchronousHydration$1);
          setAttemptContinuousHydration(attemptContinuousHydration$1);
          setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);
          setGetCurrentUpdatePriority(getCurrentUpdatePriority);
          setAttemptHydrationAtPriority(runWithPriority);
          {
            if (typeof Map !== "function" || Map.prototype == null || typeof Map.prototype.forEach !== "function" || typeof Set !== "function" || Set.prototype == null || typeof Set.prototype.clear !== "function" || typeof Set.prototype.forEach !== "function") {
              error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
            }
          }
          setRestoreImplementation(restoreControlledState$3);
          setBatchingImplementation(batchedUpdates$1, discreteUpdates, flushSync);
          function createPortal$1(children, container) {
            var key2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
            if (!isValidContainer(container)) {
              throw new Error("Target container is not a DOM element.");
            }
            return createPortal(children, container, null, key2);
          }
          function renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
            return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);
          }
          var Internals = {
            usingClientEntryPoint: false,
            Events: [getInstanceFromNode, getNodeFromInstance, getFiberCurrentPropsFromNode, enqueueStateRestore, restoreStateIfNeeded, batchedUpdates$1]
          };
          function createRoot$1(container, options2) {
            {
              if (!Internals.usingClientEntryPoint && true) {
                error('You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".');
              }
            }
            return createRoot(container, options2);
          }
          function hydrateRoot$1(container, initialChildren, options2) {
            {
              if (!Internals.usingClientEntryPoint && true) {
                error('You are importing hydrateRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".');
              }
            }
            return hydrateRoot(container, initialChildren, options2);
          }
          function flushSync$1(fn) {
            {
              if (isAlreadyRendering()) {
                error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.");
              }
            }
            return flushSync(fn);
          }
          var foundDevTools = injectIntoDevTools({
            findFiberByHostInstance: getClosestInstanceFromNode,
            bundleType: 1,
            version: ReactVersion,
            rendererPackageName: "react-dom"
          });
          {
            if (!foundDevTools && canUseDOM && window.top === window.self) {
              if (navigator.userAgent.indexOf("Chrome") > -1 && navigator.userAgent.indexOf("Edge") === -1 || navigator.userAgent.indexOf("Firefox") > -1) {
                var protocol = window.location.protocol;
                if (/^(https?|file):$/.test(protocol)) {
                  console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools" + (protocol === "file:" ? "\nYou might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq" : ""), "font-weight:bold");
                }
              }
            }
          }
          exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
          exports.createPortal = createPortal$1;
          exports.createRoot = createRoot$1;
          exports.findDOMNode = findDOMNode;
          exports.flushSync = flushSync$1;
          exports.hydrate = hydrate;
          exports.hydrateRoot = hydrateRoot$1;
          exports.render = render;
          exports.unmountComponentAtNode = unmountComponentAtNode;
          exports.unstable_batchedUpdates = batchedUpdates$1;
          exports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;
          exports.version = ReactVersion;
          if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
            __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
          }
        })();
      }
    }
  });

  // node_modules/react-dom/index.js
  var require_react_dom = __commonJS({
    "node_modules/react-dom/index.js"(exports, module) {
      "use strict";
      if (false) {
        checkDCE();
        module.exports = null;
      } else {
        module.exports = require_react_dom_development();
      }
    }
  });

  // src/dash/index.tsx
  var dash_exports = {};
  __export(dash_exports, {
    MitoDashWrapper: () => MitoDashWrapper
  });

  // src/mito/Mito.tsx
  init_react();

  // src/mito/components/CatchUpPopup.tsx
  init_react();

  // src/mito/components/layout/Col.tsx
  init_react();

  // src/mito/utils/classNames.tsx
  var classNames = (...args) => {
    let finalString = "";
    for (let i = 0; i < args.length; i++) {
      const arg = args[i];
      if (arg === void 0) {
        continue;
      }
      if (typeof arg === "string") {
        finalString += arg + " ";
      } else {
        Object.entries(arg).map(([className, include]) => {
          if (include) {
            finalString += className + " ";
          }
        });
      }
    }
    return finalString;
  };

  // src/mito/components/layout/Col.tsx
  var Col = (props) => {
    const width = props.span ? `${props.span / 24 * 100}%` : void 0;
    const marginLeft = props.offset ? `${props.offset / 24 * 100}%` : void 0;
    const marginRight = props.offsetRight ? `${props.offsetRight / 24 * 100}%` : void 0;
    return /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: classNames("spacing-col", props.className),
        style: __spreadValues({
          width,
          marginLeft,
          marginRight,
          flex: props.flex
        }, props.style),
        onClick: props.onClick,
        title: props.title
      },
      props.children
    );
  };
  var Col_default = Col;

  // src/mito/components/layout/Row.tsx
  init_react();
  var Row = (props) => {
    const marginClass = props.suppressTopBottomMargin ? "spacing-row-no-top-bottom-margin" : "spacing-row-top-bottom-margin";
    return /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: classNames(props.className, "spacing-row", marginClass),
        title: props.title,
        onClick: props.onClick,
        style: __spreadProps(__spreadValues({}, props.style), {
          justifyContent: props.justify,
          alignItems: props.align
        })
      },
      props.children
    );
  };
  var Row_default = Row;

  // src/mito/components/icons/CatchUpIcon.tsx
  init_react();
  var CatchUpIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "16", height: "15", viewBox: "0 0 16 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1 14L7.5 7.96429L1 1V14Z", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M8.42578 14L14.9258 7.96429L8.42578 1V14Z", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }));
  };
  var CatchUpIcon_default = CatchUpIcon;

  // src/mito/components/CatchUpPopup.tsx
  var CatchUpPopup = (props) => {
    return /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: "catch-up-popup-container"
      },
      /* @__PURE__ */ react_default.createElement(Row_default, null, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-overflow-wrap text-color-background-important" }, "You are viewing a previous step, and cannot make any edits."))),
      /* @__PURE__ */ react_default.createElement(Row_default, { onClick: props.fastForward, className: "text-cursor-default" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(CatchUpIcon_default, null)), /* @__PURE__ */ react_default.createElement(Col_default, { offset: 1, className: "text-color-background-important" }, /* @__PURE__ */ react_default.createElement("p", null, /* @__PURE__ */ react_default.createElement("span", { className: "text-underline" }, " Catch up"), " to continue analysis."))),
      /* @__PURE__ */ react_default.createElement(Row_default, { onClick: props.isPro ? props.deleteStepsAfterIdx : void 0, className: "text-cursor-default" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(CatchUpIcon_default, null)), /* @__PURE__ */ react_default.createElement(Col_default, { offset: 1, className: "text-color-background-important" }, /* @__PURE__ */ react_default.createElement("p", { className: classNames({ "text-color-disabled": !props.isPro }), title: !props.isPro ? "Bulk step undo requires Mito Pro or Enterprise" : void 0 }, /* @__PURE__ */ react_default.createElement("span", { className: "text-underline" }, "Undo hidden steps"), " to work from here.")))
    );
  };
  var CatchUpPopup_default = CatchUpPopup;

  // src/mito/components/elements/ErrorBoundary.tsx
  init_react();

  // src/mito/data/documentationLinks.tsx
  var DOCUMENTATION_LINK_INSTALL = "https://docs.trymito.io/getting-started/installing-mito";
  var DOCUMENTATION_LINK_AI_TRANSFORM = "https://docs.trymito.io/how-to/ai-transformations";
  var DISCORD_INVITE_LINK = "https://discord.gg/XdJSZyejJU";

  // src/mito/utils/location.tsx
  var isInJupyterLabOrNotebook = () => {
    return window.location.pathname.startsWith("/lab") || window.location.pathname.startsWith("/notebooks") || window.commands !== void 0 || window._JUPYTERLAB !== void 0;
  };
  var isInStreamlit = () => {
    if (window.parent) {
      const parent = window.parent.document.querySelector(".stApp");
      if (parent) {
        return true;
      }
    }
    return false;
  };
  var isInDash = () => {
    const dashAppContent = document.getElementById("_dash-app-content");
    if (dashAppContent) {
      return true;
    }
    const dashGlobalErrorContainer = document.getElementById("_dash-global-error-container");
    if (dashGlobalErrorContainer) {
      return true;
    }
    return false;
  };
  var isInDashboard = () => {
    return isInStreamlit() || isInDash();
  };

  // src/mito/components/elements/GetSupportButton.tsx
  init_react();

  // src/mito/components/elements/TextButton.tsx
  init_react();
  var TextButton = (props) => {
    const disabled = props.disabled === true;
    const width = props.width || "block";
    const className = props.className || "";
    const disabledClass = disabled ? "text-button-disabled" : "";
    const widthClass = `element-width-${width}`;
    const variantClass = `text-button-variant-${props.variant}`;
    const disabledTooltip = props.disabled && props.disabledTooltip !== void 0 ? props.disabledTooltip : void 0;
    const tooltip = disabledTooltip !== void 0 ? disabledTooltip : props.tooltip;
    if (props.href !== void 0) {
      return /* @__PURE__ */ react_default.createElement(
        "a",
        {
          className: classNames("text-button", widthClass, variantClass, disabledClass, className),
          href: disabled ? void 0 : props.href,
          download: disabled ? void 0 : props.download,
          onClick: disabled ? () => {
            return;
          } : props.onClick,
          target: props.target,
          title: tooltip
        },
        /* @__PURE__ */ react_default.createElement(
          "span",
          {
            className: classNames({ "text-color-background-important": props.variant === "dark" }, "text-overflow-wrap")
          },
          props.children
        )
      );
    } else {
      return /* @__PURE__ */ react_default.createElement(
        "button",
        {
          className: classNames("text-button", widthClass, variantClass, disabledClass, className),
          onClick: props.onClick,
          type: props.type,
          disabled: props.disabled,
          autoFocus: props.autoFocus,
          title: tooltip,
          style: props.style
        },
        props.children
      );
    }
  };
  var TextButton_default = TextButton;

  // src/mito/components/elements/GetSupportButton.tsx
  var DEFAULT_SUPPORT_EMAIL = "founders@sagacollab.com";
  var GetSupportButton = (props) => {
    return /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        className: classNames(props.className, "cursor-pointer"),
        variant: "default",
        width: props.width || "hug-contents",
        href: props.userProfile.mitoConfig.MITO_CONFIG_SUPPORT_EMAIL === DEFAULT_SUPPORT_EMAIL ? DISCORD_INVITE_LINK : `mailto:${props.userProfile.mitoConfig.MITO_CONFIG_SUPPORT_EMAIL}?subject=Mito support request`,
        target: "_blank",
        onClick: () => {
          var _a;
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ }
            });
          });
          void ((_a = props.mitoAPI) == null ? void 0 : _a.log("clicked_get_support_button"));
          return true;
        }
      },
      "Help"
    );
  };
  var GetSupportButton_default = GetSupportButton;

  // src/mito/components/elements/ErrorBoundary.tsx
  var ErrorBoundary = class extends Component {
    constructor() {
      super(...arguments);
      this.state = {
        hasError: false,
        error: void 0
      };
    }
    static getDerivedStateFromError() {
      return { hasError: true, error: void 0 };
    }
    componentDidCatch(error) {
      var _a;
      console.error("Sheet crashing error", error);
      console.error("userProfile", this.props.userProfile);
      console.error("analysisData", this.props.analyisData);
      console.error("sheetDataArray", this.props.sheetDataArray);
      void this.props.mitoAPI.log("frontend_render_failed", {
        "error_name": error.name,
        "error_message": error.message,
        "error_stack": (_a = error.stack) == null ? void 0 : _a.split("\n")
      });
      this.setState({ error });
    }
    render() {
      let fixUpMessage = "Rerun the Jupyter Cell above";
      if (isInStreamlit()) {
        fixUpMessage = "Refresh the Streamlit app";
      } else if (isInDash()) {
        fixUpMessage = "Refresh the Dash app";
      }
      let supportMessage = /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, "join our ", /* @__PURE__ */ react_default.createElement("a", { className: "text-body-1-link", href: DISCORD_INVITE_LINK, target: "_blank", rel: "noreferrer" }, "Discord"), " for support");
      const supportEmail = this.props.userProfile.mitoConfig.MITO_CONFIG_SUPPORT_EMAIL;
      if (supportEmail !== DEFAULT_SUPPORT_EMAIL) {
        const body = "Error Report (DO NOT DELETE): " + JSON.stringify({
          "userProfile": this.props.userProfile,
          "analysisData": this.props.analyisData,
          "sheetDataArray": this.props.sheetDataArray,
          "error": this.state.error ? {
            "name": this.state.error.name,
            "message": this.state.error.message,
            "stack": this.state.error
          } : null
        });
        supportMessage = /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("a", { className: "text-body-1-link", href: `mailto:${supportEmail}?subject=Mito error report&body=${body}`, target: "_blank", rel: "noreferrer" }, "contact support"));
      }
      if (this.state.hasError) {
        return /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1 text-color-red p-10px" }, "Looks like Mito had an error! Sorry about that. ", fixUpMessage, ", and ", supportMessage, " if this error occurs again.");
      }
      return this.props.children;
    }
  };
  var ErrorBoundary_default = ErrorBoundary;

  // src/mito/components/endo/EndoGrid.tsx
  init_react();

  // src/mito/components/endo/FormulaBar.tsx
  init_react();

  // src/mito/utils/columnHeaders.tsx
  var isPrimitiveColumnHeader = (columnHeader) => {
    return typeof columnHeader === "string" || typeof columnHeader === "number" || typeof columnHeader === "boolean";
  };
  var getDisplayColumnHeader = (columnHeader) => {
    if (isPrimitiveColumnHeader(columnHeader)) {
      return columnHeader.toString();
    } else {
      return columnHeader.map((c) => c.toString()).filter((c) => c !== "").join(", ");
    }
  };
  var columnIDMapToDisplayHeadersMap = (columnIDsMap) => {
    return Object.fromEntries(Object.entries(columnIDsMap).map(([columnID, columnHeader]) => {
      return [columnID, getDisplayColumnHeader(columnHeader)];
    }));
  };
  var isSingleStringMultiIndexHeader = (columnHeader) => {
    if (isPrimitiveColumnHeader(columnHeader)) {
      return true;
    }
    for (let i = 1; i < columnHeader.length; i++) {
      if (columnHeader[i] !== "") {
        return false;
      }
    }
    return true;
  };
  var getColumnHeaderParts = (columnHeader) => {
    if (isPrimitiveColumnHeader(columnHeader)) {
      return {
        lowerLevelColumnHeaders: [],
        finalColumnHeader: columnHeader
      };
    } else {
      if (isSingleStringMultiIndexHeader(columnHeader)) {
        return {
          lowerLevelColumnHeaders: columnHeader.slice(1),
          finalColumnHeader: columnHeader[0]
        };
      }
      const lowerLevelColumnHeaders = columnHeader.slice(0, columnHeader.length - 1);
      const finalColumnHeader = columnHeader[columnHeader.length - 1];
      return {
        lowerLevelColumnHeaders,
        finalColumnHeader
      };
    }
  };
  var rowIndexToColumnHeaderLevel = (columnHeader, rowIndex) => {
    if (isSingleStringMultiIndexHeader(columnHeader)) {
      return 0;
    }
    return columnHeader.length - rowIndex * -1;
  };
  var getFirstCharactersOfColumnHeaders = (columnHeaders, num) => {
    const columnHeadersCopy = [...columnHeaders];
    let charsRemaining = num;
    const columnHeadersToDisplay = [];
    while (columnHeadersCopy.length > 0 && charsRemaining > 0) {
      const nextFullString = getDisplayColumnHeader(columnHeadersCopy.shift() || "");
      let nextPartialString = "";
      for (let i = 0; i < nextFullString.length; i++) {
        if (charsRemaining > 0) {
          nextPartialString += nextFullString[i];
          charsRemaining--;
        }
      }
      columnHeadersToDisplay.push(nextPartialString);
    }
    return [columnHeadersToDisplay.join(", "), columnHeadersCopy.length];
  };
  var getNewColumnHeader = () => {
    let result = "";
    const characters = "abcdefghijklmnopqrstuvwxyz0123456789";
    const charactersLength = characters.length;
    for (let i = 0; i < 4; i++) {
      result += characters.charAt(Math.floor(Math.random() * charactersLength));
    }
    return result;
  };
  var getColumnIDByIndex = (sheetData, columnIndex) => {
    return Object.keys(sheetData.columnIDsMap)[columnIndex];
  };

  // src/mito/components/endo/celleditor/CellEditor.tsx
  init_react();

  // src/mito/hooks/useEffectOnElementResize.tsx
  init_react();
  var useEffectOnResizeElement = (effect, deps, mitoContainerRef, id) => {
    useEffect(() => {
      var _a;
      const resizeObserver = new ResizeObserver(() => {
        effect();
      });
      const element = (_a = mitoContainerRef.current) == null ? void 0 : _a.querySelector(id);
      if (element) {
        resizeObserver.observe(element);
      }
      return () => {
        resizeObserver.disconnect();
      };
    }, [...deps, id]);
  };

  // src/mito/components/taskpanes/taskpanes.tsx
  var EDITING_TASKPANES = [
    "pivot" /* PIVOT */,
    "merge" /* MERGE */,
    "concat" /* CONCAT */,
    "drop_duplicates" /* DROP_DUPLICATES */,
    "import files" /* IMPORT_FILES */,
    "download" /* DOWNLOAD */,
    "split_text_to_columns" /* SPLIT_TEXT_TO_COLUMNS */,
    "fill_na" /* FILL_NA */,
    "melt" /* MELT */,
    "set_dataframe_format" /* SET_DATAFRAME_FORMAT */,
    "SnowflakeImport" /* SNOWFLAKEIMPORT */,
    "Excel Range Import" /* EXCEL_RANGE_IMPORT */,
    "Export To File" /* EXPORT_TO_FILE */,
    "Column Headers Transform" /* COLUMN_HEADERS_TRANSFORM */,
    "UserDefinedImport" /* USERDEFINEDIMPORT */,
    "User Defined Edit" /* USER_DEFINED_EDIT */
  ];
  var ALLOW_UNDO_REDO_EDITING_TASKPANES = [
    "pivot" /* PIVOT */,
    "merge" /* MERGE */,
    "concat" /* CONCAT */,
    "drop_duplicates" /* DROP_DUPLICATES */,
    "import files" /* IMPORT_FILES */,
    "split_text_to_columns" /* SPLIT_TEXT_TO_COLUMNS */,
    "fill_na" /* FILL_NA */,
    "melt" /* MELT */,
    "set_dataframe_format" /* SET_DATAFRAME_FORMAT */,
    "ConditionalFormatting" /* CONDITIONALFORMATTING */,
    "UpdateImports" /* UPDATEIMPORTS */,
    "SnowflakeImport" /* SNOWFLAKEIMPORT */,
    "Excel Range Import" /* EXCEL_RANGE_IMPORT */,
    "AITransformation" /* AITRANSFORMATION */,
    "Column Headers Transform" /* COLUMN_HEADERS_TRANSFORM */,
    "UserDefinedImport" /* USERDEFINEDIMPORT */,
    "User Defined Edit" /* USER_DEFINED_EDIT */
  ];
  var DEFAULT_TASKPANE_WIDTH = 430;
  var TASKPANE_WIDTH_MAX = 500;
  var TASKPANE_WIDTH_MIN = 300;
  var getDefaultTaskpaneWidth = () => {
    if (window.innerWidth > 1200) {
      return DEFAULT_TASKPANE_WIDTH;
    }
    return TASKPANE_WIDTH_MIN;
  };

  // src/mito/components/endo/columnHeaderUtils.tsx
  var submitRenameColumnHeader = (columnHeader, finalColumnHeader, columnID, sheetIndex, editorState, setUIState, mitoAPI) => {
    const newColumnHeader = (editorState == null ? void 0 : editorState.formula) || getDisplayColumnHeader(finalColumnHeader);
    const oldColumnHeader = getDisplayColumnHeader(finalColumnHeader);
    if (newColumnHeader !== oldColumnHeader) {
      const levelIndex = isPrimitiveColumnHeader(columnHeader) ? void 0 : rowIndexToColumnHeaderLevel(columnHeader, -1);
      void mitoAPI.editRenameColumn(
        sheetIndex,
        columnID,
        newColumnHeader,
        levelIndex
      );
      setUIState((prevUIState) => {
        if (prevUIState.currOpenTaskpane.type !== "control_panel" /* CONTROL_PANEL */) {
          return __spreadProps(__spreadValues({}, prevUIState), {
            currOpenTaskpane: { type: "none" /* NONE */ }
          });
        }
        return prevUIState;
      });
    }
  };

  // src/mito/components/endo/focusUtils.tsx
  var focusGrid = (containerDiv) => {
    if (containerDiv) {
      containerDiv.focus({ preventScroll: true });
    }
  };

  // src/mito/utils/dtypes.tsx
  function isBoolDtype(dtype) {
    return dtype == "bool";
  }
  function isIntDtype(dtype) {
    return dtype.includes("int");
  }
  function isFloatDtype(dtype) {
    return dtype.includes("float");
  }
  function isStringDtype(dtype) {
    return dtype == "object" || dtype == "str" || dtype == "string";
  }
  function isDatetimeDtype(dtype) {
    return dtype.includes("datetime");
  }
  function isTimedeltaDtype(dtype) {
    return dtype.includes("timedelta");
  }
  function isNumberDtype(dtype) {
    return isIntDtype(dtype) || isFloatDtype(dtype);
  }

  // src/mito/components/endo/selectionUtils.tsx
  var getIsCellSelected = (selections, rowIndex, columnIndex) => {
    let isSelected = false;
    selections.forEach((selection) => {
      isSelected = isSelected || getIsCellInSingleSelection(selection, rowIndex, columnIndex);
    });
    return isSelected;
  };
  var getIsCellInSingleSelection = (selection, rowIndex, columnIndex) => {
    const lowerRowIndex = selection.startingRowIndex < selection.endingRowIndex ? selection.startingRowIndex : selection.endingRowIndex;
    const higherRowIndex = selection.startingRowIndex > selection.endingRowIndex ? selection.startingRowIndex : selection.endingRowIndex;
    const rowSelected = lowerRowIndex <= rowIndex && rowIndex <= higherRowIndex;
    const lowerColumnIndex = selection.startingColumnIndex < selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
    const higherColumnIndex = selection.startingColumnIndex > selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
    const columnSelected = lowerColumnIndex <= columnIndex && columnIndex <= higherColumnIndex;
    if (rowSelected && columnSelected) {
      return true;
    }
    if (lowerRowIndex <= -1 && higherRowIndex <= -1) {
      return columnSelected;
    }
    if (lowerColumnIndex <= -1 && higherColumnIndex <= -1) {
      return rowSelected;
    }
    return false;
  };
  var getIsHeader = (rowIndex, columnIndex) => {
    return rowIndex <= -1 || columnIndex <= -1;
  };
  var getIndexesFromXAndY = (clientX, clientY) => {
    let element = document.elementFromPoint(clientX, clientY);
    let rowIndex = void 0;
    let columnIndex = void 0;
    while (element) {
      const rowIndexAttribute = element == null ? void 0 : element.getAttribute("mito-row-index");
      rowIndex = rowIndex !== void 0 ? rowIndex : typeof rowIndexAttribute === "string" ? parseInt(rowIndexAttribute) : void 0;
      const columnIndexAttribute = element == null ? void 0 : element.getAttribute("mito-col-index");
      columnIndex = columnIndex !== void 0 ? columnIndex : typeof columnIndexAttribute === "string" ? parseInt(columnIndexAttribute) : void 0;
      if (rowIndex !== void 0 && columnIndex !== void 0) {
        return {
          rowIndex,
          columnIndex
        };
      }
      element = element.parentElement;
    }
    return {
      rowIndex,
      columnIndex
    };
  };
  var getIndexesFromMouseEvent = (e) => {
    return getIndexesFromXAndY(e.clientX, e.clientY);
  };
  var getNewSelectionAfterMouseUp = (selection, rowIndex, columnIndex) => {
    if (rowIndex === void 0 || columnIndex === void 0) {
      return selection;
    }
    return {
      startingRowIndex: selection.startingRowIndex,
      endingRowIndex: rowIndex,
      startingColumnIndex: selection.startingColumnIndex,
      endingColumnIndex: columnIndex,
      sheetIndex: selection.sheetIndex
    };
  };
  var isNavigationKeyPressed = (key2) => {
    const arrowUp = key2 === "Up" || key2 === "ArrowUp";
    const arrowDown = key2 === "Down" || key2 === "ArrowDown";
    const arrowLeft = key2 === "Left" || key2 === "ArrowLeft";
    const arrowRight = key2 === "Right" || key2 === "ArrowRight";
    const tabPressed = key2 === "Tab";
    return arrowUp || arrowDown || arrowLeft || arrowRight || tabPressed;
  };
  var getNewSelectionAfterKeyPress = (selection, e, sheetData) => {
    if (!isNavigationKeyPressed(e.key)) {
      return selection;
    }
    const arrowUp = e.key === "Up" || e.key === "ArrowUp";
    const arrowDown = e.key === "Down" || e.key === "ArrowDown";
    const arrowLeft = e.key === "Left" || e.key === "ArrowLeft";
    const arrowRight = e.key === "Right" || e.key === "ArrowRight";
    const tabPressed = e.key === "Tab";
    const shiftPressed = e.shiftKey;
    const metaKeyPressed = e.metaKey;
    const altPressed = e.altKey;
    let startingRowIndex = selection.startingRowIndex;
    let endingRowIndex = selection.endingRowIndex;
    let startingColumnIndex = selection.startingColumnIndex;
    let endingColumnIndex = selection.endingColumnIndex;
    const numRows = Math.min((sheetData == null ? void 0 : sheetData.numRows) || 0, MAX_ROWS);
    const numColumns = (sheetData == null ? void 0 : sheetData.numColumns) || 0;
    if (arrowUp) {
      if (shiftPressed) {
        if (metaKeyPressed) {
          if (selection.endingRowIndex === 0 || selection.endingRowIndex <= -1) {
            endingRowIndex = -1;
          } else {
            endingRowIndex = 0;
          }
        } else {
          endingRowIndex = Math.max(selection.endingRowIndex - 1, -1);
        }
      } else {
        if (metaKeyPressed) {
          if (selection.startingRowIndex === 0 || selection.startingRowIndex <= -1) {
            startingRowIndex = -1;
          } else {
            startingRowIndex = 0;
          }
        } else {
          startingRowIndex = Math.max(selection.startingRowIndex - 1, -1);
        }
        endingRowIndex = startingRowIndex;
        endingColumnIndex = startingColumnIndex;
      }
    } else if (arrowDown) {
      if (shiftPressed) {
        if (metaKeyPressed) {
          endingRowIndex = numRows - 1;
        } else {
          endingRowIndex = Math.min(selection.endingRowIndex + 1, numRows - 1);
        }
      } else if (altPressed) {
        return selection;
      } else {
        if (metaKeyPressed) {
          startingRowIndex = numRows - 1;
        } else {
          startingRowIndex = Math.min(selection.startingRowIndex + 1, numRows - 1);
        }
        endingRowIndex = startingRowIndex;
        endingColumnIndex = startingColumnIndex;
      }
    } else if (arrowLeft) {
      if (shiftPressed) {
        if (metaKeyPressed) {
          if (selection.endingColumnIndex === 0 || selection.endingColumnIndex <= -1) {
            endingColumnIndex = -1;
          } else {
            endingColumnIndex = 0;
          }
        } else {
          endingColumnIndex = Math.max(selection.endingColumnIndex - 1, -1);
        }
      } else {
        if (metaKeyPressed) {
          if (selection.startingColumnIndex === 0 || selection.startingColumnIndex <= -1) {
            startingColumnIndex = -1;
          } else {
            startingColumnIndex = 0;
          }
        } else {
          startingColumnIndex = Math.max(selection.startingColumnIndex - 1, -1);
        }
        endingColumnIndex = startingColumnIndex;
        endingRowIndex = startingRowIndex;
      }
    } else if (arrowRight) {
      if (shiftPressed) {
        if (metaKeyPressed) {
          endingColumnIndex = numColumns - 1;
        } else {
          endingColumnIndex = Math.min(selection.endingColumnIndex + 1, numColumns - 1);
        }
      } else {
        if (metaKeyPressed) {
          startingColumnIndex = numColumns - 1;
        } else {
          startingColumnIndex = Math.min(selection.startingColumnIndex + 1, numColumns - 1);
        }
        endingColumnIndex = startingColumnIndex;
        endingRowIndex = startingRowIndex;
      }
    } else if (tabPressed) {
      if (shiftPressed) {
        if (startingColumnIndex - 1 < -1) {
          if (startingRowIndex > -1) {
            startingColumnIndex = numColumns - 1;
            startingRowIndex -= 1;
          }
        } else {
          startingColumnIndex -= 1;
          if (startingColumnIndex <= -1 && startingRowIndex <= -1) {
            startingColumnIndex = 0;
          }
        }
      } else {
        if (startingColumnIndex + 1 > numColumns - 1) {
          if (startingRowIndex < numRows - 1) {
            startingRowIndex += 1;
            startingColumnIndex = -1;
          }
        } else {
          startingColumnIndex += 1;
        }
      }
      endingRowIndex = startingRowIndex;
      endingColumnIndex = startingColumnIndex;
    }
    return {
      startingRowIndex,
      endingRowIndex,
      startingColumnIndex,
      endingColumnIndex,
      sheetIndex: selection.sheetIndex
    };
  };
  var getColumnIndexesInSelections = (selections) => {
    let columnIndexes = [];
    selections.forEach((selection) => {
      columnIndexes = columnIndexes.concat(getColumnIndexesInSingleSelection(selection));
    });
    columnIndexes = [...new Set(columnIndexes)];
    return columnIndexes;
  };
  var getColumnIndexesInSingleSelection = (selection) => {
    const min = Math.min(selection.startingColumnIndex, selection.endingColumnIndex);
    const max = Math.max(selection.startingColumnIndex, selection.endingColumnIndex);
    const columnIndexes = [];
    for (let i = min; i <= max; i++) {
      columnIndexes.push(i);
    }
    return columnIndexes;
  };
  var getColumnHeadersInSelection = (selection, sheetData) => {
    const min = Math.min(selection.startingColumnIndex, selection.endingColumnIndex);
    const max = Math.max(selection.startingColumnIndex, selection.endingColumnIndex);
    const columnHeaders = [];
    for (let i = min; i < max + 1; i++) {
      if (sheetData.data[i] === void 0)
        continue;
      columnHeaders.push(sheetData.data[i].columnHeader);
    }
    if (min !== selection.startingColumnIndex) {
      return columnHeaders.reverse();
    }
    return columnHeaders;
  };
  var getColumnHeadersInSelections = (selections, sheetData) => {
    let columnHeaders = [];
    selections.forEach((selection) => {
      columnHeaders = columnHeaders.concat(getColumnHeadersInSelection(selection, sheetData));
    });
    return columnHeaders;
  };
  var getIndexLabelsInSelection = (selection, sheetData) => {
    const min = Math.min(selection.startingRowIndex, selection.endingRowIndex);
    const max = Math.max(selection.startingRowIndex, selection.endingRowIndex);
    const indexLabels = [];
    for (let i = min; i < max + 1; i++) {
      if (sheetData.index[i] === void 0)
        continue;
      indexLabels.push(sheetData.index[i]);
    }
    return indexLabels;
  };
  var getIndexLabelsInSelections = (selections, sheetData) => {
    let indexLabels = [];
    selections.forEach((selection) => {
      indexLabels = indexLabels.concat(getIndexLabelsInSelection(selection, sheetData));
    });
    return indexLabels;
  };
  var isSelectionsOnlyColumnHeaders = (selections) => {
    let isOnlyColumnHeaders = true;
    selections.forEach((selection) => {
      if (selection.startingRowIndex !== -1 || selection.endingRowIndex !== -1) {
        isOnlyColumnHeaders = false;
      }
    });
    return isOnlyColumnHeaders;
  };
  var isSelectionsOnlyIndexHeaders = (selections) => {
    let isOnlyIndexHeaders = true;
    selections.forEach((selection) => {
      if (selection.startingColumnIndex !== -1 || selection.endingColumnIndex !== -1) {
        isOnlyIndexHeaders = false;
      }
    });
    return isOnlyIndexHeaders;
  };
  var _getUpperLeftOfSelection = (selection, sheetData) => {
    var _a;
    const minColumnIndex = Math.min(selection.startingColumnIndex, selection.endingColumnIndex);
    const minRowIndex = Math.min(selection.startingRowIndex, selection.endingRowIndex);
    const columnHeader = (_a = sheetData.data[minColumnIndex]) == null ? void 0 : _a.columnHeader;
    const indexLabel = sheetData.index[minRowIndex];
    return [columnHeader, indexLabel];
  };
  var _getBottomRightOfSelection = (selection, sheetData) => {
    var _a;
    const maxColumnIndex = Math.max(selection.startingColumnIndex, selection.endingColumnIndex);
    const maxRowIndex = Math.max(selection.startingRowIndex, selection.endingRowIndex);
    const columnHeader = (_a = sheetData.data[maxColumnIndex]) == null ? void 0 : _a.columnHeader;
    const indexLabel = sheetData.index[maxRowIndex];
    return [columnHeader, indexLabel];
  };
  var getUpperLeftAndBottomRight = (selection, sheetData) => {
    const upperLeft = _getUpperLeftOfSelection(selection, sheetData);
    const bottomRight = _getBottomRightOfSelection(selection, sheetData);
    return [upperLeft, bottomRight];
  };
  var COPIED_BORDER_STYLE = "1px dashed black";
  var SELECTED_BORDER_STYLE = "1px solid var(--mito-highlight)";
  var DEFAULT_BORDER_STYLE = ".5px solid var(--mito-text-light)";
  var getBorderStyle = (selections, copiedSelections, rowIndex, columnIndex, numRows, matchesSearch, highlightedColumnIndex) => {
    const borderStyle = {};
    selections.forEach((selection) => {
      const newBorderStyle = _getBorderStyle(selection, rowIndex, columnIndex, numRows, SELECTED_BORDER_STYLE, highlightedColumnIndex);
      borderStyle.borderRight = combineBorderStyles(borderStyle.borderRight, newBorderStyle.borderRight);
      borderStyle.borderLeft = combineBorderStyles(borderStyle.borderLeft, newBorderStyle.borderLeft);
      borderStyle.borderTop = combineBorderStyles(borderStyle.borderTop, newBorderStyle.borderTop);
      borderStyle.borderBottom = combineBorderStyles(borderStyle.borderBottom, newBorderStyle.borderBottom);
    });
    copiedSelections.forEach((selection) => {
      const newBorderStyle = _getBorderStyle(selection, rowIndex, columnIndex, numRows, COPIED_BORDER_STYLE);
      borderStyle.borderRight = combineBorderStyles(borderStyle.borderRight, newBorderStyle.borderRight);
      borderStyle.borderLeft = combineBorderStyles(borderStyle.borderLeft, newBorderStyle.borderLeft);
      borderStyle.borderTop = combineBorderStyles(borderStyle.borderTop, newBorderStyle.borderTop);
      borderStyle.borderBottom = combineBorderStyles(borderStyle.borderBottom, newBorderStyle.borderBottom);
    });
    if (matchesSearch) {
      borderStyle.borderRight = combineBorderStyles(borderStyle.borderRight, SELECTED_BORDER_STYLE);
      borderStyle.borderLeft = combineBorderStyles(borderStyle.borderLeft, SELECTED_BORDER_STYLE);
      borderStyle.borderTop = combineBorderStyles(borderStyle.borderTop, SELECTED_BORDER_STYLE);
      borderStyle.borderBottom = combineBorderStyles(borderStyle.borderBottom, SELECTED_BORDER_STYLE);
    }
    return borderStyle;
  };
  var _getBorderStyle = (selection, rowIndex, columnIndex, numRows, inSelectionBorderStyle, highlightedColumnIndex) => {
    if (!getIsCellSelected([selection], rowIndex, columnIndex)) {
      return {
        borderRight: highlightedColumnIndex === columnIndex ? SELECTED_BORDER_STYLE : DEFAULT_BORDER_STYLE,
        borderLeft: columnIndex !== -1 ? DEFAULT_BORDER_STYLE : void 0
      };
    }
    const lowerRowIndex = selection.startingRowIndex < selection.endingRowIndex ? selection.startingRowIndex : selection.endingRowIndex;
    const higherRowIndex = selection.startingRowIndex > selection.endingRowIndex ? selection.startingRowIndex : selection.endingRowIndex;
    const lowerColumnIndex = selection.startingColumnIndex < selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
    const higherColumnIndex = selection.startingColumnIndex > selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
    const borderTop = lowerRowIndex === rowIndex ? inSelectionBorderStyle : void 0;
    const borderBottom = higherRowIndex === rowIndex || higherRowIndex <= -1 && rowIndex === numRows - 1 ? inSelectionBorderStyle : void 0;
    const borderLeft = lowerColumnIndex === columnIndex ? inSelectionBorderStyle : void 0;
    const borderRight = higherColumnIndex === columnIndex || highlightedColumnIndex === columnIndex ? inSelectionBorderStyle : void 0;
    if (lowerRowIndex <= -1 && higherRowIndex <= -1) {
      if (rowIndex <= -1) {
        return {
          borderTop: inSelectionBorderStyle,
          borderLeft: borderLeft || DEFAULT_BORDER_STYLE,
          borderRight: borderRight || DEFAULT_BORDER_STYLE
        };
      } else {
        return {
          borderLeft: borderLeft || DEFAULT_BORDER_STYLE,
          borderRight: borderRight || DEFAULT_BORDER_STYLE,
          borderBottom
        };
      }
    }
    if (lowerColumnIndex <= -1 && higherColumnIndex <= -1) {
      if (columnIndex <= -1) {
        return {
          borderTop,
          borderBottom,
          borderLeft: inSelectionBorderStyle,
          borderRight: DEFAULT_BORDER_STYLE
        };
      } else {
        return {
          borderTop,
          borderBottom,
          borderLeft: DEFAULT_BORDER_STYLE,
          borderRight: DEFAULT_BORDER_STYLE
        };
      }
    }
    return {
      borderTop,
      borderBottom,
      borderLeft: borderLeft || DEFAULT_BORDER_STYLE,
      borderRight: borderRight || DEFAULT_BORDER_STYLE
    };
  };
  var combineBorderStyles = (oldBorderStyle, newBorderStyle) => {
    if (oldBorderStyle === COPIED_BORDER_STYLE || newBorderStyle === COPIED_BORDER_STYLE) {
      return COPIED_BORDER_STYLE;
    }
    if (oldBorderStyle === SELECTED_BORDER_STYLE || newBorderStyle === SELECTED_BORDER_STYLE) {
      return SELECTED_BORDER_STYLE;
    }
    if (oldBorderStyle === DEFAULT_BORDER_STYLE || newBorderStyle === DEFAULT_BORDER_STYLE) {
      return DEFAULT_BORDER_STYLE;
    }
    return oldBorderStyle;
  };
  var equalSelections = (selectionOne, selectionTwo) => {
    return selectionOne.startingRowIndex === selectionTwo.startingRowIndex && selectionOne.endingRowIndex === selectionTwo.endingRowIndex && selectionOne.startingColumnIndex === selectionTwo.startingColumnIndex && selectionOne.endingColumnIndex === selectionTwo.endingColumnIndex;
  };
  var getDeletedIndexes = (oldArray, newArray) => {
    if (newArray.length < oldArray.length) {
      const oldDeletedIndexes = [];
      let oldIndex = 0;
      let newIndex = 0;
      while (oldIndex < oldArray.length && newIndex < newArray.length) {
        if (oldArray[oldIndex] !== newArray[newIndex]) {
          oldDeletedIndexes.push(oldIndex);
          oldIndex++;
        } else {
          newIndex++;
          oldIndex++;
        }
      }
      return oldDeletedIndexes;
    }
    return [];
  };
  var reconciliateSelections = (oldSheetIndex, newSheetIndex, selections, oldColumnIDsArray, sheetData) => {
    return selections.map((selection) => reconciliateSingleSelection(oldSheetIndex, newSheetIndex, selection, oldColumnIDsArray, sheetData));
  };
  var reconciliateSingleSelection = (oldSheetIndex, newSheetIndex, selection, oldColumnIDsArray, sheetData) => {
    if (oldColumnIDsArray === void 0 || oldSheetIndex !== newSheetIndex || sheetData === void 0) {
      return {
        startingRowIndex: -1,
        endingRowIndex: -1,
        startingColumnIndex: 0,
        endingColumnIndex: 0,
        sheetIndex: newSheetIndex
      };
    }
    const newColumnsIDsArray = sheetData.data.map((c) => c.columnID);
    if (oldColumnIDsArray.length > newColumnsIDsArray.length) {
      const oldDeletedIndexes = getDeletedIndexes(oldColumnIDsArray, newColumnsIDsArray);
      const lowerColumnIndex = selection.startingColumnIndex < selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
      const higherColumnIndex = selection.startingColumnIndex > selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
      let numDeletedBeforeSelection = 0;
      let numDeletedInSelection = 0;
      for (let i = 0; i < oldDeletedIndexes.length; i++) {
        const deletedIndex = oldDeletedIndexes[i];
        if (deletedIndex <= lowerColumnIndex) {
          numDeletedBeforeSelection += 1;
        } else if (deletedIndex > lowerColumnIndex && deletedIndex <= higherColumnIndex) {
          numDeletedInSelection += 1;
        }
      }
      let newLowerColumnIndex = lowerColumnIndex - numDeletedBeforeSelection;
      let newHigherColumnIndex = higherColumnIndex - numDeletedBeforeSelection - numDeletedInSelection;
      if (selection.startingColumnIndex > -1 && selection.endingColumnIndex > -1) {
        newLowerColumnIndex = Math.max(newLowerColumnIndex, 0);
        newHigherColumnIndex = Math.max(newHigherColumnIndex, 0);
      }
      if (newLowerColumnIndex > sheetData.numColumns - 1) {
        newLowerColumnIndex = sheetData.numColumns - 1;
      }
      if (newHigherColumnIndex > sheetData.numColumns - 1) {
        newHigherColumnIndex = sheetData.numColumns - 1;
      }
      const newStartingColumnIndex = selection.startingColumnIndex < selection.endingColumnIndex ? newLowerColumnIndex : newHigherColumnIndex;
      const newEndingColumnIndex = selection.startingColumnIndex > selection.endingColumnIndex ? newLowerColumnIndex : newHigherColumnIndex;
      return {
        startingRowIndex: selection.startingRowIndex,
        endingRowIndex: selection.endingRowIndex,
        startingColumnIndex: newStartingColumnIndex,
        endingColumnIndex: newEndingColumnIndex,
        sheetIndex: newSheetIndex
      };
    } else if (oldColumnIDsArray.length < newColumnsIDsArray.length) {
      const oldAddedIndexes = getDeletedIndexes(newColumnsIDsArray, oldColumnIDsArray);
      const lowerColumnIndex = selection.startingColumnIndex < selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
      const higherColumnIndex = selection.startingColumnIndex > selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
      let numAddedBeforeSelection = 0;
      let numAddedInSelection = 0;
      for (let i = 0; i < oldAddedIndexes.length; i++) {
        const addedIndex = oldAddedIndexes[i];
        if (addedIndex <= lowerColumnIndex) {
          numAddedBeforeSelection += 1;
        } else if (addedIndex > lowerColumnIndex && addedIndex <= higherColumnIndex) {
          numAddedInSelection += 1;
        }
      }
      const newLowerColumnIndex = lowerColumnIndex + numAddedBeforeSelection;
      const newHigherColumnIndex = higherColumnIndex + numAddedBeforeSelection + numAddedInSelection;
      const newStartingColumnIndex = selection.startingColumnIndex < selection.endingColumnIndex ? newLowerColumnIndex : newHigherColumnIndex;
      const newEndingColumnIndex = selection.startingColumnIndex > selection.endingColumnIndex ? newLowerColumnIndex : newHigherColumnIndex;
      return {
        startingRowIndex: selection.startingRowIndex,
        endingRowIndex: selection.endingRowIndex,
        startingColumnIndex: newStartingColumnIndex,
        endingColumnIndex: newEndingColumnIndex,
        sheetIndex: newSheetIndex
      };
    }
    return selection;
  };
  var removeColumnFromSelections = (selections, columnIndex) => {
    const newSelections = [];
    selections.forEach((selection) => {
      if (!isSelectionsOnlyColumnHeaders([selection]) || !getIsCellInSingleSelection(selection, -1, columnIndex)) {
        newSelections.push(selection);
      } else {
        const smallerColumnIndex = selection.startingColumnIndex < selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
        const largerColumnIndex = selection.startingColumnIndex > selection.endingColumnIndex ? selection.startingColumnIndex : selection.endingColumnIndex;
        if (smallerColumnIndex < columnIndex) {
          newSelections.push({
            startingRowIndex: -1,
            endingRowIndex: -1,
            startingColumnIndex: smallerColumnIndex,
            endingColumnIndex: columnIndex - 1,
            sheetIndex: selection.sheetIndex
          });
        }
        if (largerColumnIndex > columnIndex) {
          newSelections.push({
            startingRowIndex: -1,
            endingRowIndex: -1,
            startingColumnIndex: columnIndex + 1,
            endingColumnIndex: largerColumnIndex,
            sheetIndex: selection.sheetIndex
          });
        }
      }
    });
    if (newSelections.length === 0) {
      newSelections.push({
        startingColumnIndex: 0,
        endingColumnIndex: 0,
        startingRowIndex: 0,
        endingRowIndex: 0,
        sheetIndex: 0
      });
    }
    return newSelections;
  };
  var isSelectionEntireSelectedColumn = (selection) => {
    return selection.startingRowIndex === -1 && selection.endingRowIndex === -1;
  };
  var getSelectedColumnIDsWithEntireSelectedColumn = (selections, sheetData, inSameOrderAsDataframe) => {
    if (sheetData === void 0) {
      return [];
    }
    let columnIndexes = [];
    selections.forEach((selection) => {
      if (isSelectionEntireSelectedColumn(selection)) {
        columnIndexes = columnIndexes.concat(getColumnIndexesInSingleSelection(selection));
      }
    });
    columnIndexes = [...new Set(columnIndexes)];
    if (inSameOrderAsDataframe) {
      columnIndexes = columnIndexes.sort();
    }
    return columnIndexes.filter((colIdx) => sheetData.data.length > colIdx).map((colIdx) => {
      var _a;
      return (_a = sheetData.data[colIdx]) == null ? void 0 : _a.columnID;
    });
  };
  var getSelectedRowLabelsInSingleSelection = (selection, sheetData) => {
    const min = Math.min(selection.startingRowIndex, selection.endingRowIndex);
    const max = Math.max(selection.startingRowIndex, selection.endingRowIndex);
    const rowIndexes = [];
    for (let i = min; i <= max; i++) {
      rowIndexes.push(sheetData.index[i]);
    }
    return rowIndexes;
  };
  var getSelectedRowLabelsWithEntireSelectedRow = (selections, sheetData) => {
    if (sheetData === void 0) {
      return [];
    }
    let rowIndexes = [];
    selections.forEach((selection) => {
      if (selection.startingColumnIndex === -1 && (selection.endingColumnIndex === -1 || selection.endingColumnIndex === sheetData.numColumns)) {
        rowIndexes = rowIndexes.concat(getSelectedRowLabelsInSingleSelection(selection, sheetData));
      }
    });
    return rowIndexes;
  };
  var getNumberColumnIDs = (sheetData, columnIDs) => {
    const columnIDsAndDtypes = columnIDs.filter((colId) => colId !== void 0).map((columnID) => [columnID, (sheetData == null ? void 0 : sheetData.columnDtypeMap[columnID]) || ""]);
    return columnIDsAndDtypes.filter(([, columnDtype]) => {
      return columnDtype !== void 0 && isNumberDtype(columnDtype);
    }).filter(([columnID]) => {
      return columnID !== void 0;
    }).map(([columnID]) => {
      return columnID;
    });
  };
  var getSelectedNumberSeriesColumnIDs = (selections, sheetData) => {
    if (sheetData === void 0) {
      return [];
    }
    const columnIndexesSelected = getColumnIndexesInSelections(selections);
    const columnIDs = columnIndexesSelected.filter((colIdx) => sheetData.data.length > colIdx).map((colIdx) => {
      var _a;
      return (_a = sheetData.data[colIdx]) == null ? void 0 : _a.columnID;
    });
    return getNumberColumnIDs(sheetData, columnIDs);
  };

  // src/mito/types.tsx
  var UpdateType = /* @__PURE__ */ ((UpdateType2) => {
    UpdateType2["Undo"] = "undo";
    UpdateType2["Redo"] = "redo";
    UpdateType2["Clear"] = "clear";
    UpdateType2["ArgsUpdate"] = "args_update";
    UpdateType2["SaveAnalysisUpdate"] = "save_analysis_update";
    UpdateType2["ReplayAnalysisUpdate"] = "replay_analysis_update";
    UpdateType2["CheckoutStepByIdxUpdate"] = "checkout_step_by_idx_update";
    UpdateType2["AppendUserFieldUpdate"] = "append_user_field_update";
    UpdateType2["SetUserFieldUpdate"] = "set_user_field_update";
    UpdateType2["UpdateFeedbackv2ObjObject"] = "update_feedback_v2_obj_update";
    UpdateType2["GoPro"] = "go_pro";
    UpdateType2["RenderCountUpdate"] = "render_count_update";
    UpdateType2["ChecklistUpdate"] = "checklist_update";
    UpdateType2["UpdateExistingImportUpdate"] = "update_existing_import_update";
    UpdateType2["CodeOptionsUpdate"] = "code_options_update";
    UpdateType2["UndoToStepIndex"] = "undo_to_step_index_update";
    return UpdateType2;
  })(UpdateType || {});
  var AggregationType = /* @__PURE__ */ ((AggregationType2) => {
    AggregationType2["COUNT"] = "count";
    AggregationType2["COUNT_UNIQUE"] = "count unique";
    AggregationType2["SUM"] = "sum";
    AggregationType2["MEAN"] = "mean";
    AggregationType2["MEDIAN"] = "median";
    AggregationType2["STD"] = "std";
    AggregationType2["MIN"] = "min";
    AggregationType2["MAX"] = "max";
    return AggregationType2;
  })(AggregationType || {});

  // src/mito/utils/keyboardShortcuts.tsx
  var keyboardShortcuts = [
    {
      macKeyCombo: {
        metaKey: true,
        keys: ["c"]
      },
      winKeyCombo: {
        ctrlKey: true,
        keys: ["c"]
      },
      skipIfInTextInput: true,
      skipIfTextSelected: true,
      action: "copy" /* Copy */
    },
    {
      macKeyCombo: {
        metaKey: true,
        keys: ["f"]
      },
      winKeyCombo: {
        ctrlKey: true,
        keys: ["f"]
      },
      preventDefaultAndStopPropagation: true,
      action: "open search" /* OpenFind */,
      jupyterLabCommand: "mitosheet:open-search"
    },
    {
      macKeyCombo: {
        metaKey: true,
        keys: ["z"]
      },
      winKeyCombo: {
        ctrlKey: true,
        keys: ["z"]
      },
      preventDefaultAndStopPropagation: true,
      jupyterLabCommand: "mitosheet:mito-undo",
      action: "undo" /* Undo */
    },
    {
      macKeyCombo: {
        metaKey: true,
        keys: ["y"]
      },
      winKeyCombo: {
        ctrlKey: true,
        keys: ["y"]
      },
      preventDefaultAndStopPropagation: true,
      action: "redo" /* Redo */
    },
    {
      macKeyCombo: {
        ctrlKey: true,
        keys: [" "]
      },
      winKeyCombo: {
        ctrlKey: true,
        keys: [" "]
      },
      action: "select columns" /* Select_Columns */
    },
    {
      macKeyCombo: {
        shiftKey: true,
        keys: [" "]
      },
      winKeyCombo: {
        shiftKey: true,
        keys: [" "]
      },
      skipIfInTextInput: true,
      preventDefaultAndStopPropagation: true,
      action: "select rows" /* Select_Rows */
    },
    {
      macKeyCombo: {
        metaKey: true,
        keys: ["a"]
      },
      winKeyCombo: {
        ctrlKey: true,
        keys: ["a"]
      },
      skipIfInTextInput: true,
      preventDefaultAndStopPropagation: true,
      action: "select all" /* Select_All */
    },
    {
      macKeyCombo: {
        altKey: true,
        keys: ["ArrowLeft"]
      },
      winKeyCombo: {
        altKey: true,
        keys: ["ArrowLeft"]
      },
      skipIfInTextInput: true,
      action: "open previous sheet" /* Open_Previous_Sheet */
    },
    {
      macKeyCombo: {
        altKey: true,
        keys: ["ArrowRight"]
      },
      winKeyCombo: {
        altKey: true,
        keys: ["ArrowRight"]
      },
      skipIfInTextInput: true,
      action: "open next sheet" /* Open_Next_Sheet */
    },
    {
      macKeyCombo: {
        ctrlKey: true,
        shiftKey: true,
        keys: ["F"]
      },
      winKeyCombo: {
        ctrlKey: true,
        shiftKey: true,
        keys: ["h"]
      },
      action: "open search and replace" /* OpenFindAndReplace */
    },
    {
      macKeyCombo: {
        ctrlKey: true,
        keys: ["G"]
      },
      winKeyCombo: {
        altKey: true,
        keys: ["F1"]
      },
      action: "graph" /* Graph */
    },
    {
      macKeyCombo: {
        metaKey: true,
        keys: ["o"]
      },
      winKeyCombo: {
        ctrlKey: true,
        keys: ["o"]
      },
      preventDefaultAndStopPropagation: true,
      action: "import files" /* Import_Files */
    },
    {
      macKeyCombo: {
        altKey: true,
        keys: ["ArrowDown"]
      },
      winKeyCombo: {
        altKey: true,
        keys: ["ArrowDown"]
      },
      preventDefaultAndStopPropagation: true,
      action: "filter" /* Filter */
    },
    {
      macKeyCombo: {
        metaKey: true,
        keys: ["m"]
      },
      winKeyCombo: {
        ctrlKey: true,
        keys: ["m"]
      },
      preventDefaultAndStopPropagation: true,
      action: "merge" /* Merge */
    },
    {
      macKeyCombo: {
        shiftKey: true,
        ctrlKey: true,
        keys: ["L"]
      },
      winKeyCombo: {
        altKey: true,
        keys: ["F11"]
      },
      preventDefaultAndStopPropagation: true,
      action: "pivot" /* Pivot */
    },
    {
      macKeyCombo: {
        ctrlKey: true,
        shiftKey: true,
        keys: ["`", "~"]
      },
      winKeyCombo: {
        ctrlKey: true,
        shiftKey: true,
        keys: ["`", "~"]
      },
      action: "set format to default" /* Set_Format_Default */
    },
    {
      macKeyCombo: {
        ctrlKey: true,
        shiftKey: true,
        keys: ["1", "!"]
      },
      winKeyCombo: {
        ctrlKey: true,
        shiftKey: true,
        keys: ["1", "!"]
      },
      action: "set format to number (two decimal places)" /* Set_Format_Number */
    },
    {
      macKeyCombo: {
        ctrlKey: true,
        shiftKey: true,
        keys: ["@", "2"]
      },
      winKeyCombo: {
        ctrlKey: true,
        shiftKey: true,
        keys: ["@", "2"]
      },
      action: "set datetime type" /* Set_DateTime_Dtype */
    },
    {
      macKeyCombo: {
        ctrlKey: true,
        shiftKey: true,
        keys: ["3", "#"]
      },
      winKeyCombo: {
        ctrlKey: true,
        shiftKey: true,
        keys: ["3", "#"]
      },
      action: "set datetime type" /* Set_DateTime_Dtype */
    },
    {
      macKeyCombo: {
        ctrlKey: true,
        shiftKey: true,
        keys: ["4", "$"]
      },
      winKeyCombo: {
        ctrlKey: true,
        shiftKey: true,
        keys: ["4", "$"]
      },
      action: "set format to currency" /* Set_Format_Currency */
    },
    {
      macKeyCombo: {
        ctrlKey: true,
        shiftKey: true,
        keys: ["5", "%"]
      },
      winKeyCombo: {
        ctrlKey: true,
        shiftKey: true,
        keys: ["5", "%"]
      },
      action: "set format to percent" /* Set_Format_Percent */
    },
    {
      macKeyCombo: {
        ctrlKey: true,
        shiftKey: true,
        keys: ["6", "^"]
      },
      winKeyCombo: {
        ctrlKey: true,
        shiftKey: true,
        keys: ["6", "^"]
      },
      action: "set format to scientific notation" /* Set_Format_Scientific */
    }
  ];
  var keyboardShortcutsMap = new Map(keyboardShortcuts.map((shortcut) => [shortcut.action, shortcut]));
  var getOperatingSystem = () => {
    return window.navigator.userAgent.toUpperCase().includes("MAC") ? "mac" : "windows";
  };
  var getKeyboardShortcutString = (action) => {
    const shortcut = keyboardShortcutsMap.get(action);
    if (shortcut === void 0) {
      return void 0;
    }
    const keyCombo = shortcut[window.navigator.userAgent.toUpperCase().includes("MAC") ? "macKeyCombo" : "winKeyCombo"];
    const metaKey = getOperatingSystem() === "mac" ? "\u2318" : "Meta";
    const key2 = keyCombo.keys[0].length === 1 ? keyCombo.keys[0].toUpperCase() : keyCombo.keys[0];
    const keyComboString = `${keyCombo.ctrlKey ? "Ctrl+" : ""}${keyCombo.shiftKey ? "Shift+" : ""}${keyCombo.altKey ? "Alt+" : ""}${keyCombo.metaKey ? `${metaKey}+` : ""}${key2}`;
    return keyComboString;
  };
  var handleKeyboardShortcuts = (e, actions) => {
    var _a;
    const operatingSystem = getOperatingSystem();
    const shortcut = keyboardShortcuts.find((shortcut2) => {
      const keyCombo = operatingSystem === "mac" ? shortcut2.macKeyCombo : shortcut2.winKeyCombo;
      if (!!e.metaKey !== !!keyCombo.metaKey || !!e.ctrlKey !== !!keyCombo.ctrlKey || !!e.shiftKey !== !!keyCombo.shiftKey || !!e.altKey !== !!keyCombo.altKey) {
        return false;
      }
      return keyCombo.keys.includes(e.key);
    });
    if (shortcut === void 0) {
      return;
    }
    const shortcutIsDisabled = actions.buildTimeActions[shortcut.action].isDisabled();
    const isInTextInput = e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement;
    const isTextSelected = ((_a = document.getSelection()) == null ? void 0 : _a.toString()) !== "";
    if (!shortcutIsDisabled && !(shortcut.skipIfInTextInput && isInTextInput) && !(shortcut.skipIfTextSelected && isTextSelected)) {
      actions.buildTimeActions[shortcut.action].actionFunction();
      if (shortcut.preventDefaultAndStopPropagation) {
        e.preventDefault();
        e.stopPropagation();
      }
    }
  };

  // src/mito/components/icons/StepsIcon.tsx
  init_react();
  var StepsIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M12.6916 13.5156H2.30835C1.58458 13.5156 1 12.9881 1 12.335V12.0963C1 11.4432 1.58458 10.9156 2.30835 10.9156H12.6916C13.4154 10.9156 14 11.4432 14 12.0963V12.335C14 12.9881 13.4154 13.5156 12.6916 13.5156Z", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M12.6916 8.31558H2.30835C1.58458 8.31558 1 7.79058 1 7.14058V6.89058C1 6.24058 1.58458 5.71558 2.30835 5.71558H12.6916C13.4154 5.71558 14 6.24058 14 6.89058V7.12808C14 7.79058 13.4154 8.31558 12.6916 8.31558Z", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M12.6916 3.11563H2.30835C1.58458 3.11563 1 2.58809 1 1.93495V1.6963C1 1.04316 1.58458 0.515625 2.30835 0.515625H12.6916C13.4154 0.515625 14 1.04316 14 1.6963V1.93495C14 2.58809 13.4154 3.11563 12.6916 3.11563Z", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var StepsIcon_default = StepsIcon;

  // src/mito/data/function_documentation.tsx
  var functionDocumentationObjects = [{ "function": "ABS", "description": "Returns the absolute value of the passed number or series.", "search_terms": ["abs", "absolute value"], "category": "MATH", "examples": ["ABS(-1.3)", "ABS(A)"], "syntax": "ABS(value)", "syntax_elements": [{ "element": "value", "description": "The value or series to take the absolute value of." }] }, { "function": "AND", "description": "Returns True if all of the provided arguments are True, and False if any of the provided arguments are False.", "category": "LOGIC", "search_terms": ["and", "&", "if", "conditional"], "examples": ["AND(True, False)", "AND(Nums > 100, Nums < 200)", "AND(Pay > 10, Pay < 20, Status == 'active')"], "syntax": "AND(boolean_condition1, [boolean_condition2, ...])", "syntax_elements": [{ "element": "boolean_condition1", "description": "An expression or series that returns True or False values. See IF documentation for a list of conditons." }, { "element": "boolean_condition2 ... [OPTIONAL]", "description": "An expression or series that returns True or False values. See IF documentation for a list of conditons." }] }, { "function": "AVG", "description": "Returns the numerical mean value of the passed numbers and series.", "search_terms": ["avg", "average", "mean"], "category": "MATH", "examples": ["AVG(1, 2)", "AVG(A, B)", "AVG(A, 2)"], "syntax": "AVG(value1, [value2, ...])", "syntax_elements": [{ "element": "value1", "description": "The first number or series to consider when calculating the average." }, { "element": "value2, ... [OPTIONAL]", "description": "Additional numbers or series to consider when calculating the average." }] }, { "function": "BOOL", "description": "Converts the passed arguments to boolean values, either True or False. For numberic values, 0 converts to False while all other values convert to True.", "search_terms": ["bool", "boolean", "true", "false", "dtype", "convert"], "category": "LOGIC", "examples": ["BOOL(Amount_Payed)", "AND(BOOL(Amount_Payed), Is_Paying)"], "syntax": "BOOL(series)", "syntax_elements": [{ "element": "series", "description": "An series to convert to boolean values, either True or False." }] }, { "function": "CLEAN", "description": "Returns the text with the non-printable ASCII characters removed.", "search_terms": ["clean", "trim", "remove"], "category": "TEXT", "examples": ["CLEAN(A)"], "syntax": "CLEAN(string)", "syntax_elements": [{ "element": "string", "description": "The string or series whose non-printable characters are to be removed." }] }, { "function": "CONCAT", "description": "Returns the passed strings and series appended together.", "search_terms": ["&", "concatenate", "append", "combine"], "category": "TEXT", "examples": ["CONCAT('Bite', 'the bullet')", "CONCAT(A, B)"], "syntax": "CONCAT(string1, [string2, ...])", "syntax_elements": [{ "element": "string1", "description": "The first string or series." }, { "element": "string2, ... [OPTIONAL]", "description": "Additional strings or series to append in sequence." }] }, { "function": "CORR", "description": "Computes the correlation between two series, excluding missing values.", "search_terms": ["corr", "correlation", "r^2"], "category": "MATH", "examples": ["=CORR(A, B)", "=CORR(B, A)"], "syntax": "CORR(series_one, series_two)", "syntax_elements": [{ "element": "series_one", "description": "The number series to convert to calculate the correlation." }, { "element": "series_two", "description": "The number series to convert to calculate the correlation." }] }, { "function": "DATEVALUE", "description": "Converts a given string to a date series.", "search_terms": ["datevalue", "date value", "date", "string to date", "datetime", "dtype", "convert"], "category": "DATE", "examples": ["DATEVALUE(date_column)", "DATEVALUE('2012-12-22')"], "syntax": "DATEVALUE(date_string)", "syntax_elements": [{ "element": "date_string", "description": "The date string to turn into a date object." }] }, { "function": "DAY", "description": "Returns the day of the month that a specific date falls on, as a number.", "search_terms": ["day", "date"], "category": "DATE", "examples": ["DAY(date_column)", "DAY('2012-12-22')"], "syntax": "DAY(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the day of." }] }, { "function": "ENDOFBUSINESSMONTH", "description": "Given a date, returns the end of the buisness month. E.g. the last weekday.", "search_terms": ["business", "month", "eom", "eobm", "date", "workday", "end"], "category": "DATE", "examples": ["ENDOFBUSINESSMONTH(date_column)", "ENDOFBUSINESSMONTH('2012-12-22')"], "syntax": "ENDOFBUSINESSMONTH(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the end of the business month of." }] }, { "function": "ENDOFMONTH", "description": "Given a date, returns the end of the month, as a date. E.g. input of 12-22-1997 will return 12-31-1997.", "search_terms": ["month", "eom", "date", "workday", "end", "eomonth"], "category": "DATE", "examples": ["ENDOFMONTH(date_column)", "ENDOFMONTH('2012-12-22')"], "syntax": "ENDOFMONTH(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the last day of the month of." }] }, { "function": "EXP", "description": "Returns e, the base of the natural logarithm, raised to the power of passed series.", "search_terms": ["exp", "exponent", "log", "natural log"], "category": "MATH", "examples": ["=EXP(data)", "=EXP(A)"], "syntax": "EXP(series)", "syntax_elements": [{ "element": "series", "description": "The series to raise e to." }] }, { "function": "FILLNAN", "description": "Replaces the NaN values in the series with the replacement value.", "search_terms": ["fillnan", "nan", "fill nan", "missing values", "null", "null value", "fill null"], "examples": ["FILLNAN(A, 10)", "FILLNAN(A, 'replacement')"], "syntax": "FILLNAN(series, replacement)", "syntax_elements": [{ "element": "series", "description": "The series to replace the NaN values in." }, { "element": "replacement", "description": "A string, number, or date to replace the NaNs with." }] }, { "function": "FIND", "description": "Returns the position at which a string is first found within text, case-sensitive. Returns 0 if not found.", "search_terms": ["find", "search"], "category": "TEXT", "examples": ["FIND(A, 'Jack')", "FIND('Ben has a friend Jack', 'Jack')"], "syntax": "FIND(text_to_search, search_for)", "syntax_elements": [{ "element": "text_to_search", "description": "The text or series to search for the first occurrence of search_for." }, { "element": "search_for", "description": "The string to look for within text_to_search." }] }, { "function": "FLOAT", "description": "Converts a string series to a float series. Any values that fail to convert will return NaN.", "search_terms": ["number", "to number"], "category": "MATH", "examples": ["=FLOAT(Prices_string)", "=FLOAT('123.123')"], "syntax": "FLOAT(string_series)", "syntax_elements": [{ "element": "string_series", "description": "The series or string to convert to a float." }] }, { "function": "GETNEXTVALUE", "description": "Returns the next value from series that meets the condition.", "search_terms": ["ffill"], "examples": ["GETNEXTVALUE(Max_Balances, Max_Balances > 0)"], "syntax": "GETNEXTVALUE(series, condition)", "syntax_elements": [{ "element": "series", "description": "The series to get the next value from." }, { "element": "condition", "description": "When condition is True, a new previous value is set, and carried backwards until the condition is True again." }] }, { "function": "GETPREVIOUSVALUE", "description": "Returns the value from series that meets the condition.", "search_terms": ["ffill"], "examples": ["GETPREVIOUSVALUE(Max_Balances, Max_Balances > 0)"], "syntax": "GETPREVIOUSVALUE(series, condition)", "syntax_elements": [{ "element": "series", "description": "The series to get the previous value from." }, { "element": "condition", "description": "When condition is True, a new previous value is set, and carried forward until the condition is True again." }] }, { "function": "HOUR", "description": "Returns the hour component of a specific date, as a number.", "search_terms": ["hour", "hr"], "category": "DATE", "examples": ["HOUR(date_column)", "HOUR('2012-12-22 09:45:00')"], "syntax": "HOUR(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the hour of." }] }, { "function": "IF", "description": "Returns one value if the condition is True. Returns the other value if the conditon is False.", "search_terms": ["if", "conditional", "and", "or"], "category": "LOGIC", "examples": ["IF(Status == 'success', 1, 0)", "IF(Nums > 100, 100, Nums)", "IF(AND(Grade >= .6, Status == 'active'), 'pass', 'fail')"], "syntax": "IF(boolean_condition, value_if_true, value_if_false)", "syntax_elements": [{ "element": "boolean_condition", "description": "An expression or series that returns True or False values. Valid conditions for comparison include ==, !=, >, <, >=, <=." }, { "element": "value_if_true", "description": "The value the function returns if condition is True." }, { "element": "value_if_false", "description": "The value the function returns if condition is False." }] }, { "function": "IFS", "description": "Returns the value of the first condition that is true. If no conditions are true, returns None.", "search_terms": ["ifs", "if", "conditional", "and", "or"], "category": "LOGIC", "examples": ["IFS(height > 100, 'tall', height > 50, 'medium', height > 0, 'short')"], "syntax": "IFS(boolean_condition_1, value_if_true, [boolean_condition_2, value_if_true, ...])", "syntax_elements": [{ "element": "boolean_condition", "description": "An expression or series that returns True or False values. Valid conditions for comparison include ==, !=, >, <, >=, <=." }, { "element": "value_if_true, ... [OPTIONAL]", "description": "The value the function returns if condition is True, followed by alternating boolean conditions and values." }] }, { "function": "INT", "description": "Converts a string series to a int series. Any values that fail to convert will return 0.", "search_terms": ["number", "to integer"], "category": "MATH", "examples": ["=INT(Prices_string)", "=INT('123')"], "syntax": "INT(string_series)", "syntax_elements": [{ "element": "string_series", "description": "The series or string to convert to a int." }] }, { "function": "KURT", "description": "Computes the unbiased kurtosis, a measure of tailedness, of a series, excluding missing values.", "search_terms": ["kurtosis"], "category": "MATH", "examples": ["=KURT(A)", "=KURT(A * B)"], "syntax": "KURT(series)", "syntax_elements": [{ "element": "series", "description": "The series to calculate the unbiased kurtosis of." }] }, { "function": "LEFT", "description": "Returns a substring from the beginning of a specified string.", "search_terms": ["left"], "category": "TEXT", "examples": ["LEFT(A, 2)", "LEFT('The first character!')"], "syntax": "LEFT(string, [number_of_characters])", "syntax_elements": [{ "element": "string", "description": "The string or series from which the left portion will be returned." }, { "element": "number_of_characters [OPTIONAL, 1 by default]", "description": "The number of characters to return from the start of string." }] }, { "function": "LEN", "description": "Returns the length of a string.", "search_terms": ["length", "size"], "category": "TEXT", "examples": ["LEN(A)", "LEN('This is 21 characters')"], "syntax": "LEN(string)", "syntax_elements": [{ "element": "string", "description": "The string or series whose length will be returned." }] }, { "function": "LOG", "description": "Calculates the logarithm of the passed series with an optional base.", "search_terms": ["log", "logarithm", "natural log"], "category": "MATH", "examples": ["LOG(10) = 1", "LOG(100, 10) = 2"], "syntax": "LOG(series, [base])", "syntax_elements": [{ "element": "series", "description": "The series to take the logarithm of." }, { "element": "base [OPTIONAL]", "description": "The base of the logarithm to use. Defaults to 10 if no base is passed." }] }, { "function": "LOWER", "description": "Converts a given string to lowercase.", "search_terms": ["lowercase", "uppercase"], "category": "TEXT", "examples": ["=LOWER('ABC')", "=LOWER(A)", "=LOWER('Nate Rush')"], "syntax": "LOWER(string)", "syntax_elements": [{ "element": "string", "description": "The string or series to convert to lowercase." }] }, { "function": "MAX", "description": "Returns the maximum value among the passed arguments.", "search_terms": ["max", "maximum", "minimum"], "category": "MATH", "examples": ["MAX(10, 11)", "MAX(Old_Data, New_Data)"], "syntax": "MAX(value1, [value2, ...])", "syntax_elements": [{ "element": "value1", "description": "The first number or column to consider for the maximum value." }, { "element": "value2, ... [OPTIONAL]", "description": "Additional numbers or columns to compute the maximum value from." }] }, { "function": "MID", "description": "Returns a segment of a string.", "search_terms": ["middle"], "category": "TEXT", "examples": ["MID(A, 2, 2)", "MID('Some middle characters!', 3, 4)"], "syntax": "MID(string, starting_at, extract_length)", "syntax_elements": [{ "element": "string", "description": "The string or series to extract the segment from." }, { "element": "starting_at", "description": "The index from the left of string from which to begin extracting." }, { "element": "extract_length", "description": "The length of the segment to extract." }] }, { "function": "MIN", "description": "Returns the minimum value among the passed arguments.", "search_terms": ["min", "minimum", "maximum"], "category": "MATH", "examples": ["MIN(10, 11)", "MIN(Old_Data, New_Data)"], "syntax": "MIN(value1, [value2, ...])", "syntax_elements": [{ "element": "value1", "description": "The first number or column to consider for the minumum value." }, { "element": "value2, ... [OPTIONAL]", "description": "Additional numbers or columns to compute the minumum value from." }] }, { "function": "MINUTE", "description": "Returns the minute component of a specific date, as a number.", "search_terms": ["minute", "min"], "category": "DATE", "examples": ["MINUTE(date_column)", "MINUTE('2012-12-22 09:45:00')"], "syntax": "MINUTE(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the minute of." }] }, { "function": "MONTH", "description": "Returns the month that a specific date falls in, as a number.", "search_terms": ["month", "date"], "category": "DATE", "examples": ["MONTH(date_column)", "MONTH('2012-12-22')"], "syntax": "MONTH(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the month of." }] }, { "function": "MONTHNAME", "description": "Returns the month that a specific date falls in, as Jan, Feb, Mar, etc.", "search_terms": ["month", "monthname", "date"], "category": "DATE", "examples": ["MONTHNAME(date_column)", "MONTHNAME('2012-12-22')"], "syntax": "MONTHNAME(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the month of." }] }, { "function": "MULTIPLY", "description": "Returns the product of two numbers.", "search_terms": ["multiply", "product"], "category": "MATH", "examples": ["MULTIPLY(2,3)", "MULTIPLY(A,3)"], "syntax": "MULTIPLY(factor1, [factor2, ...])", "syntax_elements": [{ "element": "factor1", "description": "The first number to multiply." }, { "element": "factor2, ... [OPTIONAL]", "description": "Additional numbers or series to multiply." }] }, { "function": "OR", "description": "Returns True if any of the provided arguments are True, and False if all of the provided arguments are False.", "search_terms": ["or", "if", "conditional"], "category": "LOGIC", "examples": ["OR(True, False)", "OR(Status == 'success', Status == 'pass', Status == 'passed')"], "syntax": "OR(boolean_condition1, [boolean_condition2, ...])", "syntax_elements": [{ "element": "boolean_condition1", "description": "An expression or series that returns True or False values. See IF documentation for a list of conditons." }, { "element": "boolean_condition2 ... [OPTIONAL]", "description": "An expression or series that returns True or False values. See IF documentation for a list of conditons." }] }, { "function": "POWER", "description": "The POWER function can be used to raise a number to a given power.", "search_terms": ["power", "raise", "exponent", "square", "cube"], "category": "MATH", "examples": ["POWER(4, 1/2)", "POWER(Dose, 2)"], "syntax": "POWER(value, exponent)", "syntax_elements": [{ "element": "value", "description": "Number to raise to a power." }, { "element": "exponent", "description": "The number to raise value to." }] }, { "function": "PROPER", "description": "Capitalizes the first letter of each word in a specified string.", "search_terms": ["proper", "capitalize"], "category": "TEXT", "examples": ["=PROPER('nate nush')", "=PROPER(A)"], "syntax": "PROPER(string)", "syntax_elements": [{ "element": "string", "description": "The value or series to convert to convert to proper case." }] }, { "function": "QUARTER", "description": "Returns the quarter (1-4) that a specific date falls in, as a number.", "search_terms": ["quarter"], "category": "DATE", "examples": ["QUARTER(date_column)", "QUARTER('2012-12-22')"], "syntax": "QUARTER(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the quarter of." }] }, { "function": "RIGHT", "description": "Returns a substring from the beginning of a specified string.", "search_terms": [], "category": "TEXT", "examples": ["RIGHT(A, 2)", "RIGHT('The last character!')"], "syntax": "RIGHT(string, [number_of_characters])", "syntax_elements": [{ "element": "string", "description": "The string or series from which the right portion will be returned." }, { "element": "number_of_characters [OPTIONAL, 1 by default]", "description": "The number of characters to return from the end of string." }] }, { "function": "ROUND", "description": "Rounds a number to a given number of decimals.", "search_terms": ["round", "decimal", "integer"], "category": "MATH", "examples": ["ROUND(1.3)", "ROUND(A, 2)"], "syntax": "ROUND(value, [decimals])", "syntax_elements": [{ "element": "value", "description": "The value or series to round." }, { "element": "decimals", "description": " The number of decimals to round to. Default is 0." }] }, { "function": "SECOND", "description": "Returns the seconds component of a specific date, as a number.", "search_terms": ["second", "sec"], "category": "DATE", "examples": ["SECOND(date_column)", "SECOND('2012-12-22 09:23:05')"], "syntax": "SECOND(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the seconds of." }] }, { "function": "SKEW", "description": "Computes the skew of a series, excluding missing values.", "search_terms": [], "category": "MATH", "examples": ["=SKEW(A)", "=SKEW(A * B)"], "syntax": "SKEW(series)", "syntax_elements": [{ "element": "series", "description": "The series to calculate the skew of." }] }, { "function": "STARTOFBUSINESSMONTH", "description": "Given a date, returns the most recent start of the business month, as a state. E.g. the first weekday.", "search_terms": ["business", "month", "SOM", "SOBM", "date", "start"], "category": "DATE", "examples": ["STARTOFBUSINESSMONTH(date_column)", "STARTOFBUSINESSMONTH('2012-12-22 09:23:05')"], "syntax": "STARTOFBUSINESSMONTH(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the most recent beginning of month business day of." }] }, { "function": "STARTOFMONTH", "description": "Given a date, returns the start of the month, as a date. E.g. input of 12-22-1997 will return 12-1-1997.", "search_terms": ["month", "SOM", "date", "start"], "category": "DATE", "examples": ["STARTOFMONTH(date_column)", "STARTOFMONTH('2012-12-22 09:23:05')"], "syntax": "STARTOFMONTH(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the first day of the month of." }] }, { "function": "STDEV", "description": "Computes the standard deviation of a series, excluding missing values.", "search_terms": ["standard", "deviation", "standard", "distribution"], "category": "MATH", "examples": ["=STDEV(A)", "=STDEV(A * B)"], "syntax": "STDEV(series)", "syntax_elements": [{ "element": "series", "description": "The series to calculate the standard deviation of." }] }, { "function": "STRIPTIMETODAYS", "description": "Returns the date with a seconds, minutes, and hours component of 00:00:00.", "search_terms": ["time", "date", "days", "strip"], "category": "DATE", "examples": ["STRIPTIMETODAYS(date_column)", "STRIPTIMETODAYS('2012-12-22 09:23:05')"], "syntax": "STRIPTIMETODAYS(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to reset the seconds, minutes, and hours component of." }] }, { "function": "STRIPTIMETOHOURS", "description": "Returns the date with a seconds and minutes component of 00:00.", "search_terms": ["time", "date", "hours", "strip"], "category": "DATE", "examples": ["STRIPTIMETOHOURS(date_column)", "STRIPTIMETOHOURS('2012-12-22 09:23:05')"], "syntax": "STRIPTIMETOHOURS(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to reset the seconds and minutes component of." }] }, { "function": "STRIPTIMETOMINUTES", "description": "Returns the date with a seconds component of 00.", "search_terms": ["time", "date", "minutes", "strip"], "category": "DATE", "examples": ["STRIPTIMETOMINUTES(date_column)", "STRIPTIMETOMINUTES('2012-12-22 09:23:05')"], "syntax": "STRIPTIMETOMINUTES(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to reset the seconds component of." }] }, { "function": "STRIPTIMETOMONTHS", "description": "Returns the date adjusted to the start of the month.", "search_terms": ["time", "date", "months", "strip"], "category": "DATE", "examples": ["STRIPTIMETOMONTHS(date_column)", "STRIPTIMETOMONTHS('2012-12-22 09:23:05')"], "syntax": "STRIPTIMETOMONTHS(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to reset the seconds, minutes, hours, and days of." }] }, { "function": "STRIPTIMETOYEARS", "description": "Returns the date adjusted to the start of the year.", "search_terms": ["time", "date", "years", "strip"], "category": "DATE", "examples": ["STRIPTIMETOYEARS(date_column)", "STRIPTIMETOYEARS('2012-12-22 09:23:05')"], "syntax": "STRIPTIMETOYEARS(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to reset the seconds, minutes, hours, days, and month components of." }] }, { "function": "SUBSTITUTE", "description": "Replaces existing text with new text in a string.", "search_terms": ["replace", "find and replace"], "category": "TEXT", "examples": ["SUBSTITUTE('Better great than never', 'great', 'late')", "SUBSTITUTE(A, 'dog', 'cat')"], "syntax": "SUBSTITUTE(text_to_search, search_for, replace_with, [count])", "syntax_elements": [{ "element": "text_to_search", "description": "The text within which to search and replace." }, { "element": "search_for", "description": " The string to search for within text_to_search." }, { "element": "replace_with", "description": "The string that will replace search_for." }, { "element": "count", "description": "The number of times to perform the substitute. Default is all." }] }, { "function": "SUM", "description": "Returns the sum of the given numbers and series.", "search_terms": ["add"], "category": "MATH", "examples": ["SUM(10, 11)", "SUM(A, B, D, F)", "SUM(A, B, D, F)"], "syntax": "SUM(value1, [value2, ...])", "syntax_elements": [{ "element": "value1", "description": "The first number or column to add together." }, { "element": "value2, ... [OPTIONAL]", "description": "Additional numbers or columns to sum." }] }, { "function": "SUMPRODUCT", "description": "Returns the sum of the product of the passed arguments.", "search_terms": ["sum product", "sumproduct", "sum", "product", "weighted average"], "category": "MATH", "examples": ["SUMPRODUCT(A:A, B:B)", "SUMPRODUCT(A:B)"], "syntax": "SUMPRODUCT(array1, [array2, ...])", "syntax_elements": [{ "element": "array1", "description": "The first array argument whose components you want to multiply and then add." }, { "element": "value2, ... [OPTIONAL]", "description": "Additional series to multiply then add." }] }, { "function": "TEXT", "description": "Turns the passed series into a string.", "search_terms": ["string", "dtype"], "category": "TEXT", "examples": ["=TEXT(Product_Number)", "=TEXT(Start_Date)"], "syntax": "TEXT(series)", "syntax_elements": [{ "element": "series", "description": "The series to convert to a string." }] }, { "function": "TODAY", "description": "Returns the datetime value for the current date.", "search_terms": ["today"], "category": "DATE", "examples": ["TODAY()"], "syntax": "TODAY()", "syntax_elements": [] }, { "function": "TRIM", "description": "Returns a string with the leading and trailing whitespace removed.", "search_terms": ["trim", "whitespace", "spaces"], "category": "TEXT", "examples": ["=TRIM('  ABC')", "=TRIM('  ABC  ')", "=TRIM(A)"], "syntax": "TRIM(string)", "syntax_elements": [{ "element": "string", "description": "The value or series to remove the leading and trailing whitespace from." }] }, { "function": "TYPE", "description": "Returns the type of each element of the passed series. Return values are 'number', 'str', 'bool', 'datetime', 'object', or 'NaN'.", "search_terms": ["type", "dtype"], "examples": ["TYPE(Nums_and_Strings)", "IF(TYPE(Account_Numbers) != 'NaN', Account_Numbers, 0)"], "syntax": "TYPE(series)", "syntax_elements": [{ "element": "series", "description": "The series to get the type of each element of." }] }, { "function": "UPPER", "description": "Converts a given string to uppercase.", "search_terms": ["uppercase", "capitalize"], "category": "TEXT", "examples": ["=UPPER('abc')", "=UPPER(A)", "=UPPER('Nate Rush')"], "syntax": "UPPER(string)", "syntax_elements": [{ "element": "string", "description": "The string or series to convert to uppercase." }] }, { "function": "VALUE", "description": "Converts a string series to a number series. Any values that fail to convert will return an NaN.", "search_terms": ["number", "to number", "dtype", "convert", "parse"], "category": "MATH", "examples": ["=VALUE(A)", "=VALUE('123')"], "syntax": "VALUE(string)", "syntax_elements": [{ "element": "string", "description": "The string or series to convert to a number." }] }, { "function": "VAR", "description": "Computes the variance of a series, excluding missing values.", "search_terms": ["variance"], "category": "MATH", "examples": ["=VAR(A)", "=VAR(A - B)"], "syntax": "VAR(series)", "syntax_elements": [{ "element": "series", "description": "The series to calculate the variance of." }] }, { "function": "VLOOKUP", "description": "Looks up a value in a range and returns the value in the same row from a column you specify.", "search_terms": ["vlookup", "merge", "join", "search", "lookup"], "category": "REFERENCE", "examples": ["VLOOKUP(Names0, Ids:Ages, 1)", "VLOOKUP('John Smith', Names:Ages, 2)", "VLOOKUP(Names0, Ids:Ages, Column Indexes0)"], "syntax": "VLOOKUP(lookup_value, where, index)", "syntax_elements": [{ "element": "lookup_value", "description": "The value to look up." }, { "element": "where", "description": "The range to look up in." }, { "element": "index", "description": "The column index to return." }] }, { "function": "WEEK", "description": "Returns the week (1-52) of a specific date, as a number.", "search_terms": ["week", "1", "52"], "category": "DATE", "examples": ["WEEK(date_column)", "WEEK('2012-12-22 09:23:05')"], "syntax": "WEEK(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the week of." }] }, { "function": "WEEKDAY", "description": "Returns the day of the week that a specific date falls on. 1-7 corresponds to Monday-Sunday.", "search_terms": ["weekday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"], "category": "DATE", "examples": ["WEEKDAY(date_column)", "WEEKDAY('2012-12-22')"], "syntax": "WEEKDAY(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the weekday of." }] }, { "function": "YEAR", "description": "Returns the day of the year that a specific date falls in, as a number.", "search_terms": ["year", "date"], "category": "DATE", "examples": ["YEAR(date_column)", "YEAR('2012-12-22')"], "syntax": "YEAR(date)", "syntax_elements": [{ "element": "date", "description": "The date or date series to get the month of." }] }];

  // src/mito/components/endo/celleditor/cellEditorUtils.tsx
  var getSelectionFormulaString = (selections, selectedSheetData, editorSheetIndex) => {
    const selectionStrings = [];
    selections.forEach((selection) => {
      let dfName = "";
      if (editorSheetIndex !== selection.sheetIndex) {
        dfName = `${selectedSheetData.dfName}!`;
      }
      const [[upperLeftColumnHeader, upperLeftIndexLabel], [bottomRightColumnHeader, bottomRightIndexLabel]] = getUpperLeftAndBottomRight(selection, selectedSheetData);
      if (upperLeftColumnHeader === void 0 && upperLeftIndexLabel === void 0 && bottomRightColumnHeader === void 0 && bottomRightIndexLabel === void 0) {
        return;
      } else if (upperLeftIndexLabel === void 0 && bottomRightIndexLabel === void 0 && (upperLeftColumnHeader !== void 0 && bottomRightColumnHeader !== void 0)) {
        selectionStrings.push(dfName + getDisplayColumnHeader(upperLeftColumnHeader) + ":" + getDisplayColumnHeader(bottomRightColumnHeader));
      } else if (upperLeftColumnHeader == bottomRightColumnHeader && upperLeftIndexLabel == bottomRightIndexLabel && (upperLeftColumnHeader !== void 0 && upperLeftIndexLabel !== void 0)) {
        selectionStrings.push(dfName + getDisplayColumnHeader(upperLeftColumnHeader) + getDisplayColumnHeader(upperLeftIndexLabel));
      } else if (upperLeftColumnHeader !== void 0 && upperLeftIndexLabel !== void 0 && bottomRightColumnHeader !== void 0 && bottomRightIndexLabel !== void 0) {
        selectionStrings.push(dfName + getDisplayColumnHeader(upperLeftColumnHeader) + getDisplayColumnHeader(upperLeftIndexLabel) + ":" + getDisplayColumnHeader(bottomRightColumnHeader) + getDisplayColumnHeader(bottomRightIndexLabel));
      }
    });
    return selectionStrings.join(", ");
  };
  var getFullFormula = (editorState, sheetDataArray, selectedSheetIndex) => {
    const { formula, pendingSelections, sheetIndex } = editorState;
    if (pendingSelections === void 0 || pendingSelections.selections.length === 0) {
      return formula;
    }
    const selectionFormulaString = getSelectionFormulaString(pendingSelections.selections, sheetDataArray[selectedSheetIndex], sheetIndex);
    const beforeSelection = formula.substring(0, pendingSelections.inputSelectionStart);
    const afterSelection = formula.substring(pendingSelections.inputSelectionEnd);
    return beforeSelection + selectionFormulaString + afterSelection;
  };
  var getCellEditorInputCurrentSelection = (containerDiv) => {
    const cellEditorElement = containerDiv == null ? void 0 : containerDiv.querySelector(".cell-editor-input");
    if (cellEditorElement === null) {
      return {
        selectionStart: 0,
        selectionEnd: 0
      };
    }
    const cellEditorInput = cellEditorElement;
    return {
      selectionStart: cellEditorInput.selectionStart || 0,
      selectionEnd: cellEditorInput.selectionEnd || 0
    };
  };
  var getDefaultEditingMode = (defaultApplyFormulaToColumn) => {
    return defaultApplyFormulaToColumn ? "entire_column" : "specific_index_labels";
  };
  var KEYS_TO_ENTER_CELL_EDITING_WITHOUT_CHANGING_FORMULA = [
    "Enter",
    "F2"
  ];
  var getStartingFormula = (sheetData, editorState, rowIndex, columnIndex, defaultApplyFormulaToColumn, e) => {
    if (editorState !== void 0 && editorState.columnIndex === columnIndex) {
      return {
        startingColumnFormula: editorState.formula,
        arrowKeysScrollInFormula: true,
        editingMode: editorState.editingMode
      };
    }
    const { columnFormula, columnHeader, columnFormulaLocation } = getCellDataFromCellIndexes(sheetData, rowIndex, columnIndex);
    if (columnHeader === void 0) {
      return {
        startingColumnFormula: "",
        arrowKeysScrollInFormula: false,
        editingMode: getDefaultEditingMode(defaultApplyFormulaToColumn)
      };
    }
    let originalValue = "";
    if (rowIndex <= -1) {
      if (columnHeader === void 0) {
        originalValue = "";
      } else if (isPrimitiveColumnHeader(columnHeader)) {
        originalValue = getDisplayColumnHeader(columnHeader);
      } else {
        originalValue = getDisplayColumnHeader(columnHeader[rowIndexToColumnHeaderLevel(columnHeader, rowIndex)]);
      }
    } else {
      if (columnFormula === void 0 || columnFormula === "") {
        originalValue = "=" + getDisplayColumnHeader(columnHeader);
      } else {
        originalValue = columnFormula;
      }
    }
    if (e !== void 0 && !KEYS_TO_ENTER_CELL_EDITING_WITHOUT_CHANGING_FORMULA.includes(e.key)) {
      if (e.key === "Backspace") {
        originalValue = originalValue.substr(0, originalValue.length - 1);
      } else {
        originalValue = e.key;
      }
    }
    const defaultFormula = `=${getDisplayColumnHeader(columnHeader)}`;
    if (originalValue === defaultFormula) {
      return {
        startingColumnFormula: "",
        arrowKeysScrollInFormula: false,
        editingMode: getDefaultEditingMode(defaultApplyFormulaToColumn)
      };
    }
    return {
      startingColumnFormula: originalValue,
      arrowKeysScrollInFormula: true,
      editingMode: columnFormulaLocation || getDefaultEditingMode(defaultApplyFormulaToColumn)
    };
  };
  var getFormulaEndsInReference = (formula, sheetData) => {
    const lowercaseFormula = formula.toLowerCase();
    const lowercaseColumnHeaders = sheetData.data.map((c) => getDisplayColumnHeader(c.columnHeader).toLowerCase());
    let found = false;
    lowercaseColumnHeaders.forEach((ch) => {
      const lastIndexOf = lowercaseFormula.lastIndexOf(ch);
      if (lastIndexOf !== -1) {
        const remainingString = lowercaseFormula.substring(lastIndexOf);
        sheetData.index.forEach((indexLabel) => {
          if (remainingString === getDisplayColumnHeader(indexLabel).toLowerCase()) {
            found = true;
          }
        });
      }
    });
    return found;
  };
  var getSuggestedColumnHeaders = (formula, sheetData) => {
    const columnHeadersAndIDs = sheetData.data.map((c) => [c.columnID, getDisplayColumnHeader(c.columnHeader)]);
    const maxColumnHeaderLength = Math.min(Math.max(...columnHeadersAndIDs.map(([, columnHeader]) => columnHeader.length), formula.length), 50);
    for (let i = maxColumnHeaderLength; i > 0; i--) {
      const substring = formula.substring(formula.length - i).toLowerCase();
      const charBeforeSubstringStarts = formula[formula.length - i - 1];
      if (substring === "" || charBeforeSubstringStarts && charBeforeSubstringStarts.match(/^[0-9a-z]+$/i)) {
        continue;
      }
      const foundColumns = columnHeadersAndIDs.filter(([, columnHeader]) => columnHeader.toLowerCase().startsWith(substring));
      const suggestedColumnHeaders = foundColumns.map(([columnID, columnHeader]) => {
        const columnDtype = sheetData.columnDtypeMap[columnID];
        const subtextType = columnDtype === void 0 ? "series" : columnDtype + " series";
        return [columnHeader, `A ${subtextType} in your dataset`];
      });
      if (suggestedColumnHeaders.length > 0) {
        return [substring.length, suggestedColumnHeaders];
      }
    }
    return [0, []];
  };
  var getSuggestedFunctions = (formula, minLength, analysisData) => {
    if (formula.length === 0 || formula === "=") {
      const placeholders = functionDocumentationObjects.filter((f) => f.function === "IF" || f.function === "CONCAT" || f.function === "DAY");
      placeholders.unshift(placeholders[2]);
      delete placeholders[3];
      return [0, placeholders.map((f) => {
        return [f.function, f.description];
      })];
    }
    const allFunctionNamesAndDescription = functionDocumentationObjects.concat(analysisData.userDefinedFunctions).map(
      (f) => {
        return { function: f.function, description: f.description, search_terms: f.search_terms };
      }
    );
    const maxFunctionNameLength = Math.max(...allFunctionNamesAndDescription.map((f) => f.function.length));
    for (let i = maxFunctionNameLength; i > minLength - 1; i--) {
      const substring = formula.substring(formula.length - i).toLowerCase();
      const charBeforeSubstringStarts = formula[formula.length - i - 1];
      if (substring === "" || charBeforeSubstringStarts && charBeforeSubstringStarts.match(/^[0-9a-z]+$/i)) {
        continue;
      }
      const foundFunctionObjects = allFunctionNamesAndDescription.filter((f) => {
        if (f.function.toLowerCase().startsWith(substring)) {
          return true;
        } else {
          for (let i2 = 0; i2 < f.search_terms.length; i2++) {
            const searchTerm = f.search_terms[i2];
            if (searchTerm.toLowerCase().startsWith(substring)) {
              return true;
            }
          }
        }
        return false;
      });
      const suggestedFunctions = foundFunctionObjects.map((f) => {
        return [f.function, f.description];
      });
      if (suggestedFunctions.length > 0) {
        return [substring.length, suggestedFunctions];
      }
    }
    return [0, []];
  };
  var getDocumentationFunction = (formula, selectionStart, analysisData) => {
    const finalParenIndex = formula.substring(0, selectionStart || void 0).lastIndexOf("(");
    if (finalParenIndex === -1) {
      return void 0;
    }
    let finalFunction = "";
    for (let i = finalParenIndex - 1; i >= 0; i--) {
      const char = formula[i].toLowerCase();
      if (char.match(/^[a-z]+$/i) || char === "_") {
        finalFunction += char;
      } else {
        break;
      }
    }
    finalFunction = finalFunction.split("").reverse().join("").toLowerCase();
    const allFunctionDocumentationObjects = functionDocumentationObjects.concat(analysisData.userDefinedFunctions);
    const matchingFunctions = allFunctionDocumentationObjects.filter((functionDocumentationObject) => functionDocumentationObject.function.toLowerCase() === finalFunction);
    if (matchingFunctions.length !== 1) {
      return void 0;
    } else {
      return matchingFunctions[0];
    }
  };
  var getNewIndexLabelAtRowOffsetFromOtherIndexLabel = (index, indexLabel, rowOffset) => {
    if (indexLabel === void 0) {
      return void 0;
    }
    const indexOfIndexLabel = index.indexOf(indexLabel);
    if (indexOfIndexLabel === -1) {
      return void 0;
    }
    const indexOfNewLabel = indexOfIndexLabel - rowOffset;
    return index[indexOfNewLabel];
  };
  var getFormulaStringFromFrontendFormula = (formula, indexLabel, sheetData) => {
    let formulaString = "";
    if (!formula || !sheetData) {
      return formulaString;
    }
    formula.frontend_formula.forEach((formulaPart) => {
      if (formulaPart.type === "string part") {
        formulaString += formulaPart.string;
      } else if (formulaPart.type === "{HEADER}") {
        formulaString += formulaPart.display_column_header;
      } else if (formulaPart.type == "{SHEET}") {
        formulaString += formulaPart.display_sheet_name;
      } else {
        const newIndexLabel = getNewIndexLabelAtRowOffsetFromOtherIndexLabel(formula.index, indexLabel, formulaPart.row_offset);
        if (newIndexLabel !== void 0) {
          formulaString += formulaPart.display_column_header;
          formulaString += getDisplayColumnHeader(newIndexLabel);
        } else {
          formulaString += "0";
        }
      }
    });
    return formulaString;
  };

  // src/mito/components/endo/widthUtils.tsx
  var getWidthData = (sheetData, defaultWidthData = void 0) => {
    if (sheetData === void 0) {
      return {
        widthArray: [],
        widthSumArray: [],
        totalWidth: 0
      };
    }
    const widthArray = new Array(sheetData.numColumns);
    const widthSumArray = new Array(sheetData.numColumns);
    for (let columnIndex = 0; columnIndex < sheetData.data.length; columnIndex++) {
      const columnID = sheetData.data[columnIndex].columnID;
      let columnWidth = DEFAULT_WIDTH;
      if (defaultWidthData !== void 0) {
        columnWidth = defaultWidthData[columnID] || DEFAULT_WIDTH;
      }
      widthArray[columnIndex] = columnWidth;
      const previousSum = columnIndex === 0 ? 0 : widthSumArray[columnIndex - 1];
      widthSumArray[columnIndex] = previousSum + columnWidth;
    }
    return {
      widthArray,
      widthSumArray,
      totalWidth: widthArray.reduce((partialSum, width) => partialSum + width, 0)
    };
  };
  var changeColumnWidthDataArray = (sheetIndex, widthDataArray, columnIndex, newWidth) => {
    const newWidthArray = [...widthDataArray[sheetIndex].widthArray];
    newWidthArray[columnIndex] = newWidth;
    const newWidthSumArray = [...widthDataArray[sheetIndex].widthSumArray];
    for (let i = columnIndex; i < widthDataArray[sheetIndex].widthSumArray.length; i++) {
      let previousSumSaved = newWidthSumArray[i - 1];
      if (previousSumSaved === void 0) {
        previousSumSaved = 0;
      }
      const columnWidth = newWidthArray[i];
      newWidthSumArray[i] = previousSumSaved + columnWidth;
    }
    const newTotalWidth = newWidthArray.reduce((partialSum, width) => partialSum + width, 0);
    widthDataArray[sheetIndex] = {
      widthArray: newWidthArray,
      widthSumArray: newWidthSumArray,
      totalWidth: newTotalWidth
    };
    return widthDataArray;
  };
  var reconciliateWidthDataArray = (prevWidthDataArray, columnIDsArray, sheetDataArray) => {
    if (sheetDataArray.length === 0) {
      return [getWidthData(void 0)];
    }
    const newColumnWidthsArray = [];
    for (let i = 0; i < sheetDataArray.length; i++) {
      const columnIDs = columnIDsArray[i];
      const newColumnsWidthsResult = reconciliateWidthData(prevWidthDataArray[i], columnIDs, sheetDataArray[i]);
      newColumnWidthsArray.push(newColumnsWidthsResult);
    }
    return newColumnWidthsArray;
  };
  var reconciliateWidthData = (prevWidthData, oldColumnIDsArray, sheetData) => {
    const oldWidths = {};
    if (prevWidthData !== void 0 && oldColumnIDsArray !== void 0) {
      for (let i = 0; i < oldColumnIDsArray.length; i++) {
        oldWidths[oldColumnIDsArray[i]] = prevWidthData.widthArray[i];
      }
    }
    return getWidthData(sheetData, oldWidths);
  };
  var guessFullWidthOfColumnHeaderOrContent = (sheetData, columnIndex, displayColumnHeader) => {
    const displayColumnHeaderPx = displayColumnHeader.length * 10 + 15;
    const dataMaxLength = Math.max(...sheetData.data[columnIndex].columnData.map((el) => String(el).length)) * 8;
    return Math.max(displayColumnHeaderPx, dataMaxLength);
  };
  var getWidthArrayAtFullWidthForColumnIndexes = (columnIndexes, gridState, sheetData) => {
    let widthDataArray = gridState.widthDataArray;
    columnIndexes.forEach((columnIndex) => {
      const columnHeader = getCellDataFromCellIndexes(sheetData, -1, columnIndex).columnHeader;
      if (columnHeader === void 0) {
        return;
      }
      const displayColumnHeader = getDisplayColumnHeader(columnHeader);
      const fullWidth = guessFullWidthOfColumnHeaderOrContent(sheetData, columnIndex, displayColumnHeader);
      widthDataArray = changeColumnWidthDataArray(gridState.sheetIndex, widthDataArray, columnIndex, fullWidth);
    });
    return widthDataArray;
  };

  // src/mito/components/endo/utils.tsx
  init_react();
  var isNumberInRangeInclusive = (num, start, end) => {
    return start <= num && num <= end;
  };
  function firstNonNullOrUndefined(...args) {
    for (let i = 0; i < args.length; i++) {
      const arg = args[i];
      if (arg !== null && arg !== void 0) {
        return arg;
      }
    }
    return args[0];
  }
  var getDefaultGridState = (sheetDataArray, selectedSheetIndex) => {
    return {
      sheetIndex: selectedSheetIndex,
      viewport: {
        width: 0,
        height: 0
      },
      scrollPosition: {
        scrollLeft: 0,
        scrollTop: 0
      },
      selections: [{
        startingColumnIndex: 0,
        endingColumnIndex: 0,
        startingRowIndex: -1,
        endingRowIndex: -1,
        sheetIndex: selectedSheetIndex
      }],
      copiedSelections: [],
      widthDataArray: sheetDataArray.length === 0 ? [getWidthData(void 0)] : sheetDataArray.map((sheetData) => getWidthData(sheetData)),
      columnIDsArray: getColumnIDsArrayFromSheetDataArray(sheetDataArray)
    };
  };
  var getTypeIdentifier = (columnDtype) => {
    let typeText = "str";
    if (isFloatDtype(columnDtype)) {
      typeText = "float";
    } else if (isIntDtype(columnDtype)) {
      typeText = "int";
    } else if (isDatetimeDtype(columnDtype)) {
      typeText = "date";
    } else if (isTimedeltaDtype(columnDtype)) {
      typeText = "time";
    } else if (isBoolDtype(columnDtype)) {
      typeText = "bool";
    }
    return typeText;
  };
  var getCellDataFromCellIndexes = (sheetData, rowIndex, columnIndex) => {
    var _a, _b;
    const columnID = (_a = sheetData == null ? void 0 : sheetData.data[columnIndex]) == null ? void 0 : _a.columnID;
    const columnHeader = (_b = sheetData == null ? void 0 : sheetData.data[columnIndex]) == null ? void 0 : _b.columnHeader;
    const indexLabel = columnID !== void 0 ? sheetData == null ? void 0 : sheetData.index[rowIndex] : void 0;
    const columnDtype = columnID !== void 0 ? sheetData == null ? void 0 : sheetData.data[columnIndex].columnDtype : void 0;
    const columnFormulaAndLocation = columnID !== void 0 ? sheetData !== void 0 ? sheetData == null ? void 0 : sheetData.columnFormulasMap[columnID] : [] : [];
    let columnFormula;
    let columnFormulaLocation;
    if (columnFormulaAndLocation.length !== 0) {
      columnFormulaAndLocation.forEach((cfal) => {
        if (cfal.location.type === "entire_column") {
          columnFormula = getFormulaStringFromFrontendFormula(cfal, indexLabel, sheetData);
          columnFormulaLocation = "entire_column";
        } else if (indexLabel !== void 0 && cfal.location.index_labels.includes(indexLabel)) {
          columnFormula = getFormulaStringFromFrontendFormula(cfal, indexLabel, sheetData);
          columnFormulaLocation = "specific_index_labels";
        }
      });
    }
    const columnFilters = columnID !== void 0 ? sheetData == null ? void 0 : sheetData.columnFiltersMap[columnID] : void 0;
    const cellValue = columnID !== void 0 ? sheetData == null ? void 0 : sheetData.data[columnIndex].columnData[rowIndex] : void 0;
    const columnFormat = columnID !== void 0 ? sheetData == null ? void 0 : sheetData.dfFormat.columns[columnID] : void 0;
    const headerBackgroundColor = columnID !== void 0 ? sheetData == null ? void 0 : sheetData.dfFormat.headers.backgroundColor : void 0;
    const headerTextColor = columnID !== void 0 ? sheetData == null ? void 0 : sheetData.dfFormat.headers.color : void 0;
    return {
      columnID,
      columnHeader,
      columnFormula,
      columnFormulaLocation,
      columnDtype,
      columnFilters,
      cellValue,
      columnFormat,
      headerBackgroundColor,
      headerTextColor,
      indexLabel
    };
  };
  var getColumnIDsArrayFromSheetDataArray = (sheetDataArray) => {
    return sheetDataArray.map((sheetData) => sheetData.data.map((c) => c.columnID)) || [];
  };
  var doesAnySheetExist = (sheetDataArray) => {
    return sheetDataArray.length !== 0;
  };
  var doesColumnExist = (columnID, sheetIndex, sheetDataArray) => {
    var _a;
    return columnID !== void 0 && ((_a = sheetDataArray[sheetIndex]) == null ? void 0 : _a.columnDtypeMap[columnID]) !== void 0;
  };
  var doesSheetContainData = (sheetIndex, sheetDataArray) => {
    const sheetData = sheetDataArray[sheetIndex];
    return sheetData !== void 0 && sheetData.numRows > 0 && sheetData.numColumns > 0;
  };
  var getAnyGraphIsSelected = (uiState) => {
    return uiState.selectedTabType === "graph" && uiState.currOpenTaskpane.type === "graph" /* GRAPH */;
  };
  var getDataframeIsSelected = (uiState, sheetDataArray) => {
    return uiState.selectedTabType === "data" && sheetDataArray.length !== 0;
  };
  var getPropsForContextMenuDropdownItem = (action, closeOpenEditingPopups) => {
    var _a, _b, _c;
    return {
      title: (_b = (_a = action.titleContextMenu) != null ? _a : action.titleToolbar) != null ? _b : action.longTitle,
      tooltip: (_c = action.isDisabled()) != null ? _c : action.tooltip,
      onClick: () => {
        closeOpenEditingPopups();
        void action.actionFunction();
      },
      disabled: !!action.isDisabled(),
      icon: action.iconContextMenu ? /* @__PURE__ */ react_default.createElement(action.iconContextMenu, null) : action.iconToolbar ? /* @__PURE__ */ react_default.createElement(action.iconToolbar, null) : /* @__PURE__ */ react_default.createElement(StepsIcon_default, null),
      rightText: getKeyboardShortcutString(action.staticType)
    };
  };

  // src/mito/components/endo/domUtils.tsx
  var checkElementIsVisible = (element) => {
    if (element === void 0)
      return false;
    const rect = element.getBoundingClientRect();
    const left = rect.left + 2;
    const right = rect.right - 2;
    const top = rect.top + 2;
    const bottom = rect.bottom - 2;
    const atTopleft = document.elementFromPoint(left, top) === element;
    const atTopRight = document.elementFromPoint(right, top) === element;
    const atBottomLeft = document.elementFromPoint(left, bottom) === element;
    const atBottomRight = document.elementFromPoint(right, bottom) === element;
    if (atTopleft && atTopRight && atBottomLeft && atBottomRight) {
      return true;
    }
    return false;
  };
  var getChildrenWithQuery = (element, querySelector) => {
    if (element === null) {
      return [];
    }
    const nodeList = element.querySelectorAll(querySelector);
    if (nodeList === void 0) {
      return [];
    }
    const children = [];
    nodeList.forEach((node) => {
      children.push(node);
    });
    return children;
  };
  var isAnyElementWithSelectorEntirelyVisible = (element, querySelector) => {
    const nodeList = getChildrenWithQuery(element, querySelector);
    for (let i = 0; i < nodeList.length; i++) {
      const node = nodeList[i];
      if (checkElementIsVisible(node)) {
        return true;
      }
    }
    return false;
  };

  // src/mito/components/endo/sheetViewUtils.tsx
  var calculateCurrentSheetView = (gridState) => {
    if (gridState.sheetIndex >= gridState.widthDataArray.length) {
      return {
        startingRowIndex: -1,
        numRowsRendered: 0,
        startingColumnIndex: 0,
        numColumnsRendered: 0
      };
    }
    let foundStart = false;
    let startingColumnIndex = 0;
    let numColumnsRendered = 0;
    for (let i = 0; i < gridState.widthDataArray[gridState.sheetIndex].widthArray.length; i++) {
      const totalWidth = gridState.widthDataArray[gridState.sheetIndex].widthSumArray[i];
      if (!foundStart && totalWidth > gridState.scrollPosition.scrollLeft) {
        startingColumnIndex = i;
        foundStart = true;
      }
      if (foundStart && totalWidth > gridState.scrollPosition.scrollLeft + gridState.viewport.width) {
        numColumnsRendered = i - startingColumnIndex + 1;
        break;
      } else if (i === gridState.widthDataArray[gridState.sheetIndex].widthArray.length - 1) {
        numColumnsRendered = i - startingColumnIndex + 1;
      }
    }
    return {
      startingRowIndex: Math.max(Math.floor(gridState.scrollPosition.scrollTop / DEFAULT_HEIGHT), 0),
      numRowsRendered: Math.ceil(gridState.viewport.height / DEFAULT_HEIGHT) + 3,
      startingColumnIndex,
      numColumnsRendered
    };
  };
  var calculateTranslate = (gridState) => {
    const currentSheetView = calculateCurrentSheetView(gridState);
    return {
      x: gridState.scrollPosition.scrollLeft - (currentSheetView.startingColumnIndex === 0 ? 0 : gridState.widthDataArray[gridState.sheetIndex].widthSumArray[currentSheetView.startingColumnIndex - 1]),
      y: gridState.scrollPosition.scrollTop % DEFAULT_HEIGHT
    };
  };
  var calculateNewScrollPosition = (e, totalSize, viewport, scrollAndRenderedContainerDiv) => {
    const maxScrollLeft = totalSize.width - viewport.width;
    const maxScrollTop = totalSize.height - viewport.height;
    const noScrollLeft = totalSize.width < ((scrollAndRenderedContainerDiv == null ? void 0 : scrollAndRenderedContainerDiv.clientWidth) || 0);
    const noScrollDown = totalSize.height < ((scrollAndRenderedContainerDiv == null ? void 0 : scrollAndRenderedContainerDiv.clientHeight) || 0);
    const target = e.target;
    if (target === null) {
      return void 0;
    }
    const { scrollLeft, scrollTop } = target;
    let newScrollLeft = scrollLeft;
    let newScrollTop = scrollTop;
    if (scrollLeft >= maxScrollLeft && !noScrollLeft) {
      newScrollLeft = maxScrollLeft - 1;
    } else if (noScrollLeft) {
      newScrollLeft = 0;
    }
    if (scrollTop >= maxScrollTop && !noScrollDown) {
      newScrollTop = maxScrollTop;
    } else if (noScrollDown) {
      newScrollTop = 0;
    }
    return {
      scrollLeft: newScrollLeft || 0,
      scrollTop: newScrollTop || 0
    };
  };
  var rowIsVisible = (containerRef, rowIndex) => {
    if (containerRef === null) {
      return false;
    }
    return isAnyElementWithSelectorEntirelyVisible(containerRef, `[mito-row-index="${rowIndex}"]`);
  };
  var columnIsVisible = (containerRef, columnIndex) => {
    if (containerRef === null) {
      return false;
    }
    return isAnyElementWithSelectorEntirelyVisible(containerRef, `[mito-col-index="${columnIndex}"][mito-row-index]`);
  };
  var getCellInRow = (containerRef, rowIndex) => {
    if (containerRef === null) {
      return void 0;
    }
    const nodeList = containerRef.querySelectorAll(`[mito-row-index="${rowIndex}"]`);
    if (nodeList === void 0 || nodeList.length === 0) {
      return void 0;
    }
    return nodeList[0];
  };
  var getCellInColumn = (containerRef, columnIndex) => {
    if (containerRef === null) {
      return void 0;
    }
    const nodeList = containerRef.querySelectorAll(`[mito-col-index="${columnIndex}"]`);
    if (nodeList === void 0 || nodeList.length === 0) {
      return void 0;
    }
    return nodeList[0];
  };

  // src/mito/components/endo/visibilityUtils.tsx
  var scrollRowIntoView = (containerDiv, scrollAndRenderedContainerDiv, currentSheetView, rowIndex) => {
    if (rowIndex === -1) {
      return;
    }
    if (scrollAndRenderedContainerDiv === null)
      return;
    let scrollTop = scrollAndRenderedContainerDiv.scrollTop;
    const rowVisible = rowIsVisible(containerDiv, rowIndex);
    if (!rowVisible) {
      const newCellIsAbove = rowIndex <= currentSheetView.startingRowIndex;
      if (newCellIsAbove) {
        scrollTop = rowIndex * DEFAULT_HEIGHT;
      } else {
        scrollTop = (rowIndex + 1) * DEFAULT_HEIGHT - scrollAndRenderedContainerDiv.clientHeight;
      }
    }
    scrollAndRenderedContainerDiv.scrollTop = scrollTop;
  };
  var scrollColumnIntoView = (containerDiv, scrollAndRenderedContainerDiv, currentSheetView, gridState, columnIndex) => {
    var _a, _b;
    if (columnIndex === -1) {
      return;
    }
    if (scrollAndRenderedContainerDiv === null)
      return;
    let scrollLeft = scrollAndRenderedContainerDiv.scrollLeft;
    const columnVisible = columnIsVisible(containerDiv, columnIndex);
    if (!columnVisible) {
      const newCellIsLeft = columnIndex <= currentSheetView.startingColumnIndex;
      if (newCellIsLeft) {
        scrollLeft = ((_a = gridState.widthDataArray[gridState.sheetIndex]) == null ? void 0 : _a.widthSumArray[columnIndex - 1]) || 0;
      } else {
        scrollLeft = ((_b = gridState.widthDataArray[gridState.sheetIndex]) == null ? void 0 : _b.widthSumArray[columnIndex]) - scrollAndRenderedContainerDiv.clientWidth || 0;
      }
    }
    scrollAndRenderedContainerDiv.scrollLeft = scrollLeft;
  };
  var ensureCellVisible = (containerDiv, scrollAndRenderedContainerDiv, currentSheetView, gridState, rowIndex, columnIndex) => {
    const largeRowJump = !isNumberInRangeInclusive(rowIndex, currentSheetView.startingRowIndex - 2, currentSheetView.startingRowIndex + currentSheetView.numRowsRendered + 1);
    const largeColumnJump = !isNumberInRangeInclusive(columnIndex, currentSheetView.startingColumnIndex - 2, currentSheetView.startingColumnIndex + currentSheetView.numColumnsRendered + 1);
    const largeJump = largeRowJump || largeColumnJump;
    const rowVisible = rowIsVisible(containerDiv, rowIndex);
    const columnVisible = columnIsVisible(containerDiv, columnIndex);
    if (!rowVisible) {
      if (!largeJump) {
        scrollRowIntoView(containerDiv, scrollAndRenderedContainerDiv, currentSheetView, rowIndex);
      } else {
        setTimeout(() => scrollRowIntoView(containerDiv, scrollAndRenderedContainerDiv, currentSheetView, rowIndex), 25);
      }
    }
    if (!columnVisible) {
      if (!largeJump) {
        scrollColumnIntoView(containerDiv, scrollAndRenderedContainerDiv, currentSheetView, gridState, columnIndex);
      } else {
        setTimeout(() => scrollColumnIntoView(containerDiv, scrollAndRenderedContainerDiv, currentSheetView, gridState, columnIndex), 50);
      }
    }
  };
  var isCurrOpenDropdownForCell = (uiState, rowIndex, columnIndex) => {
    return typeof uiState.currOpenDropdown == "object" && uiState.currOpenDropdown.type === "context-menu" && uiState.currOpenDropdown.rowIndex === rowIndex && uiState.currOpenDropdown.columnIndex === columnIndex;
  };

  // src/mito/components/endo/celleditor/CellEditorDropdown.tsx
  init_react();

  // src/mito/components/elements/LoadingDots.tsx
  init_react();
  var LoadingDots = () => {
    const [indicatorState, setIndicatorState] = useState(1);
    useEffect(() => {
      const interval = setInterval(() => {
        setIndicatorState((indicatorState2) => indicatorState2 + 1);
      }, 500);
      return () => clearInterval(interval);
    }, []);
    const someNumberOfDots = ".".repeat(indicatorState % 4);
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, someNumberOfDots);
  };
  var LoadingDots_default = LoadingDots;

  // src/mito/components/elements/Toggle.tsx
  init_react();
  var Toggle = (props) => {
    const disabled = props.disabled === true;
    const className = props.className !== void 0 ? props.className : "";
    return /* @__PURE__ */ react_default.createElement(
      "label",
      {
        className: classNames("toggle-label", className),
        style: props.height ? { "--toggle-height": props.height } : {},
        title: props.title
      },
      /* @__PURE__ */ react_default.createElement(
        "input",
        {
          type: "checkbox",
          checked: props.value,
          onClick: () => {
            if (disabled) {
              return;
            }
            props.onChange();
          },
          onChange: () => {
          }
        }
      ),
      /* @__PURE__ */ react_default.createElement("div", { className: classNames("toggle", { "toggle-disabled": disabled }) })
    );
  };
  var Toggle_default = Toggle;

  // src/mito/components/elements/Input.tsx
  init_react();

  // src/mito/utils/text.tsx
  function getTextWidth(text, font) {
    const canvas = getTextWidth.canvas || (getTextWidth.canvas = document.createElement("canvas"));
    const context = canvas.getContext("2d");
    if (!context) {
      throw new Error("Could not get context from canvas");
    }
    context.font = font;
    const metrics = context.measureText(text);
    return metrics.width;
  }

  // src/mito/components/elements/Input.tsx
  var MAX_INPUT_WIDTH = 500;
  var getInputWidth = (value, defaultInputWidth) => {
    const textWidth = getTextWidth(value, "11px system-ui") + 10;
    return Math.min(Math.max(defaultInputWidth, textWidth), MAX_INPUT_WIDTH);
  };
  var Input = (props) => {
    const ref = useRef(null);
    const [width, setWidth] = useState(props.width);
    const widthWithDefault = width || "block";
    const autoFocus = props.autoFocus || false;
    const widthClass = `element-width-${widthWithDefault}`;
    const paddingRight = props.rightText !== void 0 ? props.rightText.length * 6 + 10 : void 0;
    useEffect(() => {
      var _a;
      if (autoFocus) {
        (_a = ref.current) == null ? void 0 : _a.focus();
      }
    }, []);
    return /* @__PURE__ */ react_default.createElement("div", { className: "mito-input-container" }, /* @__PURE__ */ react_default.createElement(
      "input",
      {
        id: props.id,
        className: classNames("mito-input", "text-body-2", widthClass, props.className),
        style: __spreadValues({ paddingRight }, props.style),
        value: props.value,
        placeholder: props.placeholder,
        onKeyDown: (e) => {
          if (props.onKeyDown) {
            props.onKeyDown(e);
          }
          if (props.onEscape && e.key == "Escape") {
            props.onEscape();
          }
        },
        onKeyUp: props.onKeyUp,
        onKeyPress: props.onKeyPress,
        onChange: props.onChange,
        onClick: props.onClick,
        onDoubleClick: props.onDoubleClick,
        autoFocus: props.autoFocus,
        required: props.required,
        disabled: props.disabled,
        type: props.type,
        ref,
        onFocus: (e) => {
          if (props.onFocus !== void 0) {
            props.onFocus(e);
          }
          if (props.widthOnFocus !== void 0) {
            setWidth(props.widthOnFocus);
          }
          if (props.selectTextOnFocus) {
            setTimeout(() => {
              e.target.select();
            }, 50);
          }
        },
        onBlur: (e) => {
          if (props.onBlur !== void 0) {
            props.onBlur(e);
          }
          setWidth(props.width);
        }
      }
    ), props.rightText && /* @__PURE__ */ react_default.createElement("div", { className: "mito-input-right-text" }, props.rightText));
  };
  var Input_default = Input;

  // src/mito/components/endo/celleditor/CellEditorDropdown.tsx
  var FORMULA_DOC_LINK = "https://docs.trymito.io/how-to/interacting-with-your-data/mito-spreadsheet-formulas";
  var MAX_SUGGESTIONS = 4;
  var getDisplayedDropdownType = (sheetDataArray, sheetIndex, editorState, selectionStart, cellEditorError, loading, analysisData) => {
    const fullFormula = getFullFormula(editorState, sheetDataArray, sheetIndex);
    const sheetData = sheetDataArray[editorState.sheetIndex];
    const endsInReference = getFormulaEndsInReference(fullFormula, sheetData);
    const [suggestedColumnHeadersReplacementLength, suggestedColumnHeaders] = getSuggestedColumnHeaders(editorState.formula, sheetData);
    const [suggestedFunctionsReplacementLength, suggestedFunctions] = getSuggestedFunctions(editorState.formula, suggestedColumnHeadersReplacementLength, analysisData);
    const documentationFunction = getDocumentationFunction(fullFormula, selectionStart, analysisData);
    if (cellEditorError !== void 0) {
      return {
        "type": "error",
        "error": cellEditorError
      };
    } else if (loading) {
      return {
        "type": "loading"
      };
    } else if (!endsInReference && (suggestedColumnHeaders.length > 0 || suggestedFunctions.length > 0)) {
      return {
        "type": "suggestions",
        "suggestedColumnHeaders": suggestedColumnHeaders,
        "suggestedColumnHeadersReplacementLength": suggestedColumnHeadersReplacementLength,
        "suggestedFunctions": suggestedFunctions,
        "suggestedFunctionsReplacementLength": suggestedFunctionsReplacementLength
      };
    } else if (documentationFunction !== void 0) {
      return {
        "type": "documentation",
        "documentationFunction": documentationFunction
      };
    }
    return void 0;
  };
  var CellEditorDropdown = (props) => {
    var _a;
    const sheetData = props.sheetDataArray[props.sheetIndex];
    const { columnID, columnHeader, indexLabel } = getCellDataFromCellIndexes(sheetData, props.editorState.rowIndex, props.editorState.columnIndex);
    if (columnID === void 0 || columnHeader === void 0 || indexLabel === void 0) {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
    }
    const displayedDropdownType = props.displayedDropdownType;
    const formula = getFullFormula(props.editorState, props.sheetDataArray, props.sheetIndex);
    const cellEditorWidth = props.editorState.editorLocation === "cell" ? getInputWidth(formula, CELL_EDITOR_DEFAULT_WIDTH) : CELL_EDITOR_DEFAULT_WIDTH;
    return /* @__PURE__ */ react_default.createElement("div", { className: "cell-editor-dropdown-box", style: { width: `${cellEditorWidth}px` } }, (displayedDropdownType == null ? void 0 : displayedDropdownType.type) !== "error" && props.editorState.rowIndex != -1 && /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", className: "cell-editor-label" }, /* @__PURE__ */ react_default.createElement("p", { className: classNames("text-subtext-1", "pl-5px", "mt-2px"), title: props.editorState.editingMode === "entire_column" ? "You are currently editing the entire column. Setting a formula will change all values in the column." : "You are currently editing a specific cell. Changing this value will only effect this cell." }, "Edit entire column"), /* @__PURE__ */ react_default.createElement(
      Toggle_default,
      {
        className: "mr-5px",
        value: props.editorState.editingMode === "entire_column" ? true : false,
        onChange: () => {
          props.setEditorState((prevEditorState) => {
            if (prevEditorState === void 0) {
              return void 0;
            }
            const prevEditingMode = __spreadValues({}, prevEditorState).editingMode;
            return __spreadProps(__spreadValues({}, prevEditorState), {
              editingMode: prevEditingMode === "entire_column" ? "specific_index_labels" : "entire_column"
            });
          });
        },
        height: "20px"
      }
    )), (displayedDropdownType == null ? void 0 : displayedDropdownType.type) !== "error" && props.editorState.rowIndex == -1 && /* @__PURE__ */ react_default.createElement("p", { className: classNames("text-subtext-1", "pl-5px", "mt-2px"), title: "You are currently editing the column header." }, "Edit column header"), (displayedDropdownType == null ? void 0 : displayedDropdownType.type) === "error" && /* @__PURE__ */ react_default.createElement("div", { className: "cell-editor-error-container pl-10px pr-5px pt-5px pb-5px" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1 text-color-error" }, displayedDropdownType.error), /* @__PURE__ */ react_default.createElement("p", { className: "text-subtext-1" }, "Press Escape to close the cell editor.")), (displayedDropdownType == null ? void 0 : displayedDropdownType.type) === "loading" && /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2 pl-5px" }, "Processing", /* @__PURE__ */ react_default.createElement(LoadingDots_default, null)), (displayedDropdownType == null ? void 0 : displayedDropdownType.type) === "suggestions" && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, displayedDropdownType.suggestedColumnHeaders.concat(displayedDropdownType.suggestedFunctions).map(([suggestion, subtext], idx) => {
      if (idx > MAX_SUGGESTIONS) {
        return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
      }
      const selected = idx === props.selectedSuggestionIndex;
      const suggestionClassNames = classNames("cell-editor-suggestion", "text-body-2", {
        "cell-editor-suggestion-selected": selected
      });
      return /* @__PURE__ */ react_default.createElement(
        "div",
        {
          onMouseEnter: () => props.setSavedSelectedSuggestionIndex(idx),
          onClick: () => {
            props.takeSuggestion(idx);
          },
          className: suggestionClassNames,
          key: suggestion
        },
        /* @__PURE__ */ react_default.createElement("span", { className: "text-overflow-hide", title: suggestion }, suggestion),
        selected && /* @__PURE__ */ react_default.createElement("p", { className: classNames("cell-editor-suggestion-subtext", "text-subtext-1") }, subtext)
      );
    })), (displayedDropdownType == null ? void 0 : displayedDropdownType.type) === "documentation" && /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement("div", { className: "cell-editor-function-documentation-header pt-5px pb-10px pl-10px pr-10px" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2" }, displayedDropdownType.documentationFunction.syntax), /* @__PURE__ */ react_default.createElement("p", { className: "cell-editor-function-documentation-body text-subtext-1" }, displayedDropdownType.documentationFunction.description)), displayedDropdownType.documentationFunction.examples && /* @__PURE__ */ react_default.createElement("div", { className: "pt-5px pb-10px pr-10px pl-10px" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-subtext-1" }, "Examples"), (_a = displayedDropdownType.documentationFunction.examples) == null ? void 0 : _a.map((example, index) => {
      return /* @__PURE__ */ react_default.createElement(
        "p",
        {
          key: index,
          className: "cell-editor-function-documentation-example"
        },
        example
      );
    }))), /* @__PURE__ */ react_default.createElement(
      "a",
      {
        className: classNames("text-body-2", "text-body-2-link", "cell-editor-dropdown-link"),
        target: "_blank",
        rel: "noreferrer",
        href: FORMULA_DOC_LINK
      },
      "See all formulas"
    ));
  };
  var CellEditorDropdown_default = CellEditorDropdown;

  // src/mito/components/endo/celleditor/CellEditor.tsx
  var CELL_EDITOR_DEFAULT_WIDTH = 250;
  var getDefaultTextAreaHeight = (formula) => {
    const numNewLines = formula.split("\n").length;
    if (numNewLines <= 2) {
      return 18;
    }
    return 9 * numNewLines;
  };
  var CellEditor = (props) => {
    var _a;
    const fullFormula = getFullFormula(props.editorState, props.sheetDataArray, props.sheetIndex);
    const sheetData = props.sheetDataArray[props.editorState.sheetIndex];
    const cellEditorInputRef = useRef(null);
    const [selectedSuggestionIndex, setSavedSelectedSuggestionIndex] = useState(-1);
    const [loading, setLoading] = useState(false);
    const [cellEditorError, setCellEditorError] = useState(void 0);
    const [selectionRangeToSet, setSelectionRangeToSet] = useState(void 0);
    const [textAreaHeight, setTextAreaHeight] = useState(() => getDefaultTextAreaHeight(fullFormula));
    const { columnID, columnHeader, indexLabel } = getCellDataFromCellIndexes(sheetData, props.editorState.rowIndex, props.editorState.columnIndex);
    const setRef = useCallback((unsavedInputAnchor) => {
      if (unsavedInputAnchor !== null) {
        cellEditorInputRef.current = unsavedInputAnchor;
        setTimeout(() => {
          const current = cellEditorInputRef.current;
          current == null ? void 0 : current.focus();
          current == null ? void 0 : current.setSelectionRange(current == null ? void 0 : current.value.length, current == null ? void 0 : current.value.length);
        }, 50);
      }
    }, []);
    useEffect(() => {
      setTimeout(() => {
        var _a2, _b;
        (_a2 = cellEditorInputRef.current) == null ? void 0 : _a2.focus();
        if (props.editorState.pendingSelections !== void 0) {
          const index = props.editorState.pendingSelections.inputSelectionStart + getSelectionFormulaString(props.editorState.pendingSelections.selections, props.sheetDataArray[props.sheetIndex], props.editorState.sheetIndex).length;
          (_b = cellEditorInputRef.current) == null ? void 0 : _b.setSelectionRange(
            index,
            index
          );
        }
      });
    }, [props.editorState.pendingSelections]);
    useEffect(() => {
      var _a2;
      if (selectionRangeToSet !== void 0) {
        (_a2 = cellEditorInputRef.current) == null ? void 0 : _a2.setSelectionRange(
          selectionRangeToSet,
          selectionRangeToSet
        );
        setSelectionRangeToSet(void 0);
      }
    }, [props.editorState.formula]);
    useEffect(() => {
      props.setEditorState((prevEditingState) => {
        if (prevEditingState === void 0) {
          return prevEditingState;
        }
        const startingColumnFormula = getStartingFormula(sheetData, prevEditingState, props.editorState.rowIndex, props.editorState.columnIndex, props.analysisData.defaultApplyFormulaToColumn).startingColumnFormula;
        return __spreadProps(__spreadValues({}, prevEditingState), {
          formula: startingColumnFormula
        });
      });
    }, [props.editorState.editingMode]);
    useEffectOnResizeElement(() => {
      var _a2;
      const newHeightString = (_a2 = cellEditorInputRef.current) == null ? void 0 : _a2.style.height;
      const newHeight = parseInt((newHeightString == null ? void 0 : newHeightString.substring(0, newHeightString.length - 2)) || "18");
      setTextAreaHeight(newHeight);
    }, [], props.mitoContainerRef, "#cell-editor-input");
    if (columnID === void 0 || columnHeader === void 0) {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
    }
    const displayedDropdownType = getDisplayedDropdownType(
      props.sheetDataArray,
      props.editorState.sheetIndex,
      props.editorState,
      (_a = cellEditorInputRef.current) == null ? void 0 : _a.selectionStart,
      cellEditorError,
      loading,
      props.analysisData
    );
    const closeCellEditor = () => {
      props.setGridState((gridState) => {
        return __spreadProps(__spreadValues({}, gridState), {
          selection: [{
            startingRowIndex: props.editorState.rowIndex,
            endingRowIndex: props.editorState.rowIndex,
            startingColumnIndex: props.editorState.columnIndex,
            endingColumnIndex: props.editorState.columnIndex
          }]
        });
      });
      props.setEditorState(void 0);
      ensureCellVisible(
        props.containerRef.current,
        props.scrollAndRenderedContainerRef.current,
        props.currentSheetView,
        props.gridState,
        props.editorState.rowIndex,
        props.editorState.columnIndex
      );
      setTimeout(() => focusGrid(props.containerRef.current), 100);
    };
    const takeSuggestion = (suggestionIndex) => {
      var _a2;
      if ((displayedDropdownType == null ? void 0 : displayedDropdownType.type) !== "suggestions" || suggestionIndex < 0) {
        return;
      }
      let suggestionReplacementLength = 0;
      let suggestion = "";
      let isColumnHeaderSuggestion = true;
      if (suggestionIndex < displayedDropdownType.suggestedColumnHeaders.length) {
        suggestionReplacementLength = displayedDropdownType.suggestedColumnHeadersReplacementLength;
        suggestion = displayedDropdownType.suggestedColumnHeaders[suggestionIndex][0];
      } else {
        suggestionReplacementLength = displayedDropdownType.suggestedFunctionsReplacementLength;
        suggestion = displayedDropdownType.suggestedFunctions[suggestionIndex - displayedDropdownType.suggestedColumnHeaders.length][0] + "(";
        isColumnHeaderSuggestion = false;
      }
      let newFormula = fullFormula.substr(0, fullFormula.length - suggestionReplacementLength);
      newFormula += suggestion;
      if (isColumnHeaderSuggestion && indexLabel !== void 0) {
        newFormula += getDisplayColumnHeader(indexLabel);
      }
      props.setEditorState(__spreadProps(__spreadValues({}, props.editorState), {
        formula: newFormula,
        pendingSelections: void 0,
        arrowKeysScrollInFormula: props.editorState.editorLocation === "formula bar" ? true : false
      }));
      (_a2 = cellEditorInputRef.current) == null ? void 0 : _a2.setSelectionRange(
        newFormula.length,
        newFormula.length
      );
    };
    const onKeyDown = (e) => {
      e.stopPropagation();
      e.persist();
      setCellEditorError(void 0);
      if (KEYS_TO_IGNORE_IF_PRESSED_ALONE.includes(e.key)) {
        return;
      }
      const altPressed = e.altKey;
      const arrowKeysScrollInFormula = props.editorState.arrowKeysScrollInFormula === true;
      if (isNavigationKeyPressed(e.key) && !altPressed) {
        const arrowUp = e.key === "Up" || e.key === "ArrowUp";
        const arrowDown = e.key === "Down" || e.key === "ArrowDown";
        if ((arrowUp || arrowDown) && (displayedDropdownType == null ? void 0 : displayedDropdownType.type) === "suggestions") {
          e.preventDefault();
          if (arrowUp) {
            setSavedSelectedSuggestionIndex((suggestionIndex) => Math.max(suggestionIndex - 1, -1));
          } else if (arrowDown) {
            setSavedSelectedSuggestionIndex((suggestionIndex) => Math.min(suggestionIndex + 1, displayedDropdownType.suggestedColumnHeaders.length + displayedDropdownType.suggestedFunctions.length - 1, MAX_SUGGESTIONS));
          }
          props.setEditorState((prevEditorState) => {
            if (prevEditorState === void 0)
              return void 0;
            return __spreadProps(__spreadValues({}, prevEditorState), {
              arrowKeysScrollInFormula: true
            });
          });
        } else if (e.key === "Tab") {
          e.preventDefault();
          takeSuggestion(selectedSuggestionIndex);
        } else if (!arrowKeysScrollInFormula) {
          e.preventDefault();
          props.setGridState((gridState) => {
            var _a2, _b, _c, _d;
            const newSelection = getNewSelectionAfterKeyPress(gridState.selections[gridState.selections.length - 1], e, sheetData);
            const newInputSelectionStart = firstNonNullOrUndefined(
              (_a2 = props.editorState.pendingSelections) == null ? void 0 : _a2.inputSelectionStart,
              (_b = cellEditorInputRef.current) == null ? void 0 : _b.selectionStart,
              0
            );
            const newInputSelectionEnd = firstNonNullOrUndefined(
              (_c = props.editorState.pendingSelections) == null ? void 0 : _c.inputSelectionEnd,
              (_d = cellEditorInputRef.current) == null ? void 0 : _d.selectionEnd,
              0
            );
            props.setEditorState(__spreadProps(__spreadValues({}, props.editorState), {
              pendingSelections: {
                selections: [newSelection],
                inputSelectionStart: newInputSelectionStart,
                inputSelectionEnd: newInputSelectionEnd
              }
            }));
            ensureCellVisible(
              props.containerRef.current,
              props.scrollAndRenderedContainerRef.current,
              props.currentSheetView,
              props.gridState,
              newSelection.endingRowIndex,
              newSelection.endingColumnIndex
            );
            return __spreadProps(__spreadValues({}, gridState), {
              selections: [newSelection]
            });
          });
        } else {
          props.setEditorState((prevEditorState) => {
            if (prevEditorState === void 0)
              return void 0;
            return __spreadValues({}, prevEditorState);
          });
        }
      } else if (e.key === "Escape") {
        e.preventDefault();
        closeCellEditor();
      } else if (e.key !== "Enter") {
        setSavedSelectedSuggestionIndex(-1);
        props.setGridState((gridState) => {
          return __spreadProps(__spreadValues({}, gridState), {
            selections: [{
              startingRowIndex: props.editorState.rowIndex,
              endingRowIndex: props.editorState.rowIndex,
              startingColumnIndex: props.editorState.columnIndex,
              endingColumnIndex: props.editorState.columnIndex,
              sheetIndex: props.sheetIndex
            }]
          });
        });
        ensureCellVisible(
          props.containerRef.current,
          props.scrollAndRenderedContainerRef.current,
          props.currentSheetView,
          props.gridState,
          props.editorState.rowIndex,
          props.editorState.columnIndex
        );
        const fullFormula2 = getFullFormula(props.editorState, props.sheetDataArray, props.sheetIndex);
        props.setEditorState(__spreadProps(__spreadValues({}, props.editorState), {
          formula: fullFormula2,
          pendingSelections: void 0
        }));
      }
    };
    const onChange = (e) => {
      const CHARS_TO_REMOVE_SCROLL_IN_FORMULA = [
        " ",
        ",",
        "(",
        ")",
        "-",
        "+",
        "*",
        "/",
        "=",
        ":"
      ];
      let arrowKeysScrollInFormula = true;
      if (props.editorState.editorLocation === "cell") {
        const atEndOfFormula = (e.target.selectionStart || 0) >= e.target.value.length;
        const finalChar = e.target.value.substring(e.target.value.length - 1);
        const endsInResetCharacter = atEndOfFormula && CHARS_TO_REMOVE_SCROLL_IN_FORMULA.includes(finalChar);
        const isEmpty = e.target.value.length === 0;
        arrowKeysScrollInFormula = props.editorState.arrowKeysScrollInFormula !== void 0 && !endsInResetCharacter && !isEmpty;
      }
      props.setEditorState(__spreadProps(__spreadValues({}, props.editorState), {
        formula: e.target.value,
        arrowKeysScrollInFormula
      }));
    };
    const onClick = () => {
      props.setEditorState(__spreadProps(__spreadValues({}, props.editorState), {
        arrowKeysScrollInFormula: true
      }));
    };
    const addSpacingCharacter = (char) => {
      var _a2;
      let selectionStart = (_a2 = cellEditorInputRef.current) == null ? void 0 : _a2.selectionStart;
      selectionStart = selectionStart === null || selectionStart === void 0 ? 0 : selectionStart;
      const newFormula = fullFormula.substring(0, selectionStart) + char + fullFormula.substring(selectionStart);
      props.setEditorState((prevEditingState) => {
        if (prevEditingState === void 0) {
          return void 0;
        }
        return __spreadProps(__spreadValues({}, prevEditingState), {
          formula: newFormula
        });
      });
      setSelectionRangeToSet(selectionStart + 1);
      if (char === "\n") {
        setTextAreaHeight((prevHeight) => prevHeight += 11);
      }
    };
    const onSubmit = (e) => __async(void 0, null, function* () {
      e.preventDefault();
      if (props.sheetIndex !== props.editorState.sheetIndex) {
        props.setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            selectedSheetIndex: props.editorState.sheetIndex
          });
        });
      }
      if (selectedSuggestionIndex !== -1) {
        takeSuggestion(selectedSuggestionIndex);
        setSavedSelectedSuggestionIndex(-1);
        return;
      }
      const editorSheetData = props.sheetDataArray[props.editorState.sheetIndex];
      const columnID2 = editorSheetData.data[props.editorState.columnIndex].columnID;
      const columnHeader2 = editorSheetData.data[props.editorState.columnIndex].columnHeader;
      const formula = getFullFormula(props.editorState, props.sheetDataArray, props.sheetIndex);
      const formulaLabel = editorSheetData.index[props.editorState.rowIndex];
      setLoading(true);
      let errorMessage = void 0;
      if (props.editorState.rowIndex == -1) {
        const finalColumnHeader = getColumnHeaderParts(columnHeader2).finalColumnHeader;
        submitRenameColumnHeader(columnHeader2, finalColumnHeader, columnID2, props.sheetIndex, props.editorState, props.setUIState, props.mitoAPI);
      } else {
        const index_labels_formula_is_applied_to = props.editorState.editingMode === "specific_index_labels" && indexLabel != void 0 ? { "type": "specific_index_labels", "index_labels": [indexLabel] } : { "type": "entire_column" };
        errorMessage = yield props.mitoAPI.editSetColumnFormula(
          props.editorState.sheetIndex,
          columnID2,
          formulaLabel,
          formula,
          index_labels_formula_is_applied_to,
          props.editorState.editorLocation
        );
      }
      setLoading(false);
      if (errorMessage !== void 0 && "error" in errorMessage) {
        setCellEditorError(errorMessage.error);
      } else {
        closeCellEditor();
        props.closeOpenEditingPopups();
      }
    });
    return /* @__PURE__ */ react_default.createElement("div", { className: "cell-editor" }, /* @__PURE__ */ react_default.createElement(
      "form",
      {
        className: "cell-editor-form",
        onSubmit,
        autoComplete: "off"
      },
      props.editorState.editorLocation === "cell" && /* @__PURE__ */ react_default.createElement(
        "input",
        {
          ref: setRef,
          id: "cell-editor-input",
          className: "cell-editor-input",
          onClick,
          value: fullFormula.replace(/\t/g, ""),
          onKeyDown,
          onChange,
          autoComplete: "off"
        }
      ),
      props.editorState.editorLocation === "formula bar" && /* @__PURE__ */ react_default.createElement(
        "textarea",
        {
          ref: setRef,
          id: "cell-editor-input",
          className: "cell-editor-input",
          style: { "resize": "none", "maxHeight": `${textAreaHeight}px`, "height": `${textAreaHeight}px`, "marginTop": 0 },
          onClick,
          value: fullFormula,
          autoComplete: "off",
          spellCheck: "false",
          onKeyUp: (e) => {
            if (e.key == "Enter" && e.shiftKey) {
              addSpacingCharacter("\n");
              return;
            }
          },
          onKeyDown: (e) => {
            if (e.key === "Enter") {
              if (!e.metaKey) {
                e.preventDefault();
                void onSubmit(e);
                return;
              } else {
                addSpacingCharacter("\n");
                return;
              }
            }
            if (e.key === "Tab") {
              e.preventDefault();
              if (selectedSuggestionIndex !== -1) {
                takeSuggestion(selectedSuggestionIndex);
                setSavedSelectedSuggestionIndex(-1);
              } else {
                addSpacingCharacter("	");
                return;
              }
            }
            if ((displayedDropdownType == null ? void 0 : displayedDropdownType.type) === "suggestions" && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
              e.preventDefault();
            }
            onKeyDown(e);
          },
          onChange
        }
      )
    ), /* @__PURE__ */ react_default.createElement(
      CellEditorDropdown_default,
      {
        sheetDataArray: props.sheetDataArray,
        sheetIndex: props.sheetIndex,
        editorState: props.editorState,
        setEditorState: props.setEditorState,
        cellEditorInputRef,
        selectedSuggestionIndex,
        setSavedSelectedSuggestionIndex,
        takeSuggestion,
        displayedDropdownType
      }
    ));
  };
  var CellEditor_default = CellEditor;

  // src/mito/components/endo/FormulaBar.tsx
  var FormulaBar = (props) => {
    var _a, _b, _c, _d;
    const rowIndex = props.selection.startingRowIndex;
    const colIndex = props.selection.startingColumnIndex;
    const sheetData = props.sheetDataArray[(_b = (_a = props.editorState) == null ? void 0 : _a.sheetIndex) != null ? _b : props.sheetIndex];
    const { columnHeader, columnFormula, cellValue, columnFormulaLocation } = getCellDataFromCellIndexes(sheetData, rowIndex, colIndex);
    const originalFormulaBarValue = "" + (columnFormula !== void 0 && columnFormula !== "" ? columnFormula : cellValue !== void 0 ? cellValue : "");
    const cellEditingCellData = props.editorState === void 0 ? void 0 : getCellDataFromCellIndexes(sheetData, props.editorState.rowIndex, props.editorState.columnIndex);
    const formulaBarColumnHeader = props.editorState === void 0 ? columnHeader : cellEditingCellData == null ? void 0 : cellEditingCellData.columnHeader;
    let formulaBarValue = "";
    if (props.editorState === void 0) {
      if (rowIndex == -1 && columnHeader !== void 0) {
        formulaBarValue = getDisplayColumnHeader(columnHeader);
      } else {
        formulaBarValue = originalFormulaBarValue;
      }
    } else {
      formulaBarValue = getFullFormula(props.editorState, props.sheetDataArray, props.sheetIndex);
    }
    const currentSheetView = calculateCurrentSheetView(props.gridState);
    return /* @__PURE__ */ react_default.createElement(
      Row_default,
      {
        align: "center",
        suppressTopBottomMargin: true,
        className: "formula-bar"
      },
      /* @__PURE__ */ react_default.createElement(Col_default, { offset: 0.5 }, /* @__PURE__ */ react_default.createElement("p", { className: "formula-bar-column-header text-header-3 text-overflow-hide" }, formulaBarColumnHeader)),
      /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("div", { className: "formula-bar-vertical-line" })),
      /* @__PURE__ */ react_default.createElement(Col_default, { flex: "1" }, ((_c = props.editorState) == null ? void 0 : _c.editorLocation) === "formula bar" && /* @__PURE__ */ react_default.createElement(
        CellEditor_default,
        {
          sheetDataArray: props.sheetDataArray,
          sheetIndex: props.sheetIndex,
          gridState: props.gridState,
          editorState: props.editorState,
          setEditorState: props.setEditorState,
          setGridState: props.setGridState,
          setUIState: props.setUIState,
          scrollAndRenderedContainerRef: props.scrollAndRenderedContainerRef,
          containerRef: props.containerRef,
          mitoAPI: props.mitoAPI,
          currentSheetView,
          closeOpenEditingPopups: props.closeOpenEditingPopups,
          analysisData: props.analysisData,
          mitoContainerRef: props.mitoContainerRef
        }
      ), ((_d = props.editorState) == null ? void 0 : _d.editorLocation) !== "formula bar" && /* @__PURE__ */ react_default.createElement(
        "div",
        {
          className: "formula-bar-formula text-header-3 text-overflow-hide element-width-block",
          onClick: () => {
            if (props.editorState === void 0) {
              props.setEditorState({
                rowIndex,
                columnIndex: colIndex,
                formula: formulaBarValue,
                arrowKeysScrollInFormula: true,
                editorLocation: "formula bar",
                editingMode: columnFormulaLocation || getDefaultEditingMode(props.analysisData.defaultApplyFormulaToColumn),
                sheetIndex: props.sheetIndex
              });
            } else {
              props.setEditorState(__spreadProps(__spreadValues({}, props.editorState), {
                editorLocation: "formula bar"
              }));
            }
          }
        },
        formulaBarValue
      ))
    );
  };
  var FormulaBar_default = FormulaBar;

  // src/mito/components/endo/ColumnHeaders.tsx
  init_react();

  // src/mito/components/endo/ColumnHeader.tsx
  init_react();

  // src/mito/components/icons/FilterIcons.tsx
  init_react();
  var FilterIcon = (props) => {
    if (props.nonEmpty) {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M12.681 1H1.31902C1.0608 1 0.90821 1.31983 1.0608 1.55011L5.72061 8.58635V13L8.27939 11.8614V8.6887L12.9392 1.55011C13.0918 1.30704 12.9392 1 12.681 1Z", fill: "var(--mito-highlight)", stroke: "var(--mito-highlight)", strokeMiterlimit: "10", strokeLinecap: "round" }));
    }
    if (props.sortIncluded) {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "25", height: "19", viewBox: "0 0 25 19", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M23.1215 2.07031H7.97224C7.62794 2.07031 7.42449 2.38755 7.62794 2.61596L13.841 9.59515V17.0703H17.2527V9.69667L23.4658 2.61596C23.6693 2.37486 23.4658 2.07031 23.1215 2.07031Z", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M3.73242 1.59082L1.78906 8.07031H0.871094L3.16113 0.960938H3.7373L3.73242 1.59082ZM5.30469 8.07031L3.36133 1.59082L3.35156 0.960938H3.93262L6.22266 8.07031H5.30469ZM5.30469 5.43848V6.20996H1.87695V5.43848H5.30469Z", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5.73926 16.3037V17.0703H1.7207V16.3037H5.73926ZM5.6123 10.6445L1.93066 17.0703H1.37891V16.3672L5.05566 9.96094H5.6123V10.6445ZM5.23145 9.96094V10.7324H1.4082V9.96094H5.23145Z", fill: "var(--mito-text)" }));
    } else {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M12.681 1H1.31902C1.0608 1 0.90821 1.31983 1.0608 1.55011L5.72061 8.58635V13L8.27939 11.8614V8.6887L12.9392 1.55011C13.0918 1.30704 12.9392 1 12.681 1Z", stroke: "var(--mito-text)", strokeWidth: "0.9909", strokeMiterlimit: "10", strokeLinecap: "round" }));
    }
  };

  // src/mito/components/taskpanes/ControlPanel/ControlPanelTaskpane.tsx
  init_react();

  // src/mito/components/taskpanes/Graph/graphUtils.tsx
  init_react();

  // src/mito/utils/arrays.tsx
  function intersection(array1, array2) {
    const finalArray = [];
    array1.forEach((element) => {
      if (array2.indexOf(element) >= 0) {
        finalArray.push(element);
      }
    });
    return finalArray;
  }
  function toggleInArray(array, value) {
    const index = array.indexOf(value);
    if (index === -1) {
      array.push(value);
    } else {
      array.splice(index, 1);
    }
    return array;
  }

  // src/mito/utils/numbers.tsx
  var isOnlyNumberString = (possibleNumber) => {
    return /^\d+\.?\d*$/.test(possibleNumber);
  };
  var isNum = (possibleNumber) => {
    return !isNaN(Number(possibleNumber));
  };
  var convertStringToFloatOrUndefined = (possibleNumber) => {
    return possibleNumber !== void 0 && isNum(possibleNumber) ? parseFloat(possibleNumber) : void 0;
  };

  // src/mito/utils/strings.tsx
  var fuzzyMatch = (stringOne, stringTwo) => {
    stringOne = stringOne.toLowerCase();
    stringTwo = stringTwo.toLowerCase();
    if (stringOne.includes(stringTwo)) {
      return 1;
    }
    const possibleTypos = [
      stringTwo,
      stringTwo.replace(" ", "-"),
      stringTwo.replace(" ", "_"),
      stringTwo.replace(" ", "."),
      stringTwo.replace(" ", ""),
      stringTwo.replace("_", " "),
      stringTwo.replace("-", " "),
      stringTwo.replace(".", " ")
    ];
    const stringOneIgnoredCharacters = [
      stringOne,
      stringOne.replace(",", "")
    ];
    for (let i = 0; i < possibleTypos.length; i++) {
      for (let j = 0; j < stringOneIgnoredCharacters.length; j++) {
        if (stringOneIgnoredCharacters[j].includes(possibleTypos[i])) {
          return 1;
        }
      }
    }
    return 0;
  };
  var convertToStringOrUndefined = (possibleString) => {
    return possibleString !== void 0 ? possibleString.toString() : void 0;
  };
  function capitalizeFirstLetter(s) {
    return s.charAt(0).toUpperCase() + s.slice(1);
  }
  function toTitleCase(s) {
    return s.split(" ").map(capitalizeFirstLetter).join(" ");
  }

  // src/mito/components/elements/DropdownItem.tsx
  init_react();

  // node_modules/fscreen/dist/fscreen.esm.js
  var key = {
    fullscreenEnabled: 0,
    fullscreenElement: 1,
    requestFullscreen: 2,
    exitFullscreen: 3,
    fullscreenchange: 4,
    fullscreenerror: 5,
    fullscreen: 6
  };
  var webkit = [
    "webkitFullscreenEnabled",
    "webkitFullscreenElement",
    "webkitRequestFullscreen",
    "webkitExitFullscreen",
    "webkitfullscreenchange",
    "webkitfullscreenerror",
    "-webkit-full-screen"
  ];
  var moz = [
    "mozFullScreenEnabled",
    "mozFullScreenElement",
    "mozRequestFullScreen",
    "mozCancelFullScreen",
    "mozfullscreenchange",
    "mozfullscreenerror",
    "-moz-full-screen"
  ];
  var ms = [
    "msFullscreenEnabled",
    "msFullscreenElement",
    "msRequestFullscreen",
    "msExitFullscreen",
    "MSFullscreenChange",
    "MSFullscreenError",
    "-ms-fullscreen"
  ];
  var document2 = typeof window !== "undefined" && typeof window.document !== "undefined" ? window.document : {};
  var vendor = "fullscreenEnabled" in document2 && Object.keys(key) || webkit[0] in document2 && webkit || moz[0] in document2 && moz || ms[0] in document2 && ms || [];
  var fscreen = {
    requestFullscreen: function(element) {
      return element[vendor[key.requestFullscreen]]();
    },
    requestFullscreenFunction: function(element) {
      return element[vendor[key.requestFullscreen]];
    },
    get exitFullscreen() {
      return document2[vendor[key.exitFullscreen]].bind(document2);
    },
    get fullscreenPseudoClass() {
      return ":" + vendor[key.fullscreen];
    },
    addEventListener: function(type, handler, options) {
      return document2.addEventListener(vendor[key[type]], handler, options);
    },
    removeEventListener: function(type, handler, options) {
      return document2.removeEventListener(vendor[key[type]], handler, options);
    },
    get fullscreenEnabled() {
      return Boolean(document2[vendor[key.fullscreenEnabled]]);
    },
    set fullscreenEnabled(val) {
    },
    get fullscreenElement() {
      return document2[vendor[key.fullscreenElement]];
    },
    set fullscreenElement(val) {
    },
    get onfullscreenchange() {
      return document2[("on" + vendor[key.fullscreenchange]).toLowerCase()];
    },
    set onfullscreenchange(handler) {
      return document2[("on" + vendor[key.fullscreenchange]).toLowerCase()] = handler;
    },
    get onfullscreenerror() {
      return document2[("on" + vendor[key.fullscreenerror]).toLowerCase()];
    },
    set onfullscreenerror(handler) {
      return document2[("on" + vendor[key.fullscreenerror]).toLowerCase()] = handler;
    }
  };
  var fscreen_esm_default = fscreen;

  // src/mito/components/elements/Dropdown.tsx
  init_react();
  var import_react_dom = __toESM(require_react_dom());

  // src/mito/hooks/useCallOnAnyClick.tsx
  init_react();
  var clickedOnClass = (targetNode, className) => {
    if (targetNode !== null && targetNode instanceof Node && targetNode.nodeType === Node.ELEMENT_NODE && className !== void 0) {
      let currentElement = targetNode;
      while (currentElement) {
        if (currentElement.classList.contains(className)) {
          return true;
        }
        currentElement = currentElement.parentElement;
      }
    }
    return false;
  };
  function useCallOnAnyClick(onClick, noActionClassName) {
    const handleClick = (event) => {
      const targetNode = event.target;
      if (clickedOnClass(targetNode, noActionClassName)) {
        return;
      }
      setTimeout(() => {
        onClick(targetNode);
      }, 100);
    };
    useEffect(() => {
      document.addEventListener("click", handleClick, true);
      return () => {
        document.removeEventListener("click", handleClick, true);
      };
    });
  }

  // src/mito/components/elements/sizes.d.tsx
  var WIDTH_MAPPING = {
    "small": 100,
    "medium": 170,
    "medium-large": 250,
    "large": 345,
    "block": 345,
    "hug-contents": 345
  };

  // src/mito/components/elements/Dropdown.tsx
  var MAX_HEIGHT = 250;
  var topInBounds = (top) => {
    const windowHeight = window.innerHeight;
    return top + MAX_HEIGHT < windowHeight;
  };
  var leftInBounds = (left, widthPixels) => {
    const widthWidth = window.innerWidth;
    return left + widthPixels < widthWidth;
  };
  var bottomInBounds = (bottom) => {
    return bottom - MAX_HEIGHT > 0;
  };
  var rightInBounds = (right, widthPixels) => {
    return right - widthPixels > 0;
  };
  var DROPDOWN_IGNORE_CLICK_CLASS = "mito-dropdown-ignore-click";
  var DROPDOWN_SUPRESS_FOCUS_ON_CLOSE = "mito-dropdown-suppress-focus-on-close";
  var ensureInView = (container, element, topAdjustment) => {
    const containerTop = container.scrollTop;
    const containerBottom = containerTop + container.clientHeight;
    const elementTop = element.offsetTop;
    const elementBottom = elementTop + element.clientHeight;
    if (elementTop < containerTop + topAdjustment) {
      container.scrollTop -= containerTop - elementTop + topAdjustment;
    } else if (elementBottom > containerBottom) {
      container.scrollTop += elementBottom - containerBottom;
    }
  };
  var handleKeyboardInDropdown = (e, numDropdownItems, setSelectedIndex, onEscape) => {
    const keyUp = e.key === "Up" || e.key === "ArrowUp";
    const keyDown = e.key === "Down" || e.key === "ArrowDown";
    const enterDown = e.key === "Enter";
    const escapeDown = e.key === "Escape";
    const metaKey = e.metaKey;
    if (keyUp || keyDown) {
      e.preventDefault();
      if (keyUp) {
        setSelectedIndex((selectedIndex) => {
          if (metaKey) {
            if (selectedIndex > 0) {
              return 0;
            }
            return -1;
          } else {
            return Math.max(-1, selectedIndex - 1);
          }
        });
      } else {
        setSelectedIndex((selectedIndex) => {
          if (metaKey) {
            return numDropdownItems - 1;
          } else {
            return Math.min(selectedIndex + 1, numDropdownItems - 1);
          }
        });
      }
      setTimeout(() => {
        const dropdownDiv = document.querySelector(".mito-dropdown-items-container");
        const selectedItemDiv = document.querySelector(".mito-dropdown-item-selected");
        if (dropdownDiv !== null && selectedItemDiv !== null) {
          ensureInView(dropdownDiv, selectedItemDiv, 50);
        }
      });
    } else if (enterDown) {
      setTimeout(() => {
        const selectedItemDiv = document.querySelector(".mito-dropdown-item-selected");
        if (selectedItemDiv) {
          selectedItemDiv.click();
        }
      }, 200);
    } else if (escapeDown) {
      onEscape();
    }
  };
  var Dropdown = (props) => {
    const [searchString, setSearchString] = useState("");
    const [selectedIndex, setSelectedIndex] = useState(-1);
    useCallOnAnyClick((eventTarget) => {
      var _a;
      if (!props.display) {
        return;
      }
      props.closeDropdown();
      if (!clickedOnClass(eventTarget, DROPDOWN_SUPRESS_FOCUS_ON_CLOSE)) {
        (_a = dropdownAnchor.current) == null ? void 0 : _a.focus();
      }
    }, DROPDOWN_IGNORE_CLICK_CLASS);
    const [boundingRect, setBoundingRect] = useState({
      top: void 0,
      bottom: void 0,
      right: void 0,
      left: void 0
    });
    const dropdownAnchor = useRef(null);
    const [dropdownContainerElement] = useState(() => {
      return document.createElement("div");
    });
    const [isNotFullscreen, setIsNotFullscreen] = useState(fscreen_esm_default.fullscreenElement === void 0 || fscreen_esm_default.fullscreenElement === null);
    const mitoContainerRef = useRef(null);
    const width = props.width || "large";
    const widthPixels = WIDTH_MAPPING[width];
    useEffect(() => {
      return () => {
        try {
          if (isNotFullscreen) {
            document.body.removeChild(dropdownContainerElement);
          } else {
            if (mitoContainerRef.current) {
              mitoContainerRef.current.removeChild(dropdownContainerElement);
            }
          }
        } catch (e) {
        }
      };
    }, []);
    const setRef = useCallback((unsavedDropdownAnchor) => {
      if (unsavedDropdownAnchor !== null) {
        dropdownAnchor.current = unsavedDropdownAnchor;
        if (isNotFullscreen) {
          document.body.append(dropdownContainerElement);
        } else {
          const mitoContainer = unsavedDropdownAnchor.closest(".mito-container");
          if (mitoContainer) {
            mitoContainer.appendChild(dropdownContainerElement);
            mitoContainerRef.current = mitoContainer;
          }
        }
        updateDropdownPosition(unsavedDropdownAnchor);
      }
    }, []);
    useEffect(() => {
      if (dropdownAnchor.current !== null) {
        updateDropdownPosition(dropdownAnchor.current);
      }
      const interval = setInterval(() => {
        if (dropdownAnchor.current !== null) {
          updateDropdownPosition(dropdownAnchor.current);
        }
      }, 25);
      return () => clearInterval(interval);
    }, [props.display]);
    useEffect(() => {
      const handleChange = () => {
        var _a;
        setIsNotFullscreen(!fscreen_esm_default.fullscreenElement);
        if (!fscreen_esm_default.fullscreenElement) {
          document.body.append(dropdownContainerElement);
        } else {
          const mitoContainer = (_a = dropdownAnchor.current) == null ? void 0 : _a.closest(".mito-container");
          if (mitoContainer) {
            mitoContainer.appendChild(dropdownContainerElement);
            mitoContainerRef.current = mitoContainer;
          }
        }
        if (dropdownAnchor.current) {
          updateDropdownPosition(dropdownAnchor.current);
        }
      };
      fscreen_esm_default.addEventListener("fullscreenchange", handleChange);
      return () => fscreen_esm_default.removeEventListener("fullscreenchange", handleChange);
    }, []);
    const updateDropdownPosition = (dropdownContainer) => {
      const parentElement = dropdownContainer.parentElement || dropdownContainer;
      const parentBoundingClientRect = parentElement.getBoundingClientRect();
      const parentTop = parentBoundingClientRect.top;
      const parentBottom = parentBoundingClientRect.bottom;
      const parentLeft = parentBoundingClientRect.left;
      const parentRight = parentBoundingClientRect.right;
      let newBoundingRect = {
        top: void 0,
        bottom: void 0,
        right: void 0,
        left: void 0
      };
      if (props.position === "vertical" || props.position === void 0) {
        if (topInBounds(parentBottom) && leftInBounds(parentLeft, widthPixels)) {
          newBoundingRect = {
            top: parentBottom,
            bottom: void 0,
            right: void 0,
            left: parentLeft
          };
        } else if (topInBounds(parentBottom) && rightInBounds(parentRight, widthPixels)) {
          newBoundingRect = {
            top: parentBottom,
            bottom: void 0,
            right: window.innerWidth - parentRight,
            left: void 0
          };
        } else if (bottomInBounds(parentTop) && leftInBounds(parentLeft, widthPixels)) {
          newBoundingRect = {
            top: void 0,
            bottom: window.innerHeight - parentTop,
            right: void 0,
            left: parentLeft
          };
        } else {
          newBoundingRect = {
            top: void 0,
            bottom: window.innerHeight - parentTop,
            right: window.innerWidth - parentRight,
            left: void 0
          };
        }
      } else {
        newBoundingRect = {
          top: parentTop,
          bottom: void 0,
          right: void 0,
          left: parentRight
        };
      }
      setBoundingRect((oldBoundingRect) => {
        if (newBoundingRect.top !== oldBoundingRect.top || newBoundingRect.left !== oldBoundingRect.left || newBoundingRect.bottom !== oldBoundingRect.bottom || newBoundingRect.right !== oldBoundingRect.right) {
          return newBoundingRect;
        }
        return oldBoundingRect;
      });
    };
    const dropdownClassNames = classNames("mito-dropdown", `element-width-${width}`, {
      "mito-dropdown-compressed": react_default.Children.count(props.children) > 4,
      "mito-dropdown-search": props.searchable === true,
      "mito-dropdown-streamlit": isInStreamlit(),
      "mito-dropdown-item-vertical": props.layout === "vertical",
      "mito-dropdown-item-horizontal": props.layout === "horizontal" || props.layout === void 0
    });
    let found = 0;
    const childrenToDisplay = react_default.Children.map(props.children, (child) => {
      if (child.props.isDropdownSectionSeperator) {
        return child;
      }
      const title = child.props.title;
      const inSearch = title !== void 0 && fuzzyMatch(title, searchString.toLowerCase()) > 0.8;
      if (inSearch) {
        const selected = found === selectedIndex;
        const finalChild = react_default.cloneElement(child, {
          className: classNames(child.props.className, {
            "mito-dropdown-item-selected": selected
          })
        });
        found += 1;
        return finalChild;
      } else {
        return null;
      }
    });
    return /* @__PURE__ */ react_default.createElement("div", { ref: setRef, tabIndex: 0 }, props.display && import_react_dom.default.createPortal(
      /* @__PURE__ */ react_default.createElement(
        "div",
        {
          className: dropdownClassNames,
          style: __spreadValues({
            position: "fixed",
            top: boundingRect.top,
            bottom: boundingRect.bottom,
            right: boundingRect.right,
            left: boundingRect.left
          }, props.style)
        },
        props.searchable && /* @__PURE__ */ react_default.createElement("div", { className: classNames("mito-dropdown-search-input", DROPDOWN_IGNORE_CLICK_CLASS) }, /* @__PURE__ */ react_default.createElement(
          Input_default,
          {
            value: searchString,
            placeholder: "Search",
            onKeyDown: (e) => {
              e.stopPropagation();
              handleKeyboardInDropdown(e, found, setSelectedIndex, props.closeDropdown);
            },
            onChange: (e) => {
              setSelectedIndex(-1);
              setSearchString(e.target.value);
            },
            autoFocus: true
          }
        )),
        childrenToDisplay.length > 0 && /* @__PURE__ */ react_default.createElement("div", { className: "mito-dropdown-items-container" }, childrenToDisplay),
        found === 0 && /* @__PURE__ */ react_default.createElement(Row_default, { justify: "center", style: { paddingTop: "50px" } }, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2" }, "No options to display"))
      ),
      dropdownContainerElement
    ));
  };
  var Dropdown_default = Dropdown;

  // src/mito/components/icons/RightArrowIcon.tsx
  init_react();
  var RightArrowIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "10", height: "12", viewBox: "0 0 6 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1 10.5L4 5.99576L1 1.5", stroke: "var(--mito-text-medium)", strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var RightArrowIcon_default = RightArrowIcon;

  // src/mito/components/icons/CheckmarkIcon.tsx
  init_react();
  var CheckmarkIcon = (props) => {
    var _a, _b, _c;
    return /* @__PURE__ */ react_default.createElement("svg", { style: { paddingRight: props.paddingRight }, width: (_a = props.width) != null ? _a : "15", height: (_b = props.height) != null ? _b : "12", viewBox: "0 1 15 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1.80396 7.58667L5.13903 10.4804C5.3476 10.6613 5.66339 10.6389 5.84436 10.4304L13.2045 1.94761", stroke: (_c = props.color) != null ? _c : "white", strokeWidth: "2", strokeLinecap: "round" }));
  };
  var CheckmarkIcon_default = CheckmarkIcon;

  // src/mito/components/elements/DropdownItem.tsx
  var DropdownItem = (props) => {
    const disabled = props.disabled === true;
    const hideSubtext = props.hideSubtext === true;
    const displaySubtextOnHover = props.displaySubtextOnHover === true;
    return /* @__PURE__ */ react_default.createElement(
      "button",
      {
        className: classNames("mito-dropdown-item", { [DROPDOWN_IGNORE_CLICK_CLASS]: disabled, [DROPDOWN_SUPRESS_FOCUS_ON_CLOSE]: props.supressFocusSettingOnClose }, props.className),
        style: props.canHaveCheckMark && !props.hasCheckMark ? { paddingLeft: "32px" } : void 0,
        onClick: (e) => {
          var _a;
          e.stopPropagation();
          if (!disabled) {
            (_a = props.onClick) == null ? void 0 : _a.call(props);
          }
        },
        title: props.tooltip,
        onMouseEnter: props.onMouseEnter
      },
      /* @__PURE__ */ react_default.createElement("div", { className: classNames("mito-dropdown-item-icon-and-title-container") }, props.hasCheckMark && /* @__PURE__ */ react_default.createElement(CheckmarkIcon_default, { paddingRight: "4px", color: "var(--mito-text-medium)", width: "26", height: "13" }), props.icon !== void 0 && /* @__PURE__ */ react_default.createElement("div", { className: classNames("mito-dropdown-item-icon-container") }, props.icon), /* @__PURE__ */ react_default.createElement("div", { className: "mito-dropdown-item-title-and-shortcut-container" }, /* @__PURE__ */ react_default.createElement("span", { title: props.tooltip || props.title }, /* @__PURE__ */ react_default.createElement("p", { className: classNames("text-body-2", "text-overflow-hide", "cursor-default", { "text-color-disabled": disabled }) }, props.title)), props.subMenu && /* @__PURE__ */ react_default.createElement(RightArrowIcon_default, null), props.rightText && /* @__PURE__ */ react_default.createElement("span", { className: classNames("mito-dropdown-item-right-text", "text-body-2") }, props.rightText))),
      props.subtext && /* @__PURE__ */ react_default.createElement("div", { className: classNames(
        "mito-dropdown-item-subtext-container",
        "text-subtext-1",
        { "mito-dropdown-item-subtext-disabled": disabled },
        { "mito-dropdown-item-display-subtext-on-hover": hideSubtext && displaySubtextOnHover }
      ) }, props.subtext),
      props.subMenu
    );
  };
  var DropdownItem_default = DropdownItem;

  // src/mito/components/toolbar/GraphTabs/ChangeChartTypeButton.tsx
  init_react();

  // src/mito/components/icons/GraphIcon.tsx
  init_react();
  var GraphIcon = (props) => {
    if (props.isToolbar === true || props.isToolbar === void 0) {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "14", height: "18", viewBox: "0 0 14 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "0.93689", y: "9.57031", width: "4", height: "7", fill: "var(--mito-text-light)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "8.93689", y: "5.57031", width: "4", height: "11", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "4.93689", y: "0.570312", width: "4", height: "16", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }));
    }
    if (props.variant === "light") {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "13", height: "15", viewBox: "0 0 13 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1 5.5874V14.3589", stroke: "var(--mito-background)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M4.64453 9.67969V14.3588", stroke: "var(--mito-background)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M8.28906 1V14.3588", stroke: "var(--mito-background)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M11.9336 5.5874V14.3589", stroke: "var(--mito-background)", strokeMiterlimit: "10", strokeLinecap: "round" }));
    } else {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "13", height: "15", viewBox: "0 0 13 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1 5.61938V14.3908", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M4.64453 9.71167V14.3908", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M8.28906 1.03198V14.3908", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M11.9336 5.61938V14.3908", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }));
    }
  };
  var GraphIcon_default = GraphIcon;

  // src/mito/components/icons/LineChartIcon.tsx
  init_react();
  var LineChartIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 9 9", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M0.650909 5.99102L1.69758 5.54434L1.34909 4.72773L0.302417 5.17441L0.650909 5.99102ZM1.12082 5.39141L2.34584 3.17489L2.10419 3.11082L0.879175 5.32734L1.12082 5.39141Z", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5.14517 7.18402L6.21675 6.77569L5.90463 5.9566L4.83305 6.36494L5.14517 7.18402ZM8.37963 1.9566L7.30805 2.36494L7.62017 3.18402L8.69175 2.77569L8.37963 1.9566ZM5.64473 6.60588L8.11973 2.60588L7.88007 2.53474L5.40507 6.53474L5.64473 6.60588Z", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M1.72463 2.62066L1.56989 3.44317L2.72557 3.66059L2.88031 2.83808L1.72463 2.62066ZM2.11161 3.19303L5.41161 6.6216L5.63858 6.51679L2.33858 3.08822L2.11161 3.19303Z", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M0.621194 8.18459L1.53482 8.05488L1.37881 6.95603L0.465181 7.08575L0.621194 8.18459ZM1.09263 7.65424L4.79264 1.65424L4.60737 1.48638L0.907367 7.48638L1.09263 7.65424Z", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M4.30242 0.967985L4.18185 2.07271L5.09749 2.17264L5.21805 1.06791L4.30242 0.967985ZM8.39748 7.17264L8.51805 6.06791L7.60241 5.96799L7.48185 7.07271L8.39748 7.17264ZM4.61021 1.65733L7.91021 6.65733L8.08968 6.48329L4.78969 1.48329L4.61021 1.65733Z", fill: "var(--mito-highlight)" }));
  };
  var LineChartIcon_default = LineChartIcon;

  // src/mito/components/icons/ScatterPlotIcon.tsx
  init_react();
  var ScatterPlotIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 9 9", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("line", { x1: "0.25", y1: "0.0703125", x2: "0.25", y2: "8.07031", stroke: "var(--mito-text)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("line", { y1: "7.82031", x2: "9", y2: "7.82031", stroke: "var(--mito-text)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("rect", { x: "2", y: "1.07031", width: "1", height: "1", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "4", y: "3.07031", width: "1", height: "1", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "6", y: "5.07031", width: "1", height: "1", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "2", y: "5.07031", width: "1", height: "1", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "7", y: "0.0703125", width: "1", height: "1", fill: "var(--mito-text)" }));
  };
  var ScatterPlotIcon_default = ScatterPlotIcon;

  // src/mito/components/taskpanes/Graph/GraphSetupTab.tsx
  init_react();

  // src/mito/utils/objects.tsx
  function recurseObjectAssign(target, source) {
    Object.getOwnPropertyNames(source).forEach((key2) => {
      const sourceValue = source[key2];
      const targetValue = target[key2];
      if (typeof sourceValue === "object" && typeof targetValue === "object") {
        recurseObjectAssign(targetValue, sourceValue);
      } else {
        target[key2] = sourceValue;
      }
    });
    return target;
  }
  function updateObjectWithPartialObject(obj, update) {
    const newParams = window.structuredClone(obj);
    recurseObjectAssign(newParams, update);
    return newParams;
  }
  function shallowEqualToDepth(object1, object2, depth) {
    const keys1 = Object.keys(object1);
    const keys2 = Object.keys(object2);
    if (keys1.length !== keys2.length) {
      return false;
    }
    for (const key2 of keys1) {
      if (typeof object1[key2] === "object" && typeof object2[key2] == "object") {
        if (depth > 0) {
          return shallowEqualToDepth(object1[key2], object2[key2], depth - 1);
        }
      }
      if (object1[key2] !== object2[key2]) {
        return false;
      }
    }
    return true;
  }

  // src/mito/components/elements/DataframeSelect.tsx
  init_react();

  // src/mito/components/elements/Select.tsx
  init_react();

  // src/mito/components/icons/SelectDropdownIcon.tsx
  init_react();
  var SelectDropdownIcon = (props) => {
    const fill = props.disabled === true ? "var(--mito-text-light)" : props.variant === "select" ? "var(--mito-background)" : "var(--mito-highlight)";
    return /* @__PURE__ */ react_default.createElement("svg", { width: "6", height: "4", viewBox: "0 0 6 4", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M0 0L3.00283 4L6 0", fill }));
  };
  var SelectDropdownIcon_default = SelectDropdownIcon;

  // src/mito/components/elements/Select.tsx
  var Select = (props) => {
    const [displayDropdown, setDisplayDropdown] = useState(!!props.display);
    react_default.useEffect(() => {
      setDisplayDropdown(!!props.display);
    }, [props.display]);
    const width = props.width || "block";
    const widthClass = `element-width-${width}`;
    const dropdownActiveClass = displayDropdown ? "select-dropdown-active" : "";
    const providedClasses = props.className || "";
    let displayValue = props.value;
    const children = react_default.Children.map(props.children, (child) => {
      const { id, title } = child.props;
      if (id === props.value) {
        displayValue = title;
      }
      const valueForOnChange = id !== void 0 ? id : title;
      const onChangeFunc = props.onChange;
      if (onChangeFunc === void 0) {
        return child;
      } else {
        const finalChild = react_default.cloneElement(child, {
          onClick: () => {
            onChangeFunc(valueForOnChange);
          }
        });
        return finalChild;
      }
    });
    return /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: classNames("select-container", "text-body-2", widthClass, dropdownActiveClass, providedClasses, { "select-disabled": props.disabled }),
        style: props.style,
        onClick: () => {
          if (props.disabled) {
            return;
          }
          setDisplayDropdown((prevDisplayDropdown) => {
            var _a;
            (_a = props.onChangeDisplay) == null ? void 0 : _a.call(props, !prevDisplayDropdown);
            if (!prevDisplayDropdown) {
              return true;
            }
            return prevDisplayDropdown;
          });
        }
      },
      /* @__PURE__ */ react_default.createElement("p", { className: "select-text" }, displayValue),
      /* @__PURE__ */ react_default.createElement("div", { className: "select-dropdown-icon-container", style: props.iconStyle }, /* @__PURE__ */ react_default.createElement(SelectDropdownIcon_default, { variant: "select" })),
      /* @__PURE__ */ react_default.createElement(
        Dropdown_default,
        {
          display: displayDropdown,
          closeDropdown: () => {
            var _a;
            (_a = props.onChangeDisplay) == null ? void 0 : _a.call(props, false);
            setDisplayDropdown(false);
          },
          searchable: props.searchable,
          width: props.dropdownWidth
        },
        children
      )
    );
  };
  var Select_default = Select;

  // src/mito/components/elements/DataframeSelect.tsx
  var DataframeSelect = (props) => {
    const [dfNames] = useState(
      () => props.sheetDataArray.map((sheetData) => sheetData.dfName).filter((dfName, sheetIndex) => {
        return sheetIndex !== props.sheetIndexToIgnore;
      })
    );
    return /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", title: props.title }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Dataframe")), /* @__PURE__ */ react_default.createElement(Col_default, { span: props.span }, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        width: props.span === void 0 ? "medium" : void 0,
        value: dfNames[props.sheetIndex],
        onChange: (newDfName) => {
          const newSheetIndex = dfNames.findIndex((dfName) => dfName === newDfName);
          if (newSheetIndex !== -1 && newSheetIndex !== props.sheetIndex) {
            props.onChange(newSheetIndex);
          }
        }
      },
      dfNames.map((dfName) => {
        return /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: dfName,
            title: dfName
          }
        );
      })
    )));
  };
  var DataframeSelect_default = DataframeSelect;

  // src/mito/components/elements/LabelAndTooltip.tsx
  init_react();

  // src/mito/components/elements/Tooltip.tsx
  init_react();

  // src/mito/components/icons/QuestionMarkIcon.tsx
  init_react();
  var QuestionMarkIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "20", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M7.50018 11.5909C7.87674 11.5909 8.182 11.2856 8.182 10.9091C8.182 10.5325 7.87674 10.2273 7.50018 10.2273C7.12362 10.2273 6.81836 10.5325 6.81836 10.9091C6.81836 11.2856 7.12362 11.5909 7.50018 11.5909Z", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.74299 5.15462C7.41191 5.16915 7.23537 5.30235 7.17425 5.4322C7.0139 5.77291 6.60771 5.91912 6.267 5.75877C5.92629 5.59841 5.78008 5.19222 5.94044 4.85151C6.29647 4.09503 7.06347 3.81949 7.6832 3.79229C8.27933 3.76613 9.02119 3.95601 9.43162 4.49121C9.74745 4.90306 9.92489 5.42514 9.85323 5.97406C9.78058 6.53067 9.46309 7.02995 8.94794 7.40893C8.26004 7.91501 8.26125 8.17321 8.26143 8.21081C8.26143 8.21136 8.26144 8.21186 8.26144 8.21232C8.26144 8.58887 7.95618 8.89413 7.57962 8.89413C7.20306 8.89413 6.8978 8.58887 6.8978 8.21232C6.8978 7.56001 7.27722 6.94514 8.13987 6.31051C8.40503 6.11545 8.48394 5.92881 8.50107 5.79756C8.5192 5.65864 8.47982 5.49093 8.34953 5.32102C8.34036 5.30907 8.29056 5.25933 8.16587 5.21452C8.04681 5.17174 7.8971 5.14785 7.74299 5.15462Z", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M7.5 15C3.34091 15 0 11.6591 0 7.5C0 3.34091 3.34091 0 7.5 0C11.6591 0 15 3.34091 15 7.5C15 11.6591 11.6591 15 7.5 15ZM7.5 1.36364C4.09091 1.36364 1.36364 4.09091 1.36364 7.5C1.36364 10.9091 4.09091 13.6364 7.5 13.6364C10.9091 13.6364 13.6364 10.9091 13.6364 7.5C13.6364 4.09091 10.9091 1.36364 7.5 1.36364Z", fill: "var(--mito-text)" }));
  };
  var QuestionMarkIcon_default = QuestionMarkIcon;

  // src/mito/components/elements/Tooltip.tsx
  var Tooltip = (props) => {
    return /* @__PURE__ */ react_default.createElement(
      Row_default,
      {
        justify: "center",
        align: "center",
        title: props.title
      },
      /* @__PURE__ */ react_default.createElement(QuestionMarkIcon_default, null)
    );
  };
  var Tooltip_default = Tooltip;

  // src/mito/components/elements/LabelAndTooltip.tsx
  var LabelAndTooltip = (props) => {
    return /* @__PURE__ */ react_default.createElement(Row_default, { justify: "start", align: "center", title: props.tooltip, suppressTopBottomMargin: true }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { style: props.style, className: props.textBody ? "text-body-1" : "text-header-3" }, props.children)), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(Tooltip_default, { title: props.tooltip })));
  };
  var LabelAndTooltip_default = LabelAndTooltip;

  // src/mito/components/taskpanes/Graph/AxisSection.tsx
  init_react();

  // src/mito/components/elements/DropdownButton.tsx
  init_react();
  var DropdownButton = (props) => {
    const [displayDropdown, setDisplayDropdown] = useState(false);
    const width = props.width || "block";
    const widthClass = `element-width-${width}`;
    const disabledClass = props.disabled ? "mito-dropdown-button-disabled" : "mito-dropdown-button-enabled";
    return /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: classNames("mito-dropdown-button", "text-header-4", widthClass, disabledClass),
        onClick: () => {
          setDisplayDropdown((prevDisplayDropdown) => {
            if (!props.disabled && !prevDisplayDropdown) {
              return true;
            }
            return prevDisplayDropdown;
          });
        }
      },
      /* @__PURE__ */ react_default.createElement("p", { className: "mito-dropdown-button-text", title: props.title }, props.text),
      /* @__PURE__ */ react_default.createElement("div", { className: "mito-dropdown-button-icon-container" }, /* @__PURE__ */ react_default.createElement(SelectDropdownIcon_default, { variant: "dropdown button", disabled: props.disabled })),
      /* @__PURE__ */ react_default.createElement(
        Dropdown_default,
        {
          display: displayDropdown,
          closeDropdown: () => setDisplayDropdown(false),
          searchable: props.searchable,
          width: props.dropdownWidth
        },
        props.children
      )
    );
  };
  var DropdownButton_default = DropdownButton;

  // src/mito/components/elements/SelectAndXIconCard.tsx
  init_react();

  // src/mito/components/icons/XIcon.tsx
  init_react();
  var XIcon = (props) => {
    var _a, _b, _c, _d;
    return /* @__PURE__ */ react_default.createElement("svg", { style: props.style, width: props.width || "18", onClick: props.onClick, height: props.height || "18", viewBox: "0 0 13 13", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("line", { x1: "0.707107", y1: "1.29289", x2: "11.3136", y2: "11.8994", stroke: (_a = props.strokeColor) != null ? _a : "var(--mito-text)", strokeWidth: (_b = props.strokeWidth) != null ? _b : "2", strokeLinecap: props.rounded ? "round" : void 0 }), /* @__PURE__ */ react_default.createElement("line", { x1: "0.7072", y1: "11.8995", x2: "11.3137", y2: "1.29297", stroke: (_c = props.strokeColor) != null ? _c : "var(--mito-text)", strokeWidth: (_d = props.strokeWidth) != null ? _d : "2", strokeLinecap: props.rounded ? "round" : void 0 }));
  };
  var XIcon_default = XIcon;

  // src/mito/components/elements/SelectAndXIconCard.tsx
  var SelectAndXIconCard = (props) => {
    return /* @__PURE__ */ react_default.createElement(Row_default, { key: props.value, justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, { flex: "1" }, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        value: props.value + "",
        onChange: (newID) => {
          props.onChange(newID);
        },
        searchable: true
      },
      props.selectableValues.map((id) => {
        const title = props.titleMap ? props.titleMap[id] : id;
        return /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: id,
            id,
            title
          }
        );
      })
    )), /* @__PURE__ */ react_default.createElement(Col_default, { offset: 1, offsetRight: 1 }, /* @__PURE__ */ react_default.createElement(
      XIcon_default,
      {
        onClick: props.onDelete
      }
    )));
  };
  var SelectAndXIconCard_default = SelectAndXIconCard;

  // src/mito/components/taskpanes/Graph/AxisSection.tsx
  var AxisSection = (props) => {
    const selectableColumnIDs = Object.keys(props.columnIDsMap || {});
    const selectedColumnHeaderSelects = props.selectedColumnIDs.map((columnID, i) => {
      return /* @__PURE__ */ react_default.createElement(
        SelectAndXIconCard_default,
        {
          key: i,
          value: columnID,
          titleMap: columnIDMapToDisplayHeadersMap(props.columnIDsMap),
          onChange: (columnID2) => {
            props.updateAxisData(
              props.graphAxis,
              i,
              columnID2
            );
          },
          onDelete: () => props.updateAxisData(props.graphAxis, i),
          selectableValues: selectableColumnIDs
        }
      );
    });
    const numSelectedColumns = props.selectedColumnIDs.length;
    const numOtherAxisSelectedColumns = props.otherAxisSelectedColumnIDs.length;
    const disabledDueToMaxSeriesReachedBool = numSelectedColumns + numOtherAxisSelectedColumns >= 10;
    return /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(
      Row_default,
      {
        justify: "space-between",
        align: "center",
        title: `Select columns to graph on the ${props.graphAxis}.`
      },
      /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("div", { className: "text-header-3" }, props.graphAxis)),
      /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
        DropdownButton_default,
        {
          text: "+ Add",
          width: "small",
          disabled: disabledDueToMaxSeriesReachedBool,
          searchable: true
        },
        selectableColumnIDs.map((columnID) => {
          const columnHeader = props.columnIDsMap[columnID];
          return /* @__PURE__ */ react_default.createElement(
            DropdownItem_default,
            {
              key: columnID,
              title: getDisplayColumnHeader(columnHeader),
              onClick: () => {
                props.updateAxisData(
                  props.graphAxis,
                  props.selectedColumnIDs.length,
                  columnID
                );
              }
            }
          );
        })
      ))
    ), disabledDueToMaxSeriesReachedBool && /* @__PURE__ */ react_default.createElement("div", { className: "text-subtext-1 text-align-left" }, "You can only graph ten series at once."), selectedColumnHeaderSelects);
  };
  var AxisSection_default = AxisSection;

  // src/mito/components/taskpanes/Graph/GraphSetupTab.tsx
  var GRAPH_SAFETY_FILTER_CUTOFF = 1e3;
  var SAFETY_FILTER_DISABLED_MESSAGE = `Because you\u2019re graphing less than ${GRAPH_SAFETY_FILTER_CUTOFF} rows of data, you can safely graph your data without applying a filter first.`;
  var SAFETY_FILTER_ENABLED_MESSAGE = `Turning on Limit ${GRAPH_SAFETY_FILTER_CUTOFF} rows only graphs the first ${GRAPH_SAFETY_FILTER_CUTOFF} rows of your dataframe, ensuring that your browser tab won\u2019t crash. Turning it off graphs the entire dataframe and may slow or crash your browser tab.`;
  var GRAPHS_THAT_DONT_SUPPORT_COLOR = ["density heatmap" /* DENSITY_HEATMAP */];
  function GraphSetupTab(props) {
    var _a;
    const graphSheetIndex = props.graphParams.graphCreation.sheet_index;
    const graphPreprocessingParams = props.graphParams.graphPreprocessing;
    const updateAxisData = (graphAxis, index, columnID) => {
      let axisColumnIDs = [];
      if (graphAxis === "X axis" /* X_AXIS */) {
        axisColumnIDs = props.graphParams.graphCreation.x_axis_column_ids;
      } else {
        axisColumnIDs = props.graphParams.graphCreation.y_axis_column_ids;
      }
      const axisColumnIDsCopy = [...axisColumnIDs];
      if (columnID === void 0) {
        axisColumnIDsCopy.splice(index, 1);
      } else {
        axisColumnIDsCopy[index] = columnID;
      }
      if (graphAxis === "X axis" /* X_AXIS */) {
        props.setGraphParams((prevGraphParams) => {
          const graphParamsCopy = window.structuredClone(prevGraphParams);
          return __spreadProps(__spreadValues({}, graphParamsCopy), {
            graphCreation: __spreadProps(__spreadValues({}, graphParamsCopy.graphCreation), {
              x_axis_column_ids: axisColumnIDsCopy
            })
          });
        });
      } else {
        props.setGraphParams((prevGraphParams) => {
          const graphParamsCopy = window.structuredClone(prevGraphParams);
          return __spreadProps(__spreadValues({}, graphParamsCopy), {
            graphCreation: __spreadProps(__spreadValues({}, graphParamsCopy.graphCreation), {
              y_axis_column_ids: axisColumnIDsCopy
            })
          });
        });
      }
    };
    const setColor = (newColorColumnID) => {
      props.setGraphParams((prevGraphParams) => {
        const graphParamsCopy = window.structuredClone(prevGraphParams);
        return __spreadProps(__spreadValues({}, graphParamsCopy), {
          graphCreation: __spreadProps(__spreadValues({}, graphParamsCopy.graphCreation), {
            color: newColorColumnID
          })
        });
      });
    };
    function updateGraphParam(update) {
      props.setGraphParams((prevGraphParams) => {
        return updateObjectWithPartialObject(prevGraphParams, update);
      });
    }
    const colorByColumnTooltip = GRAPHS_THAT_DONT_SUPPORT_COLOR.includes(props.graphParams.graphCreation.graph_type) ? `${props.graphParams.graphCreation.graph_type} does not support further breaking down data using color.` : "Use an additional column to further breakdown the data by color.";
    const columnIDsMap = ((_a = props.sheetDataArray[graphSheetIndex]) == null ? void 0 : _a.columnIDsMap) || {};
    return /* @__PURE__ */ react_default.createElement(Fragment, null, /* @__PURE__ */ react_default.createElement("div", { className: "graph-sidebar-toolbar-content" }, /* @__PURE__ */ react_default.createElement(
      DataframeSelect_default,
      {
        title: "Select the data sheet to graph.",
        sheetDataArray: props.sheetDataArray,
        sheetIndex: graphSheetIndex,
        onChange: (newSheetIndex) => {
          const newSheetGraphParams = getDefaultGraphParams(
            props.mitoContainerRef,
            props.sheetDataArray,
            newSheetIndex,
            {
              type: "existing_graph",
              graphID: props.graphID,
              existingParams: __spreadProps(__spreadValues({}, props.graphParams), {
                graphCreation: __spreadProps(__spreadValues({}, props.graphParams.graphCreation), {
                  sheet_index: newSheetIndex
                })
              })
            }
          );
          props.setGraphParams(newSheetGraphParams);
        }
      }
    ), /* @__PURE__ */ react_default.createElement(
      AxisSection_default,
      {
        columnIDsMap,
        graphType: props.graphParams.graphCreation.graph_type,
        graphAxis: "X axis" /* X_AXIS */,
        selectedColumnIDs: props.graphParams.graphCreation.x_axis_column_ids,
        otherAxisSelectedColumnIDs: props.graphParams.graphCreation.y_axis_column_ids,
        updateAxisData,
        mitoAPI: props.mitoAPI
      }
    ), /* @__PURE__ */ react_default.createElement(
      AxisSection_default,
      {
        columnIDsMap,
        graphType: props.graphParams.graphCreation.graph_type,
        graphAxis: "Y axis" /* Y_AXIS */,
        selectedColumnIDs: props.graphParams.graphCreation.y_axis_column_ids,
        otherAxisSelectedColumnIDs: props.graphParams.graphCreation.x_axis_column_ids,
        updateAxisData,
        mitoAPI: props.mitoAPI
      }
    ), /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(
      Row_default,
      {
        justify: "space-between",
        align: "center",
        title: colorByColumnTooltip,
        suppressTopBottomMargin: true
      },
      /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: colorByColumnTooltip }, "Color By Column")),
      /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
        Select_default,
        {
          value: props.graphParams.graphCreation.color ? getDisplayColumnHeader(columnIDsMap[props.graphParams.graphCreation.color]) : "None",
          disabled: GRAPHS_THAT_DONT_SUPPORT_COLOR.includes(props.graphParams.graphCreation.graph_type),
          width: "small",
          searchable: true
        },
        getColorDropdownItems(columnIDsMap, props.columnDtypesMap, setColor)
      ))
    )), /* @__PURE__ */ react_default.createElement(
      Row_default,
      {
        justify: "space-between",
        align: "center",
        title: getDefaultSafetyFilter(props.sheetDataArray, graphSheetIndex) ? SAFETY_FILTER_ENABLED_MESSAGE : SAFETY_FILTER_DISABLED_MESSAGE
      },
      /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: getDefaultSafetyFilter(props.sheetDataArray, graphSheetIndex) ? SAFETY_FILTER_ENABLED_MESSAGE : SAFETY_FILTER_DISABLED_MESSAGE }, `Limit ${GRAPH_SAFETY_FILTER_CUTOFF} rows`)),
      /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
        Toggle_default,
        {
          value: props.graphParams.graphPreprocessing.safety_filter_turned_on_by_user,
          onChange: () => {
            updateGraphParam({ graphPreprocessing: { safety_filter_turned_on_by_user: !graphPreprocessingParams.safety_filter_turned_on_by_user } });
          },
          disabled: !getDefaultSafetyFilter(props.sheetDataArray, graphSheetIndex)
        }
      ))
    ), /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(
      Row_default,
      {
        justify: "space-between",
        align: "center",
        title: "Create subplots based on this attribute"
      },
      /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: "Create subplots based on this attribute", textBody: true }, "Facet Column")),
      /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
        Select_default,
        {
          value: props.graphParams.graphCreation.facet_col_column_id ? getDisplayColumnHeader(columnIDsMap[props.graphParams.graphCreation.facet_col_column_id]) : "None",
          width: "small",
          searchable: true
        },
        [/* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "None",
            title: "None",
            onClick: () => {
              updateGraphParam({ graphCreation: { facet_col_column_id: void 0 } });
            }
          }
        )].concat(
          (Object.keys(columnIDsMap) || []).map((columnID) => {
            const columnHeader = columnIDsMap[columnID];
            return /* @__PURE__ */ react_default.createElement(
              DropdownItem_default,
              {
                key: columnID,
                title: getDisplayColumnHeader(columnHeader),
                onClick: () => {
                  updateGraphParam({ graphCreation: { facet_col_column_id: columnID } });
                }
              }
            );
          })
        )
      ))
    )), /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(
      Row_default,
      {
        justify: "space-between",
        align: "center",
        title: "Create subplots based on this attribute"
      },
      /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: "Create subplots based on this attribute", textBody: true }, "Facet row")),
      /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
        Select_default,
        {
          value: props.graphParams.graphCreation.facet_row_column_id ? getDisplayColumnHeader(columnIDsMap[props.graphParams.graphCreation.facet_row_column_id]) : "None",
          width: "small",
          searchable: true
        },
        [/* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "None",
            title: "None",
            onClick: () => {
              updateGraphParam({ graphCreation: { facet_row_column_id: void 0 } });
            }
          }
        )].concat(
          (Object.keys(columnIDsMap) || []).map((columnID) => {
            const columnHeader = columnIDsMap[columnID];
            return /* @__PURE__ */ react_default.createElement(
              DropdownItem_default,
              {
                key: columnID,
                title: getDisplayColumnHeader(columnHeader),
                onClick: () => {
                  updateGraphParam({ graphCreation: { facet_row_column_id: columnID } });
                }
              }
            );
          })
        )
      ))
    ))));
  }
  var GraphSetupTab_default = GraphSetupTab;

  // src/mito/components/toolbar/ToolbarButton.tsx
  init_react();
  var ToolbarButton = (props) => {
    var _a, _b, _c, _d, _e, _f, _g;
    const disabledTooltip = (_a = props.disabledTooltip) != null ? _a : props.action.isDisabled();
    const disabled = !!disabledTooltip;
    const highlightToobarItemClass = props.highlightToolbarButton === true ? "mito-toolbar-button-draw-attention" : "";
    const hasDropdown = props.children !== void 0;
    const orientation = (_b = props.orientation) != null ? _b : "vertical";
    let tooltip = (_c = disabledTooltip != null ? disabledTooltip : props.action.tooltip) != null ? _c : props.action.titleToolbar;
    const keyboardShortcut = getKeyboardShortcutString(props.action.staticType);
    if (keyboardShortcut !== void 0) {
      tooltip += ` (${keyboardShortcut})`;
    }
    return /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: classNames("mito-toolbar-button-container", orientation === "vertical" ? "vertical-align-content" : "horizontal-align-content", disabled ? "mito-toolbar-button-container-disabled" : "mito-toolbar-button-container-enabled"),
        id: (_d = props.id) != null ? _d : `mito-toolbar-button-${props.action.staticType}`,
        onClick: () => {
          if (disabled) {
            return;
          }
          if (props.onClick !== void 0) {
            props.onClick();
          }
          props.action.actionFunction();
        }
      },
      /* @__PURE__ */ react_default.createElement(
        "button",
        {
          className: classNames("mito-toolbar-button", highlightToobarItemClass),
          type: "button"
        },
        /* @__PURE__ */ react_default.createElement("span", { title: tooltip }, /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-button-icon-container" }, (_e = props.iconOverride) != null ? _e : props.action.iconToolbar !== void 0 ? /* @__PURE__ */ react_default.createElement(props.action.iconToolbar, null) : /* @__PURE__ */ react_default.createElement(StepsIcon_default, null), hasDropdown && /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-button-dropdown-icon" }, "\u25BE"), props.children !== void 0 && props.children), ((_f = props.titleToolbar) != null ? _f : props.action.titleToolbar) && /* @__PURE__ */ react_default.createElement("p", { className: "mito-toolbar-button-label" }, (_g = props.titleToolbar) != null ? _g : props.action.titleToolbar))
      )
    );
  };
  var ToolbarButton_default = ToolbarButton;

  // src/mito/components/icons/GraphToolbar/BoxGraphIcon.tsx
  init_react();
  var BoxGraphIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1 0.351562V9.64844H9.5M5.5 7V7.5V8M5.5 8H4.5M5.5 8H6.5M5.5 2.5V0.351562M5.5 0.351562H4.5M5.5 0.351562H6.5", stroke: "var(--mito-text)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("path", { d: "M4.25 2.75H6.75V6.75H4.25V2.75Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)", strokeWidth: "0.5" }));
  };
  var BoxGraphIcon_default = BoxGraphIcon;

  // src/mito/components/icons/GraphToolbar/HistogramIcon.tsx
  init_react();
  var HistogramIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "11", height: "10", viewBox: "0 0 11 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "1", y: "4.69922", width: "2.25", height: "4.8", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "3.25", y: "0.5", width: "2.25", height: "9", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "5.5", y: "3.5", width: "2.25", height: "6", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "7.75", y: "6.5", width: "2.25", height: "3", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }));
  };
  var HistogramIcon_default = HistogramIcon;

  // src/mito/components/icons/GraphToolbar/HeatMapIcon.tsx
  init_react();
  var HeatMapIcon = (props) => {
    var _a, _b;
    return /* @__PURE__ */ react_default.createElement("svg", { width: (_a = props.width) != null ? _a : "10", height: (_b = props.width) != null ? _b : "10", viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { width: "5", height: "5", fill: "#F2C94C" }), /* @__PURE__ */ react_default.createElement("rect", { x: "5", y: "5", width: "5", height: "5", fill: "#EB5757" }), /* @__PURE__ */ react_default.createElement("rect", { y: "5", width: "5", height: "5", fill: "#F2994A" }), /* @__PURE__ */ react_default.createElement("rect", { x: "5", width: "5", height: "5", fill: "#F2994A" }));
  };
  var HeatMapIcon_default = HeatMapIcon;

  // src/mito/components/icons/GraphToolbar/DensityContourIcon.tsx
  init_react();
  var DensityContourIcon = (props) => {
    var _a, _b;
    return /* @__PURE__ */ react_default.createElement("svg", { width: (_a = props.width) != null ? _a : "11", height: (_b = props.width) != null ? _b : "10", viewBox: "0 0 11 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M4.22834 1.21324C2.17375 1.87699 0.625006 3.63708 1.07976 5.73816C1.32717 6.88127 2.62012 6.40538 3.55209 7.11778C5.50219 8.60844 7.49234 10.0034 9.12614 8.17465C10.5784 6.54912 10.5037 4.29422 9.12614 2.60552C7.87258 1.06878 6.12035 0.602005 4.22834 1.21324Z", stroke: "#353750", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("path", { d: "M6.29651 3.01217C5.14719 2.77483 2.43004 4.36903 3.55072 5.00089C4.1043 5.31301 4.69836 4.85433 5.08251 5.00174C5.67938 5.23077 5.52703 6.09879 6.10342 6.41248C6.66099 6.71592 7.9073 7.02832 8.14509 6.41248C8.38287 5.79663 7.95331 4.65694 7.69588 4.05638C7.37933 3.31792 6.91069 3.139 6.29651 3.01217Z", stroke: "var(--mito-highlight)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5.49073 1.87952C4.23909 2.02012 2.78537 3.2718 2.78537 3.2718C2.78537 3.2718 1.8223 4.35215 2.02119 5.00236C2.38794 6.20127 4.06273 5.70815 4.57314 6.41394C5.64427 7.89507 8.52244 8.20923 8.98916 6.76217C9.3334 5.69486 8.9779 4.15911 8.28948 3.2718C7.54278 2.30939 6.705 1.74312 5.49073 1.87952Z", stroke: "#C2C2C2", strokeWidth: "0.5" }));
  };
  var DensityContourIcon_default = DensityContourIcon;

  // src/mito/components/icons/GraphToolbar/GroupIcon.tsx
  init_react();
  var GroupIcon = (props) => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "45", height: "45", viewBox: "0 0 45 45", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props.axis === void 0 || props.axis === "x" ? /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("path", { d: "M4.38477 17.5195C4.38477 16.9672 4.83248 16.5195 5.38477 16.5195H10.6003C11.1526 16.5195 11.6003 16.9672 11.6003 17.5195V44.0018H4.38477V17.5195Z", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M11.5996 5.74219C11.5996 5.1899 12.0473 4.74219 12.5996 4.74219H17.8152C18.3675 4.74219 18.8152 5.1899 18.8152 5.74219V44.0026H11.5996V5.74219Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight-medium)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M25 11.0234C25 10.4712 25.4477 10.0234 26 10.0234H31.1223C31.6746 10.0234 32.1223 10.4712 32.1223 11.0234V43.9943H25V11.0234Z", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M32.123 29.8867C32.123 29.3344 32.5708 28.8867 33.123 28.8867H38.5845C39.1368 28.8867 39.5845 29.3344 39.5845 29.8867V43.9849H32.123V29.8867Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight-medium)" })) : /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("path", { d: "M39.5879 4.00391C40.1402 4.00391 40.5879 4.45162 40.5879 5.00391V10.2195C40.5879 10.7718 40.1402 11.2195 39.5879 11.2195L1.32745 11.2195V4.00391L39.5879 4.00391Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M27.4824 11.0039C28.0347 11.0039 28.4824 11.4516 28.4824 12.0039V17.2195C28.4824 17.7718 28.0347 18.2195 27.4824 18.2195L1.00011 18.2195V11.0039L27.4824 11.0039Z", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight-medium)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M16.0977 26.0039C16.6499 26.0039 17.0977 26.4516 17.0977 27.0039V32.4654C17.0977 33.0177 16.6499 33.4654 16.0977 33.4654H1.99951L1.99951 26.0039L16.0977 26.0039Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M33.9707 33.0039C34.523 33.0039 34.9707 33.4516 34.9707 34.0039V39.1262C34.9707 39.6785 34.523 40.1262 33.9707 40.1262L0.999874 40.1262V33.0039L33.9707 33.0039Z", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight-medium)" })), /* @__PURE__ */ react_default.createElement("path", { d: "M1 0V44H45", stroke: "var(--mito-text-medium)" }));
  };
  var GroupIcon_default = GroupIcon;

  // src/mito/components/icons/GraphToolbar/StackedIcon.tsx
  init_react();
  var StackedIcon = (props) => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "45", height: "45", viewBox: "0 0 45 45", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props.axis === void 0 || props.axis === "x" ? /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("path", { d: "M7 30C7 29.4477 7.44772 29 8 29H16C16.5523 29 17 29.4477 17 30V44H7V30Z", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M7 17C7 16.4477 7.44772 16 8 16H16C16.5523 16 17 16.4477 17 17V29H7V17Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M17 23C17 22.4477 17.4477 22 18 22H26C26.5523 22 27 22.4477 27 23V44H17V23Z", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M17 8C17 7.44772 17.4477 7 18 7H26C26.5523 7 27 7.44772 27 8V22H17V8Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M27 28C27 27.4477 27.4477 27 28 27H36C36.5523 27 37 27.4477 37 28V44H27V28Z", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M27 17C27 16.4477 27.4477 16 28 16H36C36.5523 16 37 16.4477 37 17V27.3514H27V17Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" })) : /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("path", { d: "M16.6641 10.4375V20.4375L1.02344 20.4375L1.02344 10.4375L16.6641 10.4375Z", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M28.6641 10.4375C29.2163 10.4375 29.6641 10.8852 29.6641 11.4375V19.4375C29.6641 19.9898 29.2163 20.4375 28.6641 20.4375H16.6641V10.4375L28.6641 10.4375Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "24.0039", y: "21", width: "10", height: "23", transform: "rotate(90 24.0039 21)", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M37.5234 20.5C38.0757 20.5 38.5234 20.9477 38.5234 21.5V29.5C38.5234 30.0523 38.0757 30.5 37.5234 30.5H23.5234V20.5L37.5234 20.5Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "18.0078", y: "31", width: "10", height: "17", transform: "rotate(90 18.0078 31)", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M28.5098 31C29.062 31 29.5098 31.4477 29.5098 32V40C29.5098 40.5523 29.0621 41 28.5098 41H18.0032V31L28.5098 31Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" })), /* @__PURE__ */ react_default.createElement("path", { d: "M1 0V44H45", stroke: "var(--mito-text-medium)" }));
  };
  var StackedIcon_default = StackedIcon;

  // src/mito/components/icons/GraphToolbar/NormalizedIcon.tsx
  init_react();
  var NormalizedIcon = (props) => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "45", height: "45", viewBox: "0 0 45 45", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props.axis === void 0 || props.axis === "x" ? /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("path", { d: "M7 25.1797C7 24.6274 7.44772 24.1797 8 24.1797H16C16.5523 24.1797 17 24.6274 17 25.1797V44.0011H7V25.1797Z", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M7 8C7 7.44771 7.44772 7 8 7H16C16.5523 7 17 7.44772 17 8V24.1786H7V8Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M17 17C17 16.4477 17.4477 16 18 16H26C26.5523 16 27 16.4477 27 17V44H17V17Z", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M17 8C17 7.44772 17.4477 7 18 7H26C26.5523 7 27 7.44772 27 8V16H17V8Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M27 38C27 37.4477 27.4477 37 28 37H36C36.5523 37 37 37.4477 37 38V44H27V38Z", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M27 8C27 7.44772 27.4477 7 28 7H36C36.5523 7 37 7.44772 37 8V37H27V8Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" })) : /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("rect", { x: "20.8457", y: "10.5", width: "10", height: "19.8075", transform: "rotate(90 20.8457 10.5)", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M37.0117 10.5C37.564 10.5 38.0117 10.9477 38.0117 11.5V19.5C38.0117 20.0523 37.564 20.5 37.0117 20.5H20.8452V10.5L37.0117 10.5Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "28.0117", y: "21", width: "10", height: "27", transform: "rotate(90 28.0117 21)", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M37.0117 21C37.564 21 38.0117 21.4477 38.0117 22V30C38.0117 30.5523 37.564 31 37.0117 31H28.0117V21H37.0117Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "7.94141", y: "31", width: "10", height: "6.92397", transform: "rotate(90 7.94141 31)", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M37.0117 31C37.564 31 38.0117 31.4477 38.0117 32V40C38.0117 40.5523 37.564 41 37.0117 41L7.937 41V31L37.0117 31Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" })), /* @__PURE__ */ react_default.createElement("path", { d: "M1 0V44H45", stroke: "var(--mito-text-medium)" }));
  };
  var NormalizedIcon_default = NormalizedIcon;

  // src/mito/components/icons/GraphToolbar/LineChartSubMenuIcons.tsx
  init_react();
  var LineChartSubMenuIcon = (props) => {
    if (props.type === "linear") {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "49", height: "45", viewBox: "0 0 49 45", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M4.90625 0V44H48.9062", stroke: "var(--mito-text-medium)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M4.82324 24L14.8433 11.9605L29.2099 17.459L42.7313 12.959", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M4.82324 37L13.7263 26.4841L27.6704 32.9841L40.3466 3.98167", stroke: "var(--mito-highlight-medium)" }));
    } else if (props.type === "interpolated") {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "50", height: "45", viewBox: "0 0 50 45", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M5.35938 0V44H49.3594", stroke: "var(--mito-text-medium)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5.27637 24L10.6023 17.6007C13.4184 14.2171 17.7878 12.914 21.5233 14.3437L26.709 16.3285C28.6264 17.0623 30.7669 17.0916 32.8087 16.4121L43.1845 12.959", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5.27637 37L9.58887 31.9063C12.3129 28.6888 16.5578 27.5928 20.0288 29.2108V29.2108C24.459 31.2759 29.918 28.8784 32.0874 23.9149L40.7997 3.98167", stroke: "var(--mito-highlight-medium)" }));
    } else {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "48", height: "45", viewBox: "0 0 48 45", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M3.05469 0V44H47.0547", stroke: "var(--mito-text-medium)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M2.96955 24.0001L12.9896 24.0001L12.9896 11.9606L27.3562 11.9606L27.3562 17.4591L40.8778 17.459L40.8776 12.9591", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M2.99932 37.5H12.9993L12.9993 31H26.9993L26.9993 38H40.499L40.499 25", stroke: "var(--mito-highlight-medium)" }));
    }
  };
  var LineChartSubMenuIcons_default = LineChartSubMenuIcon;

  // src/mito/components/icons/GraphToolbar/OverlayIcon.tsx
  init_react();
  var OverlayIcon = (props) => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "45", height: "45", viewBox: "0 0 45 45", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props.axis === void 0 || props.axis === "x" ? /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("path", { d: "M7 26C7 25.4477 7.44772 25 8 25H16C16.5523 25 17 25.4477 17 26V29H7V26Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M7 30C7 29.4477 7.44772 29 8 29H16C16.5523 29 17 29.4477 17 30V44H7V30Z", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M17 13C17 12.4477 17.4477 12 18 12H26C26.5523 12 27 12.4477 27 13V19H17V13Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M17 20C17 19.4477 17.4477 19 18 19H26C26.5523 19 27 19.4477 27 20V44H17V20Z", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M27 23C27 22.4477 27.4477 22 28 22H36C36.5523 22 37 22.4477 37 23V25H27V23Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M27 26.0781C27 25.5258 27.4477 25.0781 28 25.0781H36C36.5523 25.0781 37 25.5258 37 26.0781V43.997H27V26.0781Z", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" })) : /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("path", { d: "M19 10C19.5523 10 20 10.4477 20 11V19C20 19.5523 19.5523 20 19 20H16V10H19Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M14.8965 10.0703C15.4488 10.0703 15.8965 10.518 15.8965 11.0703L15.8965 19.0703C15.8965 19.6226 15.4488 20.0703 14.8965 20.0703H1L1.0002 10.0703L14.8965 10.0703Z", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M32 20C32.5523 20 33 20.4477 33 21V29C33 29.5523 32.5523 30 32 30H26V20H32Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M25.0039 20C25.5562 20 26.0039 20.4477 26.0039 21V29C26.0039 29.5523 25.5562 30 25.0039 30L1.00391 30V20L25.0039 20Z", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M23 30C23.5523 30 24 30.4477 24 31V39C24 39.5523 23.5523 40 23 40H21V30H23Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M19.8633 30.0547C20.4156 30.0547 20.8633 30.5024 20.8633 31.0547V39.0547C20.8633 39.607 20.4156 40.0547 19.8633 40.0547H0.999531V30.0547L19.8633 30.0547Z", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" })), /* @__PURE__ */ react_default.createElement("path", { d: "M1 0V44H45", stroke: "var(--mito-text-medium)" }));
  };
  var OverlayIcon_default = OverlayIcon;

  // src/mito/components/icons/GraphToolbar/BoxPlotSubMenuIcon.tsx
  init_react();
  var BoxPlotSubMenuIcon = (props) => {
    if (props.type === "box") {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "45", height: "45", viewBox: "0 0 45 45", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1 0V44H45", stroke: "var(--mito-text-medium)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M23 33.5V36.0388V38M23 38H20M23 38H26M23 16.427V8M23 8H20M23 8H26", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M16.5 13.5H29.5V33.5H16.5V13.5Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("circle", { cx: "23", cy: "41", r: "1", fill: "var(--mito-highlight-medium)" }), /* @__PURE__ */ react_default.createElement("circle", { cx: "23", cy: "5", r: "1", fill: "var(--mito-highlight-medium)" }), /* @__PURE__ */ react_default.createElement("circle", { cx: "23", cy: "2", r: "1", fill: "var(--mito-highlight-medium)" }));
    } else if (props.type === "violin") {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "45", height: "45", viewBox: "0 0 45 45", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1 0V44H45", stroke: "var(--mito-text-medium)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M23.0008 37.1482C22.9057 37.0179 22.7958 36.8679 22.6731 36.7012C22.2196 36.085 21.5916 35.2417 20.894 34.3335C19.5084 32.5297 17.817 30.4289 16.6746 29.3671C14.5451 27.3878 13.4996 24.9342 13.5 22.5001C13.5004 20.066 14.5469 17.6122 16.6759 15.6329C17.8182 14.5709 19.5093 12.4701 20.8946 10.6664C21.5921 9.7582 22.2199 8.91487 22.6733 8.29869C22.7769 8.158 22.8713 8.02911 22.9555 7.91395C22.967 7.93294 22.9789 7.95229 22.991 7.97199C23.274 8.43308 23.6969 9.0889 24.2598 9.87454C25.3851 11.4451 27.0729 13.5386 29.3256 15.6329C31.4546 17.6121 32.5002 20.0658 32.5 22.5C32.4998 24.9341 31.4536 27.3878 29.3248 29.3672C28.1826 30.4291 26.4917 32.53 25.1067 34.3337C24.4093 35.2418 23.7816 36.0852 23.3283 36.7014C23.2057 36.8679 23.0959 37.018 23.0008 37.1482Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("circle", { cx: "23", cy: "5", r: "1", fill: "var(--mito-highlight-medium)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M24 2C24 2.55228 23.5523 3 23 3C22.4477 3 22 2.55228 22 2C22 1.44772 22.4477 1 23 1C23.5523 1 24 1.44772 24 2Z", fill: "var(--mito-highlight-medium)" }), /* @__PURE__ */ react_default.createElement("circle", { cx: "23", cy: "41", r: "1", fill: "var(--mito-highlight-medium)" }));
    } else {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "46", height: "45", viewBox: "0 0 46 45", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1 0V44H45", stroke: "var(--mito-text-medium)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "4", y1: "40.5", x2: "5", y2: "40.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "4", y1: "39.5", x2: "5", y2: "39.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "5", y1: "39.5", x2: "6", y2: "39.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "5", y1: "38.5", x2: "6", y2: "38.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "5", y1: "37.5", x2: "6", y2: "37.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "6", y1: "37.5", x2: "7", y2: "37.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "7", y1: "37.5", x2: "8", y2: "37.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "7", y1: "36.5", x2: "8", y2: "36.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "7", y1: "35.5", x2: "8", y2: "35.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "8", y1: "35.5", x2: "9", y2: "35.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "9", y1: "35.5", x2: "10", y2: "35.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "9", y1: "34.5", x2: "10", y2: "34.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "9", y1: "33.5", x2: "10", y2: "33.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "9", y1: "32.5", x2: "10", y2: "32.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "10", y1: "32.5", x2: "11", y2: "32.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "10", y1: "31.5", x2: "11", y2: "31.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "10", y1: "30.5", x2: "11", y2: "30.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "11", y1: "30.5", x2: "12", y2: "30.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "12", y1: "30.5", x2: "13", y2: "30.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "12", y1: "29.5", x2: "13", y2: "29.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "12", y1: "28.5", x2: "13", y2: "28.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "13", y1: "28.5", x2: "14", y2: "28.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "14", y1: "28.5", x2: "15", y2: "28.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "14", y1: "27.5", x2: "15", y2: "27.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "15", y1: "27.5", x2: "16", y2: "27.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "16", y1: "27.5", x2: "17", y2: "27.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "17", y1: "27.5", x2: "18", y2: "27.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "18", y1: "27.5", x2: "19", y2: "27.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "18", y1: "26.5", x2: "19", y2: "26.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "18", y1: "25.5", x2: "19", y2: "25.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "19", y1: "25.5", x2: "20", y2: "25.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "19", y1: "24.5", x2: "20", y2: "24.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "19", y1: "23.5", x2: "20", y2: "23.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "20", y1: "23.5", x2: "21", y2: "23.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "21", y1: "23.5", x2: "22", y2: "23.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "22", y1: "23.5", x2: "23", y2: "23.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "23", y1: "23.5", x2: "24", y2: "23.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "24", y1: "23.5", x2: "25", y2: "23.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "24", y1: "22.5", x2: "25", y2: "22.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "24", y1: "21.5", x2: "25", y2: "21.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "25", y1: "21.5", x2: "26", y2: "21.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "26", y1: "21.5", x2: "27", y2: "21.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "26", y1: "20.5", x2: "27", y2: "20.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "26", y1: "19.5", x2: "27", y2: "19.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "27", y1: "19.5", x2: "28", y2: "19.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "28", y1: "19.5", x2: "29", y2: "19.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "28", y1: "18.5", x2: "29", y2: "18.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "29", y1: "18.5", x2: "30", y2: "18.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "30", y1: "18.5", x2: "31", y2: "18.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "31", y1: "18.5", x2: "32", y2: "18.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "32", y1: "18.5", x2: "33", y2: "18.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "32", y1: "17.5", x2: "33", y2: "17.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "32", y1: "16.5", x2: "33", y2: "16.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "33", y1: "16.5", x2: "34", y2: "16.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "33", y1: "15.5", x2: "34", y2: "15.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "33", y1: "14.5", x2: "34", y2: "14.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "34", y1: "14.5", x2: "35", y2: "14.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "35", y1: "14.5", x2: "36", y2: "14.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "36", y1: "14.5", x2: "37", y2: "14.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "36", y1: "13.5", x2: "37", y2: "13.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "37", y1: "13.5", x2: "38", y2: "13.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "37", y1: "12.5", x2: "38", y2: "12.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "38", y1: "12.5", x2: "39", y2: "12.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "39", y1: "12.5", x2: "40", y2: "12.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "40", y1: "12.5", x2: "41", y2: "12.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "40", y1: "11.5", x2: "41", y2: "11.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "40", y1: "10.5", x2: "41", y2: "10.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "41", y1: "10.5", x2: "42", y2: "10.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "41", y1: "9.5", x2: "42", y2: "9.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "41", y1: "8.5", x2: "42", y2: "8.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "42", y1: "8.5", x2: "43", y2: "8.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "43", y1: "8.5", x2: "44", y2: "8.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "44", y1: "8.5", x2: "45", y2: "8.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "44", y1: "7.5", x2: "45", y2: "7.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "45", y1: "7.5", x2: "46", y2: "7.5", stroke: "var(--mito-highlight)" }));
    }
  };
  var BoxPlotSubMenuIcon_default = BoxPlotSubMenuIcon;

  // src/mito/components/toolbar/GraphTabs/ChangeChartTypeButton.tsx
  var GRAPHS_THAT_DONT_SUPPORT_COLOR2 = ["density heatmap" /* DENSITY_HEATMAP */];
  var GRAPHS_THAT_HAVE_NBINS = ["histogram" /* HISTOGRAM */];
  var GRAPHS_THAT_HAVE_BARMODE = ["bar" /* BAR */, "histogram" /* HISTOGRAM */];
  var GRAPHS_THAT_HAVE_BARNORM = ["bar" /* BAR */, "histogram" /* HISTOGRAM */];
  var GRAPHS_THAT_HAVE_HISTNORM = ["histogram" /* HISTOGRAM */];
  var GRAPHS_THAT_HAVE_HISTFUNC = ["histogram" /* HISTOGRAM */];
  var GRAPHS_THAT_HAVE_POINTS = ["box" /* BOX */, "violin" /* VIOLIN */];
  var GRAPHS_THAT_HAVE_LINE_SHAPE = ["line" /* LINE */];
  var GRAPHS_WITH_UNIQUE_CONFIG_OPTIONS = [.../* @__PURE__ */ new Set([
    ...GRAPHS_THAT_HAVE_NBINS,
    ...GRAPHS_THAT_HAVE_BARMODE,
    ...GRAPHS_THAT_HAVE_BARNORM,
    ...GRAPHS_THAT_HAVE_HISTNORM,
    ...GRAPHS_THAT_HAVE_HISTFUNC,
    ...GRAPHS_THAT_HAVE_POINTS,
    ...GRAPHS_THAT_HAVE_LINE_SHAPE
  ])];
  var getXandYColumnIDs = (primaryAxis, x_axis_column_ids, y_axis_column_ids) => {
    var _a, _b, _c, _d;
    if (primaryAxis === "x") {
      if (((_a = y_axis_column_ids == null ? void 0 : y_axis_column_ids.length) != null ? _a : 0) > ((_b = x_axis_column_ids == null ? void 0 : x_axis_column_ids.length) != null ? _b : 0)) {
        const tmp_y_axis_column_ids = x_axis_column_ids;
        x_axis_column_ids = y_axis_column_ids;
        y_axis_column_ids = tmp_y_axis_column_ids;
      }
    } else {
      if (((_c = x_axis_column_ids == null ? void 0 : x_axis_column_ids.length) != null ? _c : 0) > ((_d = y_axis_column_ids == null ? void 0 : y_axis_column_ids.length) != null ? _d : 0)) {
        const tmp_x_axis_column_ids = x_axis_column_ids;
        x_axis_column_ids = y_axis_column_ids;
        y_axis_column_ids = tmp_x_axis_column_ids;
      }
    }
    return [x_axis_column_ids, y_axis_column_ids];
  };
  var ChangeChartTypeButton = (props) => {
    var _a, _b, _c;
    const graphType = (_c = (_b = (_a = props.params) == null ? void 0 : _a.graph_creation) == null ? void 0 : _b.graph_type) != null ? _c : "bar" /* BAR */;
    const [currDropdown, setCurrDropdown] = react_default.useState(void 0);
    const updateGraphParams = (newParams) => {
      var _a2, _b2, _c2, _d;
      const newGraphType = (_b2 = (_a2 = newParams.graph_creation) == null ? void 0 : _a2.graph_type) != null ? _b2 : graphType;
      if (newGraphType !== graphType) {
        props.updateGraphParam(__spreadProps(__spreadValues({}, newParams), {
          graph_creation: __spreadValues({
            graph_type: newGraphType,
            color: GRAPHS_THAT_DONT_SUPPORT_COLOR2.includes(newGraphType) ? void 0 : (_d = (_c2 = props.params) == null ? void 0 : _c2.graph_creation) == null ? void 0 : _d.color,
            points: GRAPHS_THAT_HAVE_POINTS.includes(newGraphType) ? "outliers" : void 0,
            line_shape: GRAPHS_THAT_HAVE_LINE_SHAPE.includes(newGraphType) ? "linear" : void 0,
            nbins: void 0,
            histnorm: void 0,
            histfunc: GRAPHS_THAT_HAVE_HISTFUNC.includes(newGraphType) ? "count" : void 0
          }, newParams == null ? void 0 : newParams.graph_creation),
          graph_styling: __spreadValues({
            barmode: GRAPHS_THAT_HAVE_BARMODE.includes(newGraphType) ? "group" : void 0,
            barnorm: void 0
          }, newParams == null ? void 0 : newParams.graph_styling)
        }));
      } else {
        props.updateGraphParam(newParams);
      }
    };
    const graphTypeOptions = [
      {
        value: "bar" /* BAR */,
        label: "Bar",
        icon: GraphIcon_default,
        subMenu: /* @__PURE__ */ react_default.createElement(Dropdown_default, { layout: "vertical", position: "horizontal", display: currDropdown === "bar", closeDropdown: () => {
          if (currDropdown === "bar") {
            setCurrDropdown(void 0);
          }
        } }, /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "grouped_x",
            title: "Grouped",
            icon: /* @__PURE__ */ react_default.createElement(GroupIcon_default, null),
            tooltip: "Grouped",
            onClick: () => {
              var _a2, _b2, _c2, _d;
              const [x_axis_column_ids, y_axis_column_ids] = getXandYColumnIDs("y", (_b2 = (_a2 = props.params) == null ? void 0 : _a2.graph_creation) == null ? void 0 : _b2.x_axis_column_ids, (_d = (_c2 = props.params) == null ? void 0 : _c2.graph_creation) == null ? void 0 : _d.y_axis_column_ids);
              updateGraphParams({
                graph_creation: {
                  graph_type: "bar" /* BAR */,
                  x_axis_column_ids,
                  y_axis_column_ids
                },
                graph_styling: {
                  barmode: "group"
                }
              });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "stacked_x",
            title: "Stacked",
            icon: /* @__PURE__ */ react_default.createElement(StackedIcon_default, null),
            tooltip: "Stacked",
            onClick: () => {
              var _a2, _b2, _c2, _d;
              const [x_axis_column_ids, y_axis_column_ids] = getXandYColumnIDs("y", (_b2 = (_a2 = props.params) == null ? void 0 : _a2.graph_creation) == null ? void 0 : _b2.x_axis_column_ids, (_d = (_c2 = props.params) == null ? void 0 : _c2.graph_creation) == null ? void 0 : _d.y_axis_column_ids);
              updateGraphParams({
                graph_creation: {
                  graph_type: "bar" /* BAR */,
                  x_axis_column_ids,
                  y_axis_column_ids
                },
                graph_styling: {
                  barmode: "relative"
                }
              });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "normalized_x",
            title: "Normalized",
            icon: /* @__PURE__ */ react_default.createElement(NormalizedIcon_default, null),
            tooltip: "Normalized",
            onClick: () => {
              var _a2, _b2, _c2, _d;
              const [x_axis_column_ids, y_axis_column_ids] = getXandYColumnIDs("y", (_b2 = (_a2 = props.params) == null ? void 0 : _a2.graph_creation) == null ? void 0 : _b2.x_axis_column_ids, (_d = (_c2 = props.params) == null ? void 0 : _c2.graph_creation) == null ? void 0 : _d.y_axis_column_ids);
              updateGraphParams({
                graph_creation: {
                  graph_type: "bar" /* BAR */,
                  x_axis_column_ids,
                  y_axis_column_ids
                },
                graph_styling: {
                  barmode: "relative",
                  barnorm: "percent"
                }
              });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "grouped_y",
            title: "Grouped",
            icon: /* @__PURE__ */ react_default.createElement(GroupIcon_default, { axis: "y" }),
            tooltip: "Grouped",
            onClick: () => {
              var _a2, _b2, _c2, _d;
              const [x_axis_column_ids, y_axis_column_ids] = getXandYColumnIDs("x", (_b2 = (_a2 = props.params) == null ? void 0 : _a2.graph_creation) == null ? void 0 : _b2.x_axis_column_ids, (_d = (_c2 = props.params) == null ? void 0 : _c2.graph_creation) == null ? void 0 : _d.y_axis_column_ids);
              updateGraphParams({
                graph_creation: {
                  graph_type: "bar" /* BAR */,
                  x_axis_column_ids,
                  y_axis_column_ids
                },
                graph_styling: {
                  barmode: "group"
                }
              });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "stacked_y",
            title: "Stacked",
            icon: /* @__PURE__ */ react_default.createElement(StackedIcon_default, { axis: "y" }),
            tooltip: "Grouped",
            onClick: () => {
              var _a2, _b2, _c2, _d;
              const [x_axis_column_ids, y_axis_column_ids] = getXandYColumnIDs("x", (_b2 = (_a2 = props.params) == null ? void 0 : _a2.graph_creation) == null ? void 0 : _b2.x_axis_column_ids, (_d = (_c2 = props.params) == null ? void 0 : _c2.graph_creation) == null ? void 0 : _d.y_axis_column_ids);
              updateGraphParams({
                graph_creation: {
                  graph_type: "bar" /* BAR */,
                  x_axis_column_ids,
                  y_axis_column_ids
                },
                graph_styling: {
                  barmode: "group",
                  barnorm: void 0
                }
              });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "normalized_y",
            title: "Normalized",
            icon: /* @__PURE__ */ react_default.createElement(NormalizedIcon_default, { axis: "y" }),
            tooltip: "Normalized",
            onClick: () => {
              var _a2, _b2, _c2, _d;
              const [x_axis_column_ids, y_axis_column_ids] = getXandYColumnIDs("x", (_b2 = (_a2 = props.params) == null ? void 0 : _a2.graph_creation) == null ? void 0 : _b2.x_axis_column_ids, (_d = (_c2 = props.params) == null ? void 0 : _c2.graph_creation) == null ? void 0 : _d.y_axis_column_ids);
              updateGraphParams({
                graph_creation: {
                  graph_type: "bar" /* BAR */,
                  x_axis_column_ids,
                  y_axis_column_ids
                },
                graph_styling: {
                  barmode: "relative",
                  barnorm: "percent"
                }
              });
            }
          }
        ))
      },
      {
        value: "line" /* LINE */,
        label: "Line",
        icon: LineChartIcon_default,
        subMenu: /* @__PURE__ */ react_default.createElement(Dropdown_default, { layout: "vertical", position: "horizontal", width: "hug-contents", display: currDropdown === "line", closeDropdown: () => {
          if (currDropdown === "line") {
            setCurrDropdown(void 0);
          }
        } }, /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "linear",
            title: "Linear",
            icon: /* @__PURE__ */ react_default.createElement(LineChartSubMenuIcons_default, { type: "linear" }),
            tooltip: "Linear",
            onClick: () => {
              updateGraphParams({
                graph_creation: {
                  line_shape: "linear",
                  graph_type: "line" /* LINE */
                }
              });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "horizontal",
            title: "Horizontal",
            icon: /* @__PURE__ */ react_default.createElement(LineChartSubMenuIcons_default, { type: "horizontal" }),
            tooltip: "Horizontal",
            onClick: () => {
              updateGraphParams({
                graph_creation: {
                  line_shape: "hv",
                  graph_type: "line" /* LINE */
                }
              });
            }
          }
        ))
      },
      {
        value: "scatter" /* SCATTER */,
        label: "Scatter",
        icon: ScatterPlotIcon_default
      },
      {
        value: "histogram" /* HISTOGRAM */,
        label: "Histogram",
        icon: HistogramIcon_default,
        subMenu: /* @__PURE__ */ react_default.createElement(Dropdown_default, { layout: "vertical", position: "horizontal", style: { width: "445px" }, display: currDropdown === "histogram", closeDropdown: () => {
          if (currDropdown === "histogram") {
            setCurrDropdown(void 0);
          }
        } }, /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "grouped_x",
            title: "Grouped",
            icon: /* @__PURE__ */ react_default.createElement(GroupIcon_default, null),
            tooltip: "Grouped",
            onClick: () => {
              var _a2, _b2, _c2, _d;
              const [x_axis_column_ids, y_axis_column_ids] = getXandYColumnIDs("x", (_b2 = (_a2 = props.params) == null ? void 0 : _a2.graph_creation) == null ? void 0 : _b2.x_axis_column_ids, (_d = (_c2 = props.params) == null ? void 0 : _c2.graph_creation) == null ? void 0 : _d.y_axis_column_ids);
              updateGraphParams({
                graph_creation: {
                  graph_type: "histogram" /* HISTOGRAM */,
                  x_axis_column_ids,
                  y_axis_column_ids
                },
                graph_styling: {
                  barmode: "group"
                }
              });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "stacked_x",
            title: "Stacked",
            icon: /* @__PURE__ */ react_default.createElement(StackedIcon_default, null),
            tooltip: "Stacked",
            onClick: () => {
              var _a2, _b2, _c2, _d;
              const [x_axis_column_ids, y_axis_column_ids] = getXandYColumnIDs("x", (_b2 = (_a2 = props.params) == null ? void 0 : _a2.graph_creation) == null ? void 0 : _b2.x_axis_column_ids, (_d = (_c2 = props.params) == null ? void 0 : _c2.graph_creation) == null ? void 0 : _d.y_axis_column_ids);
              updateGraphParams({
                graph_creation: {
                  graph_type: "histogram" /* HISTOGRAM */,
                  x_axis_column_ids,
                  y_axis_column_ids
                },
                graph_styling: {
                  barmode: "relative"
                }
              });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "overlay_x",
            title: "Overlay",
            icon: /* @__PURE__ */ react_default.createElement(OverlayIcon_default, { axis: "x" }),
            tooltip: "Overlay",
            onClick: () => {
              var _a2, _b2, _c2, _d;
              const [x_axis_column_ids, y_axis_column_ids] = getXandYColumnIDs("x", (_b2 = (_a2 = props.params) == null ? void 0 : _a2.graph_creation) == null ? void 0 : _b2.x_axis_column_ids, (_d = (_c2 = props.params) == null ? void 0 : _c2.graph_creation) == null ? void 0 : _d.y_axis_column_ids);
              updateGraphParams({
                graph_creation: {
                  graph_type: "histogram" /* HISTOGRAM */,
                  x_axis_column_ids,
                  y_axis_column_ids
                },
                graph_styling: {
                  barmode: "overlay"
                }
              });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "normalized_x",
            title: "Normalized",
            icon: /* @__PURE__ */ react_default.createElement(NormalizedIcon_default, null),
            tooltip: "Normalized",
            onClick: () => {
              var _a2, _b2, _c2, _d;
              const [x_axis_column_ids, y_axis_column_ids] = getXandYColumnIDs("x", (_b2 = (_a2 = props.params) == null ? void 0 : _a2.graph_creation) == null ? void 0 : _b2.x_axis_column_ids, (_d = (_c2 = props.params) == null ? void 0 : _c2.graph_creation) == null ? void 0 : _d.y_axis_column_ids);
              updateGraphParams({
                graph_creation: {
                  graph_type: "histogram" /* HISTOGRAM */,
                  x_axis_column_ids,
                  y_axis_column_ids
                },
                graph_styling: {
                  barmode: "relative",
                  barnorm: "percent"
                }
              });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "grouped_y",
            title: "Grouped",
            icon: /* @__PURE__ */ react_default.createElement(GroupIcon_default, { axis: "y" }),
            tooltip: "Grouped",
            onClick: () => {
              var _a2, _b2, _c2, _d;
              const [x_axis_column_ids, y_axis_column_ids] = getXandYColumnIDs("y", (_b2 = (_a2 = props.params) == null ? void 0 : _a2.graph_creation) == null ? void 0 : _b2.x_axis_column_ids, (_d = (_c2 = props.params) == null ? void 0 : _c2.graph_creation) == null ? void 0 : _d.y_axis_column_ids);
              updateGraphParams({
                graph_creation: {
                  graph_type: "histogram" /* HISTOGRAM */,
                  x_axis_column_ids,
                  y_axis_column_ids
                },
                graph_styling: {
                  barmode: "group"
                }
              });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "stacked_y",
            title: "Stacked",
            icon: /* @__PURE__ */ react_default.createElement(StackedIcon_default, { axis: "y" }),
            tooltip: "Stacked",
            onClick: () => {
              var _a2, _b2, _c2, _d;
              const [x_axis_column_ids, y_axis_column_ids] = getXandYColumnIDs("y", (_b2 = (_a2 = props.params) == null ? void 0 : _a2.graph_creation) == null ? void 0 : _b2.x_axis_column_ids, (_d = (_c2 = props.params) == null ? void 0 : _c2.graph_creation) == null ? void 0 : _d.y_axis_column_ids);
              updateGraphParams({
                graph_creation: {
                  graph_type: "histogram" /* HISTOGRAM */,
                  x_axis_column_ids,
                  y_axis_column_ids
                },
                graph_styling: {
                  barmode: "relative"
                }
              });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "overlay_y",
            title: "Overlay",
            icon: /* @__PURE__ */ react_default.createElement(OverlayIcon_default, { axis: "y" }),
            tooltip: "Overlay",
            onClick: () => {
              var _a2, _b2, _c2, _d;
              const [x_axis_column_ids, y_axis_column_ids] = getXandYColumnIDs("y", (_b2 = (_a2 = props.params) == null ? void 0 : _a2.graph_creation) == null ? void 0 : _b2.x_axis_column_ids, (_d = (_c2 = props.params) == null ? void 0 : _c2.graph_creation) == null ? void 0 : _d.y_axis_column_ids);
              updateGraphParams({
                graph_creation: {
                  graph_type: "histogram" /* HISTOGRAM */,
                  x_axis_column_ids,
                  y_axis_column_ids
                },
                graph_styling: {
                  barmode: "overlay"
                }
              });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "normalized_y",
            title: "Normalized",
            icon: /* @__PURE__ */ react_default.createElement(NormalizedIcon_default, { axis: "y" }),
            tooltip: "Normalized",
            onClick: () => {
              var _a2, _b2, _c2, _d;
              const [x_axis_column_ids, y_axis_column_ids] = getXandYColumnIDs("y", (_b2 = (_a2 = props.params) == null ? void 0 : _a2.graph_creation) == null ? void 0 : _b2.x_axis_column_ids, (_d = (_c2 = props.params) == null ? void 0 : _c2.graph_creation) == null ? void 0 : _d.y_axis_column_ids);
              updateGraphParams({
                graph_creation: {
                  graph_type: "histogram" /* HISTOGRAM */,
                  x_axis_column_ids,
                  y_axis_column_ids
                },
                graph_styling: {
                  barmode: "relative",
                  barnorm: "percent"
                }
              });
            }
          }
        ))
      },
      {
        value: "box" /* BOX */,
        label: "Box",
        icon: BoxGraphIcon_default,
        isSelected: graphType === "box" /* BOX */ || graphType === "violin" /* VIOLIN */ || graphType === "ecdf" /* ECDF */,
        subMenu: /* @__PURE__ */ react_default.createElement(Dropdown_default, { layout: "vertical", position: "horizontal", display: currDropdown === "box", closeDropdown: () => {
          if (currDropdown === "box") {
            setCurrDropdown(void 0);
          }
        } }, /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "box",
            title: "Box",
            icon: /* @__PURE__ */ react_default.createElement(BoxPlotSubMenuIcon_default, { type: "box" }),
            tooltip: "Box",
            onClick: () => {
              updateGraphParams({
                graph_creation: {
                  graph_type: "box" /* BOX */
                }
              });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "violin",
            title: "Violin",
            icon: /* @__PURE__ */ react_default.createElement(BoxPlotSubMenuIcon_default, { type: "violin" }),
            tooltip: "Violin",
            onClick: () => {
              updateGraphParams({
                graph_creation: {
                  graph_type: "violin" /* VIOLIN */
                }
              });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "ecdf",
            title: "ECDF",
            icon: /* @__PURE__ */ react_default.createElement(BoxPlotSubMenuIcon_default, { type: "ecdf" }),
            tooltip: "ECDF",
            onClick: () => {
              updateGraphParams({
                graph_creation: {
                  graph_type: "ecdf" /* ECDF */
                }
              });
            }
          }
        ))
      },
      {
        value: "density contour" /* DENSITY_CONTOUR */,
        label: "Density",
        icon: DensityContourIcon_default,
        isSelected: graphType === "density heatmap" /* DENSITY_HEATMAP */ || graphType === "density contour" /* DENSITY_CONTOUR */,
        subMenu: /* @__PURE__ */ react_default.createElement(Dropdown_default, { layout: "vertical", position: "horizontal", width: "hug-contents", display: currDropdown === "density contour" /* DENSITY_CONTOUR */, closeDropdown: () => {
          if (currDropdown === "density heatmap" /* DENSITY_HEATMAP */) {
            setCurrDropdown(void 0);
          }
        } }, /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "heatmap",
            title: "Heatmap",
            icon: /* @__PURE__ */ react_default.createElement(HeatMapIcon_default, { width: "45px" }),
            tooltip: "Heatmap",
            onClick: () => {
              updateGraphParams({
                graph_creation: {
                  graph_type: "density heatmap" /* DENSITY_HEATMAP */
                }
              });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "contour",
            title: "Contour",
            icon: /* @__PURE__ */ react_default.createElement(DensityContourIcon_default, { width: "45px" }),
            tooltip: "Density Contour",
            onClick: () => {
              updateGraphParams({
                graph_creation: {
                  graph_type: "density contour" /* DENSITY_CONTOUR */
                }
              });
            }
          }
        ))
      }
    ];
    return /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["change chart type dropdown" /* ChangeChartTypeDropdown */]
      },
      /* @__PURE__ */ react_default.createElement(
        Dropdown_default,
        {
          display: props.uiState.currOpenDropdown === "change-chart-type",
          closeDropdown: () => {
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenDropdown: prevUIState.currOpenDropdown === "change-chart-type" ? void 0 : prevUIState.currOpenDropdown
              });
            });
          },
          width: "medium"
        },
        graphTypeOptions.map((option) => {
          var _a2;
          return /* @__PURE__ */ react_default.createElement(
            DropdownItem_default,
            {
              key: option.value,
              title: option.label,
              icon: /* @__PURE__ */ react_default.createElement(option.icon, null),
              canHaveCheckMark: true,
              hasCheckMark: (_a2 = option.isSelected) != null ? _a2 : option.value === graphType,
              onMouseEnter: () => {
                setCurrDropdown(option.value);
              },
              onClick: () => {
                if (option.subMenu === void 0) {
                  return updateGraphParams({
                    graph_creation: {
                      graph_type: option.value
                    }
                  });
                }
              },
              subMenu: option.subMenu
            }
          );
        })
      )
    );
  };

  // src/mito/components/taskpanes/Graph/graphUtils.tsx
  var DO_NOT_CHANGE_PAPER_BGCOLOR_DEFAULT = "#FFFFFF";
  var DO_NOT_CHANGE_PLOT_BGCOLOR_DEFAULT = "#E6EBF5";
  var DO_NOT_CHANGE_TITLE_FONT_COLOR_DEFAULT = "#2F3E5D";
  var getAxisColumnIDs = (sheetData, graphType, selectedColumnIds) => {
    if (selectedColumnIds === void 0 || selectedColumnIds.length === 0) {
      return {
        x_axis_column_ids: [],
        y_axis_column_ids: []
      };
    }
    if (selectedColumnIds.length === 1) {
      return {
        x_axis_column_ids: [],
        y_axis_column_ids: selectedColumnIds
      };
    }
    if (graphType === "scatter" /* SCATTER */) {
      return {
        x_axis_column_ids: [selectedColumnIds[0]],
        y_axis_column_ids: selectedColumnIds.slice(1)
      };
    } else {
      if (!isNumberDtype(sheetData.columnDtypeMap[selectedColumnIds[0]])) {
        return {
          x_axis_column_ids: [selectedColumnIds[0]],
          y_axis_column_ids: selectedColumnIds.slice(1)
        };
      } else {
        return {
          x_axis_column_ids: [],
          y_axis_column_ids: selectedColumnIds
        };
      }
    }
  };
  var deleteGraphs = (graphIDs, mitoAPI, setUIState, graphDataArray) => __async(void 0, null, function* () {
    const remainingGraphIDs = graphDataArray.filter((graphData) => !graphIDs.includes(graphData.graph_id)).map((graphData) => graphData.graph_id);
    for (const graphID of graphIDs) {
      yield mitoAPI.editGraphDelete(graphID);
    }
    if (remainingGraphIDs.length === 0) {
      return setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          selectedTabType: "data",
          selectedSheetIndex: prevUIState.selectedSheetIndex > 0 ? prevUIState.selectedSheetIndex - 1 : 0,
          currOpenTaskpane: { type: "none" /* NONE */ },
          currOpenModal: { type: "None" /* None */ }
        });
      });
    }
    const existingParams = yield getParamsForExistingGraph(mitoAPI, remainingGraphIDs[0]);
    if (existingParams === void 0) {
      return;
    }
    return setUIState((prevUIState) => {
      return __spreadProps(__spreadValues({}, prevUIState), {
        selectedTabType: "graph",
        currOpenTaskpane: {
          type: "graph" /* GRAPH */,
          graphSidebarOpen: false,
          openGraph: {
            type: "existing_graph",
            graphID: remainingGraphIDs[0],
            existingParams
          }
        }
      });
    });
  });
  var getValidParamsFromExistingParams = (existingParams, sheetDataArray) => {
    const graphDataSourceSheetIndex = existingParams.graphCreation.sheet_index;
    const validColumnIDs = sheetDataArray[graphDataSourceSheetIndex] !== void 0 ? sheetDataArray[graphDataSourceSheetIndex].data.map((c) => c.columnID) : [];
    const xAxisColumnIDs = intersection(
      validColumnIDs,
      existingParams.graphCreation.x_axis_column_ids
    );
    const yAxisColumnIDs = intersection(
      validColumnIDs,
      existingParams.graphCreation.y_axis_column_ids
    );
    const color = existingParams.graphCreation.color !== void 0 && validColumnIDs.includes(existingParams.graphCreation.color) ? existingParams.graphCreation.color : void 0;
    return __spreadProps(__spreadValues({}, existingParams), {
      graphCreation: __spreadProps(__spreadValues({}, existingParams.graphCreation), {
        x_axis_column_ids: xAxisColumnIDs,
        y_axis_column_ids: yAxisColumnIDs,
        color
      })
    });
  };
  var getDefaultGraphParams = (mitoContainerRef, sheetDataArray, selectedSheetIndex, openGraph) => {
    const graphRenderingParams = getGraphRenderingParams(mitoContainerRef);
    if (openGraph.type === "existing_graph") {
      const newValidParams = getValidParamsFromExistingParams(openGraph.existingParams, sheetDataArray);
      return __spreadProps(__spreadValues({}, newValidParams), {
        graphRendering: graphRenderingParams
      });
    }
    if (openGraph.type === "new_duplicate_graph") {
      const newValidParams = getValidParamsFromExistingParams(openGraph.existingParamsOfDuplicated, sheetDataArray);
      return __spreadProps(__spreadValues({}, newValidParams), {
        graphID: openGraph.graphID,
        graphRendering: graphRenderingParams
      });
    }
    const newGraphType = openGraph.graphType;
    const selectedColumnIDs = openGraph.selectedColumnIds;
    const axis_column_ids = getAxisColumnIDs(sheetDataArray[selectedSheetIndex], newGraphType, selectedColumnIDs);
    return {
      graphID: openGraph.graphID,
      graphPreprocessing: {
        safety_filter_turned_on_by_user: true
      },
      graphCreation: __spreadProps(__spreadValues({
        graph_type: newGraphType,
        sheet_index: selectedSheetIndex,
        color: void 0,
        facet_col_column_id: void 0,
        facet_row_column_id: void 0,
        facet_col_wrap: void 0,
        facet_col_spacing: void 0,
        facet_row_spacing: void 0
      }, axis_column_ids), {
        points: GRAPHS_THAT_HAVE_POINTS.includes(newGraphType) ? "outliers" : void 0,
        line_shape: GRAPHS_THAT_HAVE_LINE_SHAPE.includes(newGraphType) ? "linear" : void 0,
        nbins: void 0,
        histnorm: void 0,
        histfunc: GRAPHS_THAT_HAVE_HISTFUNC.includes(newGraphType) ? "count" : void 0
      }),
      graphStyling: {
        title: {
          title: void 0,
          visible: true,
          title_font_color: DO_NOT_CHANGE_TITLE_FONT_COLOR_DEFAULT
        },
        xaxis: {
          title: void 0,
          visible: true,
          title_font_color: DO_NOT_CHANGE_TITLE_FONT_COLOR_DEFAULT,
          type: void 0,
          showgrid: true,
          gridwidth: void 0,
          rangeslider: {
            visible: true
          }
        },
        yaxis: {
          title: void 0,
          visible: true,
          title_font_color: DO_NOT_CHANGE_TITLE_FONT_COLOR_DEFAULT,
          type: void 0,
          showgrid: true,
          gridwidth: void 0
        },
        showlegend: true,
        legend: {
          title: {
            text: void 0
          },
          orientation: "v",
          x: void 0,
          y: void 0
        },
        paper_bgcolor: DO_NOT_CHANGE_PAPER_BGCOLOR_DEFAULT,
        plot_bgcolor: DO_NOT_CHANGE_PLOT_BGCOLOR_DEFAULT,
        barmode: GRAPHS_THAT_HAVE_BARMODE.includes(newGraphType) ? "group" : void 0,
        barnorm: void 0
      },
      graphRendering: graphRenderingParams
    };
  };
  var getDefaultSafetyFilter = (sheetDataArray, sheetIndex) => {
    return sheetDataArray[sheetIndex] === void 0 || sheetDataArray[sheetIndex].numRows > GRAPH_SAFETY_FILTER_CUTOFF;
  };
  var getColorDropdownItems = (columnIDsMap, columnDtypesMap, setColor) => {
    const NoneOption = [/* @__PURE__ */ react_default.createElement(
      DropdownItem_default,
      {
        key: "None",
        title: "None",
        onClick: () => setColor(void 0)
      }
    )];
    const columnDropdownItems = Object.keys(columnIDsMap || {}).map((columnID) => {
      const columnHeader = columnIDsMap[columnID];
      const disabled = isDatetimeDtype(columnDtypesMap[columnID]);
      return /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          key: columnID,
          title: getDisplayColumnHeader(columnHeader),
          onClick: () => setColor(columnID),
          disabled,
          subtext: disabled ? "Dates cannot be used as the color breakdown property" : "",
          hideSubtext: true,
          displaySubtextOnHover: true
        }
      );
    });
    return NoneOption.concat(columnDropdownItems);
  };
  var getGraphRenderingParams = (mitoContainerRef) => {
    var _a, _b, _c, _d, _e;
    const centerContentContainerBoundingRect = (_b = (_a = mitoContainerRef.current) == null ? void 0 : _a.querySelector("#mito-center-content-container")) == null ? void 0 : _b.getBoundingClientRect();
    const graphSidebarToolbarContainerBoundingRect = (_d = (_c = mitoContainerRef.current) == null ? void 0 : _c.querySelector(".graph-sidebar-toolbar-container")) == null ? void 0 : _d.getBoundingClientRect();
    const graphSidebarToolbarContainerWidth = (_e = graphSidebarToolbarContainerBoundingRect == null ? void 0 : graphSidebarToolbarContainerBoundingRect.width) != null ? _e : 0;
    if (centerContentContainerBoundingRect === void 0) {
      return {
        height: void 0,
        width: void 0
      };
    }
    const newHeight = `${(centerContentContainerBoundingRect == null ? void 0 : centerContentContainerBoundingRect.height) - 10}px`;
    const newWidth = `${(centerContentContainerBoundingRect == null ? void 0 : centerContentContainerBoundingRect.width) - 20 - graphSidebarToolbarContainerWidth}px`;
    return {
      height: newHeight,
      width: newWidth
    };
  };
  var convertFrontendtoBackendGraphParams = (graphParamsFrontend) => {
    var _a, _b;
    const graphCreationParams = graphParamsFrontend.graphCreation;
    const graphStylingParams = graphParamsFrontend.graphStyling;
    return {
      graph_id: graphParamsFrontend.graphID,
      graph_creation: __spreadProps(__spreadValues({}, graphParamsFrontend.graphCreation), {
        facet_col_wrap: convertStringToFloatOrUndefined(graphCreationParams.facet_col_wrap),
        facet_col_spacing: convertStringToFloatOrUndefined(graphCreationParams.facet_col_spacing),
        facet_row_spacing: convertStringToFloatOrUndefined(graphCreationParams.facet_row_spacing),
        nbins: convertStringToFloatOrUndefined(graphCreationParams.nbins)
      }),
      graph_styling: __spreadProps(__spreadValues({}, graphParamsFrontend.graphStyling), {
        xaxis: __spreadProps(__spreadValues({}, graphParamsFrontend.graphStyling.xaxis), {
          gridwidth: convertStringToFloatOrUndefined((_a = graphStylingParams == null ? void 0 : graphStylingParams.xaxis) == null ? void 0 : _a.gridwidth)
        }),
        yaxis: __spreadProps(__spreadValues({}, graphParamsFrontend.graphStyling.yaxis), {
          gridwidth: convertStringToFloatOrUndefined((_b = graphStylingParams == null ? void 0 : graphStylingParams.yaxis) == null ? void 0 : _b.gridwidth)
        }),
        legend: __spreadProps(__spreadValues({}, graphParamsFrontend.graphStyling.legend), {
          x: convertStringToFloatOrUndefined(graphStylingParams.legend.x),
          y: convertStringToFloatOrUndefined(graphStylingParams.legend.y)
        })
      }),
      graph_preprocessing: graphParamsFrontend.graphPreprocessing,
      graph_rendering: graphParamsFrontend.graphRendering
    };
  };
  var convertBackendtoFrontendGraphParams = (graphParamsBackend) => {
    var _a, _b, _c, _d;
    const graphCreationParams = graphParamsBackend.graph_creation;
    const graphStylingParams = graphParamsBackend.graph_styling;
    return {
      graphID: graphParamsBackend.graph_id,
      graphCreation: __spreadProps(__spreadValues({}, graphCreationParams), {
        facet_col_wrap: convertToStringOrUndefined(graphCreationParams.facet_col_wrap),
        facet_col_spacing: convertToStringOrUndefined(graphCreationParams.facet_col_spacing),
        facet_row_spacing: convertToStringOrUndefined(graphCreationParams.facet_row_spacing),
        nbins: convertToStringOrUndefined(graphCreationParams.nbins)
      }),
      graphStyling: __spreadProps(__spreadValues({}, graphStylingParams), {
        xaxis: __spreadProps(__spreadValues({}, graphStylingParams.xaxis), {
          gridwidth: convertToStringOrUndefined((_a = graphStylingParams.xaxis) == null ? void 0 : _a.gridwidth)
        }),
        yaxis: __spreadProps(__spreadValues({}, graphStylingParams.yaxis), {
          gridwidth: convertToStringOrUndefined((_b = graphStylingParams.yaxis) == null ? void 0 : _b.gridwidth)
        }),
        legend: __spreadProps(__spreadValues({}, graphStylingParams.legend), {
          x: convertToStringOrUndefined((_c = graphStylingParams.legend) == null ? void 0 : _c.x),
          y: convertToStringOrUndefined((_d = graphStylingParams.legend) == null ? void 0 : _d.y)
        })
      }),
      graphPreprocessing: graphParamsBackend.graph_preprocessing,
      graphRendering: graphParamsBackend.graph_rendering
    };
  };
  var getParamsForExistingGraph = (mitoAPI, graphID) => __async(void 0, null, function* () {
    const response = yield mitoAPI.getGraphParams(graphID);
    const existingParamsBackend = "error" in response ? void 0 : response.result;
    if (existingParamsBackend !== void 0) {
      return convertBackendtoFrontendGraphParams(existingParamsBackend);
    }
  });
  var openGraphSidebar = (setUIState, uiState, setEditorState, sheetDataArray, mitoAPI, newOpenGraph) => __async(void 0, null, function* () {
    setEditorState(void 0);
    if (sheetDataArray.length === 0) {
      setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenTaskpane: {
            type: "import_first" /* IMPORT_FIRST */,
            message: "Before graphing data, you need to import some!"
          }
        });
      });
      return;
    }
    if (newOpenGraph.type === "existing_graph") {
      const existingParams = yield getParamsForExistingGraph(mitoAPI, newOpenGraph.graphID);
      if (existingParams === void 0) {
        return;
      }
      setUIState(__spreadProps(__spreadValues({}, uiState), {
        selectedTabType: "graph",
        currOpenModal: { type: "None" /* None */ },
        currOpenTaskpane: {
          type: "graph" /* GRAPH */,
          graphSidebarOpen: false,
          openGraph: {
            type: "existing_graph",
            graphID: newOpenGraph.graphID,
            existingParams
          }
        },
        currentToolbarTab: "Chart Design"
      }));
    } else if (newOpenGraph.type === "new_graph") {
      const newGraphID = getRandomId();
      setUIState(__spreadProps(__spreadValues({}, uiState), {
        selectedTabType: "graph",
        currOpenModal: { type: "None" /* None */ },
        currentToolbarTab: "Chart Design",
        currOpenTaskpane: {
          type: "graph" /* GRAPH */,
          graphSidebarOpen: true,
          openGraph: {
            type: "new_graph",
            graphID: newGraphID,
            graphType: newOpenGraph.graphType,
            selectedColumnIds: newOpenGraph.selectedColumnIds
          }
        }
      }));
    } else {
      const existingParams = yield getParamsForExistingGraph(mitoAPI, newOpenGraph.graphIDToDuplicate);
      if (existingParams === void 0) {
        return;
      }
      const newGraphID = getRandomId();
      setUIState(__spreadProps(__spreadValues({}, uiState), {
        selectedTabType: "graph",
        currOpenModal: { type: "None" /* None */ },
        currOpenTaskpane: {
          type: "graph" /* GRAPH */,
          graphSidebarOpen: true,
          openGraph: {
            type: "new_duplicate_graph",
            graphID: newGraphID,
            graphIDOfDuplicated: newOpenGraph.graphIDToDuplicate,
            existingParamsOfDuplicated: existingParams
          }
        }
      }));
    }
  });
  var getGraphElementObjects = (graphOutput) => {
    if (graphOutput === void 0) {
      return;
    }
    const div = document.getElementById(graphOutput.graphHTML.split('id="')[1].split('"')[0]);
    if (div === null) {
      return;
    }
    return {
      div,
      gtitle: div.getElementsByClassName("g-gtitle")[0],
      xtitle: div.getElementsByClassName("g-xtitle")[0],
      ytitle: div.getElementsByClassName("g-ytitle")[0]
    };
  };
  var getGraphElementInfoFromHTMLElement = (graphElement, elementType, graphOutput, mitoContainer, display) => {
    var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
    const clientRect = graphElement.getBoundingClientRect();
    if (mitoContainer === null || graphOutput === void 0) {
      return {
        element: elementType,
        popupPosition: {
          left: 0,
          top: 0
        },
        display: "highlight-selected-element",
        defaultValue: ""
      };
    }
    const graphOutputTop = (_b = (_a = document.getElementById(graphOutput.graphHTML.split('id="')[1].split('"')[0])) == null ? void 0 : _a.getBoundingClientRect().top) != null ? _b : 0;
    const mitoDivClientRect = mitoContainer == null ? void 0 : mitoContainer.getBoundingClientRect();
    const mitoDivLeft = (_c = mitoDivClientRect == null ? void 0 : mitoDivClientRect.left) != null ? _c : 0;
    const mitoDivTop = (_d = mitoDivClientRect == null ? void 0 : mitoDivClientRect.top) != null ? _d : 0;
    const mitoDivBottom = (_e = mitoDivClientRect == null ? void 0 : mitoDivClientRect.bottom) != null ? _e : 0;
    if (elementType === "gtitle") {
      return {
        element: "gtitle",
        popupPosition: {
          left: clientRect.left - mitoDivLeft,
          top: clientRect.bottom - mitoDivTop + 10
        },
        defaultValue: (_g = (_f = graphElement.children) == null ? void 0 : _f[0]) == null ? void 0 : _g.innerHTML,
        display
      };
    } else if (elementType === "xtitle") {
      return {
        element: "xtitle",
        popupPosition: {
          left: (clientRect.left + clientRect.right) / 2 - mitoDivLeft - 70,
          bottom: mitoDivBottom - clientRect.top + 10
        },
        defaultValue: (_i = (_h = graphElement.children) == null ? void 0 : _h[0]) == null ? void 0 : _i.innerHTML,
        display
      };
    } else {
      const top = display === "context-menu" ? (clientRect.top + clientRect.bottom) / 2 : clientRect.top;
      const titleDivTop = mitoDivBottom - top + 10;
      const graphDivTop = mitoDivBottom - graphOutputTop;
      let left = clientRect.left - mitoDivLeft;
      const bottom = Math.min(titleDivTop, graphDivTop);
      if (display === "context-menu") {
        left += 25;
      }
      return {
        element: "ytitle",
        popupPosition: {
          left,
          bottom
        },
        defaultValue: (_k = (_j = graphElement.children) == null ? void 0 : _j[0]) == null ? void 0 : _k.innerHTML,
        display
      };
    }
  };
  var registerClickEventsForGraphElements = (graphOutput, setSelectedGraphElement, mitoContainer) => {
    const graphElementObjects = getGraphElementObjects(graphOutput);
    if (graphElementObjects === void 0) {
      return;
    }
    const { gtitle, ytitle, xtitle } = graphElementObjects;
    gtitle.style.pointerEvents = "all";
    xtitle.style.pointerEvents = "all";
    ytitle.style.pointerEvents = "all";
    gtitle.addEventListener("contextmenu", (e) => {
      e.preventDefault();
      setSelectedGraphElement(getGraphElementInfoFromHTMLElement(gtitle, "gtitle", graphOutput, mitoContainer, "context-menu"));
    });
    xtitle.addEventListener("contextmenu", (e) => {
      e.preventDefault();
      setSelectedGraphElement(getGraphElementInfoFromHTMLElement(xtitle, "xtitle", graphOutput, mitoContainer, "context-menu"));
    });
    ytitle.addEventListener("contextmenu", (e) => {
      e.preventDefault();
      setSelectedGraphElement(getGraphElementInfoFromHTMLElement(ytitle, "ytitle", graphOutput, mitoContainer, "context-menu"));
    });
    gtitle.addEventListener("click", () => {
      setSelectedGraphElement(getGraphElementInfoFromHTMLElement(xtitle, "gtitle", graphOutput, mitoContainer, "highlight-selected-element"));
    });
    xtitle.addEventListener("click", () => {
      setSelectedGraphElement(getGraphElementInfoFromHTMLElement(xtitle, "xtitle", graphOutput, mitoContainer, "highlight-selected-element"));
    });
    ytitle.addEventListener("click", () => {
      setSelectedGraphElement(getGraphElementInfoFromHTMLElement(ytitle, "ytitle", graphOutput, mitoContainer, "highlight-selected-element"));
    });
    gtitle.addEventListener("dblclick", () => {
      setSelectedGraphElement(getGraphElementInfoFromHTMLElement(gtitle, "gtitle", graphOutput, mitoContainer, "popup-title-editor"));
    });
    xtitle.addEventListener("dblclick", () => {
      setSelectedGraphElement(getGraphElementInfoFromHTMLElement(xtitle, "xtitle", graphOutput, mitoContainer, "popup-title-editor"));
    });
    ytitle.addEventListener("dblclick", () => {
      setSelectedGraphElement(getGraphElementInfoFromHTMLElement(ytitle, "ytitle", graphOutput, mitoContainer, "popup-title-editor"));
    });
  };

  // src/mito/api/api.tsx
  var getRandomId = () => {
    return "_" + Math.random().toString(36).substr(2, 9);
  };
  var MitoAPI2 = class {
    constructor(getSendFunction, setSheetDataArray, setAnalysisData, setUserProfile, setUIState) {
      this.getSendFunction = getSendFunction;
      this.setSheetDataArray = setSheetDataArray;
      this.setAnalysisData = setAnalysisData;
      this.setUserProfile = setUserProfile;
      this.setUIState = setUIState;
    }
    _updateSharedStateVariables(response) {
      if (response.sheetDataArray) {
        this.setSheetDataArray(response.sheetDataArray);
      }
      if (response.analysisData) {
        this.setAnalysisData(response.analysisData);
      }
      if (response.userProfile) {
        this.setUserProfile(response.userProfile);
      }
    }
    _handleErrorResponse(response) {
      if (response.showErrorModal) {
        this.setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            currOpenModal: {
              type: "Error" /* Error */,
              error: response
            }
          });
        });
      }
      return response;
    }
    _startLoading(msg) {
      return setTimeout(() => {
        this.setUIState((prevUIState) => {
          const newLoadingCalls = [...prevUIState.loading];
          newLoadingCalls.push([msg["id"], msg["step_id"], msg["type"]]);
          return __spreadProps(__spreadValues({}, prevUIState), {
            loading: newLoadingCalls
          });
        });
      }, 500);
    }
    _stopLoading(id, timeout) {
      clearTimeout(timeout);
      this.setUIState((prevUIState) => {
        const newLoadingCalls = [...prevUIState.loading];
        const messageIndex = newLoadingCalls.findIndex((value) => {
          return value[0] === id;
        });
        if (messageIndex >= 0) {
          newLoadingCalls.splice(messageIndex, 1);
        }
        return __spreadProps(__spreadValues({}, prevUIState), {
          loading: newLoadingCalls
        });
      });
    }
    send(msg) {
      return __async(this, null, function* () {
        const id = getRandomId();
        msg["id"] = id;
        if (this._send === void 0) {
          const _send = yield this.getSendFunction();
          this._send = this._send || _send;
        }
        if (this._send === void 0) {
          console.error(`Unable to establish comm. Quitting before sending message with id ${id}`);
          return { error: "Connection error. Unable to establish comm.", errorShort: "Connection error", showErrorModal: true };
        }
        const loadingTimeout = this._startLoading(msg);
        const response = yield this._send(msg);
        this._stopLoading(id, loadingTimeout);
        if ("error" in response) {
          return this._handleErrorResponse(response);
        } else {
          this._updateSharedStateVariables(response);
          return { result: response.result };
        }
      });
    }
    getPathContents(pathParts, importFolderPath) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_path_contents",
          "params": {
            "path_parts": pathParts,
            "import_folder": importFolderPath
          }
        });
      });
    }
    getPathJoined(pathParts) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_path_join",
          "params": {
            "path_parts": pathParts
          }
        });
      });
    }
    getDataframeAsCSV(sheetIndex) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_dataframe_as_csv",
          "params": {
            "sheet_index": sheetIndex
          }
        });
      });
    }
    getSearchMatches(sheetIndex, searchValue) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_search_matches",
          "params": {
            "sheet_index": sheetIndex,
            "search_value": searchValue
          }
        });
      });
    }
    getDataframesAsExcel(sheetIndexes, exportFormatting) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_dataframe_as_excel",
          "params": {
            "sheet_indexes": sheetIndexes,
            "export_formatting": exportFormatting
          }
        });
      });
    }
    getColumnSummaryGraph(sheetIndex, column_id, height, width) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_column_summary_graph",
          "params": {
            "sheet_index": sheetIndex,
            "column_id": column_id,
            "height": height,
            "width": width,
            "include_plotlyjs": window.Plotly === void 0
          }
        });
      });
    }
    getColumnDescribe(sheetIndex, columnID) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_column_describe",
          "params": {
            "sheet_index": sheetIndex,
            "column_id": columnID
          }
        });
      });
    }
    getParams(stepType, stepID, executionDataToMatch, paramsToMatch) {
      return __async(this, null, function* () {
        const response = yield this.send({
          "event": "api_call",
          "type": "get_params",
          "params": {
            "step_type": stepType,
            "step_id_to_match": stepID || "",
            "execution_data_to_match": executionDataToMatch,
            "params_to_match": paramsToMatch
          }
        });
        if ("error" in response) {
          return response;
        } else {
          const result = response.result;
          if (result === null) {
            return { result: void 0 };
          } else {
            return { result };
          }
        }
      });
    }
    getAllParamsForStepType(stepType) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_all_params_for_step_type",
          "params": {
            "step_type": stepType
          }
        });
      });
    }
    getPivotParams(destinationSheetIndex) {
      return __async(this, null, function* () {
        return yield this.getParams("pivot", void 0, {
          "destination_sheet_index": destinationSheetIndex
        });
      });
    }
    getMergeParams(destinationSheetIndex) {
      return __async(this, null, function* () {
        return yield this.getParams("merge", void 0, {
          "destination_sheet_index": destinationSheetIndex
        });
      });
    }
    getGraphParams(graphID) {
      return __async(this, null, function* () {
        return yield this.getParams("graph", void 0, {}, {
          "graph_id": graphID
        });
      });
    }
    getExcelFileMetadata(filePath) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_excel_file_metadata",
          "params": {
            "file_path": filePath
          }
        });
      });
    }
    getCSVFilesMetadata(fileNames) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_csv_files_metadata",
          "params": {
            "file_names": fileNames
          }
        });
      });
    }
    getUniqueValueCounts(sheetIndex, columnID, searchString, sort) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_unique_value_counts",
          "params": {
            "sheet_index": sheetIndex,
            "column_id": columnID,
            "search_string": searchString,
            "sort": sort
          }
        });
      });
    }
    getSplitTextToColumnsPreview(params) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_split_text_to_columns_preview",
          "params": params
        });
      });
    }
    getDefinedDfNames() {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_defined_df_names",
          "params": {}
        });
      });
    }
    getImportedFilesAndDataframesFromCurrentSteps() {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_imported_files_and_dataframes_from_current_steps",
          "params": {}
        });
      });
    }
    getImportedFilesAndDataframesFromAnalysisName(analysisName, args) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_imported_files_and_dataframes_from_analysis_name",
          "params": {
            "analysis_name": analysisName,
            "args": args
          }
        });
      });
    }
    getTestImports(updated_step_import_data_list) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_test_imports",
          "params": {
            "updated_step_import_data_list": updated_step_import_data_list
          }
        });
      });
    }
    getRenderCount() {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_render_count",
          "params": {}
        });
      });
    }
    getCodeSnippets() {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_code_snippets",
          "params": {}
        });
      });
    }
    getAvailableSnowflakeOptionsAndDefaults(table_loc_and_warehouse) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_available_snowflake_options_and_defaults",
          "params": {
            "table_loc_and_warehouse": table_loc_and_warehouse
          }
        });
      });
    }
    validateSnowflakeCredentials(params) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_validate_snowflake_credentials",
          "params": params
        });
      });
    }
    getAICompletion(user_input, selection, previous_failed_completions) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_ai_completion",
          "params": {
            "user_input": user_input,
            "selection": selection,
            "previous_failed_completions": previous_failed_completions
          }
        });
      });
    }
    getParameterizableParams() {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_parameterizable_params",
          "params": {}
        });
      });
    }
    getPRUrlOfNewPR(name, description, schedule) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_pr_url_of_new_pr",
          "params": {
            "automation_name": name,
            "automation_description": description,
            "schedule": schedule
          }
        });
      });
    }
    _edit(edit_event_type, params, stepID) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "edit_event",
          "type": edit_event_type,
          "step_id": stepID,
          "params": params
        });
      });
    }
    editGraph(graphID, graphParams, height, width, stepID, refreshUseLiveUpdatingHooks) {
      return __async(this, null, function* () {
        const graphParamsBackend = convertFrontendtoBackendGraphParams(graphParams);
        return yield this.send({
          "event": "edit_event",
          "type": "graph_edit",
          "step_id": stepID,
          "refresh_use_live_updating_hooks": refreshUseLiveUpdatingHooks,
          "params": {
            "graph_id": graphID,
            "graph_preprocessing": graphParamsBackend.graph_preprocessing,
            "graph_creation": graphParamsBackend.graph_creation,
            "graph_styling": graphParamsBackend.graph_styling,
            "graph_rendering": {
              "height": height,
              "width": width
            },
            "include_plotlyjs": window.Plotly === void 0
          }
        });
      });
    }
    editGraphDelete(graphID) {
      return __async(this, null, function* () {
        yield this.send({
          "event": "edit_event",
          "type": "graph_delete_edit",
          "step_id": getRandomId(),
          "params": {
            "graph_id": graphID
          }
        });
      });
    }
    editGraphRename(graphID, newGraphTabName) {
      return __async(this, null, function* () {
        yield this.send({
          "event": "edit_event",
          "type": "graph_rename_edit",
          "step_id": getRandomId(),
          "params": {
            "graph_id": graphID,
            "new_graph_tab_name": newGraphTabName
          }
        });
      });
    }
    editAddColumn(sheetIndex, columnHeader, columnHeaderIndex) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "edit_event",
          "type": "add_column_edit",
          "step_id": getRandomId(),
          "params": {
            "sheet_index": sheetIndex,
            "column_header": columnHeader,
            "column_header_index": columnHeaderIndex
          }
        });
      });
    }
    editDeleteColumn(sheetIndex, columnIDs) {
      return __async(this, null, function* () {
        columnIDs = columnIDs.filter((columnID) => columnID !== void 0);
        yield this.send({
          "event": "edit_event",
          "type": "delete_column_edit",
          "step_id": getRandomId(),
          "params": {
            "sheet_index": sheetIndex,
            "column_ids": columnIDs
          }
        });
      });
    }
    editDeleteRow(sheetIndex, labels) {
      return __async(this, null, function* () {
        yield this.send({
          "event": "edit_event",
          "type": "delete_row_edit",
          "step_id": getRandomId(),
          "params": {
            "sheet_index": sheetIndex,
            "labels": labels
          }
        });
      });
    }
    editTranspose(sheet_index) {
      return __async(this, null, function* () {
        yield this.send({
          "event": "edit_event",
          "type": "transpose_edit",
          "step_id": getRandomId(),
          "params": {
            sheet_index
          }
        });
      });
    }
    editOneHotEncoding(sheet_index, column_id) {
      return __async(this, null, function* () {
        yield this.send({
          "event": "edit_event",
          "type": "one_hot_encoding_edit",
          "step_id": getRandomId(),
          "params": {
            sheet_index,
            column_id
          }
        });
      });
    }
    editResetIndex(sheet_index, drop) {
      return __async(this, null, function* () {
        yield this.send({
          "event": "edit_event",
          "type": "reset_index_edit",
          "step_id": getRandomId(),
          "params": {
            sheet_index,
            drop
          }
        });
      });
    }
    editReplace(sheet_index, search_value, replace_value, column_ids) {
      return __async(this, null, function* () {
        const stepID = getRandomId();
        yield this.send({
          "event": "edit_event",
          "type": "replace_edit",
          "step_id": stepID,
          "params": {
            sheet_index,
            search_value,
            replace_value,
            column_ids
          }
        });
      });
    }
    editPromoteRowToHeader(sheetIndex, index) {
      return __async(this, null, function* () {
        yield this.send({
          "event": "edit_event",
          "type": "promote_row_to_header_edit",
          "step_id": getRandomId(),
          "params": {
            "sheet_index": sheetIndex,
            "index": index
          }
        });
      });
    }
    editReorderColumn(sheetIndex, columnID, newIndex) {
      return __async(this, null, function* () {
        yield this.send({
          "event": "edit_event",
          "type": "reorder_column_edit",
          "step_id": getRandomId(),
          "params": {
            "sheet_index": sheetIndex,
            "column_id": columnID,
            "new_column_index": newIndex
          }
        });
      });
    }
    editDataframeRename(sheetIndex, newDataframeName) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "edit_event",
          "type": "dataframe_rename_edit",
          "step_id": getRandomId(),
          "params": {
            "sheet_index": sheetIndex,
            "new_dataframe_name": newDataframeName
          }
        });
      });
    }
    editFilter(sheetIndex, columnID, filters, operator, filterLocation, stepID) {
      return __async(this, null, function* () {
        return yield this.send({
          event: "edit_event",
          type: "filter_column_edit",
          "step_id": stepID,
          "params": {
            sheet_index: sheetIndex,
            column_id: columnID,
            operator,
            filters,
            filter_location: filterLocation
          }
        });
      });
    }
    editRenameColumn(sheetIndex, columnID, newColumnHeader, level) {
      return __async(this, null, function* () {
        return yield this.send({
          event: "edit_event",
          type: "rename_column_edit",
          "step_id": getRandomId(),
          "params": {
            sheet_index: sheetIndex,
            column_id: columnID,
            new_column_header: newColumnHeader,
            level
          }
        });
      });
    }
    editColumnHeadersTransform(params) {
      return __async(this, null, function* () {
        yield this.send({
          "event": "edit_event",
          "type": "column_headers_transform_edit",
          "step_id": getRandomId(),
          "params": params
        });
      });
    }
    editDataframeDuplicate(sheetIndex) {
      return __async(this, null, function* () {
        yield this.send({
          "event": "edit_event",
          "type": "dataframe_duplicate_edit",
          "step_id": getRandomId(),
          "params": {
            "sheet_index": sheetIndex
          }
        });
      });
    }
    editDataframeDelete(sheetIndex) {
      return __async(this, null, function* () {
        yield this.send({
          "event": "edit_event",
          "type": "dataframe_delete_edit",
          "step_id": getRandomId(),
          "params": {
            "sheet_index": sheetIndex
          }
        });
      });
    }
    getSavedAnalysisCode() {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "api_call",
          "type": "get_saved_analysis_code",
          "params": {}
        });
      });
    }
    editSetDataframeFormat(sheetIndex, dfFormat) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "edit_event",
          "type": "set_dataframe_format_edit",
          "step_id": getRandomId(),
          "params": {
            "sheet_index": sheetIndex,
            "df_format": dfFormat
          }
        });
      });
    }
    editSetColumnFormula(sheetIndex, columnID, formula_label, newFormula, index_labels_formula_is_applied_to, cell_editor_location) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "edit_event",
          "type": "set_column_formula_edit",
          "step_id": getRandomId(),
          "params": {
            "sheet_index": sheetIndex,
            "column_id": columnID,
            "formula_label": formula_label,
            "new_formula": newFormula,
            "index_labels_formula_is_applied_to": index_labels_formula_is_applied_to,
            "cell_editor_location": cell_editor_location
          }
        });
      });
    }
    editSortColumn(sheetIndex, columnID, direction) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "edit_event",
          "type": "sort_edit",
          "step_id": getRandomId(),
          "params": {
            "sheet_index": sheetIndex,
            "column_id": columnID,
            "sort_direction": direction
          }
        });
      });
    }
    editChangeColumnDtype(sheetIndex, columnIDs, newDtype, stepID) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "edit_event",
          "type": "change_column_dtype_edit",
          "step_id": stepID,
          "params": {
            "sheet_index": sheetIndex,
            "column_ids": columnIDs,
            "new_dtype": newDtype
          }
        });
      });
    }
    editSimpleImport(fileNames) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "edit_event",
          "type": "simple_import_edit",
          "step_id": getRandomId(),
          "params": {
            "file_names": fileNames
          }
        });
      });
    }
    updateUndo() {
      return __async(this, null, function* () {
        yield this.send({
          "event": "update_event",
          "type": "undo",
          "params": {}
        });
      });
    }
    updateGoPro() {
      return __async(this, null, function* () {
        yield this.send({
          "event": "update_event",
          "type": "go_pro",
          "params": {}
        });
      });
    }
    updateRedo() {
      return __async(this, null, function* () {
        yield this.send({
          "event": "update_event",
          "type": "redo",
          "params": {}
        });
      });
    }
    updateClear() {
      return __async(this, null, function* () {
        yield this.send({
          "event": "update_event",
          "type": "clear",
          "params": {}
        });
      });
    }
    updateRenderCount() {
      return __async(this, null, function* () {
        yield this.send({
          "event": "update_event",
          "type": "render_count_update",
          "params": {
            "number_rendered_sheets": document.querySelectorAll(".mito-container").length,
            "jupyterlab_theme": document.body.getAttribute("data-jp-theme-name") || "undefined"
          }
        });
      });
    }
    updateReplayAnalysis(analysisName, args, stepImportDataListToOverwrite) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "update_event",
          "type": "replay_analysis_update",
          "params": {
            "analysis_name": analysisName,
            "args": args,
            "step_import_data_list_to_overwrite": stepImportDataListToOverwrite === void 0 ? [] : stepImportDataListToOverwrite
          }
        });
      });
    }
    updateArgs(args) {
      return __async(this, null, function* () {
        yield this.send({
          "event": "update_event",
          "type": "args_update",
          "params": {
            "args": args
          }
        });
      });
    }
    updateCodeOptions(codeOptions) {
      return __async(this, null, function* () {
        yield this.send({
          "event": "update_event",
          "type": "code_options_update",
          "params": {
            "code_options": codeOptions
          }
        });
      });
    }
    updateSignUp(userEmail) {
      return __async(this, null, function* () {
        yield this.send({
          "event": "update_event",
          "type": "set_user_field_update",
          "params": {
            "field": "user_email" /* UJ_USER_EMAIL */,
            "value": userEmail
          }
        });
      });
    }
    updateExistingImports(updatedStepImportDataList) {
      return __async(this, null, function* () {
        return yield this.send({
          "event": "update_event",
          "type": "update_existing_import_update",
          "params": {
            "updated_step_import_data_list": updatedStepImportDataList
          }
        });
      });
    }
    updateManuallyMarkUpgraded() {
      return __async(this, null, function* () {
        const tenDaysAgo = new Date().getDate() - 10;
        const tenDaysAgoDate = new Date();
        tenDaysAgoDate.setDate(tenDaysAgo);
        yield this.send({
          "event": "update_event",
          "type": "set_user_field_update",
          "params": {
            "field": "mitosheet_last_upgraded_date" /* UJ_MITOSHEET_LAST_UPGRADED_DATE */,
            "value": tenDaysAgoDate.toISOString().split("T")[0]
          }
        });
      });
    }
    updateAcceptAITransformationPrivacyPolicy() {
      return __async(this, null, function* () {
        yield this.send({
          "event": "update_event",
          "type": "set_user_field_update",
          "params": {
            "field": "ai_privacy_policy" /* UJ_AI_PRIVACY_POLICY */,
            "value": true
          }
        });
      });
    }
    updateCheckoutStepByIndex(stepIndex) {
      return __async(this, null, function* () {
        yield this.send({
          "event": "update_event",
          "type": "checkout_step_by_idx_update",
          "params": {
            "step_idx": stepIndex
          }
        });
      });
    }
    updateUndoToStepIndex(stepIndex) {
      return __async(this, null, function* () {
        yield this.send({
          "event": "update_event",
          "type": "undo_to_step_index_update",
          "params": {
            "step_idx": stepIndex
          }
        });
      });
    }
    updateCloseTour(tourNames) {
      return __async(this, null, function* () {
        yield this.send({
          "event": "update_event",
          "type": "append_user_field_update",
          "params": {
            "field": "received_tours" /* UJ_RECEIVED_TOURS */,
            "value": tourNames
          }
        });
      });
    }
    updateFeedback(feedbackID, numUsages, questionsAndAnswers) {
      return __async(this, null, function* () {
        const message = {
          "event": "update_event",
          "type": "update_feedback_v2_obj_update",
          "params": {
            "feedback_id": feedbackID,
            "num_usages": numUsages,
            "questions_and_answers": questionsAndAnswers
          }
        };
        questionsAndAnswers.forEach((questionAndAnswer) => {
          message[questionAndAnswer["question"]] = questionAndAnswer["answer"];
        });
        yield this.send(message);
      });
    }
    log(logEventType, params) {
      return __async(this, null, function* () {
        const message = {};
        const defaultParams = {
          "user_agent": window.navigator.userAgent
        };
        if (params !== void 0) {
          message["params"] = Object.assign(defaultParams, params);
        } else {
          message["params"] = defaultParams;
        }
        message["event"] = "log_event";
        message["type"] = logEventType;
        void this.send(message);
      });
    }
  };

  // src/mito/hooks/useDebouncedEffect.tsx
  init_react();
  var useDebouncedEffect = (effect, deps, delay) => {
    useEffect(() => {
      let cleanup = () => {
      };
      const handler = setTimeout(() => {
        const result = effect();
        if (result instanceof Object) {
          cleanup = result;
        }
      }, delay);
      return () => {
        clearTimeout(handler);
        cleanup();
      };
    }, [...deps || [], delay]);
  };

  // src/mito/hooks/useEffectOnUpdateEvent.tsx
  init_react();
  var useEffectOnUpdateEvent = (effect, analysisData) => {
    const [firstRender, setFirstRender] = useState(true);
    useEffect(() => {
      if (firstRender) {
        setFirstRender(false);
        return;
      }
      effect();
    }, [analysisData.updateEventCount]);
  };

  // src/mito/components/taskpanes/DefaultTaskpane/DefaultTaskpane.tsx
  init_react();

  // src/mito/components/taskpanes/DefaultTaskpane/DefaultTaskpaneErrorBoundry.tsx
  init_react();
  var DefaultTaskpaneErrorBoundry = class extends react_default.Component {
    constructor(props) {
      super(props);
      this.state = { hasError: false };
    }
    static getDerivedStateFromError() {
      return { hasError: true };
    }
    componentDidCatch(error, errorInfo) {
      var _a;
      this.props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenTaskpane: { type: "none" /* NONE */ }
        });
      });
      void ((_a = this.props.mitoAPI) == null ? void 0 : _a.log("taskpane_render_failed", {
        js_error: error,
        js_error_info: errorInfo
      }));
    }
    render() {
      if (this.state.hasError) {
        return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
      }
      return this.props.children;
    }
  };
  var DefaultTaskpaneErrorBoundry_default = DefaultTaskpaneErrorBoundry;

  // src/mito/components/taskpanes/DefaultTaskpane/DefaultTaskpane.tsx
  var DefaultTaskpane = (props) => {
    const firstChild = react_default.Children.toArray(props.children)[0];
    const reactNode = react_default.isValidElement(firstChild) ? firstChild : null;
    const headerProp = reactNode !== null ? reactNode.props.header : "No header";
    return /* @__PURE__ */ react_default.createElement("div", { className: "default-taskpane-div", ref: props.ref }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneErrorBoundry_default,
      {
        setUIState: props.setUIState,
        mitoAPI: props.mitoAPI,
        taskpaneHeader: headerProp
      },
      props.children
    ));
  };
  var DefaultTaskpane_default = DefaultTaskpane;

  // src/mito/components/taskpanes/DefaultTaskpane/DefaultTaskpaneBody.tsx
  init_react();

  // src/mito/components/elements/MitoProUpgradePrompt.tsx
  init_react();
  var MitoUpgradePrompt = (props) => {
    const logClick = () => {
      var _a;
      void ((_a = props.mitoAPI) == null ? void 0 : _a.log("clicked_upgrade", { feature: props.featureName }));
    };
    useEffect(() => {
      const logEventType = props.proOrEnterprise === "Pro" ? "prompted_pro_upgrade" : "prompted_enterprise_upgrade";
      void props.mitoAPI.log(logEventType, { feature: props.featureName });
    }, []);
    return /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1" }, props.message || `This is a Mito ${props.proOrEnterprise} feature. To access all Mito ${props.proOrEnterprise} functionality, please upgrade.`)), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "center" }, /* @__PURE__ */ react_default.createElement(TextButton_default, { href: "https://trymito.io/plans", target: "_blank", variant: "dark", width: "large", onClick: logClick }, "Upgrade to Mito ", props.proOrEnterprise)));
  };
  var MitoProUpgradePrompt_default = MitoUpgradePrompt;

  // src/mito/components/taskpanes/DefaultTaskpane/DefaultTaskpaneBody.tsx
  var DefaultTaskpaneBody = (props) => {
    var _a, _b, _c, _d;
    const shouldPromptProUpgrade = !((_a = props.userProfile) == null ? void 0 : _a.isPro) && props.requiresPro !== void 0;
    const shouldPromptEnterpriseUpgrade = !((_b = props.userProfile) == null ? void 0 : _b.isEnterprise) && props.requiresEnterprise !== void 0;
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, !((_c = props.userProfile) == null ? void 0 : _c.isPro) && props.requiresPro !== void 0 && /* @__PURE__ */ react_default.createElement(
      MitoProUpgradePrompt_default,
      {
        message: props.requiresPro.message,
        proOrEnterprise: "Pro",
        mitoAPI: props.requiresPro.mitoAPI,
        featureName: props.requiresPro.featureName
      }
    ), !((_d = props.userProfile) == null ? void 0 : _d.isEnterprise) && props.requiresEnterprise !== void 0 && /* @__PURE__ */ react_default.createElement(
      MitoProUpgradePrompt_default,
      {
        message: props.requiresEnterprise.message,
        proOrEnterprise: "Enterprise",
        mitoAPI: props.requiresEnterprise.mitoAPI,
        featureName: props.requiresEnterprise.featureName
      }
    ), /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: classNames("default-taskpane-body-div", { "default-taskpane-body-div-no-scroll": props.noScroll, "default-taskpane-body-disabled": shouldPromptProUpgrade || shouldPromptEnterpriseUpgrade }),
        ref: props.setRef
      },
      props.children
    ));
  };
  var DefaultTaskpaneBody_default = DefaultTaskpaneBody;

  // src/mito/components/taskpanes/DefaultTaskpane/DefaultTaskpaneFooter.tsx
  init_react();
  var DefaultTaskpaneFooter = (props) => {
    return /* @__PURE__ */ react_default.createElement("div", { style: props.ignoreTaskpanePadding ? { margin: " 0px -10px -7px -14px" } : void 0 }, "  ", props.children);
  };
  var DefaultTaskpaneFooter_default = DefaultTaskpaneFooter;

  // src/mito/components/taskpanes/DefaultTaskpane/DefaultTaskpaneHeader.tsx
  init_react();

  // src/mito/components/icons/BackArrowIcon.tsx
  init_react();
  var BackArrowIcon = (props) => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: props.width || "24", height: "16", viewBox: "0 0 24 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M0.292892 7.29289C-0.0976315 7.68342 -0.0976315 8.31658 0.292892 8.70711L6.65685 15.0711C7.04738 15.4616 7.68054 15.4616 8.07107 15.0711C8.46159 14.6805 8.46159 14.0474 8.07107 13.6569L2.41421 8L8.07107 2.34315C8.46159 1.95262 8.46159 1.31946 8.07107 0.928932C7.68054 0.538408 7.04738 0.538408 6.65685 0.928932L0.292892 7.29289ZM24 7L1 7V9L24 9V7Z", fill: "var(--mito-text)" }));
  };
  var BackArrowIcon_default = BackArrowIcon;

  // src/mito/components/taskpanes/DefaultTaskpane/DefaultTaskpaneHeader.tsx
  var DefaultTaskpaneHeader = (props) => {
    return /* @__PURE__ */ react_default.createElement("div", { className: "default-taskpane-header-div" }, /* @__PURE__ */ react_default.createElement(Row_default, { suppressTopBottomMargin: true }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 23 }, /* @__PURE__ */ react_default.createElement("div", { className: "default-taskpane-header-and-back-button" }, props.backCallback !== void 0 && /* @__PURE__ */ react_default.createElement("div", { onClick: props.backCallback, className: "mt-5px mr-10px" }, /* @__PURE__ */ react_default.createElement(BackArrowIcon_default, null)), /* @__PURE__ */ react_default.createElement("p", { className: "text-header-2 text-overflow-hide" }, props.header))), /* @__PURE__ */ react_default.createElement(Col_default, null, !props.notCloseable && /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: "default-taskpane-header-exit-button-div",
        onClick: () => {
          if (props.callbackOnClose) {
            props.callbackOnClose();
          }
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "none" /* NONE */ }
            });
          });
        }
      },
      /* @__PURE__ */ react_default.createElement(XIcon_default, null)
    ))));
  };
  var DefaultTaskpaneHeader_default = DefaultTaskpaneHeader;

  // src/mito/components/taskpanes/ControlPanel/ControlPanelTaskpaneTabs.tsx
  init_react();
  function ControlPanelTaskpaneTabs(props) {
    const changeTab = (tab) => {
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          selectedColumnControlPanelTab: tab
        });
      });
      void props.mitoAPI.log("clicked_" + tab + "_tab");
    };
    return /* @__PURE__ */ react_default.createElement("div", { className: "control-panel-taskpane-tab-container" }, /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: classNames("control-panel-taskpane-tab", props.selectedTab === "filter_sort" /* FilterSort */ ? "selected" : "unselected"),
        onClick: () => changeTab("filter_sort" /* FilterSort */)
      },
      /* @__PURE__ */ react_default.createElement("p", null, "Filter/Sort")
    ), /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: classNames("control-panel-taskpane-tab", props.selectedTab === "unique_values" /* UniqueValues */ ? "selected" : "unselected"),
        onClick: () => changeTab("unique_values" /* UniqueValues */)
      },
      /* @__PURE__ */ react_default.createElement("p", null, "Values")
    ), /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: classNames("control-panel-taskpane-tab", props.selectedTab === "summary_stats" /* SummaryStats */ ? "selected" : "unselected"),
        onClick: () => changeTab("summary_stats" /* SummaryStats */)
      },
      /* @__PURE__ */ react_default.createElement("p", null, "Stats")
    ));
  }
  var ControlPanelTaskpaneTabs_default = ControlPanelTaskpaneTabs;

  // src/mito/components/taskpanes/ControlPanel/FilterAndSortTab/DtypeCard.tsx
  init_react();
  var DTYPE_DESCRIPTION = "Changes the dtype of the selected column in the underlying dataframe.";
  function getDtypeValue(dtype) {
    if (dtype === void 0) {
      return "str" /* STRING */;
    }
    if (dtype.includes("bool")) {
      return "bool" /* BOOL */;
    } else if (dtype.includes("int")) {
      return "int" /* INT */;
    } else if (dtype.includes("float")) {
      return "float" /* FLOAT */;
    } else if (dtype.includes("str") || dtype.includes("object")) {
      return "str" /* STRING */;
    } else if (dtype.includes("datetime")) {
      return "datetime" /* DATETIME */;
    } else if (dtype.includes("timedelta")) {
      return "timedelta" /* TIMEDELTA */;
    }
    return "str" /* STRING */;
  }
  function getDtypeSelectOptions(onChange) {
    return [
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "bool" /* BOOL */,
          key: "bool" /* BOOL */,
          onClick: onChange ? () => {
            onChange("bool" /* BOOL */);
          } : void 0
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "int" /* INT */,
          key: "int" /* INT */,
          hideSubtext: true,
          displaySubtextOnHover: true,
          onClick: onChange ? () => {
            onChange("int" /* INT */);
          } : void 0
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "float" /* FLOAT */,
          key: "float" /* FLOAT */,
          onClick: onChange ? () => {
            onChange("float" /* FLOAT */);
          } : void 0
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "str" /* STRING */,
          key: "str" /* STRING */,
          onClick: onChange ? () => {
            onChange("str" /* STRING */);
          } : void 0
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "datetime" /* DATETIME */,
          key: "datetime" /* DATETIME */,
          onClick: onChange ? () => {
            onChange("datetime" /* DATETIME */);
          } : void 0
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "timedelta" /* TIMEDELTA */,
          key: "timedelta" /* TIMEDELTA */,
          onClick: onChange ? () => {
            onChange("timedelta" /* TIMEDELTA */);
          } : void 0
        }
      )
    ];
  }
  function DtypeCard(props) {
    const [stepID] = useState(() => getRandomId());
    function changeColumnDtype(newDtype) {
      return __async(this, null, function* () {
        yield props.mitoAPI.editChangeColumnDtype(
          props.selectedSheetIndex,
          [props.columnID],
          newDtype,
          stepID
        );
      });
    }
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 6, title: DTYPE_DESCRIPTION }, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Dtype")), /* @__PURE__ */ react_default.createElement(Col_default, { offset: 2, flex: "1" }, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        value: getDtypeValue(props.columnDtype),
        onChange: (newDtype) => {
          void changeColumnDtype(newDtype);
        },
        dropdownWidth: "medium"
      },
      getDtypeSelectOptions()
    ))));
  }
  var DtypeCard_default = DtypeCard;

  // src/mito/components/taskpanes/ControlPanel/FilterAndSortTab/FormatCard.tsx
  init_react();

  // src/mito/utils/format.tsx
  init_react();

  // src/mito/components/icons/DropdownCheckmark.tsx
  init_react();
  var DropdownCheckmark = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "12", height: "14", viewBox: "0 0 12 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M10.0608 0.805159C10.2802 0.402958 10.8246 0.324565 11.1485 0.64852V0.64852C11.3582 0.858224 11.4095 1.17891 11.2756 1.44354L5.57867 12.705C5.26247 13.3301 4.41824 13.4447 3.94677 12.9267L0.628074 9.28008C0.18803 8.79655 0.522012 8.01982 1.17566 8.00657V8.00657C1.38287 8.00237 1.58284 8.08284 1.72939 8.22939L3.55497 10.055C4.02704 10.527 4.82029 10.4128 5.13997 9.82672L10.0608 0.805159Z", fill: "var(--mito-highlight)" }));
  };
  var DropdownCheckmark_default = DropdownCheckmark;

  // src/mito/pro/taskpanes/SetDataframeFormat/SetDataframeFormatTaskpane.tsx
  init_react();

  // src/mito/components/endo/GridData.tsx
  init_react();

  // src/mito/components/taskpanes/AITransformation/aiUtils.tsx
  var getSelectionForCompletion = (uiState, gridState, sheetDataArray) => {
    const selectedSheetIndex = uiState.selectedSheetIndex;
    const sheetData = sheetDataArray[selectedSheetIndex];
    if (sheetData === void 0) {
      return void 0;
    }
    const dfName = sheetData.dfName;
    const selectedColumnHeaders = getColumnHeadersInSelections(gridState.selections, sheetData);
    const selectedIndexLabels = getIndexLabelsInSelections(gridState.selections, sheetData);
    return {
      "selected_df_name": dfName,
      "selected_column_headers": selectedColumnHeaders,
      "selected_index_labels": selectedIndexLabels
    };
  };
  var DEFAULT_CHAT_HEIGHT = 30;
  var MAX_CHAT_HEIGHT = 100;
  var getChatHeight = (userInput, chatInputRef) => {
    var _a;
    const chatHeight = DEFAULT_CHAT_HEIGHT + (userInput.split("\n").length - 1) * 14;
    const scrollHeight = ((_a = chatInputRef.current) == null ? void 0 : _a.scrollHeight) || 0;
    const chatOrScrollMax = Math.max(chatHeight, scrollHeight);
    if (userInput === "" || chatOrScrollMax < DEFAULT_CHAT_HEIGHT) {
      return DEFAULT_CHAT_HEIGHT;
    } else if (chatOrScrollMax > MAX_CHAT_HEIGHT) {
      return MAX_CHAT_HEIGHT;
    } else {
      return chatOrScrollMax;
    }
  };
  var reconIsColumnCreated = (columnHeader, dataRecon, sheetData) => {
    var _a;
    const createdColumnHeadersList = ((_a = dataRecon == null ? void 0 : dataRecon.modified_dataframes_recons[sheetData.dfName]) == null ? void 0 : _a.column_recon.created_columns) || [];
    const createdDataframesList = (dataRecon == null ? void 0 : dataRecon.created_dataframe_names) || [];
    return createdColumnHeadersList.includes(columnHeader) || createdDataframesList.includes(sheetData.dfName);
  };
  var reconIsColumnModified = (columnHeader, dataRecon, sheetData) => {
    var _a;
    const modifiedColumnHeadersList = Object.values(((_a = dataRecon == null ? void 0 : dataRecon.modified_dataframes_recons[sheetData.dfName]) == null ? void 0 : _a.column_recon.modified_columns) || {});
    return modifiedColumnHeadersList.includes(getDisplayColumnHeader(columnHeader));
  };
  var reconIsColumnRenamed = (columnHeader, dataRecon, sheetData) => {
    var _a;
    const renamedColumnHeaderList = Object.values(((_a = dataRecon == null ? void 0 : dataRecon.modified_dataframes_recons[sheetData.dfName]) == null ? void 0 : _a.column_recon.renamed_columns) || {});
    return renamedColumnHeaderList.includes(getDisplayColumnHeader(columnHeader));
  };

  // src/mito/utils/colors.tsx
  var HIGHLIGHT_VARIABLE_NAME = "--mito-highlight";
  var HIGHLIGHT_MEDIUM_VARIABLE_NAME = "--mito-highlight-medium";
  var HIGHLIGHT_LIGHT_VARIABLE_NAME = "--mito-highlight-light";
  var HIGHLIGHT_VERY_LIGHT_VARIABLE_NAME = "--mito-highlight-very-light";
  var TEXT_VARIABLE_NAME = "--mito-text";
  var TEXT_MEDIUM_VARIABLE_NAME = "--mito-text-medium";
  var TEXT_LIGHT_VARIABLE_NAME = "--mito-text-light";
  var BACKGROUND_VARIABLE_NAME = "--mito-background";
  var BACKGROUND_OFF_VARIABLE_NAME = "--mito-background-off";
  var BACKGROUND_HIGHLIGHT_VARIABLE_NAME = "--mito-background-highlight";
  var BACKGROUND_DEFAULT_VARIABLE_NAME = "--mito-background-default";
  var BACKGROUND_DEFAULT_HOVER_VARIABLE_NAME = "--mito-background-default-hover";
  var TOOLBAR_HOVER_VARIABLE_NAME = "--mito-toolbar-hover";
  var DEFAULT_HIGHLIGHT = "var(--mito-purple)";
  var DEFAULT_HIGHLIGHT_MEDIUM = "var(--mito-medium-purple)";
  var DEFAULT_HIGHLIGHT_LIGHT = "var(--mito-light-purple)";
  var DEFAULT_HIGHLIGHT_VERY_LIGHT = "var(--mito-very-light-purple)";
  var DEFAULT_TEXT_MEDIUM = "var(--mito-medium-gray)";
  var DEFAULT_TEXT_LIGHT = "var(--mito-light-gray)";
  var DEFAULT_TEXT = "var(--mito-gray)";
  var DEFAULT_BACKGROUND = "var(--mito-white)";
  var DEFAULT_BACKGROUND_OFF = "var(--mito-very-light-gray)";
  var DEFAULT_BACKGROUND_HIGHLIGHT = "var(--mito-light-blue)";
  var TOOLBAR_HOVER_BACKGROUND = "var(--mito-pretty-light-gray)";
  var DEFAULT_BACKGROUND_DEFAULT = "var(--mito-light-purple)";
  var DEFAULT_BACKGROUND_DEFAULT_HOVER = "var(--mito-medium-purple)";
  if (isInJupyterLabOrNotebook()) {
    DEFAULT_TEXT = "var(--jp-content-font-color1)";
    DEFAULT_BACKGROUND = "var(--jp-layout-color1)";
    DEFAULT_BACKGROUND_OFF = "var(--jp-layout-color2)";
    DEFAULT_BACKGROUND_HIGHLIGHT = "var(--jp-input-background)";
    TOOLBAR_HOVER_BACKGROUND = "var(--jp-layout-color3)";
    DEFAULT_BACKGROUND_DEFAULT = "var(--jp-layout-color3)";
    DEFAULT_BACKGROUND_DEFAULT_HOVER = "var(--jp-layout-color4)";
  }
  var getHighlightTheme = (primaryColor) => {
    if (primaryColor === void 0) {
      return {
        [HIGHLIGHT_VARIABLE_NAME]: DEFAULT_HIGHLIGHT,
        [HIGHLIGHT_MEDIUM_VARIABLE_NAME]: DEFAULT_HIGHLIGHT_MEDIUM,
        [HIGHLIGHT_LIGHT_VARIABLE_NAME]: DEFAULT_HIGHLIGHT_LIGHT,
        [HIGHLIGHT_VERY_LIGHT_VARIABLE_NAME]: DEFAULT_HIGHLIGHT_VERY_LIGHT
      };
    }
    const primaryColorHex = convertToHex(primaryColor);
    return {
      [HIGHLIGHT_VARIABLE_NAME]: hexToRGBString(primaryColorHex, 1),
      [HIGHLIGHT_MEDIUM_VARIABLE_NAME]: hexToRGBString(primaryColorHex, 0.8),
      [HIGHLIGHT_LIGHT_VARIABLE_NAME]: hexToRGBString(primaryColorHex, 0.6),
      [HIGHLIGHT_VERY_LIGHT_VARIABLE_NAME]: hexToRGBString(primaryColorHex, 0.4)
    };
  };
  var getTextColors = (textColor) => {
    if (textColor === void 0) {
      return {
        [TEXT_VARIABLE_NAME]: DEFAULT_TEXT,
        [TEXT_MEDIUM_VARIABLE_NAME]: DEFAULT_TEXT_MEDIUM,
        [TEXT_LIGHT_VARIABLE_NAME]: DEFAULT_TEXT_LIGHT
      };
    }
    const textColorHex = convertToHex(textColor);
    return {
      [TEXT_VARIABLE_NAME]: hexToRGBString(textColorHex, 1),
      [TEXT_MEDIUM_VARIABLE_NAME]: hexToRGBString(textColorHex, 0.8),
      [TEXT_LIGHT_VARIABLE_NAME]: hexToRGBString(textColorHex, 0.6)
    };
  };
  var getBackgroundColors = (backgroundColor) => {
    if (backgroundColor === void 0) {
      return {
        [BACKGROUND_VARIABLE_NAME]: DEFAULT_BACKGROUND,
        [BACKGROUND_OFF_VARIABLE_NAME]: DEFAULT_BACKGROUND_OFF,
        [BACKGROUND_HIGHLIGHT_VARIABLE_NAME]: DEFAULT_BACKGROUND_HIGHLIGHT,
        [TOOLBAR_HOVER_VARIABLE_NAME]: TOOLBAR_HOVER_BACKGROUND,
        [BACKGROUND_DEFAULT_VARIABLE_NAME]: DEFAULT_BACKGROUND_DEFAULT,
        [BACKGROUND_DEFAULT_HOVER_VARIABLE_NAME]: DEFAULT_BACKGROUND_DEFAULT_HOVER
      };
    }
    const backgroundColorHex = convertToHex(backgroundColor);
    const { offBackground, highlightBackground } = generateOffAndHighlightBackground(backgroundColorHex);
    return {
      [BACKGROUND_VARIABLE_NAME]: hexToRGBString(backgroundColorHex, 1),
      [BACKGROUND_OFF_VARIABLE_NAME]: offBackground,
      [BACKGROUND_HIGHLIGHT_VARIABLE_NAME]: highlightBackground,
      [TOOLBAR_HOVER_VARIABLE_NAME]: hexToRGBString(backgroundColorHex, 0.8),
      [BACKGROUND_DEFAULT_VARIABLE_NAME]: DEFAULT_BACKGROUND_DEFAULT,
      [BACKGROUND_DEFAULT_HOVER_VARIABLE_NAME]: DEFAULT_BACKGROUND_DEFAULT_HOVER
    };
  };
  var getCSSStyleVariables = (height, theme) => {
    const highlightTheme = getHighlightTheme(theme == null ? void 0 : theme.primaryColor);
    const textTheme = getTextColors(theme == null ? void 0 : theme.textColor);
    const backgroundTheme = getBackgroundColors(theme == null ? void 0 : theme.backgroundColor);
    const heightTheme = height ? { "--mito-height": height } : { "--mito-height": "538px" };
    return __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, highlightTheme), textTheme), backgroundTheme), heightTheme);
  };
  var hexToRGBString = (hex, alpha) => {
    if (hex === null) {
      return void 0;
    }
    const r = parseInt(hex.slice(1, 3), 16);
    const g = parseInt(hex.slice(3, 5), 16);
    const b = parseInt(hex.slice(5, 7), 16);
    if (alpha) {
      return "rgba(" + r + ", " + g + ", " + b + ", " + alpha + ")";
    } else {
      return "rgb(" + r + ", " + g + ", " + b + ")";
    }
  };
  function convertToHex(color, parentDiv) {
    if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(color)) {
      return color;
    }
    if (/^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/.test(color)) {
      const rgbValues = color.match(/\d+/g);
      const hexValues = rgbValues == null ? void 0 : rgbValues.map((value) => {
        const hex = Number(value).toString(16);
        return hex.length === 1 ? "0" + hex : hex;
      });
      if (hexValues) {
        return "#" + hexValues.join("");
      }
    }
    const tempElement = document.createElement("div");
    tempElement.style.color = color;
    if (parentDiv) {
      parentDiv.appendChild(tempElement);
    } else {
      document.body.appendChild(tempElement);
    }
    const computedColor = getComputedStyle(tempElement).color;
    document.body.removeChild(tempElement);
    return convertToHex(computedColor);
  }
  function generateOffAndHighlightBackground(hexColor) {
    const rgbColor = hexToRgb(hexColor);
    const brightness = calculateBrightness(rgbColor);
    const threshold = 128;
    let backgroundColor;
    if (brightness < threshold) {
      backgroundColor = lightenColor(rgbColor, 10);
    } else {
      backgroundColor = darkenColor(rgbColor, 10);
    }
    let highlightColor;
    if (brightness < threshold) {
      highlightColor = lightenColor(rgbColor, 20);
    } else {
      highlightColor = darkenColor(rgbColor, 20);
    }
    return {
      offBackground: rgbToHex(backgroundColor),
      highlightBackground: rgbToHex(highlightColor)
    };
  }
  function hexToRgb(hexColor) {
    const hex = hexColor.replace("#", "");
    const bigint = parseInt(hex, 16);
    const r = bigint >> 16 & 255;
    const g = bigint >> 8 & 255;
    const b = bigint & 255;
    return { r, g, b };
  }
  function rgbToHex(rgbColor) {
    const hexR = rgbColor.r.toString(16).padStart(2, "0");
    const hexG = rgbColor.g.toString(16).padStart(2, "0");
    const hexB = rgbColor.b.toString(16).padStart(2, "0");
    return "#" + hexR + hexG + hexB;
  }
  function calculateBrightness(rgbColor) {
    return (rgbColor.r * 299 + rgbColor.g * 587 + rgbColor.b * 114) / 1e3;
  }
  function lightenColor(rgbColor, amount) {
    const hslColor = rgbToHsl(rgbColor);
    hslColor.l += amount / 100;
    hslColor.l = Math.min(Math.max(hslColor.l, 0), 1);
    return hslToRgb(hslColor);
  }
  function darkenColor(rgbColor, amount) {
    const hslColor = rgbToHsl(rgbColor);
    hslColor.l -= amount / 100;
    hslColor.l = Math.min(Math.max(hslColor.l, 0), 1);
    return hslToRgb(hslColor);
  }
  function rgbToHsl(rgbColor) {
    const r = rgbColor.r / 255;
    const g = rgbColor.g / 255;
    const b = rgbColor.b / 255;
    const max = Math.max(r, g, b);
    const min = Math.min(r, g, b);
    let h, s;
    const l = (max + min) / 2;
    if (max === min) {
      h = s = 0;
    } else {
      const d = max - min;
      s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
      switch (max) {
        case r:
          h = (g - b) / d + (g < b ? 6 : 0);
          break;
        case g:
          h = (b - r) / d + 2;
          break;
        case b:
          h = (r - g) / d + 4;
          break;
      }
      if (h !== void 0) {
        h /= 6;
      }
    }
    return { h, s, l };
  }
  function hslToRgb(hslColor) {
    const h = hslColor.h;
    const s = hslColor.s;
    const l = hslColor.l;
    let r, g, b;
    if (s === 0) {
      r = g = b = l;
    } else {
      const hueToRgb = function hueToRgb2(p2, q2, t) {
        if (t < 0)
          t += 1;
        if (t > 1)
          t -= 1;
        if (t < 1 / 6)
          return p2 + (q2 - p2) * 6 * t;
        if (t < 1 / 2)
          return q2;
        if (t < 2 / 3)
          return p2 + (q2 - p2) * (2 / 3 - t) * 6;
        return p2;
      };
      const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
      const p = 2 * l - q;
      r = hueToRgb(p, q, h + 1 / 3);
      g = hueToRgb(p, q, h);
      b = hueToRgb(p, q, h - 1 / 3);
    }
    return {
      r: Math.round(r * 255),
      g: Math.round(g * 255),
      b: Math.round(b * 255)
    };
  }

  // src/mito/components/endo/CellContextMenu.tsx
  init_react();

  // src/mito/components/elements/DropdownSectionSeperator.tsx
  init_react();
  var DropdownSectionSeperator = (props) => {
    props.isDropdownSectionSeperator;
    return /* @__PURE__ */ react_default.createElement("div", { style: { width: "100%", borderTop: "1px solid #dadce0", paddingBottom: "3px", marginTop: "3px" } });
  };
  var DropdownSectionSeperator_default = DropdownSectionSeperator;

  // src/mito/components/endo/CellContextMenu.tsx
  function CellContextMenu(props) {
    return /* @__PURE__ */ react_default.createElement(
      Dropdown_default,
      {
        display: props.display,
        closeDropdown: () => {
          props.setUiState((prevUIState) => {
            const isCurrOpenDropdown = isCurrOpenDropdownForCell(prevUIState, props.rowIndex, props.colIndex);
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: isCurrOpenDropdown ? void 0 : prevUIState.currOpenDropdown
            });
          });
        },
        width: "medium-large"
      },
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        __spreadProps(__spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["copy" /* Copy */], props.closeOpenEditingPopups)), {
          title: "Copy"
        })
      ),
      /* @__PURE__ */ react_default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, __spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["add column to the left" /* Add_Column_Left */], props.closeOpenEditingPopups))),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, __spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["add column to the right" /* Add_Column_Right */], props.closeOpenEditingPopups))),
      /* @__PURE__ */ react_default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, __spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["delete row" /* Delete_Row */], props.closeOpenEditingPopups))),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, __spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["delete column" /* Delete_Col */], props.closeOpenEditingPopups))),
      /* @__PURE__ */ react_default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        __spreadProps(__spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["filter" /* Filter */], props.closeOpenEditingPopups)), {
          title: "Create a Filter"
        })
      ),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, __spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["filter to cell value" /* FilterToCellValue */], props.closeOpenEditingPopups)))
    );
  }

  // src/mito/components/endo/GridData.tsx
  var EVEN_ROW_BACKGROUND_COLOR_DEFAULT = "var(--mito-background)";
  var ODD_ROW_BACKGROUND_COLOR_DEFAULT = "var(--mito-background-off)";
  var ROW_TEXT_COLOR_DEFAULT = "var(--mito-text)";
  var GridData = (props) => {
    var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
    const currentSheetView = calculateCurrentSheetView(props.gridState);
    const sheetData = props.sheetData;
    const evenRowBackgroundColor = ((_c = (_b = (_a = sheetData == null ? void 0 : sheetData.dfFormat) == null ? void 0 : _a.rows) == null ? void 0 : _b.even) == null ? void 0 : _c.backgroundColor) || EVEN_ROW_BACKGROUND_COLOR_DEFAULT;
    const oddRowBackgroundColor = ((_f = (_e = (_d = sheetData == null ? void 0 : sheetData.dfFormat) == null ? void 0 : _d.rows) == null ? void 0 : _e.odd) == null ? void 0 : _f.backgroundColor) || ODD_ROW_BACKGROUND_COLOR_DEFAULT;
    const evenRowTextColor = ((_i = (_h = (_g = sheetData == null ? void 0 : sheetData.dfFormat) == null ? void 0 : _g.rows) == null ? void 0 : _h.even) == null ? void 0 : _i.color) || ROW_TEXT_COLOR_DEFAULT;
    const oddRowTextColor = ((_l = (_k = (_j = sheetData == null ? void 0 : sheetData.dfFormat) == null ? void 0 : _j.rows) == null ? void 0 : _k.odd) == null ? void 0 : _l.color) || ROW_TEXT_COLOR_DEFAULT;
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, sheetData && sheetData.numRows > 0 && Array(currentSheetView.numRowsRendered).fill(0).map((_, _rowIndex) => {
      const rowIndex = currentSheetView.startingRowIndex + _rowIndex;
      const columnIDs = getColumnIDsArrayFromSheetDataArray([sheetData])[0];
      const rowClassNames = classNames("mito-grid-row", {
        "mito-grid-row-even": rowIndex % 2 === 0,
        "mito-grid-row-odd": rowIndex % 2 !== 0
      });
      const style = rowIndex % 2 === 0 ? { backgroundColor: evenRowBackgroundColor, color: evenRowTextColor } : { backgroundColor: oddRowBackgroundColor, color: oddRowTextColor };
      return /* @__PURE__ */ react_default.createElement("div", { className: rowClassNames, key: rowIndex, style }, Array(currentSheetView.numColumnsRendered).fill(0).map((_2, _colIndex) => {
        var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
        const columnIndex = currentSheetView.startingColumnIndex + _colIndex;
        const columnID = columnIDs[columnIndex];
        const columnDtype = (_b2 = (_a2 = props.sheetData) == null ? void 0 : _a2.data[columnIndex]) == null ? void 0 : _b2.columnDtype;
        const index = ((_c2 = props.sheetData) == null ? void 0 : _c2.index[rowIndex]) !== void 0 ? (_d2 = props.sheetData) == null ? void 0 : _d2.index[rowIndex] : 0;
        const columnFormatType = sheetData.dfFormat.columns[columnID];
        const cellData = (_f2 = (_e2 = props.sheetData) == null ? void 0 : _e2.data[columnIndex]) == null ? void 0 : _f2.columnData[rowIndex];
        const cellIsSelected = getIsCellSelected(props.gridState.selections, rowIndex, columnIndex);
        const columnHeader = (_h2 = (_g2 = props.sheetData) == null ? void 0 : _g2.data[columnIndex]) == null ? void 0 : _h2.columnHeader;
        const conditionalFormatMap = sheetData == null ? void 0 : sheetData.conditionalFormattingResult.results[columnID];
        const conditionalFormat = conditionalFormatMap ? __spreadValues({}, conditionalFormatMap[index]) : void 0;
        if (cellIsSelected && (conditionalFormat == null ? void 0 : conditionalFormat.backgroundColor) !== void 0 && (conditionalFormat == null ? void 0 : conditionalFormat.backgroundColor) !== null) {
          conditionalFormat.backgroundColor = hexToRGBString(conditionalFormat.backgroundColor, 0.4);
        }
        if (cellData === void 0 || columnDtype === void 0 || columnHeader === void 0) {
          return null;
        }
        const isColumnCreated = reconIsColumnCreated(columnHeader, props.uiState.dataRecon, sheetData);
        const isColumnModified = reconIsColumnModified(columnHeader, props.uiState.dataRecon, sheetData);
        const matchesSearch = !!props.uiState.currOpenSearch.matches.find((value) => {
          return value.rowIndex === rowIndex && value.colIndex === columnIndex;
        });
        const className = classNames("mito-grid-cell", "text-unselectable", {
          "mito-grid-cell-selected": cellIsSelected,
          "mito-grid-cell-conditional-format-background-color": (conditionalFormat == null ? void 0 : conditionalFormat.backgroundColor) !== void 0,
          "mito-grid-cell-hidden": props.editorState !== void 0 && props.editorState.rowIndex === rowIndex && props.editorState.columnIndex === columnIndex,
          "right-align-number-series": isNumberDtype(columnDtype),
          "recon created-recon-background-color": isColumnCreated && rowIndex % 2 !== 0,
          "recon created-recon-background-color-dark": isColumnCreated && rowIndex % 2 === 0,
          "recon modified-recon-background-color": isColumnModified && rowIndex % 2 !== 0,
          "recon modified-recon-background-color-dark": isColumnModified && rowIndex % 2 === 0
        });
        const cellWidth = props.gridState.widthDataArray[props.gridState.sheetIndex].widthArray[columnIndex];
        const displayCellData = formatCellData(cellData, columnDtype, columnFormatType);
        const displayDropdown = isCurrOpenDropdownForCell(props.uiState, rowIndex, columnIndex);
        return /* @__PURE__ */ react_default.createElement(
          "div",
          {
            className,
            key: columnIndex,
            style: __spreadValues(__spreadValues({
              width: `${cellWidth}px`
            }, getBorderStyle(props.gridState.selections, props.gridState.copiedSelections, rowIndex, columnIndex, sheetData.numRows, matchesSearch, props.uiState.highlightedColumnIndex)), conditionalFormat || {}),
            onContextMenu: (e) => {
              if (e.shiftKey) {
                return;
              }
              e.preventDefault();
              e.stopPropagation();
              props.setUIState((prevUiState) => {
                return __spreadProps(__spreadValues({}, prevUiState), {
                  currOpenDropdown: {
                    type: "context-menu",
                    rowIndex,
                    columnIndex
                  }
                });
              });
              props.setGridState((prevGridState) => {
                return __spreadProps(__spreadValues({}, prevGridState), {
                  selections: [{
                    startingRowIndex: rowIndex,
                    endingRowIndex: rowIndex,
                    startingColumnIndex: columnIndex,
                    endingColumnIndex: columnIndex,
                    sheetIndex: props.sheetIndex
                  }]
                });
              });
            },
            tabIndex: -1,
            "mito-col-index": columnIndex,
            "mito-row-index": rowIndex,
            title: displayCellData
          },
          displayCellData,
          /* @__PURE__ */ react_default.createElement(
            CellContextMenu,
            {
              display: displayDropdown,
              rowIndex,
              colIndex: columnIndex,
              setUiState: props.setUIState,
              actions: props.actions,
              closeOpenEditingPopups: props.closeOpenEditingPopups
            }
          )
        );
      }));
    }));
  };
  var GridData_default = react_default.memo(GridData);

  // src/mito/components/layout/CollapsibleSection.tsx
  init_react();

  // src/mito/components/icons/DownArrowIcon.tsx
  init_react();
  var DownArrowIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "19", height: "11", viewBox: "0 0 19 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M18 1.94141L9.49199 8.94141L1 1.94141", stroke: "var(--mito-text)", strokeWidth: "2", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var DownArrowIcon_default = DownArrowIcon;

  // src/mito/components/icons/UpArrowIcon.tsx
  init_react();
  var UpArrowIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "19", height: "10", viewBox: "0 0 19 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1 8.94141L9.50801 1.94141L18 8.94141", stroke: "var(--mito-text)", strokeWidth: "2", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var UpArrowIcon_default = UpArrowIcon;

  // src/mito/components/icons/ProIcon.tsx
  init_react();
  var ProIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M4.70455 13V7.18182H6.67045C7.12689 7.18182 7.5 7.2642 7.78977 7.42898C8.08144 7.59186 8.29735 7.8125 8.4375 8.09091C8.57765 8.36932 8.64773 8.67992 8.64773 9.02273C8.64773 9.36553 8.57765 9.67708 8.4375 9.95739C8.29924 10.2377 8.08523 10.4612 7.79545 10.6278C7.50568 10.7926 7.13447 10.875 6.68182 10.875H5.27273V10.25H6.65909C6.97159 10.25 7.22254 10.196 7.41193 10.0881C7.60133 9.98011 7.73864 9.83428 7.82386 9.65057C7.91098 9.46496 7.95455 9.25568 7.95455 9.02273C7.95455 8.78977 7.91098 8.58144 7.82386 8.39773C7.73864 8.21402 7.60038 8.07008 7.40909 7.96591C7.2178 7.85985 6.96402 7.80682 6.64773 7.80682H5.40909V13H4.70455ZM9.69176 13V8.63636H10.3395V9.29545H10.3849C10.4645 9.07955 10.6084 8.90436 10.8168 8.76989C11.0251 8.63542 11.2599 8.56818 11.5213 8.56818C11.5705 8.56818 11.6321 8.56913 11.706 8.57102C11.7798 8.57292 11.8357 8.57576 11.8736 8.57955V9.26136C11.8509 9.25568 11.7988 9.24716 11.7173 9.2358C11.6378 9.22254 11.5535 9.21591 11.4645 9.21591C11.2524 9.21591 11.063 9.26042 10.8963 9.34943C10.7315 9.43655 10.6009 9.55777 10.5043 9.71307C10.4096 9.86648 10.3622 10.0417 10.3622 10.2386V13H9.69176ZM14.3082 13.0909C13.9143 13.0909 13.5687 12.9972 13.2713 12.8097C12.9759 12.6222 12.7448 12.3598 12.5781 12.0227C12.4134 11.6856 12.331 11.2917 12.331 10.8409C12.331 10.3864 12.4134 9.98958 12.5781 9.65057C12.7448 9.31155 12.9759 9.0483 13.2713 8.8608C13.5687 8.6733 13.9143 8.57955 14.3082 8.57955C14.7022 8.57955 15.0469 8.6733 15.3423 8.8608C15.6397 9.0483 15.8707 9.31155 16.0355 9.65057C16.2022 9.98958 16.2855 10.3864 16.2855 10.8409C16.2855 11.2917 16.2022 11.6856 16.0355 12.0227C15.8707 12.3598 15.6397 12.6222 15.3423 12.8097C15.0469 12.9972 14.7022 13.0909 14.3082 13.0909ZM14.3082 12.4886C14.6075 12.4886 14.8537 12.4119 15.0469 12.2585C15.2401 12.1051 15.383 11.9034 15.4759 11.6534C15.5687 11.4034 15.6151 11.1326 15.6151 10.8409C15.6151 10.5492 15.5687 10.2775 15.4759 10.0256C15.383 9.77367 15.2401 9.57008 15.0469 9.41477C14.8537 9.25947 14.6075 9.18182 14.3082 9.18182C14.009 9.18182 13.7628 9.25947 13.5696 9.41477C13.3764 9.57008 13.2334 9.77367 13.1406 10.0256C13.0478 10.2775 13.0014 10.5492 13.0014 10.8409C13.0014 11.1326 13.0478 11.4034 13.1406 11.6534C13.2334 11.9034 13.3764 12.1051 13.5696 12.2585C13.7628 12.4119 14.009 12.4886 14.3082 12.4886Z", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M19.25 10C19.25 15.1086 15.1086 19.25 10 19.25C4.89137 19.25 0.75 15.1086 0.75 10C0.75 4.89137 4.89137 0.75 10 0.75C15.1086 0.75 19.25 4.89137 19.25 10Z", stroke: "var(--mito-highlight)", strokeWidth: "1.5" }));
  };
  var ProIcon_default = ProIcon;

  // src/mito/components/layout/CollapsibleSection.tsx
  var CollapsibleSection = (props) => {
    const [open, setOpen] = useState(props.open || false);
    useEffect(() => {
      if (props.open !== void 0) {
        setOpen(props.open);
      }
    }, [props.open]);
    if (open && props.disabled !== true) {
      return /* @__PURE__ */ react_default.createElement(
        "div",
        {
          className: "mito-blue-container"
        },
        /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", onClick: () => {
          setOpen(false);
        } }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(Row_default, { suppressTopBottomMargin: true }, typeof props.title === "string" && /* @__PURE__ */ react_default.createElement("div", { className: "text-header-3" }, props.title), typeof props.title !== "string" && props.title, "\xA0 ", props.proSection && !props.isPro && /* @__PURE__ */ react_default.createElement(ProIcon_default, null))), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(UpArrowIcon_default, null))),
        props.children
      );
    } else {
      return /* @__PURE__ */ react_default.createElement(
        "div",
        {
          className: classNames("mito-blue-container", { "mito-blue-container-disabled": props.disabled }),
          onClick: () => {
            setOpen(true);
          }
        },
        /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(Row_default, { suppressTopBottomMargin: true }, typeof props.title === "string" && /* @__PURE__ */ react_default.createElement("div", { className: "text-header-3" }, props.title), typeof props.title !== "string" && props.title, "\xA0 ", props.proSection && !props.isPro && /* @__PURE__ */ react_default.createElement(ProIcon_default, null))), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(DownArrowIcon_default, null)))
      );
    }
  };
  var CollapsibleSection_default = CollapsibleSection;

  // src/mito/components/layout/Spacer.tsx
  init_react();
  var Spacer = (props) => {
    const px = props.seperatingLine ? props.px / 2 : props.px;
    const marginTop = `${px}px`;
    const border = props.seperatingLine ? ".5px solid var(--mito-text-light)" : "none";
    const marginBottom = props.seperatingLine ? `${px}px` : "none";
    return /* @__PURE__ */ react_default.createElement("div", { style: { marginTop, border, marginBottom } });
  };
  var Spacer_default = Spacer;

  // src/mito/components/taskpanes/DefaultTaskpane/DefaultEmptyTaskpane.tsx
  init_react();
  var DefaultEmptyTaskpane = (props) => {
    const openImportTaskpane = () => {
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenTaskpane: { type: "import files" /* IMPORT_FILES */ }
        });
      });
    };
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: props.header !== void 0 ? props.header : "Import data first",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement(
      "p",
      {
        className: classNames("text-body-1", "text-overflow-wrap", { "text-color-error": props.errorMessage }),
        style: { whiteSpace: "pre-wrap" }
      },
      props.message ? props.message : "Before performing that action, you need to import data into Mito.",
      props.suppressImportLink !== true && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, " ", /* @__PURE__ */ react_default.createElement("span", { className: "text-body-1-link", onClick: openImportTaskpane }, "Click here to import data."))
    )));
  };
  var DefaultEmptyTaskpane_default = DefaultEmptyTaskpane;

  // src/mito/hooks/useLiveUpdatingParams.tsx
  init_react();
  function useLiveUpdatingParams(defaultParams, stepType, mitoAPI, analysisData, debounceDelay, frontendToBackendConverters, options, sheetDataArray) {
    const [params, _setParams] = useState(defaultParams);
    const [updateNumber, setUpdateNumber] = useState(0);
    const [stepID, setStepID] = useState(() => getRandomId());
    const [error, setError] = useState(void 0);
    const [loading, setLoading] = useState(false);
    const converters = frontendToBackendConverters || {
      getBackendFromFrontend: (p) => {
        return p;
      },
      getFrontendFromBackend: (p) => {
        return p;
      }
    };
    useDebouncedEffect(() => {
      void onChange();
    }, [updateNumber], debounceDelay);
    useEffectOnUpdateEvent(() => {
      void refreshParams();
    }, analysisData);
    const editEvent = stepType + "_edit";
    const setParams = useCallback(
      (args) => {
        _setParams(args);
        setUpdateNumber((old) => old + 1);
      },
      []
    );
    const onChange = () => __async(this, null, function* () {
      if (params === void 0) {
        return;
      }
      if ((options == null ? void 0 : options.doNotSendDefaultParams) === true && updateNumber === 0) {
        return;
      }
      const finalParams = converters.getBackendFromFrontend(params, sheetDataArray);
      setLoading(true);
      const possibleError = yield mitoAPI._edit(editEvent, finalParams, stepID);
      setLoading(false);
      if ("error" in possibleError) {
        setError(possibleError.error);
      } else {
        setError(void 0);
      }
    });
    const refreshParams = () => __async(this, null, function* () {
      const steps = analysisData.stepSummaryList.filter((step) => step.step_id === stepID);
      if (steps.length === 0) {
        _setParams(defaultParams);
      } else {
        const lastStep = steps[steps.length - 1];
        const newBackendParams = lastStep.params;
        _setParams(converters.getFrontendFromBackend(newBackendParams, sheetDataArray));
      }
      setError(void 0);
    });
    return {
      params,
      setParams,
      error,
      loading,
      startNewStep: () => {
        setStepID(getRandomId());
      }
    };
  }
  var useLiveUpdatingParams_default = useLiveUpdatingParams;

  // src/mito/pro/graph/LabelAndColor.tsx
  init_react();

  // src/mito/components/elements/ColorInput.tsx
  init_react();

  // src/mito/components/icons/GraphToolbar/ColorIcon.tsx
  init_react();
  var ColorIcon = (props) => {
    if (props.type === "font-color") {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "13", height: "14", viewBox: "0 0 13 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M6.56836 1.68896L2.09668 14H0.269043L5.41797 0.492188H6.59619L6.56836 1.68896ZM10.3164 14L5.83545 1.68896L5.80762 0.492188H6.98584L12.1533 14H10.3164ZM10.0845 8.99951V10.4653H2.49561V8.99951H10.0845Z", fill: "var(--mito-text)" }));
    } else {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "18", height: "20", viewBox: "0 0 18 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M14.2413 11.3514H1.55255C1.13154 11.3514 0.899003 11.8003 1.16449 12.1005L6.66295 18.3192C6.84611 18.5263 7.18217 18.5469 7.39368 18.364L14.584 12.1454C14.9137 11.8602 14.6941 11.3514 14.2413 11.3514Z", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M14.0791 17.4732C14.0792 17.2663 15.5791 14.704 15.5791 14.704C15.5791 14.704 17.079 17.287 17.0791 17.4732C17.0794 18.2426 16.3293 18.704 15.5791 18.704C14.8289 18.704 14.0787 18.2426 14.0791 17.4732Z", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M6.5 1L9.00207 4M9.00207 4L14.8324 10.5939C15.201 11.0109 15.1583 11.6486 14.7374 12.0127L7.75019 18.0557C7.3357 18.4142 6.70989 18.3723 6.34689 17.9617L1.17176 12.1088C0.803091 11.6918 0.845795 11.0541 1.26676 10.69L9.00207 4ZM1.55255 11.3514H14.2413C14.6941 11.3514 14.9137 11.8602 14.584 12.1454L7.39368 18.364C7.18217 18.5469 6.84611 18.5263 6.66295 18.3192L1.16449 12.1005C0.899003 11.8003 1.13154 11.3514 1.55255 11.3514ZM15.5791 14.704C15.5791 14.704 14.0792 17.2663 14.0791 17.4732C14.0787 18.2426 14.8289 18.704 15.5791 18.704C16.3293 18.704 17.0794 18.2426 17.0791 17.4732C17.079 17.287 15.5791 14.704 15.5791 14.704Z", stroke: "var(--mito-text)", strokeWidth: "1.5" }));
    }
  };
  var ColorIcon_default = ColorIcon;

  // src/mito/components/elements/ColorInput.tsx
  var ColorInput = (props) => {
    var _a, _b;
    const [color, setColor] = react_default.useState(props.value);
    useDebouncedEffect(() => {
      props.onChange(color);
    }, [color], 100);
    return props.type === void 0 ? /* @__PURE__ */ react_default.createElement(
      "input",
      {
        className: "color-input",
        type: "color",
        value: props.value,
        onChange: (e) => {
          setColor(e.target.value);
        }
      }
    ) : /* @__PURE__ */ react_default.createElement("label", { className: "mito-toolbar-button-icon-container", htmlFor: `color-picker-${(_a = props.id) != null ? _a : ""}`, style: { display: "flex", flexDirection: "column", alignItems: "center", height: "35px", justifyContent: "space-evenly" } }, /* @__PURE__ */ react_default.createElement(ColorIcon_default, { type: props.type }), /* @__PURE__ */ react_default.createElement(
      "input",
      {
        id: `color-picker-${(_b = props.id) != null ? _b : ""}`,
        className: "color-input-with-icon",
        type: "color",
        value: props.value,
        onChange: (e) => {
          setColor(e.target.value);
        }
      }
    ));
  };
  var ColorInput_default = ColorInput;

  // src/mito/pro/graph/LabelAndColor.tsx
  var LabelAndColor = (props) => {
    return /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", null, props.label)), /* @__PURE__ */ react_default.createElement(
      ColorInput_default,
      {
        value: props.color,
        onChange: props.onChange
      }
    ));
  };
  var LabelAndColor_default = LabelAndColor;

  // src/mito/pro/taskpanes/SetDataframeFormat/SuggestedStyles.tsx
  init_react();

  // src/mito/components/icons/SuggestedStyleIcon.tsx
  init_react();
  var SuggestedStyleIcon = (props) => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "52", height: "54", viewBox: "0 0 64 54", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { width: "60", height: "10", transform: "translate(2 2)", fill: props.headerColor }), /* @__PURE__ */ react_default.createElement("rect", { width: "60", height: "10", transform: "translate(2 12)", fill: props.evenRowColor }), /* @__PURE__ */ react_default.createElement("rect", { width: "60", height: "10", transform: "translate(2 22)", fill: props.oddRowColor }), /* @__PURE__ */ react_default.createElement("rect", { width: "60", height: "10", transform: "translate(2 32)", fill: props.evenRowColor }), /* @__PURE__ */ react_default.createElement("rect", { width: "60", height: "10", transform: "translate(2 42)", fill: props.oddRowColor }), /* @__PURE__ */ react_default.createElement("rect", { x: "1", y: "1", width: "62", height: "52", stroke: "var(--mito-highlight)", strokeWidth: "2" }));
  };
  var SuggestedStyleIcon_default = SuggestedStyleIcon;

  // src/mito/pro/taskpanes/SetDataframeFormat/SuggestedStyles.tsx
  var DARK_TEXT_COLOR = "#494650";
  var DEFAULT_SUGGESTED_STYLES = [
    {
      headers: { color: void 0, backgroundColor: void 0 },
      rows: { even: { color: void 0, backgroundColor: void 0 }, odd: { color: void 0, backgroundColor: void 0 } },
      border: { borderStyle: void 0, borderColor: void 0 }
    },
    {
      headers: {
        color: void 0,
        backgroundColor: "#9B9B9D"
      },
      rows: { even: { color: ROW_TEXT_COLOR_DEFAULT, backgroundColor: void 0 }, odd: { color: ROW_TEXT_COLOR_DEFAULT, backgroundColor: void 0 } },
      border: { borderStyle: void 0, borderColor: void 0 }
    },
    {
      headers: {
        color: "#FFFFFF",
        backgroundColor: "#549D3A"
      },
      rows: { even: { color: DARK_TEXT_COLOR, backgroundColor: "#D0E3C9" }, odd: { color: DARK_TEXT_COLOR, backgroundColor: "#FFFFFF" } },
      border: { borderStyle: void 0, borderColor: void 0 }
    },
    {
      headers: {
        color: "#FFFFFF",
        backgroundColor: "#4D73BE"
      },
      rows: { even: { color: DARK_TEXT_COLOR, backgroundColor: "#DAE1F0" }, odd: { color: DARK_TEXT_COLOR, backgroundColor: "#FFFFFF" } },
      border: { borderStyle: void 0, borderColor: void 0 }
    },
    {
      headers: {
        color: "#FFFFFF",
        backgroundColor: "#8F1B15"
      },
      rows: { even: { color: DARK_TEXT_COLOR, backgroundColor: "#F0DADA" }, odd: { color: DARK_TEXT_COLOR, backgroundColor: "#FFFFFF" } },
      border: { borderStyle: void 0, borderColor: void 0 }
    }
  ];
  var SuggestedStyles = (props) => {
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(Row_default, null, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Suggested Styles"))), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, DEFAULT_SUGGESTED_STYLES.map((suggestedStyle, index) => {
      var _a, _b, _c, _d, _e;
      const headerColor = ((_a = suggestedStyle.headers) == null ? void 0 : _a.backgroundColor) || "var(--mito-background-highlight)";
      const evenRowColor = ((_c = (_b = suggestedStyle.rows) == null ? void 0 : _b.even) == null ? void 0 : _c.backgroundColor) || "var(--mito-background)";
      const oddRowColor = ((_e = (_d = suggestedStyle.rows) == null ? void 0 : _d.odd) == null ? void 0 : _e.backgroundColor) || "var(--mito-background-off)";
      return /* @__PURE__ */ react_default.createElement(
        "div",
        {
          key: index,
          onClick: () => {
            props.updateDataframeFormatParams(suggestedStyle);
          },
          className: "mito-suggested-style"
        },
        /* @__PURE__ */ react_default.createElement(
          SuggestedStyleIcon_default,
          {
            headerColor,
            evenRowColor,
            oddRowColor
          }
        )
      );
    })));
  };
  var SuggestedStyles_default = SuggestedStyles;

  // src/mito/pro/taskpanes/SetDataframeFormat/SetDataframeFormatTaskpane.tsx
  var BORDER_COLOR_DEFAULT = "#FFFFFF";
  var getDefaultDataframeFormat = () => {
    return { columns: {}, headers: {}, rows: { even: {}, odd: {} }, border: {}, conditional_formats: [] };
  };
  var getDefaultParams = (sheetDataArray, sheetIndex) => {
    if (sheetDataArray.length === 0 || sheetDataArray[sheetIndex] === void 0) {
      return void 0;
    }
    return {
      sheet_index: sheetIndex,
      df_format: sheetDataArray[sheetIndex].dfFormat || getDefaultDataframeFormat()
    };
  };
  var SetDataframeFormatTaskpane = (props) => {
    const { params, setParams, startNewStep } = useLiveUpdatingParams_default(
      () => getDefaultParams(props.sheetDataArray, props.selectedSheetIndex),
      "set_dataframe_format" /* SetDataframeFormat */,
      props.mitoAPI,
      props.analysisData,
      50
    );
    const ref = react_default.useRef(null);
    const sheetFormat = (props.sheetDataArray[(params == null ? void 0 : params.sheet_index) || 0] || {}).dfFormat;
    if (params === void 0 || sheetFormat === void 0) {
      return /* @__PURE__ */ react_default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    const updateDataframeFormatParams = (newParams) => {
      setParams((prevParams) => {
        return updateObjectWithPartialObject(prevParams, { df_format: newParams });
      });
    };
    return /* @__PURE__ */ react_default.createElement(
      DefaultTaskpane_default,
      {
        ref,
        setUIState: props.setUIState,
        mitoAPI: props.mitoAPI
      },
      /* @__PURE__ */ react_default.createElement(
        DefaultTaskpaneHeader_default,
        {
          header: "Color Dataframe",
          setUIState: props.setUIState
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DefaultTaskpaneBody_default,
        {
          userProfile: props.userProfile,
          requiresPro: {
            message: "Setting the dataframe format is a Mito Pro feature. Please upgrade to use this feature.",
            mitoAPI: props.mitoAPI,
            featureName: "Set dataframe colors"
          }
        },
        /* @__PURE__ */ react_default.createElement(
          DataframeSelect_default,
          {
            sheetDataArray: props.sheetDataArray,
            sheetIndex: params.sheet_index,
            onChange: (newSheetIndex) => {
              startNewStep();
              setParams((prevParams) => {
                const newParams = getDefaultParams(props.sheetDataArray, newSheetIndex);
                if (newParams) {
                  return newParams;
                }
                return __spreadProps(__spreadValues({}, prevParams), {
                  sheet_index: newSheetIndex
                });
              });
              props.setUIState((prevState) => {
                return __spreadProps(__spreadValues({}, prevState), {
                  selectedSheetIndex: newSheetIndex
                });
              });
            }
          }
        ),
        /* @__PURE__ */ react_default.createElement(SuggestedStyles_default, { updateDataframeFormatParams }),
        /* @__PURE__ */ react_default.createElement(CollapsibleSection_default, { title: "Column Headers" }, /* @__PURE__ */ react_default.createElement(
          LabelAndColor_default,
          {
            label: "Background Color",
            color: convertToHex(params.df_format.headers.backgroundColor || HEADER_BACKGROUND_COLOR_DEFAULT, ref.current),
            onChange: (newColor) => {
              return updateDataframeFormatParams({ headers: { backgroundColor: newColor } });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          LabelAndColor_default,
          {
            label: "Text Color",
            color: convertToHex(params.df_format.headers.color || HEADER_TEXT_COLOR_DEFAULT, ref.current),
            onChange: (newColor) => {
              return updateDataframeFormatParams({ headers: { color: newColor } });
            }
          }
        )),
        /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 10 }),
        /* @__PURE__ */ react_default.createElement(CollapsibleSection_default, { title: "Rows" }, /* @__PURE__ */ react_default.createElement(
          LabelAndColor_default,
          {
            label: "Even Row: Background Color",
            color: convertToHex(params.df_format.rows.even.backgroundColor || EVEN_ROW_BACKGROUND_COLOR_DEFAULT, ref.current),
            onChange: (newColor) => {
              return updateDataframeFormatParams({ rows: { even: { backgroundColor: newColor } } });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          LabelAndColor_default,
          {
            label: "Even Row: Text Color",
            color: convertToHex(params.df_format.rows.even.color || ROW_TEXT_COLOR_DEFAULT, ref.current),
            onChange: (newColor) => {
              return updateDataframeFormatParams({ rows: { even: { color: newColor } } });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          LabelAndColor_default,
          {
            label: "Odd Row: Background Color",
            color: convertToHex(params.df_format.rows.odd.backgroundColor || ODD_ROW_BACKGROUND_COLOR_DEFAULT, ref.current),
            onChange: (newColor) => {
              return updateDataframeFormatParams({ rows: { odd: { backgroundColor: newColor } } });
            }
          }
        ), /* @__PURE__ */ react_default.createElement(
          LabelAndColor_default,
          {
            label: "Odd Row: Text Color",
            color: convertToHex(params.df_format.rows.odd.color || ROW_TEXT_COLOR_DEFAULT, ref.current),
            onChange: (newColor) => {
              return updateDataframeFormatParams({ rows: { odd: { color: newColor } } });
            }
          }
        )),
        /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 10 }),
        /* @__PURE__ */ react_default.createElement(CollapsibleSection_default, { title: "Dataframe Border" }, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: "The border line will be displayed when the dataframe styling object is printed out.", textBody: true }, "Border Style")), /* @__PURE__ */ react_default.createElement(Col_default, null), /* @__PURE__ */ react_default.createElement(
          Select_default,
          {
            value: params.df_format.border.borderStyle || "none",
            width: "medium",
            onChange: (newBorderStyle) => {
              if (newBorderStyle === "none") {
                return updateDataframeFormatParams({ border: { borderStyle: void 0 } });
              }
              return updateDataframeFormatParams({ border: { borderStyle: newBorderStyle } });
            }
          },
          /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: "none" }),
          /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: "solid" }),
          /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: "dashed" })
        )), /* @__PURE__ */ react_default.createElement(
          LabelAndColor_default,
          {
            label: "Border Color",
            color: convertToHex(params.df_format.border.borderColor || BORDER_COLOR_DEFAULT, ref.current),
            onChange: (newColor) => {
              return updateDataframeFormatParams({ border: { borderColor: newColor } });
            }
          }
        ))
      )
    );
  };
  var SetDataframeFormatTaskpane_default = SetDataframeFormatTaskpane;

  // src/mito/utils/format.tsx
  var FORMAT_DISABLED_MESSAGE = "You must have at least one number column selected to adjust the formatting.";
  var formatNumber = (number, precision) => {
    return number.toLocaleString("en-US", { minimumFractionDigits: precision, maximumFractionDigits: precision });
  };
  var formatCellData = (cellData, columnDtype, columnFormat) => {
    if (typeof cellData !== "number") {
      return "" + cellData;
    }
    const type = columnFormat == null ? void 0 : columnFormat.type;
    let precision = columnFormat == null ? void 0 : columnFormat.precision;
    if (precision === void 0) {
      if (isFloatDtype(columnDtype)) {
        precision = 2;
      }
      if (isIntDtype(columnDtype)) {
        precision = 0;
      }
    }
    if ((precision || 0) > 20) {
      precision = 20;
    }
    switch (type) {
      case void 0: {
        return formatNumber(cellData, precision);
      }
      case "plain text" /* PLAIN_TEXT */:
        return formatNumber(cellData, precision).replace(/,/g, "");
      case "percentage" /* PERCENTAGE */:
        return cellData.toLocaleString("en-US", { style: "percent", minimumFractionDigits: precision, maximumFractionDigits: precision });
      case "currency" /* CURRENCY */:
        return cellData.toLocaleString("en-US", { style: "currency", currency: "USD", minimumFractionDigits: precision, maximumFractionDigits: precision });
      case "accounting" /* ACCOUNTING */:
        return cellData.toLocaleString("en-US", { style: "currency", currency: "USD", currencySign: "accounting", minimumFractionDigits: precision, maximumFractionDigits: precision });
      case "scientific notation" /* SCIENTIFIC_NOTATION */:
        return cellData.toExponential(precision);
    }
  };
  var increasePrecision = (columnFormat, columnDtype) => {
    if (columnDtype && isFloatDtype(columnDtype) && columnFormat.precision === void 0) {
      return __spreadProps(__spreadValues({}, columnFormat), { precision: 3 });
    } else {
      return __spreadProps(__spreadValues({}, columnFormat), { precision: (columnFormat.precision || 0) + 1 });
    }
  };
  var decreasePrecision = (columnFormat, columnDtype) => {
    if (columnDtype && isFloatDtype(columnDtype) && columnFormat.precision === void 0) {
      return __spreadProps(__spreadValues({}, columnFormat), { precision: 1 });
    } else {
      return __spreadProps(__spreadValues({}, columnFormat), { precision: Math.max((columnFormat.precision || 0) - 1, 0) });
    }
  };
  var changeFormatOfColumns = (sheetIndex, sheetData, columnIDs, newColumnFormat, mitoAPI) => __async(void 0, null, function* () {
    const newDfFormat = __spreadValues({}, (sheetData == null ? void 0 : sheetData.dfFormat) || getDefaultDataframeFormat());
    columnIDs.forEach((columnID) => {
      if (newColumnFormat === void 0) {
        newDfFormat.columns[columnID] = newColumnFormat;
      } else {
        const existingColumnFormat = newDfFormat.columns[columnID] || {};
        newDfFormat.columns[columnID] = __spreadValues(__spreadValues({}, existingColumnFormat), newColumnFormat);
      }
    });
    yield mitoAPI.editSetDataframeFormat(
      sheetIndex,
      newDfFormat
    );
  });
  var getColumnAppliedFormat = (sheetData, columnIDs) => {
    const numberColumnColumnIDs = getNumberColumnIDs(sheetData, columnIDs);
    const appliedFormatting = sheetData == null ? void 0 : sheetData.dfFormat.columns[numberColumnColumnIDs[0]];
    return getFormatTitle(appliedFormatting);
  };
  var getColumnFormatDropdownItems = (sheetIndex, sheetData, columnIDs, mitoAPI, closeOpenEditingPopups) => {
    const numberColumnColumnIDs = getNumberColumnIDs(sheetData, columnIDs);
    const appliedFormatting = sheetData == null ? void 0 : sheetData.dfFormat.columns[numberColumnColumnIDs[0]];
    const onClick = (columnFormat) => {
      closeOpenEditingPopups();
      void changeFormatOfColumns(
        sheetIndex,
        sheetData,
        columnIDs,
        columnFormat,
        mitoAPI
      );
    };
    return _getColumnFormatDropdownItems(onClick, numberColumnColumnIDs.length === 0, appliedFormatting);
  };
  var _getColumnFormatDropdownItems = (onClick, disabled, appliedColumnFormat) => {
    return [
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          key: "Default",
          title: "Default",
          icon: (appliedColumnFormat == null ? void 0 : appliedColumnFormat.type) === void 0 ? /* @__PURE__ */ react_default.createElement(DropdownCheckmark_default, null) : void 0,
          onClick: () => onClick({ type: void 0 }),
          rightText: "1,234.6",
          disabled
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          key: getFormatTitle({ type: "plain text" /* PLAIN_TEXT */ }),
          title: getFormatTitle({ type: "plain text" /* PLAIN_TEXT */ }),
          icon: (appliedColumnFormat == null ? void 0 : appliedColumnFormat.type) === "plain text" /* PLAIN_TEXT */ ? /* @__PURE__ */ react_default.createElement(DropdownCheckmark_default, null) : void 0,
          onClick: () => onClick({ type: "plain text" /* PLAIN_TEXT */ }),
          rightText: "1234.6",
          disabled
        }
      ),
      /* @__PURE__ */ react_default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true, key: "sep" }),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          key: getFormatTitle({ type: "currency" /* CURRENCY */ }),
          title: getFormatTitle({ type: "currency" /* CURRENCY */ }),
          icon: (appliedColumnFormat == null ? void 0 : appliedColumnFormat.type) === "currency" /* CURRENCY */ ? /* @__PURE__ */ react_default.createElement(DropdownCheckmark_default, null) : void 0,
          onClick: () => onClick({ type: "currency" /* CURRENCY */ }),
          rightText: "$-1,234.57",
          disabled
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          key: getFormatTitle({ type: "accounting" /* ACCOUNTING */ }),
          title: getFormatTitle({ type: "accounting" /* ACCOUNTING */ }),
          icon: (appliedColumnFormat == null ? void 0 : appliedColumnFormat.type) === "accounting" /* ACCOUNTING */ ? /* @__PURE__ */ react_default.createElement(DropdownCheckmark_default, null) : void 0,
          onClick: () => onClick({ type: "accounting" /* ACCOUNTING */ }),
          rightText: "($1,234.57)",
          disabled
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          key: getFormatTitle({ type: "percentage" /* PERCENTAGE */ }),
          title: getFormatTitle({ type: "percentage" /* PERCENTAGE */ }),
          icon: (appliedColumnFormat == null ? void 0 : appliedColumnFormat.type) === "percentage" /* PERCENTAGE */ ? /* @__PURE__ */ react_default.createElement(DropdownCheckmark_default, null) : void 0,
          onClick: () => onClick({ type: "percentage" /* PERCENTAGE */ }),
          rightText: "123,457.00%",
          disabled
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          key: getFormatTitle({ type: "scientific notation" /* SCIENTIFIC_NOTATION */ }),
          title: getFormatTitle({ type: "scientific notation" /* SCIENTIFIC_NOTATION */ }),
          icon: (appliedColumnFormat == null ? void 0 : appliedColumnFormat.type) === "scientific notation" /* SCIENTIFIC_NOTATION */ ? /* @__PURE__ */ react_default.createElement(DropdownCheckmark_default, null) : void 0,
          onClick: () => onClick({ type: "scientific notation" /* SCIENTIFIC_NOTATION */ }),
          rightText: "1.23e+3",
          disabled
        }
      )
    ];
  };
  var getFormatTitle = (formatTypeObj) => {
    if (formatTypeObj === void 0) {
      return "Default";
    }
    switch (formatTypeObj.type) {
      case void 0:
        return "Default";
      case "plain text" /* PLAIN_TEXT */:
        return "Plain Text";
      case "percentage" /* PERCENTAGE */: {
        return "Percentage";
      }
      case "currency" /* CURRENCY */: {
        return "Currency";
      }
      case "accounting" /* ACCOUNTING */: {
        return "Accounting";
      }
      case "scientific notation" /* SCIENTIFIC_NOTATION */:
        return "Scientific Notation";
    }
  };

  // src/mito/components/taskpanes/ControlPanel/FilterAndSortTab/FormatCard.tsx
  var FORMAT_DESCRIPTION = "Format the selected column as a percent, choose the number of decimals, etc. This only changes the display of the column, and does not effect the underlying dataframe.";
  function FormatCard(props) {
    var _a;
    const formatTypeTitle = getFormatTitle((_a = props.sheetData) == null ? void 0 : _a.dfFormat.columns[props.columnID]);
    if (!isNumberDtype(props.columnDtype)) {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
    }
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 6, title: FORMAT_DESCRIPTION }, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3", title: "" }, "Num Type")), /* @__PURE__ */ react_default.createElement(Col_default, { offset: 2, flex: "1" }, isNumberDtype(props.columnDtype) && /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        value: formatTypeTitle
      },
      getColumnFormatDropdownItems(props.gridState.sheetIndex, props.sheetData, [props.columnID], props.mitoAPI, props.closeOpenEditingPopups)
    ), !isNumberDtype(props.columnDtype) && /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3 text-align-right" }, formatTypeTitle))));
  }
  var FormatCard_default = FormatCard;

  // src/mito/components/taskpanes/ControlPanel/FilterAndSortTab/SortCard.tsx
  init_react();
  var SortCard = (props) => {
    const { params, setParams } = useLiveUpdatingParams_default(void 0, "sort", props.mitoAPI, props.analysisData, 0);
    const updateSortDirection = (newSortDirection) => {
      setParams((prevSortParams) => {
        let finalSortDirection = newSortDirection;
        if (prevSortParams && newSortDirection == prevSortParams.sort_direction) {
          finalSortDirection = "none" /* NONE */;
        }
        return {
          sheet_index: props.selectedSheetIndex,
          column_id: props.columnID,
          sort_direction: finalSortDirection
        };
      });
    };
    const ascendingButtonClass = params && params.sort_direction == "ascending" /* ASCENDING */ ? "sort-button-selected" : "";
    const descendingButtonClass = params && params.sort_direction == "descending" /* DESCENDING */ ? "sort-button-selected" : "";
    return /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 6 }, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Sort")), /* @__PURE__ */ react_default.createElement(Col_default, { offset: 2, flex: "1" }, /* @__PURE__ */ react_default.createElement(Row_default, { suppressTopBottomMargin: true }, /* @__PURE__ */ react_default.createElement(Col_default, { flex: "1" }, /* @__PURE__ */ react_default.createElement(
      "button",
      {
        className: classNames("sort-button", ascendingButtonClass),
        onClick: () => updateSortDirection("ascending" /* ASCENDING */)
      },
      "Ascending"
    )), /* @__PURE__ */ react_default.createElement(Col_default, { offset: 1, flex: "1" }, /* @__PURE__ */ react_default.createElement(
      "button",
      {
        className: classNames("sort-button", descendingButtonClass),
        onClick: () => updateSortDirection("descending" /* DESCENDING */)
      },
      "Descending"
    )))));
  };
  var SortCard_default = SortCard;

  // src/mito/components/taskpanes/ControlPanel/FilterAndSortTab/filter/FilterCard.tsx
  init_react();

  // src/mito/components/taskpanes/ControlPanel/FilterAndSortTab/filter/filterTypes.tsx
  function isFilterGroup(filter) {
    return filter.filters !== void 0;
  }

  // src/mito/components/taskpanes/ControlPanel/FilterAndSortTab/filter/Filter.tsx
  init_react();

  // src/mito/components/taskpanes/ControlPanel/FilterAndSortTab/filter/filterConditions.tsx
  var BOOLEAN_SELECT_OPTIONS = {
    ["boolean_is_true"]: {
      long_name: "is true",
      short_name: "is true"
    },
    ["boolean_is_false"]: {
      long_name: "is false",
      short_name: "is false"
    }
  };
  var NUMBER_SELECT_OPTIONS = {
    ["number_exactly"]: {
      long_name: "=",
      short_name: "="
    },
    ["number_not_exactly"]: {
      long_name: "\u2260",
      short_name: "\u2260"
    },
    ["greater"]: {
      long_name: ">",
      short_name: ">"
    },
    ["greater_than_or_equal"]: {
      long_name: "\u2265",
      short_name: "\u2265"
    },
    ["less"]: {
      long_name: "<",
      short_name: "<"
    },
    ["less_than_or_equal"]: {
      long_name: "\u2264",
      short_name: "\u2264"
    },
    ["number_lowest"]: {
      long_name: "lowest N values",
      short_name: "lowest N"
    },
    ["number_highest"]: {
      long_name: "highest N values",
      short_name: "highest N"
    }
  };
  var STRING_SELECT_OPTIONS = {
    ["contains"]: {
      long_name: "string contains",
      short_name: "contains"
    },
    ["string_does_not_contain"]: {
      long_name: "string does not contain",
      short_name: "does not contain"
    },
    ["string_exactly"]: {
      long_name: "string is exactly",
      short_name: "is exactly"
    },
    ["string_not_exactly"]: {
      long_name: "string is not exactly",
      short_name: "is not exactly"
    },
    ["string_starts_with"]: {
      long_name: "string starts with",
      short_name: "starts with"
    },
    ["string_ends_with"]: {
      long_name: "string ends with",
      short_name: "ends with"
    },
    ["string_contains_case_insensitive"]: {
      long_name: "string contains case insensitive",
      short_name: "contains case insensitive"
    }
  };
  var DATETIME_SELECT_OPTIONS = {
    ["datetime_exactly"]: {
      long_name: "date is exactly",
      short_name: "="
    },
    ["datetime_not_exactly"]: {
      long_name: "date is not exactly",
      short_name: "!="
    },
    ["datetime_greater"]: {
      long_name: "date is after",
      short_name: ">"
    },
    ["datetime_greater_than_or_equal"]: {
      long_name: "date is exactly or after",
      short_name: "\u2265"
    },
    ["datetime_less"]: {
      long_name: "date is before",
      short_name: "<"
    },
    ["datetime_less_than_or_equal"]: {
      long_name: "date is exactly or before",
      short_name: "\u2264"
    }
  };
  var SHARED_SELECT_OPTIONS = {
    ["empty"]: {
      long_name: "is empty",
      short_name: "is empty"
    },
    ["not_empty"]: {
      long_name: "is not empty",
      short_name: "is not empty"
    },
    ["most_frequent"]: {
      long_name: "most frequent N values",
      short_name: "most frequent N"
    },
    ["least_frequent"]: {
      long_name: "least frequent N values",
      short_name: "least frequent N"
    }
  };
  var ALL_SELECT_OPTIONS = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, BOOLEAN_SELECT_OPTIONS), NUMBER_SELECT_OPTIONS), STRING_SELECT_OPTIONS), DATETIME_SELECT_OPTIONS), SHARED_SELECT_OPTIONS);
  var CONDITIONS_WITH_NO_INPUT = [
    "boolean_is_true",
    "boolean_is_false",
    "empty",
    "not_empty"
  ];

  // src/mito/components/taskpanes/ControlPanel/FilterAndSortTab/filter/filterUtils.tsx
  init_react();
  function getFilterDisabledMessage(columnDtype) {
    if (isTimedeltaDtype(columnDtype)) {
      return "Sorry, Mito does not support filtering on timedeltas columns currently. Try changing the column dtype to a string and filtering on that instead.";
    }
    return void 0;
  }
  function getEmptyFilterData(columnDtype) {
    if (isBoolDtype(columnDtype)) {
      return {
        condition: "boolean_is_true",
        value: ""
      };
    } else if (isStringDtype(columnDtype)) {
      return {
        condition: "contains",
        value: ""
      };
    } else if (isNumberDtype(columnDtype)) {
      return {
        condition: "greater",
        value: ""
      };
    } else if (isDatetimeDtype(columnDtype)) {
      return {
        condition: "datetime_exactly",
        value: ""
      };
    } else {
      return {
        condition: "not_empty",
        value: ""
      };
    }
  }
  function getExclusiveFilterData(columnDtype, value) {
    const isNaN2 = isValueNone(value);
    if (isBoolDtype(columnDtype)) {
      return {
        condition: isNaN2 ? "not_empty" : value ? "boolean_is_false" : "boolean_is_true",
        value: ""
      };
    } else if (isStringDtype(columnDtype)) {
      return {
        condition: isNaN2 ? "not_empty" : "string_not_exactly",
        value
      };
    } else if (isNumberDtype(columnDtype)) {
      return {
        condition: isNaN2 ? "not_empty" : "number_not_exactly",
        value
      };
    } else if (isDatetimeDtype(columnDtype)) {
      return {
        condition: isNaN2 ? "not_empty" : "datetime_not_exactly",
        value: value.split(" ")[0]
      };
    } else {
      return {
        condition: "contains",
        value: ""
      };
    }
  }
  var checkFilterShouldHaveNumberValue = (filter) => {
    return (Object.keys(NUMBER_SELECT_OPTIONS).includes(filter.condition) || filter.condition === "most_frequent" || filter.condition === "least_frequent") && typeof filter.value === "string";
  };
  var isValidFilter = (filter, columnDtype) => {
    if (CONDITIONS_WITH_NO_INPUT.includes(filter.condition)) {
      return true;
    }
    if (isNumberDtype(columnDtype)) {
      return typeof filter.value !== "string" && !isNaN(filter.value);
    }
    if (isStringDtype(columnDtype) || isDatetimeDtype(columnDtype)) {
      return filter.value !== "";
    }
    return true;
  };
  var parseFilter = (filter) => {
    if (checkFilterShouldHaveNumberValue(filter)) {
      return {
        condition: filter.condition,
        value: parseFloat(filter.value)
      };
    }
    return filter;
  };
  var getFiltersToApply = (filters, columnDtype) => {
    const parsedFilters = filters.map((filterOrGroup) => {
      if (isFilterGroup(filterOrGroup)) {
        return {
          filters: filterOrGroup.filters.map((filter) => {
            return parseFilter(filter);
          }),
          operator: filterOrGroup.operator
        };
      } else {
        return parseFilter(filterOrGroup);
      }
    });
    const filtersToApply = parsedFilters.map((filterOrGroup) => {
      if (isFilterGroup(filterOrGroup)) {
        return {
          filters: filterOrGroup.filters.filter((filter) => {
            return isValidFilter(filter, columnDtype);
          }),
          operator: filterOrGroup.operator
        };
      } else {
        return filterOrGroup;
      }
    }).filter((filterOrGroup) => {
      if (isFilterGroup(filterOrGroup)) {
        return filterOrGroup.filters.length > 0;
      }
      return isValidFilter(filterOrGroup, columnDtype);
    });
    return filtersToApply;
  };
  var getAllDoesNotContainsFilterValues = (filters, columnDtype) => {
    const filteredOutValues = [];
    filters.forEach((filterOrGroup) => {
      if (isFilterGroup(filterOrGroup)) {
        return;
      } else if (isBoolDtype(columnDtype)) {
        if (filterOrGroup.condition === "boolean_is_false") {
          filteredOutValues.push(true);
        } else if (filterOrGroup.condition === "boolean_is_true") {
          filteredOutValues.push(false);
        }
      } else {
        if (filterOrGroup.condition === getNotExactlyFilterCondition(columnDtype)) {
          filteredOutValues.push(filterOrGroup.value);
        } else if (filterOrGroup.condition === "not_empty") {
          filteredOutValues.push("NaN");
        }
      }
    });
    return filteredOutValues;
  };
  var getNotExactlyFilterCondition = (columnDtype) => {
    if (isNumberDtype(columnDtype)) {
      return "number_not_exactly";
    } else if (isStringDtype(columnDtype)) {
      return "string_not_exactly";
    } else if (isDatetimeDtype(columnDtype)) {
      return "datetime_not_exactly";
    } else {
      return "";
    }
  };
  var areFiltersEqual = (filterOne, filterTwo) => {
    const valueOne = isValueNone(filterOne.value) || filterOne.value;
    const valueTwo = isValueNone(filterOne.value) || filterTwo.value;
    return valueOne == valueTwo && filterOne.condition === filterTwo.condition;
  };
  var isValueNone = (value) => {
    return value === "NaN" || value === "nan" || value === "NaT" || value === "nat" || value === null || value === void 0;
  };
  var addToFilterOptions = (prevFilterOptions, newOptions, name) => {
    const newFilterOptions = [...prevFilterOptions];
    Object.entries(newOptions).forEach(([filterCondition, displayFilterCondition]) => {
      newFilterOptions.push(
        /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: filterCondition,
            id: filterCondition,
            title: displayFilterCondition[name]
          }
        )
      );
    });
    return newFilterOptions;
  };
  var getFilterOptions = (columnDtype, nameLength) => {
    let filterOptions = [];
    if (!columnDtype || isNumberDtype(columnDtype)) {
      filterOptions = addToFilterOptions(filterOptions, NUMBER_SELECT_OPTIONS, nameLength);
      filterOptions.push(/* @__PURE__ */ react_default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }));
    }
    if (!columnDtype || isStringDtype(columnDtype)) {
      filterOptions = addToFilterOptions(filterOptions, STRING_SELECT_OPTIONS, nameLength);
      filterOptions.push(/* @__PURE__ */ react_default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }));
    }
    if (!columnDtype || isBoolDtype(columnDtype)) {
      filterOptions = addToFilterOptions(filterOptions, BOOLEAN_SELECT_OPTIONS, nameLength);
      filterOptions.push(/* @__PURE__ */ react_default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }));
    }
    if (!columnDtype || isDatetimeDtype(columnDtype)) {
      filterOptions = addToFilterOptions(filterOptions, DATETIME_SELECT_OPTIONS, nameLength);
      filterOptions.push(/* @__PURE__ */ react_default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }));
    }
    filterOptions = addToFilterOptions(filterOptions, SHARED_SELECT_OPTIONS, nameLength);
    return filterOptions;
  };
  var getEqualityFilterCondition = (value, columnDtype) => {
    const isNaN2 = value === void 0 || isValueNone(value);
    let condition = "string_exactly";
    if (columnDtype === "number") {
      condition = "number_exactly";
    } else if (columnDtype === "boolean") {
      condition = value ? "boolean_is_true" : "boolean_is_false";
    } else if (columnDtype === "datetime") {
      condition = "datetime_exactly";
    }
    if (isNaN2) {
      condition = "empty";
    }
    return condition;
  };

  // src/mito/components/taskpanes/ControlPanel/FilterAndSortTab/filter/Filter.tsx
  function Filter(props) {
    const inputStyle = CONDITIONS_WITH_NO_INPUT.includes(props.filter.condition) ? { "visibility": "hidden" } : { "visibility": "visible" };
    const filterConditionOptions = getFilterOptions(props.columnDtype, props.nameLength);
    const setOperator = props.setOperator;
    const isDatetime = props.columnDtype && isDatetimeDtype(props.columnDtype) || props.columnDtype === void 0 && DATETIME_SELECT_OPTIONS[props.filter.condition] !== void 0;
    return /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", suppressTopBottomMargin: props.suppressTopBottomMargin }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 5 }, setOperator === void 0 && /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1" }, "Where"), setOperator !== void 0 && /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        value: props.operator,
        onChange: (newOperator) => setOperator(newOperator),
        dropdownWidth: "small"
      },
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "And"
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "Or"
        }
      )
    )), /* @__PURE__ */ react_default.createElement(Col_default, { span: 7 }, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        value: props.filter.condition,
        onChange: (newFilterCondition) => {
          props.setFilter({
            condition: newFilterCondition,
            value: props.filter.value
          });
        },
        width: "block",
        dropdownWidth: props.nameLength == "long_name" ? "medium-large" : "medium"
      },
      filterConditionOptions
    )), /* @__PURE__ */ react_default.createElement(Col_default, { span: 9 }, /* @__PURE__ */ react_default.createElement(
      "input",
      {
        className: "mito-input element-width-block",
        style: inputStyle,
        type: isDatetime ? "date" : "text",
        value: props.filter.value,
        onChange: (e) => {
          props.setFilter({
            condition: props.filter.condition,
            value: e.target.value
          });
        }
      }
    )), props.deleteFilter && /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(XIcon_default, { onClick: props.deleteFilter })));
  }

  // src/mito/components/taskpanes/ControlPanel/FilterAndSortTab/filter/FilterGroup.tsx
  init_react();
  function FilterGroup(props) {
    return /* @__PURE__ */ react_default.createElement("div", { className: "filter-group" }, props.filters.map((filter, index) => {
      return /* @__PURE__ */ react_default.createElement(
        Filter,
        {
          key: index,
          filter,
          operator: props.groupOperator,
          displayOperator: true,
          setFilter: (newFilter) => {
            props.setFilter(index, newFilter);
          },
          setOperator: index === 0 ? void 0 : props.setOperator,
          deleteFilter: () => {
            props.deleteFilter(index);
          },
          inGroup: true,
          columnDtype: props.columnDtype,
          nameLength: "short_name"
        }
      );
    }), /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "light",
        onClick: props.addFilter,
        width: "medium"
      },
      "+ Add a Filter"
    ));
  }

  // src/mito/components/taskpanes/ControlPanel/FilterAndSortTab/filter/FilterCard.tsx
  var ADD_FILTER_SELECT_TITLE = "+ Add Filter";
  function FilterCard(props) {
    const addFilter = () => {
      props.setFilters((prevFilters) => {
        const newFilters = [...prevFilters];
        newFilters.push(getEmptyFilterData(props.columnDtype));
        return newFilters;
      });
    };
    const addFilterGroup = () => {
      props.setFilters((prevFilters) => {
        const newFilters = [...prevFilters];
        newFilters.push(
          {
            filters: [
              getEmptyFilterData(props.columnDtype)
            ],
            operator: "And"
          }
        );
        return newFilters;
      });
    };
    const addFilterToGroup = (groupIndex) => {
      props.setFilters((prevFilters) => {
        const newFilters = [...prevFilters];
        const filterGroup = newFilters[groupIndex];
        if (isFilterGroup(filterGroup)) {
          filterGroup.filters.push(
            getEmptyFilterData(props.columnDtype)
          );
          return newFilters;
        } else {
          return prevFilters;
        }
      });
    };
    const deleteFilter = (filterIndex) => {
      props.setFilters((prevFilters) => {
        const newFilters = [...prevFilters];
        newFilters.splice(filterIndex, 1);
        return newFilters;
      });
    };
    const deleteFilterFromGroup = (groupIndex, filterIndex) => {
      props.setFilters((prevFilters) => {
        const newFilters = [...prevFilters];
        const filterGroup = newFilters[groupIndex];
        if (isFilterGroup(filterGroup)) {
          filterGroup.filters.splice(filterIndex, 1);
          if (filterGroup.filters.length === 0) {
            newFilters.splice(groupIndex, 1);
          }
          return newFilters;
        } else {
          return prevFilters;
        }
      });
    };
    const setFilter = (filterIndex, filter) => {
      props.setFilters((prevFilters) => {
        const newFilters = [...prevFilters];
        newFilters[filterIndex] = filter;
        return newFilters;
      });
    };
    const setFilterInGroup = (groupIndex, filterIndex, filter) => {
      props.setFilters((prevFilters) => {
        const newFilters = [...prevFilters];
        const filterGroup = newFilters[groupIndex];
        if (isFilterGroup(filterGroup)) {
          filterGroup.filters[filterIndex] = filter;
          return newFilters;
        } else {
          return prevFilters;
        }
      });
    };
    const setOperatorInGroup = (groupIndex, operator) => {
      props.setFilters((prevFilters) => {
        const newFilters = [...prevFilters];
        const filterGroup = newFilters[groupIndex];
        if (isFilterGroup(filterGroup)) {
          filterGroup.operator = operator;
          return newFilters;
        } else {
          return prevFilters;
        }
      });
    };
    return /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement("div", { className: "text-header-3 mt-15px" }, /* @__PURE__ */ react_default.createElement("p", null, " Filter ")), props.filters.map((filterOrGroup, index) => {
      if (isFilterGroup(filterOrGroup)) {
        return /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "top" }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 4 }, index === 0 && /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1" }, "Where"), index !== 0 && /* @__PURE__ */ react_default.createElement(
          Select_default,
          {
            value: props.operator,
            onChange: (newOperator) => props.setOperator(newOperator),
            dropdownWidth: "small"
          },
          /* @__PURE__ */ react_default.createElement(
            DropdownItem_default,
            {
              title: "And"
            }
          ),
          /* @__PURE__ */ react_default.createElement(
            DropdownItem_default,
            {
              title: "Or"
            }
          )
        )), /* @__PURE__ */ react_default.createElement(Col_default, { span: 19 }, /* @__PURE__ */ react_default.createElement(
          FilterGroup,
          {
            key: index,
            mainOperator: props.operator,
            filters: filterOrGroup.filters,
            groupOperator: filterOrGroup.operator,
            setFilter: (filterIndex, newFilter) => {
              setFilterInGroup(index, filterIndex, newFilter);
            },
            setOperator: (newOperator) => {
              setOperatorInGroup(index, newOperator);
            },
            deleteFilter: (filterIndex) => {
              deleteFilterFromGroup(index, filterIndex);
            },
            addFilter: () => addFilterToGroup(index),
            columnDtype: props.columnDtype
          }
        )));
      } else {
        return /* @__PURE__ */ react_default.createElement(
          Filter,
          {
            key: index,
            filter: filterOrGroup,
            operator: props.operator,
            displayOperator: true,
            setFilter: (newFilter) => {
              setFilter(index, newFilter);
            },
            setOperator: index === 0 ? void 0 : props.setOperator,
            deleteFilter: () => {
              deleteFilter(index);
            },
            columnDtype: props.columnDtype,
            nameLength: "short_name"
          }
        );
      }
    }), /* @__PURE__ */ react_default.createElement(
      DropdownButton_default,
      {
        text: ADD_FILTER_SELECT_TITLE,
        width: "medium",
        dropdownWidth: "medium"
      },
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "Add a Filter",
          onClick: addFilter
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "Add a Group of Filters",
          onClick: addFilterGroup
        }
      )
    ), props.editedFilter && /* @__PURE__ */ react_default.createElement(Row_default, { className: "text-subtext-1" }, props.rowDifference >= 0 ? `Removed an additional ${Math.abs(props.rowDifference)} rows` : `Added back ${Math.abs(props.rowDifference)} rows`));
  }
  var FilterCard_default = FilterCard;

  // src/mito/components/taskpanes/ControlPanel/SummaryStatsTab/ColumnSummaryGraph.tsx
  init_react();
  function ColumnSummaryGraph(props) {
    const [graphObj, setGraphObj] = useState(void 0);
    function loadBase64PNGImage() {
      return __async(this, null, function* () {
        const response = yield props.mitoAPI.getColumnSummaryGraph(
          props.selectedSheetIndex,
          props.columnID,
          "350px",
          "100%"
        );
        const _graphHTMLAndScript = "error" in response ? void 0 : response.result;
        setGraphObj(_graphHTMLAndScript);
      });
    }
    useEffect(() => {
      void loadBase64PNGImage();
    }, []);
    useEffect(() => {
      if (graphObj === void 0) {
        return;
      }
      try {
        const executeScript = new Function(graphObj.script);
        executeScript();
      } catch (e) {
        console.error("Failed to execute graph function", e);
      }
    }, [graphObj]);
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, graphObj !== void 0 && /* @__PURE__ */ react_default.createElement("div", { dangerouslySetInnerHTML: { __html: graphObj.html } }), graphObj === void 0 && /* @__PURE__ */ react_default.createElement("div", null, "Loading the summary graph..."));
  }
  var ColumnSummaryGraph_default = ColumnSummaryGraph;

  // src/mito/components/taskpanes/ControlPanel/SummaryStatsTab/ColumnSummaryStatistics.tsx
  init_react();

  // src/mito/hooks/useStateFromAPIAsync.tsx
  init_react();
  function useStateFromAPIAsync(defaultValue, apiCall, onLoad, params) {
    const [loading, setLoading] = useState(true);
    const [state, setState] = useState(defaultValue);
    useEffect(() => {
      const loadData = () => __async(this, null, function* () {
        setLoading(true);
        const loadedData = yield apiCall(...params);
        if (loadedData !== void 0) {
          setState(loadedData);
          if (onLoad !== void 0) {
            const loadedDataCopy = window.structuredClone(loadedData);
            onLoad(loadedDataCopy);
          }
        }
        setLoading(false);
      });
      void loadData();
    }, params);
    return [state, loading];
  }

  // src/mito/components/taskpanes/FillNa/OpenFillNaN.tsx
  init_react();
  var OpenFillNaN = (props) => {
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, "\xA0", /* @__PURE__ */ react_default.createElement(
      "span",
      {
        className: "text-color-medium-important text-underline-on-hover",
        onClick: () => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "fill_na" /* FILL_NA */, startingColumnIDs: [props.columnID] }
            });
          });
        }
      },
      "(or Fill NaN Values)"
    ));
  };
  var OpenFillNaN_default = OpenFillNaN;

  // src/mito/components/taskpanes/ControlPanel/SummaryStatsTab/ColumnSummaryStatistics.tsx
  var KEY_TO_FORMAT_WITH_COLUMN_FORMAT = [
    "mean",
    "std",
    "min",
    "25%",
    "50%",
    "75%",
    "max",
    "median",
    "sum"
  ];
  function ColumnSummaryStatistics(props) {
    const [describe, loading] = useStateFromAPIAsync(
      {},
      () => __async(this, null, function* () {
        const response = yield props.mitoAPI.getColumnDescribe(
          props.selectedSheetIndex,
          props.columnID
        );
        return "error" in response ? void 0 : response.result;
      }),
      void 0,
      []
    );
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("div", { className: "text-header-3" }, /* @__PURE__ */ react_default.createElement("p", null, " Column Summary Statistics ")), /* @__PURE__ */ react_default.createElement("div", { key: loading.toString() }, !loading && /* @__PURE__ */ react_default.createElement("table", { className: "column-describe-table-container" }, Object.keys(describe).map((key2) => {
      const value = describe[key2];
      let valueToDisplay = value;
      if (KEY_TO_FORMAT_WITH_COLUMN_FORMAT.includes(key2)) {
        valueToDisplay = formatCellData(value, props.columnDtype, props.columnFormat);
      }
      valueToDisplay = valueToDisplay.substring(0, 15) + (valueToDisplay.length > 15 ? "..." : "");
      return /* @__PURE__ */ react_default.createElement("tr", { className: "column-describe-table-row", key: key2 }, /* @__PURE__ */ react_default.createElement("th", null, key2, key2 === "count: NaN" && valueToDisplay !== "0" && /* @__PURE__ */ react_default.createElement(
        OpenFillNaN_default,
        {
          setUIState: props.setUIState,
          columnID: props.columnID
        }
      )), /* @__PURE__ */ react_default.createElement("th", { title: value }, valueToDisplay));
    })), loading && /* @__PURE__ */ react_default.createElement("p", null, "Column Summary statistics are loading...")));
  }
  var ColumnSummaryStatistics_default = ColumnSummaryStatistics;

  // src/mito/components/taskpanes/ControlPanel/ValuesTab/ValuesTab.tsx
  init_react();

  // src/mito/components/elements/MultiToggleBox.tsx
  init_react();
  var MAX_DISPLAYED = 1e4;
  var MultiToggleBoxMessage = (props) => {
    const _emptyMessage = props.emptyMessage !== void 0 ? props.emptyMessage : "No items to display.";
    if (props.loading) {
      return /* @__PURE__ */ react_default.createElement(Row_default, { justify: "center" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1 text-align-center-important" }, "Loading items", /* @__PURE__ */ react_default.createElement(LoadingDots_default, null)));
    } else if (props.maxDisplayed || props.isSubset) {
      return /* @__PURE__ */ react_default.createElement(Row_default, { justify: "center" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1 text-align-center-important" }, "There are too many items to display. Search to filter down to the items you care about."));
    } else if (props.numDisplayed === 0) {
      return /* @__PURE__ */ react_default.createElement(Row_default, { justify: "center" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1 text-align-center-important" }, _emptyMessage));
    } else if (props.message !== void 0) {
      return /* @__PURE__ */ react_default.createElement(Row_default, { justify: "center" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1 text-align-center-important" }, props.message));
    }
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
  };
  var MultiToggleSelectedMessage = (props) => {
    let text = `${props.numToggled} selected`;
    if (props.numToggled > 0 && props.numToggled === props.numToggledButNotDisplayed) {
      text = `${props.numToggled} selected and not displayed`;
    } else if (props.numToggledButNotDisplayed > 0) {
      text = `${props.numToggled} selected, of which ${props.numToggledButNotDisplayed} not displayed`;
    }
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, "Toggle ", props.searchString !== "" ? "Displayed" : "All", /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, "\xA0(", text, ")"));
  };
  var MultiToggleBox = (props) => {
    const [_searchString, _setSearchString] = useState("");
    const searchString = props.searchState !== void 0 ? props.searchState.searchString : _searchString;
    const setSearchString = props.searchState !== void 0 ? props.searchState.setSearchString : _setSearchString;
    const setRef = useCallback((unsavedDropdownAnchor) => {
      if (unsavedDropdownAnchor !== null) {
        const firstSelectedChild = unsavedDropdownAnchor.querySelector(".multi-toggle-box-row-selected");
        if (firstSelectedChild !== null) {
          ensureInView(unsavedDropdownAnchor, firstSelectedChild, 0);
        }
      }
    }, []);
    const height = props.height || "block";
    const width = props.width || "block";
    const heightClass = `element-height-${height}`;
    const widthClass = `element-width-${width}`;
    let isAllDisplayedNonDisabledAreToggled = true;
    const nonDisabledDisplayedIndexes = [];
    let numToggled = 0;
    let numToggledButNotDisplayed = 0;
    let numDisplayed = 0;
    let maxDisplayed = false;
    const childrenToDisplay = react_default.Children.map(props.children, (child) => {
      const title = child.props.title;
      const rightText = child.props.rightText;
      const toggled = child.props.toggled;
      if (toggled) {
        numToggled++;
      }
      const noTitleMatch = title === null || title === void 0 || fuzzyMatch(title + "", searchString) < 0.8;
      const noRightTextMatch = title === null || title === void 0 || fuzzyMatch(rightText + "", searchString) < 0.8;
      if (noTitleMatch && noRightTextMatch) {
        if (toggled) {
          numToggledButNotDisplayed++;
        }
        return null;
      }
      if (numDisplayed > MAX_DISPLAYED) {
        maxDisplayed = true;
        return null;
      }
      numDisplayed++;
      const itemDisabled = child.props.disabled || props.disabled;
      if (!itemDisabled) {
        nonDisabledDisplayedIndexes.push(child.props.index);
        isAllDisplayedNonDisabledAreToggled = isAllDisplayedNonDisabledAreToggled && child.props.toggled;
      }
      const copiedChild = react_default.cloneElement(child, {
        disabled: itemDisabled
      });
      return copiedChild;
    });
    const { onToggleAll: toggleAllIndexes } = props;
    return /* @__PURE__ */ react_default.createElement("div", { className: classNames("multi-toggle-box-container", heightClass, widthClass, props.className) }, props.searchable && /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        value: searchString,
        onChange: (e) => {
          setSearchString(e.target.value);
        },
        placeholder: "Search",
        width: "block",
        className: "mb-2px"
      }
    ), /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: classNames("multi-toggle-box"),
        style: { height: props.searchable ? "calc(100% - 30px)" : "100%" },
        ref: setRef
      },
      /* @__PURE__ */ react_default.createElement(
        MultiToggleBoxMessage,
        {
          loading: props.loading,
          isSubset: props.isSubset,
          message: props.message,
          emptyMessage: props.emptyMessage,
          maxDisplayed,
          numDisplayed
        }
      ),
      toggleAllIndexes !== void 0 && numDisplayed > 0 && /* @__PURE__ */ react_default.createElement(
        "div",
        {
          key: "Toggle All",
          className: classNames("multi-toggle-box-row", { "multi-toggle-box-row-selected": isAllDisplayedNonDisabledAreToggled }),
          onClick: () => {
            if (props.disabled) {
              return;
            }
            if (!isAllDisplayedNonDisabledAreToggled) {
              toggleAllIndexes(nonDisabledDisplayedIndexes);
            } else {
              toggleAllIndexes([]);
            }
          }
        },
        /* @__PURE__ */ react_default.createElement(
          "input",
          {
            key: "Toggle All",
            type: "checkbox",
            name: "Toggle All",
            checked: isAllDisplayedNonDisabledAreToggled
          }
        ),
        /* @__PURE__ */ react_default.createElement(
          MultiToggleSelectedMessage,
          {
            searchString,
            numToggled,
            numToggledButNotDisplayed
          }
        )
      ),
      childrenToDisplay
    ));
  };
  var MultiToggleBox_default = MultiToggleBox;

  // src/mito/components/elements/MultiToggleItem.tsx
  init_react();
  var MultiToggleItem = (props) => {
    var _a;
    const rightTextSpan = props.rightTextSpan || 4;
    return /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: classNames(
          "multi-toggle-box-row",
          "text-overflow-hide",
          {
            "multi-toggle-box-row-selected": props.toggled,
            "multi-toggle-box-row-disabled": props.disabled
          }
        ),
        onClick: () => {
          if (props.disabled) {
            return;
          }
          props.onToggle();
        }
      },
      /* @__PURE__ */ react_default.createElement(
        Row_default,
        {
          justify: "space-between",
          align: "center",
          suppressTopBottomMargin: true
        },
        /* @__PURE__ */ react_default.createElement(Col_default, { span: props.rightText ? 24 - rightTextSpan : 24 }, /* @__PURE__ */ react_default.createElement(Row_default, { align: "center", justify: "start", suppressTopBottomMargin: true }, /* @__PURE__ */ react_default.createElement(Col_default, { offset: 1 }, /* @__PURE__ */ react_default.createElement(
          "input",
          {
            name: "input",
            type: "checkbox",
            checked: props.toggled
          }
        )), /* @__PURE__ */ react_default.createElement(Col_default, { span: 14 }, /* @__PURE__ */ react_default.createElement("span", { title: (_a = props.title) == null ? void 0 : _a.toString() }, props.title)))),
        props.rightText && /* @__PURE__ */ react_default.createElement(Col_default, { span: rightTextSpan, offset: 1 }, props.rightText)
      )
    );
  };
  var MultiToggleItem_default = MultiToggleItem;

  // src/mito/components/taskpanes/ControlPanel/ValuesTab/ValuesTab.tsx
  var UniqueValueSortType = /* @__PURE__ */ ((UniqueValueSortType2) => {
    UniqueValueSortType2["ASCENDING_ALPHABETICAL"] = "Ascending Value";
    UniqueValueSortType2["DESCENDING_ALPHABETICAL"] = "Descending Value";
    UniqueValueSortType2["ASCENDING_PERCENT_OCCURENCE"] = "Ascending Occurence";
    UniqueValueSortType2["DESCENDING_PERCENT_OCCURENCE"] = "Descending Occurence";
    return UniqueValueSortType2;
  })(UniqueValueSortType || {});
  var sortUniqueValueCounts = (uniqueValueCounts, uniqueValueSortType) => {
    if (uniqueValueSortType === "Ascending Value" /* ASCENDING_ALPHABETICAL */) {
      return uniqueValueCounts.sort(function(a, b) {
        if (a.value < b.value) {
          return -1;
        }
        if (a.value > b.value) {
          return 1;
        }
        return 0;
      });
    } else if (uniqueValueSortType === "Descending Value" /* DESCENDING_ALPHABETICAL */) {
      return uniqueValueCounts.sort(function(a, b) {
        if (a.value > b.value) {
          return -1;
        }
        if (a.value < b.value) {
          return 1;
        }
        return 0;
      });
    } else if (uniqueValueSortType === "Ascending Occurence" /* ASCENDING_PERCENT_OCCURENCE */) {
      return uniqueValueCounts.sort(function(a, b) {
        return a.percentOccurence - b.percentOccurence;
      });
    } else {
      return uniqueValueCounts.sort(function(a, b) {
        return b.percentOccurence - a.percentOccurence;
      });
    }
  };
  function ValuesTab(props) {
    const [loading, setLoading] = useState(true);
    const [isAllData, setIsAllData] = useState(false);
    const [uniqueValueCounts, setUniqueValueCounts] = useState([]);
    const [searchString, setSearchString] = useState("");
    const [sort, setSort] = useState("Ascending Value" /* ASCENDING_ALPHABETICAL */);
    const lastSearchTerm = useRef("so it rerenders the first time");
    const lastSort = useRef(sort);
    useDebouncedEffect(() => {
      if (!isAllData || isAllData && (!searchString.startsWith(lastSearchTerm.current) || searchString.length < lastSearchTerm.current.length)) {
        void loadUniqueValueCounts();
      }
      lastSearchTerm.current = searchString;
      lastSort.current = sort;
    }, [searchString, sort], 500);
    function loadUniqueValueCounts() {
      return __async(this, null, function* () {
        setLoading(true);
        const response = yield props.mitoAPI.getUniqueValueCounts(
          props.selectedSheetIndex,
          props.columnID,
          searchString,
          sort
        );
        const uniqueValueCountsObj = "error" in response ? void 0 : response.result;
        if (uniqueValueCountsObj === void 0) {
          setUniqueValueCounts([]);
          setLoading(false);
          return void 0;
        }
        const uniqueValueCounts2 = [];
        for (let i = 0; i < uniqueValueCountsObj.uniqueValueRowDataArray.length; i++) {
          uniqueValueCounts2.push({
            value: uniqueValueCountsObj.uniqueValueRowDataArray[i][0],
            percentOccurence: uniqueValueCountsObj.uniqueValueRowDataArray[i][1] * 100,
            countOccurence: uniqueValueCountsObj.uniqueValueRowDataArray[i][2],
            isNotFiltered: true
          });
        }
        const allDoesNotContainsFilters = getAllDoesNotContainsFilterValues(props.filters, props.columnDtype);
        allDoesNotContainsFilters.forEach((key2) => {
          uniqueValueCounts2.push({
            value: key2,
            percentOccurence: 0,
            countOccurence: 0,
            isNotFiltered: false
          });
        });
        setUniqueValueCounts(uniqueValueCounts2);
        setIsAllData(uniqueValueCountsObj.isAllData);
        setLoading(false);
      });
    }
    const getUniqueValueCountIndexFromSortedIndex = (index) => {
      const value = sortedUniqueValueCounts[index].value;
      return uniqueValueCounts.findIndex((uniqueValueCount) => {
        return uniqueValueCount.value === value;
      });
    };
    const toggleExclusiveFilters = (values) => {
      props.setFilters((prevFilters) => {
        let newFilters = [...prevFilters];
        values.forEach((value) => {
          const exclusiveFilter = getExclusiveFilterData(props.columnDtype, value);
          const originalFilterLength = newFilters.length;
          newFilters = newFilters.filter((filter) => {
            return isFilterGroup(filter) || !areFiltersEqual(filter, exclusiveFilter);
          });
          if (newFilters.length === originalFilterLength) {
            newFilters.push(exclusiveFilter);
          }
        });
        return newFilters;
      });
    };
    const sortedUniqueValueCounts = sortUniqueValueCounts(uniqueValueCounts, sort);
    const disabledMessage = getFilterDisabledMessage(props.columnDtype);
    return /* @__PURE__ */ react_default.createElement(Fragment, null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ react_default.createElement(Col_default, { flex: "1", offsetRight: 1 }, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-2" }, "Values")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        value: sort,
        onChange: (newSortType) => {
          setSort(newSortType);
        },
        width: "medium",
        dropdownWidth: "medium"
      },
      Object.values(UniqueValueSortType).map((sortType) => {
        return /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: sortType,
            title: sortType
          }
        );
      })
    ))), /* @__PURE__ */ react_default.createElement("div", { style: { height: "calc(100% - 40px)" } }, /* @__PURE__ */ react_default.createElement(
      MultiToggleBox_default,
      {
        loading,
        searchable: true,
        searchState: {
          searchString,
          setSearchString
        },
        isSubset: !isAllData,
        message: disabledMessage,
        disabled: disabledMessage !== void 0
      },
      sortedUniqueValueCounts.map((uniqueValueCount, index) => {
        const valueToDisplay = formatCellData(uniqueValueCount.value, props.columnDtype, props.columnFormat);
        if (valueToDisplay === "NaN") {
          return /* @__PURE__ */ react_default.createElement(
            MultiToggleItem_default,
            {
              key: index,
              title: /* @__PURE__ */ react_default.createElement("span", null, valueToDisplay, " ", /* @__PURE__ */ react_default.createElement(OpenFillNaN_default, { setUIState: props.setUIState, columnID: props.columnID })),
              rightText: uniqueValueCount.countOccurence + " (" + uniqueValueCount.percentOccurence.toFixed(2).toString() + "%)",
              rightTextSpan: 7,
              toggled: uniqueValueCount.isNotFiltered,
              index,
              onToggle: () => {
                const uniqueValueCountIndex = getUniqueValueCountIndexFromSortedIndex(index);
                setUniqueValueCounts((oldUniqueValueCounts) => {
                  const newUniqueValueCounts = oldUniqueValueCounts.slice();
                  newUniqueValueCounts[uniqueValueCountIndex].isNotFiltered = !uniqueValueCounts[uniqueValueCountIndex].isNotFiltered;
                  return newUniqueValueCounts;
                });
                toggleExclusiveFilters([uniqueValueCount.value]);
              }
            }
          );
        }
        return /* @__PURE__ */ react_default.createElement(
          MultiToggleItem_default,
          {
            key: index,
            title: valueToDisplay,
            rightText: uniqueValueCount.countOccurence + " (" + uniqueValueCount.percentOccurence.toFixed(2).toString() + "%)",
            rightTextSpan: 7,
            toggled: uniqueValueCount.isNotFiltered,
            index,
            onToggle: () => {
              const uniqueValueCountIndex = getUniqueValueCountIndexFromSortedIndex(index);
              setUniqueValueCounts((oldUniqueValueCounts) => {
                const newUniqueValueCounts = oldUniqueValueCounts.slice();
                newUniqueValueCounts[uniqueValueCountIndex].isNotFiltered = !uniqueValueCounts[uniqueValueCountIndex].isNotFiltered;
                return newUniqueValueCounts;
              });
              toggleExclusiveFilters([uniqueValueCount.value]);
            }
          }
        );
      })
    )));
  }

  // src/mito/components/taskpanes/ControlPanel/ControlPanelTaskpane.tsx
  var FILTER_MESSAGE_DELAY = 500;
  var ControlPanelTaskpane = (props) => {
    var _a, _b;
    const { columnHeader, columnID, columnFilters, columnDtype, columnFormat } = getCellDataFromCellIndexes(props.sheetData, props.selection.startingRowIndex, props.selection.startingColumnIndex);
    const [filters, _setFilters] = useState(columnFilters !== void 0 ? columnFilters.filters : []);
    const [operator, _setOperator] = useState(columnFilters !== void 0 ? columnFilters.operator : "And");
    const [updateNumber, setUpdateNumber] = useState(0);
    const [stepID] = useState(() => getRandomId());
    const setFilters = useCallback(
      (args) => {
        _setFilters(args);
        setUpdateNumber((old) => old + 1);
      },
      []
    );
    const setOperator = useCallback(
      (args) => {
        _setOperator(args);
        setUpdateNumber((old) => old + 1);
      },
      []
    );
    const [originalNumRows] = useState(((_a = props.sheetData) == null ? void 0 : _a.numRows) || 0);
    const [editedFilter, setEditedFilter] = useState(false);
    useDebouncedEffect(() => {
      if (updateNumber != 0) {
        void _sendFilterUpdateMessage();
      }
    }, [updateNumber], FILTER_MESSAGE_DELAY);
    useEffectOnUpdateEvent(() => {
      _setFilters((prevFilters) => {
        return (columnFilters == null ? void 0 : columnFilters.filters) || prevFilters;
      });
    }, props.analysisData);
    if (columnHeader === void 0 || columnID === void 0 || columnDtype == void 0) {
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenTaskpane: { type: "none" /* NONE */ }
        });
      });
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
    }
    const _sendFilterUpdateMessage = () => __async(void 0, null, function* () {
      const filtersToApply = getFiltersToApply(filters, columnDtype);
      if (filtersToApply.length === 0 && (columnFilters !== void 0 && columnFilters.filters.length === 0)) {
        return;
      }
      yield props.mitoAPI.editFilter(
        props.selectedSheetIndex,
        columnID,
        filtersToApply,
        operator,
        props.tab,
        stepID
      );
      setEditedFilter(true);
    });
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: getDisplayColumnHeader(columnHeader),
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, props.tab === "filter_sort" /* FilterSort */ && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
      DtypeCard_default,
      {
        selectedSheetIndex: props.selectedSheetIndex,
        columnID,
        columnDtype,
        mitoAPI: props.mitoAPI,
        lastStepIndex: props.lastStepIndex,
        lastStepType: props.lastStepType
      }
    ), /* @__PURE__ */ react_default.createElement(
      FormatCard_default,
      {
        columnID,
        mitoAPI: props.mitoAPI,
        gridState: props.gridState,
        columnDtype,
        sheetData: props.sheetData,
        closeOpenEditingPopups: props.closeOpenEditingPopups
      }
    ), /* @__PURE__ */ react_default.createElement(
      SortCard_default,
      {
        selectedSheetIndex: props.selectedSheetIndex,
        columnID,
        mitoAPI: props.mitoAPI,
        analysisData: props.analysisData
      }
    ), /* @__PURE__ */ react_default.createElement(
      FilterCard_default,
      {
        selectedSheetIndex: props.selectedSheetIndex,
        columnID,
        filters,
        setFilters,
        setOperator,
        columnDtype,
        operator,
        mitoAPI: props.mitoAPI,
        rowDifference: originalNumRows - (((_b = props.sheetData) == null ? void 0 : _b.numRows) || 0),
        editedFilter
      }
    )), props.tab === "unique_values" /* UniqueValues */ && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
      ValuesTab,
      {
        selectedSheetIndex: props.selectedSheetIndex,
        columnID,
        filters,
        setFilters,
        mitoAPI: props.mitoAPI,
        columnDtype,
        columnFormat,
        setUIState: props.setUIState
      }
    )), props.tab === "summary_stats" /* SummaryStats */ && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
      ColumnSummaryGraph_default,
      {
        selectedSheetIndex: props.selectedSheetIndex,
        columnID,
        mitoAPI: props.mitoAPI
      }
    ), /* @__PURE__ */ react_default.createElement(
      ColumnSummaryStatistics_default,
      {
        selectedSheetIndex: props.selectedSheetIndex,
        columnID,
        mitoAPI: props.mitoAPI,
        columnDtype,
        columnFormat,
        setUIState: props.setUIState
      }
    ))), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneFooter_default, { ignoreTaskpanePadding: true }, /* @__PURE__ */ react_default.createElement(
      ControlPanelTaskpaneTabs_default,
      {
        selectedTab: props.tab,
        setUIState: props.setUIState,
        mitoAPI: props.mitoAPI
      }
    ))));
  };
  var ControlPanelTaskpane_default = ControlPanelTaskpane;

  // src/mito/components/endo/ColumnHeaderContextMenu.tsx
  init_react();

  // src/mito/components/icons/SortAscendingIcon.tsx
  init_react();
  var SortAscendingIcon = (props) => {
    const aColor = props.aColor === "black" ? "var(--mito-text)" : "var(--mito-highlight)";
    return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 17 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M5.90234 0.942871L3.31348 8.07031H2.25537L5.23633 0.25H5.91846L5.90234 0.942871ZM8.07227 8.07031L5.47803 0.942871L5.46191 0.25H6.14404L9.13574 8.07031H8.07227ZM7.93799 5.17529V6.02393H3.54443V5.17529H7.93799Z", fill: aColor }), /* @__PURE__ */ react_default.createElement("path", { d: "M8.54492 17.2271V18.0703H3.24902V17.2271H8.54492ZM8.37305 11.002L3.49609 18.0703H2.85693V17.2969L7.72852 10.25H8.37305V11.002ZM7.93262 10.25V11.0986H2.92676V10.25H7.93262Z", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M12.6464 18.4239C12.8417 18.6191 13.1583 18.6191 13.3536 18.4239L16.5355 15.2419C16.7308 15.0466 16.7308 14.73 16.5355 14.5348C16.3403 14.3395 16.0237 14.3395 15.8284 14.5348L13 17.3632L10.1716 14.5348C9.97631 14.3395 9.65973 14.3395 9.46447 14.5348C9.2692 14.73 9.2692 15.0466 9.46447 15.2419L12.6464 18.4239ZM12.5 0.0703125V18.0703H13.5V0.0703125L12.5 0.0703125Z", fill: "var(--mito-text)" }));
  };
  var SortAscendingIcon_default = SortAscendingIcon;

  // src/mito/components/icons/SortDescendingIcon.tsx
  init_react();
  var SortDescendingIcon = (props) => {
    const aColor = props.aColor === "black" ? "var(--mito-text)" : "var(--mito-highlight)";
    return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 17 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M13.3536 18.4239C13.1583 18.6191 12.8417 18.6191 12.6464 18.4239L9.46447 15.2419C9.2692 15.0466 9.2692 14.73 9.46447 14.5348C9.65973 14.3395 9.97631 14.3395 10.1716 14.5348L13 17.3632L15.8284 14.5348C16.0237 14.3395 16.3403 14.3395 16.5355 14.5348C16.7308 14.73 16.7308 15.0466 16.5355 15.2419L13.3536 18.4239ZM13.5 0.0703125V18.0703H12.5V0.0703125L13.5 0.0703125Z", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M8.54492 7.22705V8.07031H3.24902V7.22705H8.54492ZM8.37305 1.00195L3.49609 8.07031H2.85693V7.29688L7.72852 0.25H8.37305V1.00195ZM7.93262 0.25V1.09863H2.92676V0.25H7.93262Z", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5.90234 10.9429L3.31348 18.0703H2.25537L5.23633 10.25H5.91846L5.90234 10.9429ZM8.07227 18.0703L5.47803 10.9429L5.46191 10.25H6.14404L9.13574 18.0703H8.07227ZM7.93799 15.1753V16.0239H3.54443V15.1753H7.93799Z", fill: aColor }));
  };
  var SortDescendingIcon_default = SortDescendingIcon;

  // src/mito/components/endo/ColumnHeaderContextMenu.tsx
  function ColumnHeaderContextMenu(props) {
    const display = isCurrOpenDropdownForCell(props.uiState, -1, props.column);
    return /* @__PURE__ */ react_default.createElement(
      Dropdown_default,
      {
        display,
        closeDropdown: () => {
          props.setUIState((prevUIState) => {
            const display2 = isCurrOpenDropdownForCell(prevUIState, -1, props.column);
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: display2 ? void 0 : prevUIState.currOpenDropdown
            });
          });
        },
        width: "medium-large"
      },
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, __spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["copy" /* Copy */], props.closeOpenEditingPopups))),
      /* @__PURE__ */ react_default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, __spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["add column to the left" /* Add_Column_Left */], props.closeOpenEditingPopups))),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, __spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["add column to the right" /* Add_Column_Right */], props.closeOpenEditingPopups))),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, __spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["delete" /* Delete */], props.closeOpenEditingPopups))),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, __spreadProps(__spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["rename column" /* Rename_Column */], props.closeOpenEditingPopups)), { supressFocusSettingOnClose: true })),
      /* @__PURE__ */ react_default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, __spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["filter" /* Filter */], props.closeOpenEditingPopups))),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        __spreadProps(__spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["sort ascending" /* SortAscending */], props.closeOpenEditingPopups)), {
          icon: /* @__PURE__ */ react_default.createElement(SortAscendingIcon_default, { aColor: "black" })
        })
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        __spreadProps(__spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["sort descending" /* SortDescending */], props.closeOpenEditingPopups)), {
          icon: /* @__PURE__ */ react_default.createElement(SortDescendingIcon_default, { aColor: "black" })
        })
      ),
      /* @__PURE__ */ react_default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        __spreadProps(__spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["format number columns" /* Format_Number_Columns */], props.closeOpenEditingPopups)), {
          supressFocusSettingOnClose: true
        })
      ),
      /* @__PURE__ */ react_default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, __spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["column summary" /* Column_Summary */], props.closeOpenEditingPopups))),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, __spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["unique values" /* Unique_Values */], props.closeOpenEditingPopups)))
    );
  }

  // src/mito/components/endo/ColumnHeader.tsx
  var HEADER_TEXT_COLOR_DEFAULT = "var(--mito-text)";
  var HEADER_BACKGROUND_COLOR_DEFAULT = "var(--mito-background-highlight)";
  var CREATED_RECON_COLOR = "#E4EFDC";
  var MODIFIED_RECON_COLOR = "#FDF3D0";
  var ColumnHeader = (props) => {
    var _a;
    const selected = getIsCellSelected(props.gridState.selections, -1, props.columnIndex);
    const width = props.gridState.widthDataArray[props.gridState.sheetIndex].widthArray[props.columnIndex];
    const { columnID, columnFilters, columnHeader, columnDtype, headerBackgroundColor, headerTextColor } = getCellDataFromCellIndexes(props.sheetData, -1, props.columnIndex);
    if (columnID === void 0 || columnFilters === void 0 || columnDtype == void 0 || columnHeader === void 0) {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
    }
    const hasFilters = columnFilters.filters.length > 0;
    const editingColumnHeader = props.editorState !== void 0 && props.editorState.editorLocation === "cell" && props.editorState.rowIndex <= -1 && props.editorState.columnIndex === props.columnIndex;
    const editingFinalColumnHeader = props.editorState !== void 0 && props.editorState.editorLocation === "cell" && props.editorState.rowIndex === -1 && props.editorState.columnIndex === props.columnIndex;
    const { lowerLevelColumnHeaders, finalColumnHeader } = getColumnHeaderParts(columnHeader);
    const matchesSearch = props.uiState.currOpenSearch.matches.find((value) => {
      return value.rowIndex === -1 && value.colIndex === props.columnIndex;
    }) !== void 0;
    const borderStyle = getBorderStyle(props.gridState.selections, props.gridState.copiedSelections, -1, props.columnIndex, props.sheetData.numRows, matchesSearch, props.uiState.highlightedColumnIndex);
    const openColumnHeaderEditor = () => {
      props.setEditorState({
        rowIndex: -1,
        columnIndex: props.columnIndex,
        formula: getDisplayColumnHeader(finalColumnHeader),
        editorLocation: "cell",
        editingMode: "specific_index_labels",
        sheetIndex: props.gridState.sheetIndex
      });
    };
    const closeColumnHeaderEditor = () => {
      props.setEditorState(void 0);
      setTimeout(() => focusGrid(props.containerRef.current), 100);
    };
    const ColumnHeaderResizer = /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: "endo-column-header-resizer",
        onDragStart: (e) => {
          e.stopPropagation();
          e.dataTransfer.setData("operation", "resize");
          e.dataTransfer.setData("mito-col-index", props.columnIndex + "");
          props.setColumnHeaderOperation("resize");
        },
        onDragEnd: () => {
          props.setColumnHeaderOperation(void 0);
        },
        onMouseDown: (e) => {
          e.stopPropagation();
        },
        onMouseUp: (e) => {
          e.stopPropagation();
        },
        onClick: (e) => {
          e.stopPropagation();
        },
        draggable: "true",
        onDoubleClick: () => {
          const selectionsCopy = [...props.gridState.selections];
          const isColumnSelected = getIsCellSelected(selectionsCopy, -1, props.columnIndex);
          if (!isColumnSelected) {
            selectionsCopy.push({
              startingRowIndex: -1,
              endingRowIndex: -1,
              startingColumnIndex: props.columnIndex,
              endingColumnIndex: props.columnIndex,
              sheetIndex: props.gridState.sheetIndex
            });
          }
          const columnIndexes = getColumnIndexesInSelections(selectionsCopy);
          const widthData = getWidthArrayAtFullWidthForColumnIndexes(columnIndexes, props.gridState, props.sheetData);
          props.setGridState((prevGridState) => {
            return __spreadProps(__spreadValues({}, prevGridState), {
              selections: selectionsCopy,
              widthDataArray: widthData
            });
          });
        }
      }
    );
    const isColumnCreated = reconIsColumnCreated(columnHeader, props.uiState.dataRecon, props.sheetData);
    const isColumnRenamed = reconIsColumnRenamed(columnHeader, props.uiState.dataRecon, props.sheetData);
    const backgroundColor = isColumnCreated ? CREATED_RECON_COLOR : isColumnRenamed ? MODIFIED_RECON_COLOR : headerBackgroundColor || HEADER_BACKGROUND_COLOR_DEFAULT;
    const textColor = isColumnCreated || isColumnRenamed ? "var(--mito-recon-text-color)" : headerTextColor || HEADER_TEXT_COLOR_DEFAULT;
    return /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: classNames(
          "endo-column-header-container",
          "endo-column-header-text",
          {
            "endo-column-header-container-selected": selected,
            "recon": isColumnCreated || isColumnRenamed
          }
        ),
        style: { color: textColor, backgroundColor },
        key: props.columnIndex,
        "mito-col-index": props.columnIndex + "",
        onDragStart: (e) => {
          e.dataTransfer.setData("operation", "reorder");
          e.dataTransfer.setData("mito-col-index", props.columnIndex + "");
          props.setColumnHeaderOperation("reorder");
        },
        onDragEnd: () => {
          props.setColumnHeaderOperation(void 0);
          props.setUIState(__spreadProps(__spreadValues({}, props.uiState), { highlightedColumnIndex: void 0 }));
        },
        title: getDisplayColumnHeader(columnHeader),
        draggable: !editingColumnHeader ? "true" : "false",
        onContextMenu: (e) => {
          if (e.shiftKey) {
            return;
          }
          e.preventDefault();
          props.setUIState((prevUiState) => {
            return __spreadProps(__spreadValues({}, prevUiState), {
              currOpenDropdown: {
                type: "context-menu",
                rowIndex: -1,
                columnIndex: props.columnIndex
              }
            });
          });
        }
      },
      lowerLevelColumnHeaders.map((lowerLevelColumnHeader, levelIndex) => {
        var _a2;
        const rowIndex = -1 - (lowerLevelColumnHeaders.length - levelIndex);
        const editingLowerLevelColumnHeader = props.editorState !== void 0 && props.editorState.rowIndex === rowIndex && props.editorState.columnIndex === props.columnIndex;
        return /* @__PURE__ */ react_default.createElement(
          "div",
          {
            className: "endo-column-header-lower-level-container",
            key: levelIndex,
            "mito-row-index": rowIndex + "",
            "mito-col-index": props.columnIndex,
            style: {
              minHeight: DEFAULT_HEIGHT,
              borderLeft: borderStyle.borderLeft,
              borderRight: borderStyle.borderRight,
              borderTop: levelIndex === 0 ? borderStyle.borderTop : void 0,
              borderBottom: levelIndex < lowerLevelColumnHeaders.length - 1 ? DEFAULT_BORDER_STYLE : void 0
            }
          },
          !editingLowerLevelColumnHeader && /* @__PURE__ */ react_default.createElement(
            "p",
            {
              className: "endo-column-header-lower-level-text text-overflow-hide",
              style: {
                maxWidth: `${width - 25}px`
              },
              onDoubleClick: (e) => {
                e.stopPropagation();
                props.setEditorState({
                  rowIndex,
                  columnIndex: props.columnIndex,
                  formula: getDisplayColumnHeader(lowerLevelColumnHeader),
                  editorLocation: "cell",
                  editingMode: "specific_index_labels",
                  sheetIndex: props.gridState.sheetIndex
                });
              }
            },
            getDisplayColumnHeader(lowerLevelColumnHeader)
          ),
          editingLowerLevelColumnHeader && /* @__PURE__ */ react_default.createElement(
            "form",
            {
              style: {
                width: `${width - 25}px`
              },
              onSubmit: (e) => __async(void 0, null, function* () {
                var _a3;
                e.preventDefault();
                const newColumnHeader = ((_a3 = props.editorState) == null ? void 0 : _a3.formula) || getDisplayColumnHeader(finalColumnHeader);
                const oldColumnHeader = getDisplayColumnHeader(lowerLevelColumnHeader);
                if (newColumnHeader !== oldColumnHeader) {
                  void props.mitoAPI.editRenameColumn(
                    props.gridState.sheetIndex,
                    columnID,
                    newColumnHeader,
                    levelIndex
                  );
                  props.setUIState((prevUIState) => {
                    if (prevUIState.currOpenTaskpane.type !== "control_panel" /* CONTROL_PANEL */) {
                      return __spreadProps(__spreadValues({}, prevUIState), {
                        currOpenTaskpane: { type: "none" /* NONE */ }
                      });
                    }
                    return prevUIState;
                  });
                }
                closeColumnHeaderEditor();
              })
            },
            /* @__PURE__ */ react_default.createElement(
              Input_default,
              {
                value: ((_a2 = props.editorState) == null ? void 0 : _a2.formula) || "",
                onChange: (e) => {
                  const newHeader = e.target.value;
                  props.setEditorState((prevEditorState) => {
                    if (prevEditorState === void 0)
                      return void 0;
                    return __spreadProps(__spreadValues({}, prevEditorState), {
                      formula: newHeader
                    });
                  });
                },
                onKeyDown: (e) => {
                  if (e.key === "Escape") {
                    closeColumnHeaderEditor();
                  }
                },
                autoFocus: true,
                width: "block"
              }
            )
          ),
          ColumnHeaderResizer
        );
      }),
      /* @__PURE__ */ react_default.createElement(
        "div",
        {
          className: classNames("endo-column-header-final-container", {
            "endo-grabbable": props.columnHeaderOperation === "reorder"
          }),
          "mito-row-index": "-1",
          "mito-col-index": props.columnIndex,
          onClick: () => {
            if (editingFinalColumnHeader) {
              return;
            }
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                selectedColumnControlPanelTab: "filter_sort" /* FilterSort */,
                currOpenTaskpane: { type: "control_panel" /* CONTROL_PANEL */ }
              });
            });
          },
          style: {
            height: "100%",
            minHeight: "45px",
            width: `${width}px`,
            borderTop: lowerLevelColumnHeaders.length > 0 ? DEFAULT_BORDER_STYLE : borderStyle.borderTop,
            borderBottom: borderStyle.borderBottom,
            borderLeft: borderStyle.borderLeft,
            borderRight: borderStyle.borderRight
          }
        },
        !editingFinalColumnHeader && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
          "div",
          {
            className: "endo-column-header-final-text",
            onClick: (e) => {
              e.stopPropagation();
            },
            onDoubleClick: (e) => {
              e.stopPropagation();
              props.setEditorState({
                rowIndex: -1,
                columnIndex: props.columnIndex,
                formula: getDisplayColumnHeader(finalColumnHeader),
                editorLocation: "cell",
                editingMode: "specific_index_labels",
                sheetIndex: props.gridState.sheetIndex
              });
            },
            key: props.columnIndex,
            tabIndex: -1
          },
          finalColumnHeader + ""
        ), /* @__PURE__ */ react_default.createElement("div", { className: "endo-column-header-final-right-side" }, /* @__PURE__ */ react_default.createElement("div", { className: "endo-column-header-final-icons", title: "Open the column control panel" }, /* @__PURE__ */ react_default.createElement("span", { title: "Edit filters" }, !hasFilters && /* @__PURE__ */ react_default.createElement(FilterIcon, null), hasFilters && /* @__PURE__ */ react_default.createElement(FilterIcon, { nonEmpty: true })), /* @__PURE__ */ react_default.createElement("div", { className: "text-body-2 text-color-highlight-important-on-hover", style: { color: textColor } }, getTypeIdentifier(columnDtype))), ColumnHeaderResizer)),
        editingFinalColumnHeader && /* @__PURE__ */ react_default.createElement(
          "form",
          {
            className: "element-width-block",
            onSubmit: () => {
              submitRenameColumnHeader(columnHeader, finalColumnHeader, columnID, props.gridState.sheetIndex, props.editorState, props.setUIState, props.mitoAPI);
              closeColumnHeaderEditor();
            }
          },
          /* @__PURE__ */ react_default.createElement(
            Input_default,
            {
              value: ((_a = props.editorState) == null ? void 0 : _a.formula) || "",
              onChange: (e) => {
                const newHeader = e.target.value;
                props.setEditorState((prevEditorState) => {
                  if (prevEditorState === void 0)
                    return void 0;
                  return __spreadProps(__spreadValues({}, prevEditorState), {
                    formula: newHeader
                  });
                });
              },
              onKeyDown: (e) => {
                if (e.key === "Escape") {
                  closeColumnHeaderEditor();
                }
              },
              onBlur: () => {
                void submitRenameColumnHeader(columnHeader, finalColumnHeader, columnID, props.gridState.sheetIndex, props.editorState, props.setUIState, props.mitoAPI);
                closeColumnHeaderEditor();
              },
              autoFocus: true,
              width: "block"
            }
          )
        )
      ),
      /* @__PURE__ */ react_default.createElement(
        ColumnHeaderContextMenu,
        {
          mitoAPI: props.mitoAPI,
          column: props.columnIndex,
          uiState: props.uiState,
          setUIState: props.setUIState,
          openColumnHeaderEditor,
          sheetIndex: props.gridState.sheetIndex,
          columnID,
          columnDtype,
          closeOpenEditingPopups: props.closeOpenEditingPopups,
          setEditorState: props.setEditorState,
          sheetData: props.sheetData,
          gridState: props.gridState,
          actions: props.actions
        }
      )
    );
  };
  var ColumnHeader_default = react_default.memo(ColumnHeader);

  // src/mito/components/endo/ColumnHeaders.tsx
  var ColumnHeaders = (props) => {
    const columnHeadersContainerRef = useRef(null);
    const [columnHeaderOperation, setColumnHeaderOperation] = useState(void 0);
    const [scrollAmount, setScrollAmount] = useState(void 0);
    useEffect(() => {
      if (scrollAmount !== void 0) {
        const interval = setInterval(() => {
          var _a;
          (_a = props.scrollAndRenderedContainerRef.current) == null ? void 0 : _a.scrollBy(
            {
              left: scrollAmount
            }
          );
        }, 10);
        return () => {
          clearInterval(interval);
        };
      }
    }, [props.scrollAndRenderedContainerRef, scrollAmount]);
    const currentSheetView = calculateCurrentSheetView(props.gridState);
    const translate = calculateTranslate(props.gridState);
    const columnHeaderStyle = { transform: `translateX(${-translate.x}px)` };
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, props.sheetData.numColumns > 0 && /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: classNames("endo-column-headers-container", {
          "endo-column-headers-no-operation": columnHeaderOperation === void 0,
          "endo-column-headers-resizing": columnHeaderOperation === "resize"
        }),
        ref: columnHeadersContainerRef,
        onDragOver: (e) => {
          var _a, _b, _c;
          e.preventDefault();
          e.persist();
          const { columnIndex } = getIndexesFromXAndY(e.clientX, e.clientY);
          if (columnHeaderOperation === "reorder" && columnIndex !== props.uiState.highlightedColumnIndex) {
            props.setUIState(__spreadProps(__spreadValues({}, props.uiState), { highlightedColumnIndex: columnIndex }));
          }
          const leftInHeader = e.clientX - (((_a = columnHeadersContainerRef.current) == null ? void 0 : _a.getBoundingClientRect().left) || 0);
          if (leftInHeader < 100) {
            const offsetScale = 1 - leftInHeader / 100;
            setScrollAmount(-25 * offsetScale);
          } else if (leftInHeader > (((_b = columnHeadersContainerRef.current) == null ? void 0 : _b.getBoundingClientRect().width) || 0) - 100) {
            const offsetScale = 1 - ((((_c = columnHeadersContainerRef.current) == null ? void 0 : _c.getBoundingClientRect().width) || 0) - leftInHeader) / 100;
            setScrollAmount(25 * offsetScale);
          } else {
            setScrollAmount(void 0);
          }
        },
        onDrop: (e) => {
          e.preventDefault();
          setScrollAmount(void 0);
          const clientX = e.clientX;
          const clientY = e.clientY;
          const operation = e.dataTransfer.getData("operation");
          const columnIndexString = e.dataTransfer.getData("mito-col-index");
          if (operation === "" || columnIndexString === "") {
            return;
          }
          const dragColumnIndex = parseInt(columnIndexString);
          if (operation === "resize") {
            const columnHeaderDivs = getChildrenWithQuery(props.containerRef.current, `.endo-column-header-container[mito-col-index="${dragColumnIndex}"]`);
            if (columnHeaderDivs.length === 0) {
              return;
            }
            const columnHeaderDiv = columnHeaderDivs[0];
            const newWidth = Math.max(e.clientX - columnHeaderDiv.getBoundingClientRect().left, MIN_WIDTH);
            props.setGridState((gridState) => {
              return __spreadProps(__spreadValues({}, gridState), {
                widthDataArray: changeColumnWidthDataArray(props.sheetIndex, props.gridState.widthDataArray, dragColumnIndex, newWidth)
              });
            });
          } else if (operation === "reorder") {
            const startingColumnIndex = dragColumnIndex;
            const { columnIndex } = getIndexesFromXAndY(clientX, clientY);
            const columnIDToReorder = props.sheetData.data[startingColumnIndex].columnID;
            if (dragColumnIndex === columnIndex) {
              return;
            }
            if (columnIndex === void 0 || columnIDToReorder === void 0) {
              return;
            }
            void props.mitoAPI.editReorderColumn(props.sheetIndex, columnIDToReorder, columnIndex);
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                highlightedColumnIndex: void 0,
                currOpenTaskpane: { type: "none" /* NONE */ }
              });
            });
            props.setGridState((gridState) => {
              return __spreadProps(__spreadValues({}, gridState), {
                selection: __spreadProps(__spreadValues({}, gridState.selections), {
                  startingColumnIndex: columnIndex,
                  endingColumnIndex: columnIndex
                })
              });
            });
          }
        },
        onMouseLeave: () => {
          setScrollAmount(void 0);
        },
        onMouseUp: () => {
          setScrollAmount(void 0);
        }
      },
      /* @__PURE__ */ react_default.createElement("div", { style: columnHeaderStyle }, Array(currentSheetView.numColumnsRendered).fill(0).map((_, _colIndex) => {
        const columnIndex = currentSheetView.startingColumnIndex + _colIndex;
        return /* @__PURE__ */ react_default.createElement(
          ColumnHeader_default,
          {
            key: columnIndex,
            columnIndex,
            sheetData: props.sheetData,
            gridState: props.gridState,
            setGridState: props.setGridState,
            editorState: props.editorState,
            setEditorState: props.setEditorState,
            containerRef: props.containerRef,
            columnHeaderOperation,
            setColumnHeaderOperation,
            uiState: props.uiState,
            setUIState: props.setUIState,
            mitoAPI: props.mitoAPI,
            closeOpenEditingPopups: props.closeOpenEditingPopups,
            actions: props.actions
          }
        );
      }))
    ));
  };
  var ColumnHeaders_default = react_default.memo(ColumnHeaders);

  // src/mito/components/endo/EmptyGridMessages.tsx
  init_react();
  var GridDataEmptyContainer = (props) => {
    return /* @__PURE__ */ react_default.createElement("div", { className: "endo-grid-empty-container" }, /* @__PURE__ */ react_default.createElement("div", { className: "endo-grid-empty-text-container" }, props.children));
  };
  var EmptyGridMessages = (props) => {
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, props.sheetData === void 0 && /* @__PURE__ */ react_default.createElement(GridDataEmptyContainer, null, /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "medium",
        onClick: () => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "import files" /* IMPORT_FILES */ }
            });
          });
          void props.mitoAPI.log("clicked_empty_grid_import_button");
        },
        disabled: props.uiState.currOpenTaskpane.type === "import files" /* IMPORT_FILES */ || props.uiState.currOpenTaskpane.type === "Excel Range Import" /* EXCEL_RANGE_IMPORT */ || props.uiState.currOpenTaskpane.type === "UpdateImports" /* UPDATEIMPORTS */ && props.uiState.currOpenTaskpane.failedReplayData !== void 0 || props.sendFunctionStatus !== "finished"
      },
      "Import Files"
    )), !isInDashboard() && /* @__PURE__ */ react_default.createElement("p", { className: "mt-5px text-body-1", style: { textAlign: "center" } }, "Or import dfs using the syntax ", /* @__PURE__ */ react_default.createElement("code", null, "mitosheet.sheet(df1, df2)"), " in the code above.")), props.sheetData !== void 0 && props.sheetData.numRows === 0 && props.sheetData.numColumns === 0 && /* @__PURE__ */ react_default.createElement(GridDataEmptyContainer, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1", style: { textAlign: "center" } }, "No data in dataframe.")), props.sheetData !== void 0 && props.sheetData.numRows > 0 && props.sheetData.numColumns === 0 && /* @__PURE__ */ react_default.createElement(GridDataEmptyContainer, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1", style: { textAlign: "center" } }, "No columns in dataframe.")), props.sheetData !== void 0 && props.sheetData.numRows === 0 && props.sheetData.numColumns > 0 && /* @__PURE__ */ react_default.createElement(GridDataEmptyContainer, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1", style: { textAlign: "center" } }, "No rows in dataframe.")));
  };
  var EmptyGridMessages_default = EmptyGridMessages;

  // src/mito/components/endo/IndexHeaders.tsx
  init_react();

  // src/mito/components/endo/IndexHeaderContextMenu.tsx
  init_react();
  function IndexHeaderContextMenu(props) {
    return /* @__PURE__ */ react_default.createElement(
      Dropdown_default,
      {
        display: props.display,
        closeDropdown: () => props.setUIState((prevUIState) => {
          const isCurrOpenDropdown = isCurrOpenDropdownForCell(prevUIState, props.rowIndex, -1);
          return __spreadProps(__spreadValues({}, prevUIState), {
            currOpenDropdown: isCurrOpenDropdown ? void 0 : prevUIState.currOpenDropdown
          });
        }),
        width: "medium-large"
      },
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        __spreadProps(__spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["copy" /* Copy */], props.closeOpenEditingPopups)), {
          title: "Copy Row"
        })
      ),
      /* @__PURE__ */ react_default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        __spreadProps(__spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["delete" /* Delete */], props.closeOpenEditingPopups)), {
          title: "Delete Row"
        })
      ),
      /* @__PURE__ */ react_default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, __spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["promote row to header" /* Promote_Row_To_Header */], props.closeOpenEditingPopups))),
      /* @__PURE__ */ react_default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, __spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["reset and drop index" /* RESET_AND_DROP_INDEX */], props.closeOpenEditingPopups))),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, __spreadValues({}, getPropsForContextMenuDropdownItem(props.actions.buildTimeActions["reset and keep index" /* RESET_AND_KEEP_INDEX */], props.closeOpenEditingPopups)))
    );
  }

  // src/mito/components/endo/IndexHeaders.tsx
  var IndexHeaders = (props) => {
    const currentSheetView = calculateCurrentSheetView(props.gridState);
    const translate = calculateTranslate(props.gridState);
    const indexHeadersStyle = {
      transform: `translateY(${-translate.y}px)`
    };
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("div", { className: "endo-index-headers-container" }, props.sheetData.numRows > 0 && /* @__PURE__ */ react_default.createElement("div", { style: indexHeadersStyle }, Array(currentSheetView.numRowsRendered).fill(0).map((_, _rowIndex) => {
      const rowIndex = currentSheetView.startingRowIndex + _rowIndex;
      if (rowIndex >= props.sheetData.numRows) {
        return null;
      }
      const selected = getIsCellSelected(
        props.gridState.selections,
        rowIndex,
        -1
      );
      const className = classNames("index-header-container", "text-overflow-hide", "text-unselectable", { "index-header-selected": selected });
      const indexHeader = rowIndex >= props.sheetData.numRows ? "" : props.sheetData.index[rowIndex];
      return /* @__PURE__ */ react_default.createElement(
        "div",
        {
          className,
          key: rowIndex,
          title: indexHeader + "",
          tabIndex: -1,
          "mito-row-index": rowIndex,
          "mito-col-index": -1,
          style: __spreadValues({}, getBorderStyle(props.gridState.selections, props.gridState.copiedSelections, rowIndex, -1, props.sheetData.numRows, false)),
          onContextMenu: (e) => {
            if (e.shiftKey) {
              return;
            }
            e.preventDefault();
            e.stopPropagation();
            props.setUIState((prevUiState) => {
              return __spreadProps(__spreadValues({}, prevUiState), {
                currOpenDropdown: {
                  type: "context-menu",
                  rowIndex,
                  columnIndex: -1
                }
              });
            });
          }
        },
        indexHeader,
        /* @__PURE__ */ react_default.createElement(
          IndexHeaderContextMenu,
          {
            rowIndex,
            display: isCurrOpenDropdownForCell(props.uiState, rowIndex, -1),
            setUIState: props.setUIState,
            actions: props.actions,
            closeOpenEditingPopups: props.closeOpenEditingPopups
          }
        )
      );
    }))));
  };
  var IndexHeaders_default = react_default.memo(IndexHeaders);

  // src/mito/components/endo/celleditor/FloatingCellEditor.tsx
  init_react();
  var FloatingCellEditor = (props) => {
    const [editorStyle, setEditorStyle] = useState({
      top: 0,
      left: 0,
      display: "none"
    });
    const sheetData = props.sheetDataArray[props.editorState.sheetIndex];
    const currentSheetView = calculateCurrentSheetView(props.gridState);
    const { columnID, columnHeader } = getCellDataFromCellIndexes(sheetData, props.editorState.rowIndex, props.editorState.columnIndex);
    const fullFormula = getFullFormula(props.editorState, props.sheetDataArray, props.sheetIndex);
    const cellEditorWidth = props.editorState.editorLocation === "cell" ? getInputWidth(fullFormula, CELL_EDITOR_DEFAULT_WIDTH) : CELL_EDITOR_DEFAULT_WIDTH;
    useEffect(() => {
      const updateCellEditorPosition = () => {
        var _a;
        const scrollAndRenderedContainerRect = (_a = props.scrollAndRenderedContainerRef.current) == null ? void 0 : _a.getBoundingClientRect();
        if (scrollAndRenderedContainerRect === void 0) {
          return;
        }
        const cellInRow = getCellInRow(props.scrollAndRenderedContainerRef.current, props.editorState.rowIndex);
        const cellInRowRect = cellInRow == null ? void 0 : cellInRow.getBoundingClientRect();
        const cellInColumn = getCellInColumn(props.scrollAndRenderedContainerRef.current, props.editorState.columnIndex);
        const cellInColumnRect = cellInColumn == null ? void 0 : cellInColumn.getBoundingClientRect();
        let top = void 0;
        let left = void 0;
        let bottom = void 0;
        let right = void 0;
        const columnHeadersHeight = columnHeader === void 0 || isPrimitiveColumnHeader(columnHeader) ? 45 : 45 + (columnHeader.length - 1) * 25;
        const defaultTop = cellInRowRect ? cellInRowRect.y : props.editorState.rowIndex < currentSheetView.startingRowIndex ? 0 : scrollAndRenderedContainerRect.y * 100;
        top = Math.min(Math.max(0, defaultTop - scrollAndRenderedContainerRect.y + 4) + columnHeadersHeight, scrollAndRenderedContainerRect.height);
        if (top >= scrollAndRenderedContainerRect.height - 50) {
          top = void 0;
          bottom = 0;
        }
        const defaultLeft = cellInColumnRect ? cellInColumnRect.x : props.editorState.columnIndex < currentSheetView.startingColumnIndex ? 0 : scrollAndRenderedContainerRect.x * 100;
        left = Math.min(Math.max(0, defaultLeft - scrollAndRenderedContainerRect.x) + 80, scrollAndRenderedContainerRect.width);
        if (left + cellEditorWidth >= scrollAndRenderedContainerRect.width) {
          left = void 0;
          right = 0;
        }
        if (top === editorStyle.top && left === editorStyle.left && bottom === editorStyle.bottom && right === editorStyle.right) {
          return;
        }
        setEditorStyle({
          top,
          left,
          bottom,
          right,
          display: void 0
        });
      };
      setTimeout(updateCellEditorPosition);
      fscreen_esm_default.addEventListener("fullscreenchange", updateCellEditorPosition);
      return () => fscreen_esm_default.removeEventListener("fullscreenchange", updateCellEditorPosition);
    }, [cellEditorWidth]);
    if (columnID === void 0 || columnHeader === void 0) {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
    }
    return /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: "floating-cell-editor",
        style: __spreadProps(__spreadValues({}, editorStyle), {
          width: `${cellEditorWidth}px`
        })
      },
      /* @__PURE__ */ react_default.createElement(
        CellEditor_default,
        {
          sheetDataArray: props.sheetDataArray,
          sheetIndex: props.sheetIndex,
          gridState: props.gridState,
          editorState: props.editorState,
          setEditorState: props.setEditorState,
          setGridState: props.setGridState,
          setUIState: props.setUIState,
          scrollAndRenderedContainerRef: props.scrollAndRenderedContainerRef,
          containerRef: props.containerRef,
          mitoAPI: props.mitoAPI,
          currentSheetView,
          closeOpenEditingPopups: props.closeOpenEditingPopups,
          analysisData: props.analysisData,
          mitoContainerRef: props.mitoContainerRef
        }
      )
    );
  };
  var FloatingCellEditor_default = FloatingCellEditor;

  // src/mito/components/SearchBar.tsx
  init_react();

  // src/mito/components/icons/SearchNavigateIcon.tsx
  init_react();
  var SearchNavigateIcon = (props) => {
    var _a, _b, _c;
    const stroke = (_a = props.strokeColor) != null ? _a : props.disabled ? "#C3C0CA" : "#767180";
    if (props.direction === "up") {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "18", viewBox: "0 0 15 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M7.5 1.50009L0.5 8M7.5 1.50009L14.5 8M7.5 1.50009L7.5 17.5", stroke, strokeWidth: (_b = props.strokeWidth) != null ? _b : "2" }));
    } else {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "16", height: "17", viewBox: "0 0 16 17", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M8 15.9999L15 9.5M8 15.9999L1 9.5M8 15.9999L8 0", stroke, strokeWidth: (_c = props.strokeWidth) != null ? _c : "2" }));
    }
  };
  var SearchNavigateIcon_default = SearchNavigateIcon;

  // src/mito/components/icons/CautionIcon.tsx
  init_react();
  var CautionIcon = (props) => {
    var _a, _b, _c, _d;
    return /* @__PURE__ */ react_default.createElement("svg", { width: (_a = props.width) != null ? _a : "15", height: (_b = props.height) != null ? _b : "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M7.5 10.2059V5.79412M1 14.25L7.5 1.75L14 14.25H1Z", stroke: (_c = props.color) != null ? _c : "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M8.22228 12.0439C8.22228 12.45 7.89893 12.7792 7.50005 12.7792C7.10118 12.7792 6.77783 12.45 6.77783 12.0439C6.77783 11.6378 7.10118 11.3086 7.50005 11.3086C7.89893 11.3086 8.22228 11.6378 8.22228 12.0439Z", fill: (_d = props.color) != null ? _d : "var(--mito-text)" }));
  };
  var CautionIcon_default = CautionIcon;

  // src/mito/components/icons/ExpandCollapseIcon.tsx
  init_react();
  var ExpandCollapseIcon = (props) => {
    var _a, _b, _c;
    const stroke = (_a = props.strokeColor) != null ? _a : props.disabled ? "#C3C0CA" : "#767180";
    if (props.action === "expand") {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "9", height: "15", viewBox: "0 0 11 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1 1L10 7.75862L1 14", stroke, strokeWidth: (_b = props.strokeWidth) != null ? _b : "2", strokeLinejoin: "round" }));
    } else {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "12", viewBox: "0 0 18 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M17.5588 1L9.11256 10.8736L1.00003 1.27663", stroke, strokeWidth: (_c = props.strokeWidth) != null ? _c : "2", strokeLinejoin: "round" }));
    }
  };
  var ExpandCollapseIcon_default = ExpandCollapseIcon;

  // src/mito/components/SearchBar.tsx
  var SearchBar = (props) => {
    var _a;
    const {
      setUIState,
      uiState,
      mitoAPI,
      containerDiv,
      scrollAndRenderedContainerDiv,
      sheetView,
      gridState,
      setGridState,
      sheetData
    } = props;
    const { searchValue, currentMatchIndex, matches } = uiState.currOpenSearch;
    const [totalMatches, setTotalMatches] = react_default.useState(void 0);
    const [showCautionMessage, setShowCautionMessage] = react_default.useState(false);
    const [replaceValue, setReplaceValue] = react_default.useState("");
    const scrollMatchIntoViewAndUpdateSelection = (match) => {
      if ((match == null ? void 0 : match.rowIndex) === -1) {
        scrollColumnIntoView(
          containerDiv,
          scrollAndRenderedContainerDiv,
          sheetView,
          gridState,
          match == null ? void 0 : match.colIndex
        );
      } else if (match !== void 0) {
        ensureCellVisible(
          containerDiv,
          scrollAndRenderedContainerDiv,
          sheetView,
          gridState,
          match.rowIndex,
          match.colIndex
        );
      }
      if (match !== void 0) {
        setGridState((prevGridState) => {
          return __spreadProps(__spreadValues({}, prevGridState), {
            selections: [{
              startingColumnIndex: match.colIndex,
              endingColumnIndex: match.colIndex,
              startingRowIndex: match.rowIndex,
              endingRowIndex: match.rowIndex,
              sheetIndex: uiState.selectedSheetIndex
            }]
          });
        });
      }
    };
    const getMatches = () => {
      if (searchValue === void 0 || searchValue === "") {
        setTotalMatches(0);
        return;
      }
      void mitoAPI.getSearchMatches(uiState.selectedSheetIndex, searchValue != null ? searchValue : "").then((response) => {
        if ("error" in response) {
          return;
        }
        const new_total_number_matches = response.result.total_number_matches;
        const new_matches = response.result.matches;
        setTotalMatches(new_total_number_matches != null ? new_total_number_matches : 0);
        setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            currOpenSearch: __spreadProps(__spreadValues({}, prevUIState.currOpenSearch), {
              matches: new_matches != null ? new_matches : []
            })
          });
        });
      });
    };
    useDebouncedEffect(getMatches, [searchValue, uiState.selectedSheetIndex], 500);
    const totalMatchesDisplayed = (_a = matches == null ? void 0 : matches.length) != null ? _a : 0;
    const matchesInfo = /* @__PURE__ */ react_default.createElement("span", null, " ", (totalMatches != null ? totalMatches : 0) > 0 ? Math.max(currentMatchIndex + 1, 0) : 0, " of ", totalMatches != null ? totalMatches : /* @__PURE__ */ react_default.createElement(LoadingDots_default, null), " ");
    const finalMatchInfo = totalMatches === 0 ? /* @__PURE__ */ react_default.createElement("span", null, "No results.") : matchesInfo;
    const handleCurrentMatchChange = (direction) => {
      setUIState((prevUIState) => {
        let currentMatch = currentMatchIndex;
        const someMatchesNotDisplayed = (totalMatches != null ? totalMatches : totalMatchesDisplayed) > totalMatchesDisplayed;
        if (direction === "prev") {
          const isFirstMatch = currentMatch === 0;
          setShowCautionMessage(isFirstMatch && someMatchesNotDisplayed);
          currentMatch = isFirstMatch ? totalMatchesDisplayed - 1 : currentMatch - 1;
        } else {
          const isLastMatch = currentMatch >= totalMatchesDisplayed - 1;
          setShowCautionMessage(isLastMatch && someMatchesNotDisplayed);
          currentMatch = isLastMatch ? 0 : currentMatch + 1;
        }
        const newMatch = matches == null ? void 0 : matches[currentMatch];
        scrollMatchIntoViewAndUpdateSelection(newMatch);
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenSearch: __spreadProps(__spreadValues({}, prevUIState.currOpenSearch), {
            currentMatchIndex: currentMatch
          })
        });
      });
    };
    const handleChange = (e) => {
      setUIState(__spreadProps(__spreadValues({}, uiState), {
        currOpenSearch: __spreadProps(__spreadValues({}, uiState.currOpenSearch), {
          searchValue: e.target.value,
          currentMatchIndex: -1,
          matches: e.target.value === "" ? [] : uiState.currOpenSearch.matches
        })
      }));
      setShowCautionMessage(false);
      setTotalMatches(e.target.value === "" ? 0 : void 0);
    };
    const handleReplace = (onlySelectedColumns) => {
      void mitoAPI.editReplace(
        uiState.selectedSheetIndex,
        searchValue != null ? searchValue : "",
        replaceValue != null ? replaceValue : "",
        onlySelectedColumns ? getSelectedColumnIDsWithEntireSelectedColumn(gridState.selections, sheetData) : []
      ).then(() => {
        getMatches();
      });
    };
    return /* @__PURE__ */ react_default.createElement("div", { className: "mito-search-bar", style: { top: uiState.currentToolbarTab !== void 0 ? "117px" : "57px" } }, /* @__PURE__ */ react_default.createElement(
      "button",
      {
        onClick: () => {
          setUIState((prevUiState) => {
            return __spreadProps(__spreadValues({}, prevUiState), {
              currOpenSearch: __spreadProps(__spreadValues({}, prevUiState.currOpenSearch), {
                isExpanded: !uiState.currOpenSearch.isExpanded
              })
            });
          });
        },
        className: "mito-search-button"
      },
      /* @__PURE__ */ react_default.createElement(ExpandCollapseIcon_default, { action: uiState.currOpenSearch.isExpanded ? "collapse" : "expand", strokeColor: "var(--mito-text)", strokeWidth: 1 })
    ), /* @__PURE__ */ react_default.createElement("div", { className: "mito-search-bar-content" }, /* @__PURE__ */ react_default.createElement("div", { className: "mito-search-bar-search" }, /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        id: "mito-search-bar-input",
        value: searchValue != null ? searchValue : "",
        onChange: handleChange,
        onKeyDown: (e) => {
          if (e.key === "Enter" && !e.shiftKey) {
            handleCurrentMatchChange("next");
          }
        },
        onKeyUp: (e) => {
          if (e.key === "Enter" && e.shiftKey) {
            handleCurrentMatchChange("prev");
          }
        },
        className: classNames("mito-input"),
        placeholder: "Find...",
        autoFocus: true
      }
    ), /* @__PURE__ */ react_default.createElement("span", { style: { whiteSpace: "nowrap" } }, finalMatchInfo), /* @__PURE__ */ react_default.createElement(
      "button",
      {
        className: "mito-search-button",
        onClick: () => {
          handleCurrentMatchChange("prev");
        }
      },
      /* @__PURE__ */ react_default.createElement(SearchNavigateIcon_default, { width: "17", height: "15", direction: "up", strokeColor: "var(--mito-text)", strokeWidth: 1 })
    ), /* @__PURE__ */ react_default.createElement(
      "button",
      {
        className: "mito-search-button",
        onClick: () => {
          handleCurrentMatchChange("next");
        }
      },
      /* @__PURE__ */ react_default.createElement(SearchNavigateIcon_default, { width: "17", height: "15", direction: "down", strokeColor: "var(--mito-text)", strokeWidth: 1 })
    ), /* @__PURE__ */ react_default.createElement(
      "button",
      {
        className: "mito-search-button",
        onClick: () => {
          setUIState(__spreadProps(__spreadValues({}, uiState), {
            currOpenSearch: { isOpen: false, currentMatchIndex: 0, matches: [] }
          }));
        }
      },
      /* @__PURE__ */ react_default.createElement(XIcon_default, { strokeWidth: "1", width: "15", height: "15" })
    )), uiState.currOpenSearch.isExpanded && /* @__PURE__ */ react_default.createElement("div", { className: "mito-search-bar-replace" }, /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        value: replaceValue,
        onChange: (e) => {
          setReplaceValue(e.target.value);
        },
        onKeyDown: (e) => {
          if (e.key === "Enter") {
            handleReplace();
          }
        },
        className: "mito-input",
        placeholder: "Replace...",
        autoFocus: searchValue !== void 0 && searchValue !== ""
      }
    ), /* @__PURE__ */ react_default.createElement("button", { className: "mito-search-button", onClick: () => {
      handleReplace();
    } }, "Replace All"), /* @__PURE__ */ react_default.createElement("button", { className: "mito-search-button", disabled: getSelectedColumnIDsWithEntireSelectedColumn(gridState.selections, sheetData).length === 0, onClick: () => {
      handleReplace(true);
    } }, "Replace in Selected Columns"))), showCautionMessage && /* @__PURE__ */ react_default.createElement("div", { style: { top: uiState.currOpenSearch.isExpanded ? "71px" : "40px" }, className: "mito-search-caution" }, /* @__PURE__ */ react_default.createElement(CautionIcon_default, null), /* @__PURE__ */ react_default.createElement("span", null, "Only the first 1500 rows are displayed.")));
  };

  // src/mito/components/endo/EndoGrid.tsx
  var DEFAULT_WIDTH = 123;
  var DEFAULT_HEIGHT = 25;
  var MIN_WIDTH = 50;
  var MAX_ROWS = 1500;
  var KEYS_TO_IGNORE_IF_PRESSED_ALONE = [
    "Shift",
    "Meta",
    "Alt",
    "Control",
    "CapsLock",
    "NumLock",
    "PageUp",
    "PageDown",
    "Unidentified"
  ];
  var KEYBOARD_SHORTCUTS_TO_IGNORE_WITH_CONTROL = [
    "c",
    "z",
    "y"
  ];
  function EndoGrid(props) {
    var _a;
    const containerRef = useRef(null);
    const scrollAndRenderedContainerRef = useRef(null);
    const [mouseDown, setMouseDown] = useState(false);
    const [resizeObserver] = useState(() => new ResizeObserver(() => {
      resizeViewport();
    }));
    const {
      sheetDataArray,
      sheetIndex,
      gridState,
      setGridState,
      editorState,
      setEditorState,
      uiState,
      setUIState,
      mitoAPI
    } = props;
    const sheetData = sheetDataArray[sheetIndex];
    const totalSize = {
      width: ((_a = gridState.widthDataArray[gridState.sheetIndex]) == null ? void 0 : _a.totalWidth) || 0,
      height: DEFAULT_HEIGHT * Math.min((sheetData == null ? void 0 : sheetData.numRows) || 0, MAX_ROWS)
    };
    const currentSheetView = useMemo(() => {
      return calculateCurrentSheetView(gridState);
    }, [gridState]);
    const translate = useMemo(() => {
      return calculateTranslate(gridState);
    }, [gridState]);
    useEffect(() => {
      setGridState((gridState2) => {
        return __spreadProps(__spreadValues({}, gridState2), {
          selections: reconciliateSelections(gridState2.sheetIndex, sheetIndex, gridState2.selections, gridState2.columnIDsArray[gridState2.sheetIndex], sheetData),
          widthDataArray: reconciliateWidthDataArray(gridState2.widthDataArray, gridState2.columnIDsArray, sheetDataArray),
          columnIDsArray: getColumnIDsArrayFromSheetDataArray(sheetDataArray),
          sheetIndex,
          copiedSelections: []
        });
      });
    }, [sheetData, setGridState, sheetIndex]);
    const resizeViewport = () => {
      setGridState((gridState2) => {
        const scrollAndRenderedContainerDiv = scrollAndRenderedContainerRef == null ? void 0 : scrollAndRenderedContainerRef.current;
        if (scrollAndRenderedContainerDiv) {
          const newViewport = {
            width: scrollAndRenderedContainerDiv.clientWidth,
            height: scrollAndRenderedContainerDiv.clientHeight
          };
          return __spreadProps(__spreadValues({}, gridState2), {
            viewport: newViewport
          });
        }
        return gridState2;
      });
    };
    const setScrollAndRendererContainerRef = useCallback((unsavedScrollAndRenderedContainerDiv) => {
      if (unsavedScrollAndRenderedContainerDiv !== null) {
        scrollAndRenderedContainerRef.current = unsavedScrollAndRenderedContainerDiv;
        resizeObserver.observe(unsavedScrollAndRenderedContainerDiv);
      }
    }, []);
    useEffect(() => {
      return () => {
        resizeObserver.disconnect();
      };
    }, []);
    const onGridScroll = (e) => {
      const newScrollPosition = calculateNewScrollPosition(
        e,
        totalSize,
        gridState.viewport,
        scrollAndRenderedContainerRef.current
      );
      if (newScrollPosition !== void 0) {
        setGridState((gridState2) => {
          return __spreadProps(__spreadValues({}, gridState2), {
            scrollPosition: newScrollPosition
          });
        });
      }
    };
    const onMouseDown = (e) => {
      var _a2, _b, _c, _d, _e, _f, _g, _h;
      if (editorState !== void 0) {
        const { rowIndex, columnIndex } = getIndexesFromMouseEvent(e);
        if (editorState.rowIndex === -1) {
          return;
        }
        if (columnIndex !== void 0 && (sheetData == null ? void 0 : sheetData.data[columnIndex]) !== void 0) {
          const cellEditorContainer = editorState.editorLocation === "cell" ? containerRef.current : props.mitoContainerRef.current;
          const { selectionStart, selectionEnd } = getCellEditorInputCurrentSelection(cellEditorContainer);
          const newInputSelectionStart = firstNonNullOrUndefined(
            (_a2 = editorState.pendingSelections) == null ? void 0 : _a2.inputSelectionStart,
            selectionStart
          );
          const newInputSelectionEnd = firstNonNullOrUndefined(
            (_b = editorState.pendingSelections) == null ? void 0 : _b.inputSelectionEnd,
            selectionEnd
          );
          let startingColumnIndex = (_e = (_d = (_c = props.editorState) == null ? void 0 : _c.pendingSelections) == null ? void 0 : _d.selections[0].startingColumnIndex) != null ? _e : columnIndex;
          let endingColumnIndex = (_h = (_g = (_f = props.editorState) == null ? void 0 : _f.pendingSelections) == null ? void 0 : _g.selections[0].endingColumnIndex) != null ? _h : columnIndex;
          if (e.shiftKey && startingColumnIndex > columnIndex) {
            startingColumnIndex = columnIndex;
          } else if (e.shiftKey && endingColumnIndex < columnIndex) {
            endingColumnIndex = columnIndex;
          } else if (!e.shiftKey) {
            startingColumnIndex = columnIndex;
            endingColumnIndex = columnIndex;
          }
          const newSelection = [{
            startingRowIndex: rowIndex !== void 0 ? rowIndex : -1,
            endingRowIndex: rowIndex !== void 0 ? rowIndex : -1,
            startingColumnIndex,
            endingColumnIndex,
            sheetIndex
          }];
          setGridState((prevGridState) => {
            return __spreadProps(__spreadValues({}, prevGridState), {
              selections: newSelection
            });
          });
          return setEditorState(__spreadProps(__spreadValues({}, editorState), {
            pendingSelections: {
              selections: newSelection,
              inputSelectionStart: newInputSelectionStart,
              inputSelectionEnd: newInputSelectionEnd
            },
            arrowKeysScrollInFormula: false
          }));
        }
        return;
      } else {
        focusGrid(containerRef.current);
        setMouseDown(true);
        const { rowIndex, columnIndex } = getIndexesFromMouseEvent(e);
        if (rowIndex === void 0 || columnIndex === void 0) {
          return;
        }
        if (e.button === 2 && getIsCellSelected(gridState.selections, rowIndex, columnIndex)) {
          return;
        }
        if (e.metaKey || e.ctrlKey) {
          const operatingSystem = getOperatingSystem();
          if (e.shiftKey) {
            setGridState((gridState2) => {
              const selectionsCopy = [...gridState2.selections];
              selectionsCopy.push({
                startingRowIndex: rowIndex,
                endingRowIndex: rowIndex,
                startingColumnIndex: columnIndex,
                endingColumnIndex: columnIndex,
                sheetIndex
              });
              return __spreadProps(__spreadValues({}, gridState2), {
                selections: selectionsCopy
              });
            });
          } else if (operatingSystem === "mac" && e.metaKey || operatingSystem === "windows" && e.ctrlKey) {
            if (rowIndex === -1) {
              if (getIsCellSelected(gridState.selections, -1, columnIndex)) {
                setGridState((gridState2) => {
                  return __spreadProps(__spreadValues({}, gridState2), {
                    selections: removeColumnFromSelections(gridState2.selections, columnIndex)
                  });
                });
              } else {
                setGridState((gridState2) => {
                  const selectionsCopy = [...gridState2.selections];
                  selectionsCopy.push({
                    startingRowIndex: rowIndex,
                    endingRowIndex: rowIndex,
                    startingColumnIndex: columnIndex,
                    endingColumnIndex: columnIndex,
                    sheetIndex
                  });
                  return __spreadProps(__spreadValues({}, gridState2), {
                    selections: selectionsCopy
                  });
                });
              }
            } else {
              if (!getIsCellSelected(props.gridState.selections, rowIndex, columnIndex)) {
                const selectionsCopy = [...gridState.selections];
                selectionsCopy.push({
                  startingRowIndex: rowIndex,
                  endingRowIndex: rowIndex,
                  startingColumnIndex: columnIndex,
                  endingColumnIndex: columnIndex,
                  sheetIndex
                });
                setGridState((gridState2) => {
                  return __spreadProps(__spreadValues({}, gridState2), {
                    selections: selectionsCopy
                  });
                });
              } else {
                setGridState((gridState2) => {
                  return __spreadProps(__spreadValues({}, gridState2), {
                    selections: [{
                      startingRowIndex: rowIndex,
                      endingRowIndex: rowIndex,
                      startingColumnIndex: columnIndex,
                      endingColumnIndex: columnIndex,
                      sheetIndex
                    }]
                  });
                });
              }
            }
          }
          return;
        } else {
          if (e.shiftKey) {
            const selectionsCopy = [...gridState.selections];
            selectionsCopy[selectionsCopy.length - 1] = getNewSelectionAfterMouseUp(selectionsCopy[selectionsCopy.length - 1], rowIndex, columnIndex);
            setGridState((gridState2) => {
              return __spreadProps(__spreadValues({}, gridState2), {
                selections: selectionsCopy
              });
            });
          } else {
            setGridState((gridState2) => {
              return __spreadProps(__spreadValues({}, gridState2), {
                selections: [{
                  startingRowIndex: rowIndex,
                  endingRowIndex: rowIndex,
                  startingColumnIndex: columnIndex,
                  endingColumnIndex: columnIndex,
                  sheetIndex
                }]
              });
            });
          }
        }
        if (columnIndex === -1) {
          setUIState((prevUIState) => {
            if (prevUIState.currOpenTaskpane.type === "control_panel" /* CONTROL_PANEL */) {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenTaskpane: { type: "none" /* NONE */ }
              });
            }
            return prevUIState;
          });
        }
      }
    };
    const onMouseUp = (e) => {
      if (editorState !== void 0) {
        return;
      }
      focusGrid(containerRef.current);
      setMouseDown(false);
      const { rowIndex, columnIndex } = getIndexesFromMouseEvent(e);
      if (e.shiftKey || e.metaKey) {
        return;
      }
      if (e.button === 2 && rowIndex && columnIndex && getIsCellSelected(gridState.selections, rowIndex, columnIndex)) {
        return;
      }
      const newLastSelection = getNewSelectionAfterMouseUp(gridState.selections[gridState.selections.length - 1], rowIndex, columnIndex);
      const newSelections = [...gridState.selections];
      newSelections[newSelections.length - 1] = newLastSelection;
      if (e.ctrlKey && rowIndex !== void 0 && columnIndex !== void 0) {
        if (getIsCellSelected(gridState.selections, rowIndex, columnIndex)) {
          return;
        }
        setGridState((gridState2) => {
          return __spreadProps(__spreadValues({}, gridState2), {
            selections: [{
              startingColumnIndex: columnIndex,
              endingColumnIndex: columnIndex,
              startingRowIndex: rowIndex,
              endingRowIndex: rowIndex,
              sheetIndex
            }]
          });
        });
        return;
      }
      if (!equalSelections(newLastSelection, gridState.selections[gridState.selections.length - 1])) {
        setGridState((gridState2) => {
          return __spreadProps(__spreadValues({}, gridState2), {
            selections: newSelections
          });
        });
      }
    };
    useEffect(() => {
      if (mouseDown) {
        const updateSelectionOnMouseDrag = (e) => {
          const { rowIndex, columnIndex } = getIndexesFromMouseEvent(e);
          setGridState((gridState2) => {
            const newLastSelection = getNewSelectionAfterMouseUp(gridState2.selections[gridState2.selections.length - 1], rowIndex, columnIndex);
            const newSelections = [...gridState2.selections];
            newSelections[newSelections.length - 1] = newLastSelection;
            return __spreadProps(__spreadValues({}, gridState2), {
              selections: newSelections
            });
          });
        };
        const containerDiv = containerRef.current;
        if (gridState.selections[gridState.selections.length - 1].startingRowIndex === -1) {
          return;
        }
        containerDiv == null ? void 0 : containerDiv.addEventListener("mousemove", updateSelectionOnMouseDrag);
        return () => {
          containerDiv == null ? void 0 : containerDiv.removeEventListener("mousemove", updateSelectionOnMouseDrag);
        };
      }
    }, [mouseDown, gridState, setGridState]);
    const onDoubleClick = (e) => {
      if (editorState !== void 0) {
        return;
      }
      const { rowIndex, columnIndex } = getIndexesFromMouseEvent(e);
      if (rowIndex === void 0 || columnIndex === void 0 || getIsHeader(rowIndex, columnIndex)) {
        return;
      }
      const { startingColumnFormula, arrowKeysScrollInFormula, editingMode } = getStartingFormula(sheetData, props.editorState, rowIndex, columnIndex, props.analysisData.defaultApplyFormulaToColumn);
      setEditorState({
        rowIndex,
        columnIndex,
        formula: startingColumnFormula,
        arrowKeysScrollInFormula,
        editorLocation: "cell",
        editingMode,
        sheetIndex
      });
    };
    useEffect(() => {
      const onKeyDown = (e) => {
        if (editorState !== void 0) {
          return;
        }
        if (KEYS_TO_IGNORE_IF_PRESSED_ALONE.includes(e.key)) {
          return;
        }
        if (KEYBOARD_SHORTCUTS_TO_IGNORE_WITH_CONTROL.includes(e.key) || e.ctrlKey) {
          return;
        }
        if (!isNavigationKeyPressed(e.key)) {
          if (e.metaKey || e.key === "Escape" || e.shiftKey) {
            return;
          }
          if (e.key === "Backspace" || e.key === "Delete") {
            if (isSelectionsOnlyColumnHeaders(gridState.selections)) {
              const columnIndexesSelected = getColumnIndexesInSelections(gridState.selections);
              const columnIDsToDelete = columnIndexesSelected.map((colIdx) => {
                var _a2;
                return (_a2 = sheetData == null ? void 0 : sheetData.data[colIdx]) == null ? void 0 : _a2.columnID;
              });
              if (columnIDsToDelete !== void 0) {
                props.closeOpenEditingPopups();
                void mitoAPI.editDeleteColumn(
                  sheetIndex,
                  columnIDsToDelete
                );
              }
              return;
            } else if (isSelectionsOnlyIndexHeaders(gridState.selections)) {
              void props.mitoAPI.editDeleteRow(props.sheetIndex, getSelectedRowLabelsWithEntireSelectedRow(gridState.selections, sheetData));
              return;
            }
          }
          setGridState((gridState2) => {
            const lastSelection = gridState2.selections[gridState2.selections.length - 1];
            const { startingColumnFormula, arrowKeysScrollInFormula, editingMode } = getStartingFormula(sheetData, void 0, lastSelection.startingRowIndex, lastSelection.startingColumnIndex, props.analysisData.defaultApplyFormulaToColumn, e);
            setEditorState({
              rowIndex: lastSelection.startingRowIndex,
              columnIndex: lastSelection.startingColumnIndex,
              formula: startingColumnFormula,
              arrowKeysScrollInFormula,
              editorLocation: "cell",
              editingMode,
              sheetIndex
            });
            e.preventDefault();
            return __spreadProps(__spreadValues({}, gridState2), {
              selections: [{
                startingRowIndex: lastSelection.startingRowIndex,
                endingRowIndex: lastSelection.startingRowIndex,
                startingColumnIndex: lastSelection.startingColumnIndex,
                endingColumnIndex: lastSelection.startingColumnIndex,
                sheetIndex
              }]
            });
          });
          return;
        } else {
          e.preventDefault();
          setGridState((gridState2) => {
            const newSelection = getNewSelectionAfterKeyPress(gridState2.selections[gridState2.selections.length - 1], e, sheetData);
            ensureCellVisible(
              containerRef.current,
              scrollAndRenderedContainerRef.current,
              currentSheetView,
              gridState2,
              newSelection.endingRowIndex,
              newSelection.endingColumnIndex
            );
            return __spreadProps(__spreadValues({}, gridState2), {
              selections: [newSelection]
            });
          });
        }
      };
      const containerDiv = containerRef.current;
      containerDiv == null ? void 0 : containerDiv.addEventListener("keydown", onKeyDown);
      return () => containerDiv == null ? void 0 : containerDiv.removeEventListener("keydown", onKeyDown);
    }, [editorState, setEditorState, sheetData, currentSheetView, mitoAPI, gridState.selections, sheetIndex, setGridState]);
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
      FormulaBar_default,
      {
        sheetDataArray,
        selection: gridState.selections[gridState.selections.length - 1],
        sheetIndex: props.sheetIndex,
        editorState,
        setEditorState: props.setEditorState,
        gridState: props.gridState,
        setGridState: props.setGridState,
        setUIState: props.setUIState,
        scrollAndRenderedContainerRef,
        containerRef,
        mitoAPI: props.mitoAPI,
        closeOpenEditingPopups: props.closeOpenEditingPopups,
        analysisData: props.analysisData,
        mitoContainerRef: props.mitoContainerRef
      }
    ), /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: "endo-grid-container",
        ref: containerRef,
        tabIndex: -1,
        onMouseDown,
        onMouseUp,
        onMouseLeave: () => setMouseDown(false),
        onDoubleClick
      },
      sheetData !== void 0 && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
        ColumnHeaders_default,
        {
          sheetData,
          uiState,
          setUIState,
          sheetIndex,
          containerRef,
          editorState,
          setEditorState,
          scrollAndRenderedContainerRef,
          gridState,
          setGridState,
          mitoAPI,
          closeOpenEditingPopups: props.closeOpenEditingPopups,
          actions: props.actions
        }
      ), /* @__PURE__ */ react_default.createElement(
        IndexHeaders_default,
        {
          sheetData,
          gridState,
          uiState,
          setUIState,
          mitoAPI,
          closeOpenEditingPopups: props.closeOpenEditingPopups,
          sheetIndex,
          actions: props.actions
        }
      )),
      /* @__PURE__ */ react_default.createElement("div", { className: "endo-scroller-and-renderer-container", ref: setScrollAndRendererContainerRef, onScroll: onGridScroll }, /* @__PURE__ */ react_default.createElement(
        EmptyGridMessages_default,
        {
          setUIState: props.setUIState,
          sheetData,
          mitoAPI,
          uiState: props.uiState,
          sendFunctionStatus: props.sendFunctionStatus
        }
      ), /* @__PURE__ */ react_default.createElement(
        "div",
        {
          id: "scroller",
          style: {
            height: `${totalSize.height}px`,
            width: `${totalSize.width}px`
          }
        }
      ), /* @__PURE__ */ react_default.createElement(
        "div",
        {
          className: "endo-renderer-container",
          style: {
            transform: `translate(${gridState.scrollPosition.scrollLeft - translate.x}px, ${gridState.scrollPosition.scrollTop - translate.y}px)`
          }
        },
        /* @__PURE__ */ react_default.createElement(
          GridData_default,
          {
            sheetData,
            gridState,
            setGridState,
            sheetIndex,
            uiState,
            setUIState,
            editorState,
            actions: props.actions,
            closeOpenEditingPopups: props.closeOpenEditingPopups
          }
        )
      )),
      sheetData !== void 0 && editorState !== void 0 && editorState.editorLocation === "cell" && editorState.rowIndex > -1 && /* @__PURE__ */ react_default.createElement(
        FloatingCellEditor_default,
        {
          sheetDataArray,
          sheetIndex,
          gridState,
          editorState,
          setGridState,
          setEditorState,
          setUIState,
          scrollAndRenderedContainerRef,
          containerRef,
          mitoAPI,
          closeOpenEditingPopups: props.closeOpenEditingPopups,
          analysisData: props.analysisData,
          mitoContainerRef: props.mitoContainerRef
        }
      )
    ), uiState.currOpenSearch.isOpen && /* @__PURE__ */ react_default.createElement(
      SearchBar,
      {
        uiState,
        setUIState,
        mitoAPI,
        containerDiv: containerRef.current,
        scrollAndRenderedContainerDiv: scrollAndRenderedContainerRef.current,
        sheetView: currentSheetView,
        gridState,
        setGridState,
        sheetData
      }
    ));
  }
  var EndoGrid_default = EndoGrid;

  // src/mito/components/footer/Footer.tsx
  init_react();

  // src/mito/components/footer/SheetTab.tsx
  init_react();

  // src/mito/components/icons/SelectedSheetTabDropdownIcon.tsx
  init_react();
  var SelectedSheetTabDropdownIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "8", height: "6", viewBox: "0 0 8 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1 1L4.00283 4L7 1", stroke: "var(--mito-text)", strokeWidth: "2", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var SelectedSheetTabDropdownIcon_default = SelectedSheetTabDropdownIcon;

  // src/mito/components/icons/UnselectedSheetTabDropdownIcon.tsx
  init_react();
  var UnselectedSheetTabDropdownIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "8", height: "6", viewBox: "0 0 8 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1 1L4.00283 4L7 1", stroke: "var(--mito-text)", strokeWidth: "2", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var UnselectedSheetTabDropdownIcon_default = UnselectedSheetTabDropdownIcon;

  // src/mito/components/footer/GraphTabContextMenu.tsx
  init_react();
  function GraphTabContextMenu(props) {
    useEffect(() => {
      if (props.display) {
        void props.mitoAPI.log(
          "clicked_graph_sheet_tab_actions",
          {
            graph_id: props.graphID
          }
        );
      }
    }, [props.display]);
    const onDelete = () => __async(this, null, function* () {
      props.closeOpenEditingPopups();
      yield deleteGraphs([props.graphID], props.mitoAPI, props.setUIState, props.graphDataArray);
    });
    const onDuplicate = () => __async(this, null, function* () {
      props.closeOpenEditingPopups();
      yield openGraphSidebar(
        props.setUIState,
        props.uiState,
        props.setEditorState,
        props.sheetDataArray,
        props.mitoAPI,
        {
          type: "new_duplicate_graph",
          graphIDToDuplicate: props.graphID
        }
      );
    });
    const onRename = () => {
      props.setIsRename(true);
    };
    const openExportGraphTaskpaneDropdown = () => __async(this, null, function* () {
      const existingParams = yield getParamsForExistingGraph(props.mitoAPI, props.graphID);
      if (existingParams === void 0) {
        return;
      }
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          selectedTabType: "graph",
          currOpenTaskpane: {
            type: "graph" /* GRAPH */,
            graphSidebarOpen: false,
            openGraph: {
              type: "existing_graph",
              graphID: props.graphID,
              existingParams
            }
          }
        });
      });
      props.actions.buildTimeActions["export graph dropdown" /* ExportGraphDropdown */].actionFunction();
    });
    return /* @__PURE__ */ react_default.createElement(
      Dropdown_default,
      {
        display: props.display,
        closeDropdown: () => {
          props.setUIState((prevUIState) => {
            const display = typeof prevUIState.currOpenDropdown === "object" && prevUIState.currOpenDropdown.type === "footer-context-menu" && prevUIState.currOpenDropdown.graphID === props.graphID;
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: display ? void 0 : prevUIState.currOpenDropdown
            });
          });
        },
        width: "small"
      },
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "Export",
          onClick: (e) => {
            e == null ? void 0 : e.stopPropagation();
            void openExportGraphTaskpaneDropdown();
          }
        }
      ),
      /* @__PURE__ */ react_default.createElement(DropdownSectionSeperator_default, { isDropdownSectionSeperator: true }),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "Duplicate",
          onClick: onDuplicate
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "Rename",
          onClick: onRename,
          supressFocusSettingOnClose: true
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "Delete",
          onClick: (e) => {
            e == null ? void 0 : e.stopPropagation();
            void onDelete();
          }
        }
      )
    );
  }

  // src/mito/components/footer/SheetTabContextMenu.tsx
  init_react();
  var getGraphTabNamesAndIDsFromSheetIndex = (sheetIndex, graphDataArray, mitoAPI) => __async(void 0, null, function* () {
    const response = yield mitoAPI.getAllParamsForStepType("graph" /* Graph */);
    const allGraphParams = "error" in response ? void 0 : response.result;
    if (allGraphParams === void 0) {
      return [];
    }
    const filteredGraphDataJSON = graphDataArray.filter((graphData) => {
      const graphParams = allGraphParams.find((graphParam) => graphParam.graph_id === graphData.graph_id);
      if (!graphParams) {
        return false;
      }
      return graphParams.graph_creation.sheet_index === sheetIndex;
    });
    return filteredGraphDataJSON.map((graphData) => {
      return { graphTabName: graphData.graph_tab_name, graphID: graphData.graph_id };
    });
  });
  function SheetTabContextMenu(props) {
    var _a, _b;
    const imported = ((_a = props.sheetDataArray[props.sheetIndex]) == null ? void 0 : _a.dfSource) === "imported" /* Imported */;
    const pivoted = ((_b = props.sheetDataArray[props.sheetIndex]) == null ? void 0 : _b.dfSource) === "pivoted" /* Pivoted */;
    useEffect(() => {
      if (props.display) {
        void props.mitoAPI.log(
          "clicked_data_sheet_tab_actions",
          {
            sheet_index: props.sheetIndex
          }
        );
      }
    }, [props.display]);
    const onDelete = () => __async(this, null, function* () {
      const dependantGraphTabNamesAndIDs = yield getGraphTabNamesAndIDsFromSheetIndex(props.sheetIndex, props.graphDataArray, props.mitoAPI);
      if (dependantGraphTabNamesAndIDs.length > 0) {
        props.setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            currOpenModal: {
              type: "DeleteGraphs" /* DeleteGraphs */,
              dependantGraphTabNamesAndIDs,
              sheetIndex: props.sheetIndex
            }
          });
        });
      } else {
        props.setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            selectedTabType: "data",
            selectedSheetIndex: prevUIState.selectedSheetIndex > 0 ? prevUIState.selectedSheetIndex - 1 : 0
          });
        });
        props.closeOpenEditingPopups();
        yield props.mitoAPI.editDataframeDelete(props.sheetIndex);
      }
    });
    const onDuplicate = () => __async(this, null, function* () {
      props.closeOpenEditingPopups();
      yield props.mitoAPI.editDataframeDuplicate(props.sheetIndex);
    });
    const onRename = () => {
      props.setIsRename(true);
    };
    const openDownloadTaskpane = () => __async(this, null, function* () {
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenTaskpane: { type: "download" /* DOWNLOAD */ },
          currOpenModal: { type: "None" /* None */ }
        });
      });
    });
    const dfSource = props.sheetDataArray[props.sheetIndex].dfSource;
    const dropdownItems = [
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          key: "Create graph",
          title: "Create graph",
          onClick: (e) => {
            e == null ? void 0 : e.stopPropagation();
            void openGraphSidebar(
              props.setUIState,
              props.uiState,
              props.setEditorState,
              props.sheetDataArray,
              props.mitoAPI,
              {
                type: "new_graph",
                graphType: "bar" /* BAR */
              }
            );
          }
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          key: "Export",
          title: "Export",
          onClick: openDownloadTaskpane
        }
      ),
      pivoted ? /* @__PURE__ */ react_default.createElement(DropdownItem_default, { key: "Edit Pivot", title: "Edit Pivot", onClick: () => __async(this, null, function* () {
        const response = yield props.mitoAPI.getPivotParams(props.sheetIndex);
        const existingPivotParams = "error" in response ? void 0 : response.result;
        if (existingPivotParams !== void 0) {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: {
                type: "pivot" /* PIVOT */,
                sourceSheetIndex: existingPivotParams.sheet_index,
                destinationSheetIndex: prevUIState.selectedSheetIndex,
                existingPivotParams
              },
              selectedTabType: "data"
            });
          });
        }
      }) }) : void 0,
      imported ? /* @__PURE__ */ react_default.createElement(DropdownItem_default, { key: "Change Import", title: "Change Import", onClick: () => {
        props.closeOpenEditingPopups();
        props.setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            currOpenTaskpane: {
              type: "UpdateImports" /* UPDATEIMPORTS */
            }
          });
        });
      } }) : void 0,
      dfSource === "merged" /* Merged */ ? /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          key: "Edit Merge",
          title: "Edit Merge",
          onClick: () => __async(this, null, function* () {
            props.closeOpenEditingPopups();
            const response = yield props.mitoAPI.getMergeParams(props.sheetIndex);
            const existingMergeParams = "error" in response ? void 0 : response.result;
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenTaskpane: {
                  type: "merge" /* MERGE */,
                  existingParams: existingMergeParams
                }
              });
            });
          })
        }
      ) : void 0,
      /* @__PURE__ */ react_default.createElement(DropdownSectionSeperator_default, { key: "sep", isDropdownSectionSeperator: true }),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          key: "Duplicate",
          title: "Duplicate",
          onClick: onDuplicate
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          key: "Rename",
          title: "Rename",
          onClick: onRename,
          supressFocusSettingOnClose: true
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          key: "Delete",
          title: "Delete",
          onClick: (e) => {
            e == null ? void 0 : e.stopPropagation();
            void onDelete();
          }
        }
      )
    ].filter((element) => element !== null && element !== void 0);
    return /* @__PURE__ */ react_default.createElement(
      Dropdown_default,
      {
        display: props.display,
        closeDropdown: () => {
          props.setUIState((prevUIState) => {
            const display = typeof prevUIState.currOpenDropdown === "object" && prevUIState.currOpenDropdown.type === "footer-context-menu" && prevUIState.currOpenDropdown.sheetIndex === props.sheetIndex;
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: display ? void 0 : prevUIState.currOpenDropdown
            });
          });
        },
        width: "medium"
      },
      dropdownItems
    );
  }

  // src/mito/components/footer/SheetTab.tsx
  function SheetTab(props) {
    var _a, _b;
    const [isRename, setIsRename] = useState(false);
    const [newTabName, setNewTabName] = useState(props.tabName);
    useEffect(() => {
      setNewTabName(props.tabName);
    }, [props.tabName]);
    const onRename = () => __async(this, null, function* () {
      var _a2;
      void props.closeOpenEditingPopups();
      if (props.tabIDObj.tabType === "data") {
        yield props.mitoAPI.editDataframeRename(
          props.tabIDObj.sheetIndex,
          newTabName
        );
      } else {
        yield props.mitoAPI.editGraphRename(
          props.tabIDObj.graphID,
          newTabName
        );
      }
      props.setDisplayContextMenu(false);
      setIsRename(false);
      const endoGridContainer = (_a2 = props.mitoContainerRef.current) == null ? void 0 : _a2.querySelector(".endo-grid-container");
      focusGrid(endoGridContainer);
    });
    const createdSheetTab = (_a = props.uiState.dataRecon) == null ? void 0 : _a.created_dataframe_names.includes(props.tabName);
    const modifiedSheetTab = Object.keys(((_b = props.uiState.dataRecon) == null ? void 0 : _b.modified_dataframes_recons) || {}).includes(props.tabName);
    return /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: classNames(
          "tab",
          { "tab-graph": props.tabIDObj.tabType === "graph" },
          { "tab-selected": props.isSelectedTab },
          "cursor-pointer",
          { "tab-created-recon": createdSheetTab },
          { "tab-modified-recon": modifiedSheetTab }
        ),
        onClick: () => {
          if (props.tabIDObj.tabType === "graph") {
            props.setEditorState(void 0);
            const graphID = props.tabIDObj.graphID;
            void openGraphSidebar(props.setUIState, props.uiState, props.setEditorState, props.sheetDataArray, props.mitoAPI, { type: "existing_graph", "graphID": graphID });
          }
          if (props.tabIDObj.tabType === "data") {
            const sheetIndex = props.tabIDObj.sheetIndex;
            props.setUIState((prevUIState) => {
              const taskpaneInfo = prevUIState.currOpenTaskpane.type === "graph" /* GRAPH */ ? { type: "none" /* NONE */ } : prevUIState.currOpenTaskpane;
              return __spreadProps(__spreadValues({}, prevUIState), {
                selectedTabType: "data",
                selectedSheetIndex: sheetIndex,
                currOpenTaskpane: taskpaneInfo
              });
            });
          }
        },
        onDoubleClick: () => {
          setIsRename(true);
        },
        onContextMenu: (e) => {
          if (e.shiftKey) {
            return;
          }
          e.preventDefault();
          props.setDisplayContextMenu(true);
        }
      },
      /* @__PURE__ */ react_default.createElement("div", { className: "tab-content" }, props.tabIDObj.tabType === "graph" && /* @__PURE__ */ react_default.createElement("div", { className: "mr-3px" }, /* @__PURE__ */ react_default.createElement(GraphIcon_default, { isToolbar: false, variant: props.isSelectedTab ? "light" : void 0 })), isRename && /* @__PURE__ */ react_default.createElement(
        "form",
        {
          onSubmit: (e) => __async(this, null, function* () {
            e.preventDefault();
            yield onRename();
          }),
          onBlur: onRename
        },
        /* @__PURE__ */ react_default.createElement(
          Input_default,
          {
            value: newTabName,
            onChange: (e) => {
              setNewTabName(e.target.value);
            },
            autoFocus: true,
            onEscape: () => {
              setIsRename(false);
              setNewTabName(props.tabName);
            }
          }
        )
      ), !isRename && /* @__PURE__ */ react_default.createElement("p", null, props.tabName), /* @__PURE__ */ react_default.createElement(
        "div",
        {
          onClick: (e) => {
            e.stopPropagation();
            props.setDisplayContextMenu(true);
          }
        },
        props.isSelectedTab ? /* @__PURE__ */ react_default.createElement(SelectedSheetTabDropdownIcon_default, null) : /* @__PURE__ */ react_default.createElement(UnselectedSheetTabDropdownIcon_default, null)
      )),
      props.tabIDObj.tabType === "data" && /* @__PURE__ */ react_default.createElement(
        SheetTabContextMenu,
        {
          setDisplayContextMenu: props.setDisplayContextMenu,
          setUIState: props.setUIState,
          uiState: props.uiState,
          setEditorState: props.setEditorState,
          closeOpenEditingPopups: props.closeOpenEditingPopups,
          setIsRename,
          sheetIndex: props.tabIDObj.sheetIndex,
          mitoAPI: props.mitoAPI,
          graphDataArray: props.graphDataArray,
          sheetDataArray: props.sheetDataArray,
          display: props.display
        }
      ),
      props.tabIDObj.tabType === "graph" && /* @__PURE__ */ react_default.createElement(
        GraphTabContextMenu,
        {
          setDisplayActions: props.setDisplayContextMenu,
          setUIState: props.setUIState,
          uiState: props.uiState,
          sheetDataArray: props.sheetDataArray,
          setEditorState: props.setEditorState,
          closeOpenEditingPopups: props.closeOpenEditingPopups,
          setIsRename,
          graphID: props.tabIDObj.graphID,
          mitoAPI: props.mitoAPI,
          graphDataArray: props.graphDataArray,
          display: props.display,
          actions: props.actions
        }
      )
    );
  }

  // src/mito/components/icons/PlusIcon.tsx
  init_react();
  var PlusIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M7.0498 1.66016V13.7602", stroke: "var(--mito-text)", strokeWidth: "2", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M13.1 7.71008H1", stroke: "var(--mito-text)", strokeWidth: "2", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var PlusIcon_default = PlusIcon;

  // src/mito/components/footer/Footer.tsx
  function Footer(props) {
    const selectedSheetIndex = props.uiState.selectedSheetIndex;
    const selectedGraphID = props.uiState.currOpenTaskpane.type === "graph" /* GRAPH */ ? props.uiState.currOpenTaskpane.openGraph.graphID : void 0;
    const selectedTabType = props.uiState.selectedTabType;
    const displayContextMenuForIndex = typeof props.uiState.currOpenDropdown === "object" && props.uiState.currOpenDropdown.type === "footer-context-menu" ? props.uiState.currOpenDropdown.sheetIndex : null;
    const setDisplayContextMenuForIndex = (index) => {
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenDropdown: index === null ? void 0 : {
            type: "footer-context-menu",
            sheetIndex: index
          }
        });
      });
    };
    const sheetIndex = selectedSheetIndex;
    const sheetData = props.sheetDataArray[sheetIndex];
    const disabledDueToReplayAnalysis = props.uiState.currOpenTaskpane.type === "UpdateImports" /* UPDATEIMPORTS */ && props.uiState.currOpenTaskpane.failedReplayData !== void 0;
    return /* @__PURE__ */ react_default.createElement("div", { className: "footer" }, /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: classNames("footer-add-button", "cursor-pointer"),
        onClick: () => {
          if (disabledDueToReplayAnalysis) {
            return;
          }
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "import files" /* IMPORT_FILES */ }
            });
          });
        }
      },
      /* @__PURE__ */ react_default.createElement(PlusIcon_default, null)
    ), /* @__PURE__ */ react_default.createElement("div", { className: "footer-tab-bar scrollbar-gutter" }, props.sheetDataArray.map((df) => df.dfName).map((dfName, idx) => {
      return /* @__PURE__ */ react_default.createElement(
        SheetTab,
        {
          key: idx,
          tabName: dfName,
          actions: props.actions,
          tabIDObj: { tabType: "data", sheetIndex: idx },
          isSelectedTab: selectedTabType === "data" && idx === selectedSheetIndex,
          uiState: props.uiState,
          setUIState: props.setUIState,
          closeOpenEditingPopups: props.closeOpenEditingPopups,
          mitoAPI: props.mitoAPI,
          mitoContainerRef: props.mitoContainerRef,
          graphDataArray: props.graphDataArray,
          sheetDataArray: props.sheetDataArray,
          setEditorState: props.setEditorState,
          display: displayContextMenuForIndex === idx,
          setDisplayContextMenu: (display) => {
            if (display) {
              setDisplayContextMenuForIndex(idx);
            } else {
              setDisplayContextMenuForIndex(null);
            }
          }
        }
      );
    }), props.graphDataArray.map((graphData) => {
      return /* @__PURE__ */ react_default.createElement(
        SheetTab,
        {
          key: graphData.graph_id,
          tabName: graphData.graph_tab_name,
          tabIDObj: { tabType: "graph", graphID: graphData.graph_id },
          isSelectedTab: selectedTabType === "graph" && graphData.graph_id === selectedGraphID,
          uiState: props.uiState,
          setUIState: props.setUIState,
          closeOpenEditingPopups: props.closeOpenEditingPopups,
          mitoAPI: props.mitoAPI,
          mitoContainerRef: props.mitoContainerRef,
          graphDataArray: props.graphDataArray,
          sheetDataArray: props.sheetDataArray,
          setEditorState: props.setEditorState,
          actions: props.actions,
          display: typeof props.uiState.currOpenDropdown === "object" && props.uiState.currOpenDropdown.type === "footer-context-menu" && props.uiState.currOpenDropdown.graphID === graphData.graph_id,
          setDisplayContextMenu: (display) => {
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenDropdown: display ? {
                  type: "footer-context-menu",
                  graphID: graphData.graph_id
                } : void 0
              });
            });
          }
        }
      );
    })), sheetData !== void 0 && /* @__PURE__ */ react_default.createElement("div", { className: "footer-right-side" }, /* @__PURE__ */ react_default.createElement("div", { className: "footer-sheet-shape" }, "(", sheetData.numRows, " rows, ", sheetData.numColumns, " cols)")));
  }
  var Footer_default = Footer;

  // src/mito/components/modals/ClearAnalysisModal.tsx
  init_react();

  // src/mito/components/DefaultModal.tsx
  init_react();
  var DefaultModal = (props) => {
    const headerColor = props.modalType === "Error" /* Error */ ? "#ED4747" : "#343434";
    const displayOverlay = props.overlay !== void 0 && props.overlay;
    return /* @__PURE__ */ react_default.createElement("div", { className: classNames({ "mito-modal-container": !displayOverlay }, { "overlay": displayOverlay }) }, /* @__PURE__ */ react_default.createElement("div", { className: classNames({ "mito-modal-container": displayOverlay }) }, /* @__PURE__ */ react_default.createElement("div", { className: classNames("mito-modal", { "modal-wide": props.wide }) }, props.setUIState !== void 0 && /* @__PURE__ */ react_default.createElement(Row_default, { justify: "end" }, /* @__PURE__ */ react_default.createElement(Col_default, { offsetRight: 0.25 }, /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: "default-taskpane-header-exit-button-div",
        onClick: () => {
          if (props.setUIState != void 0) {
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenModal: { type: "None" /* None */ }
              });
            });
          }
        }
      },
      /* @__PURE__ */ react_default.createElement(XIcon_default, null)
    ))), /* @__PURE__ */ react_default.createElement("div", { className: classNames("mito-modal-header-text-div", "text-color-mito-text", { "mt-25px": props.setUIState === void 0 }), style: { color: headerColor } }, /* @__PURE__ */ react_default.createElement("p", { className: "text-align-center-important" }, props.header)), props.viewComponent && /* @__PURE__ */ react_default.createElement("div", { className: "mito-modal-message" }, props.viewComponent), /* @__PURE__ */ react_default.createElement("div", { className: "mito-modal-buttons" }, props.buttons))));
  };
  var DefaultModal_default = DefaultModal;

  // src/mito/components/modals/ClearAnalysisModal.tsx
  var ClearAnalysisModal = (props) => {
    useEffect(() => {
      void props.mitoAPI.log("click_open_clear_analysis");
    }, []);
    const clickClear = () => __async(void 0, null, function* () {
      void props.mitoAPI.updateClear();
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenModal: { type: "None" /* None */ }
        });
      });
    });
    return /* @__PURE__ */ react_default.createElement(
      DefaultModal_default,
      {
        header: `Clear your current analysis?`,
        modalType: "ClearAnalysis" /* ClearAnalysis */,
        viewComponent: [
          /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("p", { className: "body-text-1" }, "This will undo all transformations and you've made to imported dataframes and delete all of the graphs you've created."))
        ],
        buttons: [
          /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
            TextButton_default,
            {
              variant: "light",
              width: "small",
              onClick: () => {
                props.setUIState((prevUIState) => {
                  return __spreadProps(__spreadValues({}, prevUIState), {
                    currOpenModal: { type: "None" /* None */ }
                  });
                });
              }
            },
            "Close"
          ), /* @__PURE__ */ react_default.createElement(
            TextButton_default,
            {
              variant: "dark",
              width: "small",
              onClick: clickClear
            },
            "Clear"
          ))
        ]
      }
    );
  };
  var ClearAnalysisModal_default = ClearAnalysisModal;

  // src/mito/components/modals/DeleteGraphsModal.tsx
  init_react();
  var DeleteGraphsModal = (props) => {
    const graphIDs = props.dependantGraphTabNamesAndIDs.map((graphTabNameAndID) => {
      return graphTabNameAndID.graphID;
    });
    const graphTabNames = props.dependantGraphTabNamesAndIDs.map((graphTabNameAndID) => {
      return graphTabNameAndID.graphTabName;
    });
    const clickDelete = () => __async(void 0, null, function* () {
      yield deleteGraphs(graphIDs, props.mitoAPI, props.setUIState, props.graphDataArray);
      yield props.mitoAPI.editDataframeDelete(props.sheetIndex);
    });
    return /* @__PURE__ */ react_default.createElement(
      DefaultModal_default,
      {
        header: `Delete Sheet and Dependant Graphs`,
        modalType: "ClearAnalysis" /* ClearAnalysis */,
        viewComponent: [
          /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("p", { className: "body-text-1" }, "Deleting ", props.dfName, " will delete the following graphs that rely on it:\xA0", /* @__PURE__ */ react_default.createElement("span", { className: "text-color-mito-highlight-important" }, graphTabNames.join(", "))))
        ],
        buttons: [
          /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
            TextButton_default,
            {
              variant: "light",
              width: "small",
              onClick: () => {
                props.setUIState((prevUIState) => {
                  return __spreadProps(__spreadValues({}, prevUIState), {
                    currOpenModal: { type: "None" /* None */ }
                  });
                });
              }
            },
            "Close"
          ), /* @__PURE__ */ react_default.createElement(
            TextButton_default,
            {
              variant: "dark",
              width: "large",
              onClick: clickDelete
            },
            "Delete Sheet and Graphs"
          ))
        ]
      }
    );
  };
  var DeleteGraphsModal_default = DeleteGraphsModal;

  // src/mito/components/modals/ErrorModal.tsx
  init_react();
  var ErrorModal = (props) => {
    const [viewTraceback, setViewTraceback] = useState(false);
    if (props.error === void 0) {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
    }
    return /* @__PURE__ */ react_default.createElement(
      DefaultModal_default,
      {
        header: props.error.errorShort,
        modalType: "Error" /* Error */,
        wide: true,
        viewComponent: [
          /* @__PURE__ */ react_default.createElement(Fragment, { key: props.error.errorShort }, props.error.error && /* @__PURE__ */ react_default.createElement("div", { className: "text-align-left text-body-1", onClick: () => setViewTraceback((viewTraceback2) => !viewTraceback2) }, props.error.error, " ", " ", props.error.traceback && /* @__PURE__ */ react_default.createElement("span", { className: "text-body-1-link" }, "Click to view full traceback.")), props.error.traceback && viewTraceback && /* @__PURE__ */ react_default.createElement("div", { className: "flex flex-column text-align-left text-overflow-hidden text-overflow-scroll mt-5px", style: { height: "200px", border: "1px solid var(--mito-highlight)", borderRadius: "2px", padding: "5px" } }, /* @__PURE__ */ react_default.createElement("pre", null, props.error.traceback)))
        ],
        buttons: [
          /* @__PURE__ */ react_default.createElement(Fragment, { key: "error-modal-buttons" }, /* @__PURE__ */ react_default.createElement(
            TextButton_default,
            {
              variant: "light",
              width: "small",
              onClick: () => {
                props.setUIState((prevUIState) => {
                  return __spreadProps(__spreadValues({}, prevUIState), {
                    currOpenModal: { type: "None" /* None */ }
                  });
                });
              }
            },
            "Close"
          ), /* @__PURE__ */ react_default.createElement(
            GetSupportButton_default,
            {
              userProfile: props.userProfile,
              setUIState: props.setUIState,
              mitoAPI: props.mitoAPI
            }
          ))
        ]
      }
    );
  };
  var ErrorModal_default = ErrorModal;

  // src/mito/components/modals/ReplayAnalysisModals.tsx
  init_react();
  var ErrorReplayedAnalysisModal = (props) => {
    var _a, _b;
    const [viewTraceback, setViewTraceback] = useState(false);
    return /* @__PURE__ */ react_default.createElement(
      DefaultModal_default,
      {
        header: props.header,
        modalType: "Error" /* Error */,
        wide: true,
        viewComponent: [
          /* @__PURE__ */ react_default.createElement(Fragment, { key: "error-modal-view" }, /* @__PURE__ */ react_default.createElement("div", { className: "text-align-left text-body-1", onClick: () => setViewTraceback((viewTraceback2) => !viewTraceback2) }, props.message, " ", " ", ((_a = props.error) == null ? void 0 : _a.traceback) && /* @__PURE__ */ react_default.createElement("span", { className: "text-body-1-link" }, "Click to view full traceback.")), ((_b = props.error) == null ? void 0 : _b.traceback) && viewTraceback && /* @__PURE__ */ react_default.createElement("div", { className: "flex flex-column text-align-left text-overflow-hidden text-overflow-scroll mt-5px", style: { height: "200px", border: "1px solid var(--mito-highlight)", borderRadius: "2px", padding: "5px" } }, /* @__PURE__ */ react_default.createElement("pre", null, props.error.traceback)))
        ],
        buttons: [
          /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
            GetSupportButton_default,
            {
              userProfile: props.userProfile,
              setUIState: props.setUIState,
              mitoAPI: props.mitoAPI
            }
          ), /* @__PURE__ */ react_default.createElement(
            TextButton_default,
            {
              variant: "dark",
              width: "medium",
              onClick: () => {
                if (props.overwriteAnalysisToReplayToMitosheetCall) {
                  props.overwriteAnalysisToReplayToMitosheetCall(
                    props.oldAnalysisName,
                    props.newAnalysisName,
                    props.mitoAPI
                  );
                }
                props.setUIState((prevUIState) => {
                  return __spreadProps(__spreadValues({}, prevUIState), {
                    currOpenModal: { type: "None" /* None */ }
                  });
                });
              }
            },
            "Start New Analysis"
          ))
        ]
      }
    );
  };
  var ReplayAnalysisModals_default = ErrorReplayedAnalysisModal;

  // src/mito/components/modals/SignupModal.tsx
  init_react();

  // src/mito/components/icons/mitofolks/BlueMitoFolk.tsx
  init_react();
  var BlueMitoFolk = () => /* @__PURE__ */ createElement(
    "svg",
    {
      width: 172,
      height: 129,
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg",
      style: { transform: "scale(1.25)", "margin": "100px 75px" },
      onClick: () => {
        window.open("https://github.com/mito-ds/monorepo", "_blank");
      }
    },
    /* @__PURE__ */ createElement("g", { clipPath: "url(#a)" }, /* @__PURE__ */ createElement("path", { d: "m52.592 32.185 31.38 22.609", stroke: "#000", strokeWidth: 5.525 }), /* @__PURE__ */ createElement(
      "path",
      {
        d: "M79.438 84.58c-1.068-1.98-1.891-4.396-2.479-7.127-1.103-5.125-1.366-11.3-.907-17.637.46-6.335 1.638-12.818 3.407-18.557 1.772-5.744 4.127-10.717 6.924-14.05l.04-.048.02-.056c2.375-6.458 7.575-11.181 13.626-13.934 6.054-2.754 12.93-3.521 18.62-2.094 2.777.697 5.27 1.914 7.252 3.68-2.873-1.34-6.039-2.195-9.28-2.604-6.903-.872-14.187.276-19.779 3.142-5.56 2.85-9.482 7.422-9.611 13.412-5.937 7.152-9.74 20.31-10.638 32.729-.452 6.245-.171 12.33.954 17.4.466 2.101 1.08 4.038 1.85 5.744Zm3.742 4.29c-2.281-2.203-3.896-5.77-4.876-10.184-1.107-4.994-1.389-11.012-.94-17.213.898-12.42 4.714-25.469 10.557-32.434l.08-.094v-.12c.076-5.724 3.79-10.138 9.224-12.923 5.439-2.787 12.563-3.918 19.329-3.063 3.89.49 7.648 1.636 10.892 3.488 1.298 1.592 2.257 3.514 2.772 5.776 1.372 6.027-.384 14.546-7.397 25.818l-.045.073-.006.083c-.23 3.636-.193 7.135-.141 10.484l.013.754c.05 3.08.098 6.027-.053 8.854-.324 6.1-1.572 11.59-5.684 16.501-9.401 8.78-22.752 9.205-33.725 4.2Zm24.883 3.86c-8.329 1.638-16.88 1.235-22.595-2.16 10.65 3.913 23.028 2.933 31.965-5.427l.016-.014.014-.017c4.26-5.078 5.53-10.742 5.858-16.918.152-2.85.104-5.82.054-8.894-.004-.252-.009-.505-.012-.76-.053-3.322-.089-6.77.134-10.347 7.018-11.306 8.862-19.987 7.438-26.244a14.89 14.89 0 0 0-1.878-4.614c1.739 1.19 3.292 2.613 4.587 4.277 3.954 5.078 5.559 12.459 2.702 22.506-1.001 2.801-1.353 5.922-1.463 9.17-.068 2.006-.043 4.08-.018 6.165.016 1.286.031 2.576.025 3.856-.033 6.75-.669 13.312-4.946 18.411-4.289 5.113-12.883 9.238-21.881 11.01Z",
        fill: "#00090F"
      }
    ), /* @__PURE__ */ createElement(
      "path",
      {
        d: "M79.438 84.58c-1.068-1.98-1.891-4.396-2.479-7.127-1.103-5.125-1.366-11.3-.907-17.637.46-6.335 1.638-12.818 3.407-18.557 1.772-5.744 4.127-10.717 6.924-14.05l.04-.048.02-.056c2.375-6.458 7.575-11.181 13.626-13.934 6.054-2.754 12.93-3.521 18.62-2.094 2.777.697 5.27 1.914 7.252 3.68-2.873-1.34-6.039-2.195-9.28-2.604-6.903-.872-14.187.276-19.779 3.142-5.56 2.85-9.482 7.422-9.611 13.412-5.937 7.152-9.74 20.31-10.638 32.729-.452 6.245-.171 12.33.954 17.4.466 2.101 1.08 4.038 1.85 5.744Zm3.742 4.29c-2.281-2.203-3.896-5.77-4.876-10.184-1.107-4.994-1.389-11.012-.94-17.213.898-12.42 4.714-25.469 10.557-32.434l.08-.094v-.12c.076-5.724 3.79-10.138 9.224-12.923 5.439-2.787 12.563-3.918 19.329-3.063 3.89.49 7.648 1.636 10.892 3.488 1.298 1.592 2.257 3.514 2.772 5.776 1.372 6.027-.384 14.546-7.397 25.818l-.045.073-.006.083c-.23 3.636-.193 7.135-.141 10.484l.013.754c.05 3.08.098 6.027-.053 8.854-.324 6.1-1.572 11.59-5.684 16.501-9.401 8.78-22.752 9.205-33.725 4.2Zm24.883 3.86c-8.329 1.638-16.88 1.235-22.595-2.16 10.65 3.913 23.028 2.933 31.965-5.427l.016-.014.014-.017c4.26-5.078 5.53-10.742 5.858-16.918.152-2.85.104-5.82.054-8.894-.004-.252-.009-.505-.012-.76-.053-3.322-.089-6.77.134-10.347 7.018-11.306 8.862-19.987 7.438-26.244a14.89 14.89 0 0 0-1.878-4.614c1.739 1.19 3.292 2.613 4.587 4.277 3.954 5.078 5.559 12.459 2.702 22.506-1.001 2.801-1.353 5.922-1.463 9.17-.068 2.006-.043 4.08-.018 6.165.016 1.286.031 2.576.025 3.856-.033 6.75-.669 13.312-4.946 18.411-4.289 5.113-12.883 9.238-21.881 11.01Z",
        fill: "url(#b)"
      }
    ), /* @__PURE__ */ createElement(
      "path",
      {
        d: "M127.446 16.327c-3.244-1.852-7.002-2.997-10.892-3.488-6.766-.855-13.89.276-19.329 3.063-5.434 2.785-9.148 7.199-9.223 12.924l-.002.119-.079.093c-5.843 6.966-9.659 20.016-10.557 32.435-.449 6.201-.167 12.22.94 17.213.98 4.414 2.595 7.981 4.876 10.185 10.973 5.004 24.324 4.579 33.725-4.2 4.112-4.911 5.36-10.401 5.684-16.502.151-2.827.103-5.774.053-8.854l-.013-.754c-.052-3.35-.089-6.848.141-10.484l.006-.083.045-.073c7.013-11.272 8.769-19.79 7.397-25.817-.515-2.263-1.474-4.185-2.772-5.777Zm0 0c.844 1.351 3.096 3.896 3.489 5.622 1.424 6.257-.42 14.938-7.438 26.244-.223 3.577-.187 7.025-.134 10.348.003.254.008.507.012.76.05 3.073.098 6.043-.054 8.893-.328 6.176-1.598 11.84-5.858 16.918l-.014.017-.016.014c-8.937 8.36-21.315 9.34-31.965 5.426 5.714 3.396 14.266 3.799 22.595 2.16 8.998-1.77 17.592-5.896 21.881-11.009 4.278-5.1 4.913-11.662 4.946-18.411.006-1.28-.009-2.57-.025-3.856-.025-2.085-.05-4.16.018-6.165.11-3.248.462-6.369 1.463-9.17 2.857-10.047 1.252-17.428-2.702-22.506-1.295-1.663-4.459-4.094-6.198-5.285ZM79.438 84.58c-1.068-1.98-1.891-4.396-2.479-7.127-1.103-5.125-1.366-11.3-.907-17.637.46-6.335 1.638-12.818 3.407-18.557 1.772-5.744 4.127-10.717 6.924-14.05l.04-.048.02-.056c2.375-6.458 7.575-11.181 13.626-13.934 6.054-2.754 12.93-3.521 18.62-2.094 2.777.697 5.27 1.914 7.252 3.68-2.873-1.34-6.039-2.195-9.28-2.604-6.903-.872-14.187.276-19.779 3.142-5.56 2.85-9.482 7.422-9.611 13.412-5.937 7.152-9.74 20.31-10.638 32.729-.452 6.245-.171 12.33.954 17.4.466 2.101 1.08 4.038 1.85 5.744Z",
        stroke: "#000",
        strokeWidth: 1.105
      }
    ), /* @__PURE__ */ createElement("g", { filter: "url(#c)" }, /* @__PURE__ */ createElement(
      "path",
      {
        d: "M123.137 48.094c-.921 14.487 2.423 26.813-5.96 36.805-9.657 9.033-23.41 9.346-34.564 4.096-11.757-8.734-7.874-48.46 3.484-61.999C95.75.75 151.273 2.868 123.137 48.094Z",
        fill: "#0081DE"
      }
    ), /* @__PURE__ */ createElement(
      "path",
      {
        d: "m122.821 47.922-.045.072-.006.084c-.23 3.636-.193 7.134-.141 10.483l.013.755c.05 3.079.098 6.027-.053 8.854-.324 6.1-1.572 11.59-5.684 16.5-9.506 8.878-23.051 9.214-34.092 4.031-2.822-2.113-4.751-6.124-5.854-11.247-1.103-5.125-1.366-11.3-.907-17.637.46-6.335 1.638-12.819 3.407-18.557 1.772-5.744 4.127-10.717 6.924-14.051l.04-.047.02-.056c2.375-6.458 7.575-11.182 13.626-13.934 6.054-2.755 12.93-3.522 18.62-2.094 5.676 1.423 10.163 5.024 11.529 11.026 1.372 6.027-.384 14.546-7.397 25.818Z",
        stroke: "#000",
        strokeWidth: 1.105
      }
    )), /* @__PURE__ */ createElement("g", { filter: "url(#d)" }, /* @__PURE__ */ createElement(
      "path",
      {
        d: "m85.013 75.222 26.868-2.453",
        stroke: "#3B6787",
        strokeWidth: 1.104
      }
    )), /* @__PURE__ */ createElement("g", { filter: "url(#e)" }, /* @__PURE__ */ createElement(
      "path",
      {
        d: "m86.003 65.37 23.79-1.938",
        stroke: "#3B6787",
        strokeWidth: 1.104
      }
    )), /* @__PURE__ */ createElement("g", { filter: "url(#f)" }, /* @__PURE__ */ createElement(
      "path",
      {
        d: "m88.856 55.66 23.79-1.938",
        stroke: "#3B6787",
        strokeWidth: 1.104
      }
    )), /* @__PURE__ */ createElement("g", { filter: "url(#g)" }, /* @__PURE__ */ createElement(
      "path",
      {
        d: "m91.344 45.99 23.79-1.938",
        stroke: "#3B6787",
        strokeWidth: 1.104
      }
    )), /* @__PURE__ */ createElement("g", { filter: "url(#h)" }, /* @__PURE__ */ createElement(
      "path",
      {
        d: "m88.096 80.49 12.163-41.706",
        stroke: "#3B6787",
        strokeWidth: 1.104
      }
    )), /* @__PURE__ */ createElement("g", { filter: "url(#i)" }, /* @__PURE__ */ createElement(
      "path",
      {
        d: "m97.642 82.913 12.163-41.707",
        stroke: "#3B6787",
        strokeWidth: 1.104
      }
    )), /* @__PURE__ */ createElement("path", { d: "m109.5 23-2 1 .5 2", stroke: "#000" }), /* @__PURE__ */ createElement(
      "path",
      {
        d: "M102.743 33.484c1.514.834 3.574.173 4.6-1.477 1.025-1.65.629-3.663-.886-4.497-1.514-.834-3.574-.173-4.6 1.477-1.025 1.65-.629 3.663.886 4.497Z",
        fill: "#000"
      }
    ), /* @__PURE__ */ createElement(
      "path",
      {
        d: "m88.975 91.492-10.787 33.683M110.007 92.21l15.69 35.99M123.199 47.411l31.38 22.61",
        stroke: "#000",
        strokeWidth: 5.525
      }
    ), /* @__PURE__ */ createElement(
      "path",
      {
        d: "M106.609 16.93c-1.961-.93-3.391-.23-4.422.383.325.705 1.311 2.276 2.656 2.914 1.345.638 3.436.803 4.349.41-.03-1.256-.734-2.83-2.583-3.707ZM117.727 20.447c-1.961-.93-3.391-.231-4.422.382.325.705 1.311 2.276 2.656 2.914 1.345.638 3.436.803 4.349.41-.03-1.255-.734-2.83-2.583-3.706Z",
        stroke: "#000",
        strokeWidth: 1.105
      }
    ), /* @__PURE__ */ createElement(
      "mask",
      {
        id: "j",
        style: {
          maskType: "alpha"
        },
        maskUnits: "userSpaceOnUse",
        x: 103,
        y: 17,
        width: 3,
        height: 2
      },
      /* @__PURE__ */ createElement(
        "path",
        {
          d: "M104.29 18.863c.484.23 1.073.047 1.317-.408.244-.455.05-1.01-.434-1.24-.484-.23-1.073-.046-1.317.409-.244.455-.049 1.01.434 1.24Z",
          fill: "#fff"
        }
      )
    ), /* @__PURE__ */ createElement("g", { mask: "url(#j)" }, /* @__PURE__ */ createElement(
      "path",
      {
        d: "M104.641 17.996a.166.166 0 0 1 .09-.077.09.09 0 0 1 .064.002l-1.01 1.885c.984.466 2.248.114 2.788-.893l-1.932-.917Zm.154-.075c.013.006.03.022.039.047a.15.15 0 0 1-.012.114l-1.932-.916c-.54 1.007-.089 2.173.895 2.64l1.01-1.885Zm.027.161a.163.163 0 0 1-.09.077.091.091 0 0 1-.064-.002l1.01-1.884c-.984-.467-2.248-.115-2.788.893l1.932.916Zm-.154.075a.083.083 0 0 1-.039-.047.15.15 0 0 1 .012-.114l1.932.917c.54-1.008.089-2.174-.895-2.64l-1.01 1.884Z",
        fill: "#000"
      }
    )), /* @__PURE__ */ createElement(
      "mask",
      {
        id: "k",
        style: {
          maskType: "alpha"
        },
        maskUnits: "userSpaceOnUse",
        x: 115,
        y: 21,
        width: 3,
        height: 3
      },
      /* @__PURE__ */ createElement(
        "path",
        {
          d: "M116.058 23.016c.484.229 1.073.046 1.317-.409.244-.455.049-1.01-.434-1.24-.484-.229-1.073-.046-1.317.41-.244.454-.05 1.01.434 1.239Z",
          fill: "#fff"
        }
      )
    ), /* @__PURE__ */ createElement("g", { mask: "url(#k)" }, /* @__PURE__ */ createElement(
      "path",
      {
        d: "M116.409 22.149a.163.163 0 0 1 .09-.077.091.091 0 0 1 .064.001l-1.01 1.885c.984.467 2.248.115 2.788-.893l-1.932-.916Zm.154-.076c.013.007.03.022.039.047a.15.15 0 0 1-.012.114l-1.932-.916c-.54 1.007-.089 2.173.895 2.64l1.01-1.885Zm.027.161a.166.166 0 0 1-.09.077.091.091 0 0 1-.064-.001l1.01-1.885c-.984-.467-2.249-.114-2.788.893l1.932.916Zm-.154.076a.084.084 0 0 1-.039-.047.15.15 0 0 1 .012-.114l1.932.916c.54-1.007.089-2.173-.895-2.64l-1.01 1.885Z",
        fill: "#000"
      }
    ))),
    /* @__PURE__ */ createElement("rect", { y: 13, width: 100, height: 22, rx: 11, fill: "#000" }),
    /* @__PURE__ */ createElement(
      "path",
      {
        d: "m13.5 18.118 1.208 3.719.113.345h4.273l-3.163 2.299-.294.213.112.346 1.208 3.719-3.163-2.299-.294-.213-.294.213-3.163 2.299 1.208-3.72.112-.345-.294-.213-3.163-2.299h4.273l.113-.345 1.208-3.719Z",
        stroke: "#9D6CFF"
      }
    ),
    /* @__PURE__ */ createElement(
      "path",
      {
        d: "M27.65 27.6c1.58 0 2.63-.97 2.63-2.21 0-1.43-.87-1.91-2.55-2.14-1.24-.18-1.48-.47-1.48-1.05 0-.55.42-.94 1.23-.94.82 0 1.25.32 1.38 1.07h1.22c-.14-1.37-1.06-2.07-2.6-2.07-1.49 0-2.49.88-2.49 2.05 0 1.34.81 1.86 2.52 2.09 1.16.19 1.49.44 1.49 1.1 0 .66-.56 1.1-1.35 1.1-1.21 0-1.5-.6-1.59-1.32h-1.28c.1 1.35.92 2.32 2.87 2.32Zm5.598-.01c.37 0 .63-.06.82-.13v-.96c-.17.07-.35.1-.59.1-.38 0-.6-.21-.6-.67v-2.75h1.15v-.91h-1.15v-1.15h-1.21v1.15h-.7v.91h.7v2.86c0 .99.54 1.55 1.58 1.55Zm3.33.01c.8 0 1.26-.29 1.6-.74v.64h1.19v-3.43c0-1.43-.92-1.91-2.09-1.91s-2.14.51-2.24 1.73h1.17c.06-.52.37-.82 1-.82.71 0 .95.35.95 1.05v.27h-.65c-1.5 0-2.68.44-2.68 1.66 0 1.09.79 1.55 1.75 1.55Zm.29-.87c-.6 0-.84-.29-.84-.73 0-.64.59-.85 1.51-.85h.62v.52c0 .67-.55 1.06-1.29 1.06Zm3.887.77h1.21v-2.72c0-1.11.64-1.45 1.7-1.46v-1.13c-.88.01-1.37.4-1.7 1.06v-.98h-1.21v5.23Zm8.698-.84c-.92 0-1.45-.67-1.45-1.74v-.08c0-1.08.55-1.73 1.45-1.73.9 0 1.44.66 1.44 1.74v.07c0 1.07-.54 1.74-1.44 1.74Zm-.01.94c1.54 0 2.69-1.06 2.69-2.69v-.08c0-1.6-1.15-2.67-2.68-2.67-1.54 0-2.69 1.08-2.69 2.7v.08c0 1.59 1.14 2.66 2.68 2.66Zm3.783-.1h1.21v-3.08c0-.83.55-1.25 1.23-1.25.72 0 1.04.36 1.04 1.15v3.18h1.21v-3.29c0-1.44-.74-2.05-1.79-2.05-.86 0-1.44.43-1.69.94v-.83h-1.21v5.23Zm11.777.1c2.02 0 3.26-1.2 3.26-3.18v-.66h-3.11v1h1.8c-.04.99-.59 1.8-1.93 1.8-1.5 0-2.21-1.05-2.21-2.58v-.08c0-1.57.81-2.61 2.21-2.61.93 0 1.57.41 1.73 1.36h1.33c-.19-1.71-1.55-2.41-3.08-2.41-2.09 0-3.57 1.52-3.57 3.65v.08c0 2.11 1.28 3.63 3.57 3.63Zm4.474-.1h1.21v-5.23h-1.21v5.23Zm.59-6.09c.4 0 .72-.3.72-.69 0-.4-.32-.7-.72-.7-.4 0-.72.3-.72.7 0 .39.32.69.72.69Zm3.874 6.18c.37 0 .63-.06.82-.13v-.96c-.17.07-.35.1-.59.1-.38 0-.6-.21-.6-.67v-2.75h1.15v-.91h-1.15v-1.15h-1.21v1.15h-.7v.91h.7v2.86c0 .99.54 1.55 1.58 1.55Zm1.912-.09h1.21v-3.08c0-.83.55-1.25 1.23-1.25.72 0 1.04.36 1.04 1.15v3.18h1.21v-3.29c0-1.44-.74-2.05-1.79-2.05-.86 0-1.44.43-1.69.94v-3.25h-1.21v7.65Zm7.834.1c.85 0 1.4-.41 1.66-.92v.82h1.21v-5.23h-1.21v3.11c0 .83-.57 1.25-1.22 1.25-.7 0-1.03-.36-1.03-1.15v-3.21h-1.21v3.35c0 1.39.77 1.98 1.8 1.98Zm7.225 0c1.35 0 2.32-1.02 2.32-2.7v-.08c0-1.69-1.01-2.66-2.32-2.66-.77 0-1.42.45-1.71.95v-3.26h-1.21v7.65h1.21v-.84c.28.53.88.94 1.71.94Zm-.3-.96c-.88 0-1.45-.55-1.45-1.72v-.08c0-1.16.6-1.73 1.44-1.73.79 0 1.39.57 1.39 1.73v.08c0 1.12-.49 1.72-1.38 1.72Z",
        fill: "#fff"
      }
    ),
    /* @__PURE__ */ createElement("defs", null, /* @__PURE__ */ createElement(
      "filter",
      {
        id: "c",
        x: 70.865,
        y: 9.821,
        width: 64.757,
        height: 91.658,
        filterUnits: "userSpaceOnUse",
        colorInterpolationFilters: "sRGB"
      },
      /* @__PURE__ */ createElement("feFlood", { floodOpacity: 0, result: "BackgroundImageFix" }),
      /* @__PURE__ */ createElement(
        "feColorMatrix",
        {
          in: "SourceAlpha",
          values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
          result: "hardAlpha"
        }
      ),
      /* @__PURE__ */ createElement("feOffset", { dy: 4.42 }),
      /* @__PURE__ */ createElement("feGaussianBlur", { stdDeviation: 2.21 }),
      /* @__PURE__ */ createElement("feColorMatrix", { values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }),
      /* @__PURE__ */ createElement(
        "feBlend",
        {
          in2: "BackgroundImageFix",
          result: "effect1_dropShadow_4703_152"
        }
      ),
      /* @__PURE__ */ createElement(
        "feBlend",
        {
          in: "SourceGraphic",
          in2: "effect1_dropShadow_4703_152",
          result: "shape"
        }
      )
    ), /* @__PURE__ */ createElement(
      "filter",
      {
        id: "d",
        x: 80.536,
        y: 72.219,
        width: 35.822,
        height: 12.392,
        filterUnits: "userSpaceOnUse",
        colorInterpolationFilters: "sRGB"
      },
      /* @__PURE__ */ createElement("feFlood", { floodOpacity: 0, result: "BackgroundImageFix" }),
      /* @__PURE__ */ createElement(
        "feColorMatrix",
        {
          in: "SourceAlpha",
          values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
          result: "hardAlpha"
        }
      ),
      /* @__PURE__ */ createElement("feOffset", { dy: 4.42 }),
      /* @__PURE__ */ createElement("feGaussianBlur", { stdDeviation: 2.21 }),
      /* @__PURE__ */ createElement("feColorMatrix", { values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }),
      /* @__PURE__ */ createElement(
        "feBlend",
        {
          in2: "BackgroundImageFix",
          result: "effect1_dropShadow_4703_152"
        }
      ),
      /* @__PURE__ */ createElement(
        "feBlend",
        {
          in: "SourceGraphic",
          in2: "effect1_dropShadow_4703_152",
          result: "shape"
        }
      )
    ), /* @__PURE__ */ createElement(
      "filter",
      {
        id: "e",
        x: 81.533,
        y: 62.882,
        width: 32.731,
        height: 11.877,
        filterUnits: "userSpaceOnUse",
        colorInterpolationFilters: "sRGB"
      },
      /* @__PURE__ */ createElement("feFlood", { floodOpacity: 0, result: "BackgroundImageFix" }),
      /* @__PURE__ */ createElement(
        "feColorMatrix",
        {
          in: "SourceAlpha",
          values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
          result: "hardAlpha"
        }
      ),
      /* @__PURE__ */ createElement("feOffset", { dy: 4.42 }),
      /* @__PURE__ */ createElement("feGaussianBlur", { stdDeviation: 2.21 }),
      /* @__PURE__ */ createElement("feColorMatrix", { values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }),
      /* @__PURE__ */ createElement(
        "feBlend",
        {
          in2: "BackgroundImageFix",
          result: "effect1_dropShadow_4703_152"
        }
      ),
      /* @__PURE__ */ createElement(
        "feBlend",
        {
          in: "SourceGraphic",
          in2: "effect1_dropShadow_4703_152",
          result: "shape"
        }
      )
    ), /* @__PURE__ */ createElement(
      "filter",
      {
        id: "f",
        x: 84.386,
        y: 53.173,
        width: 32.731,
        height: 11.877,
        filterUnits: "userSpaceOnUse",
        colorInterpolationFilters: "sRGB"
      },
      /* @__PURE__ */ createElement("feFlood", { floodOpacity: 0, result: "BackgroundImageFix" }),
      /* @__PURE__ */ createElement(
        "feColorMatrix",
        {
          in: "SourceAlpha",
          values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
          result: "hardAlpha"
        }
      ),
      /* @__PURE__ */ createElement("feOffset", { dy: 4.42 }),
      /* @__PURE__ */ createElement("feGaussianBlur", { stdDeviation: 2.21 }),
      /* @__PURE__ */ createElement("feColorMatrix", { values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }),
      /* @__PURE__ */ createElement(
        "feBlend",
        {
          in2: "BackgroundImageFix",
          result: "effect1_dropShadow_4703_152"
        }
      ),
      /* @__PURE__ */ createElement(
        "feBlend",
        {
          in: "SourceGraphic",
          in2: "effect1_dropShadow_4703_152",
          result: "shape"
        }
      )
    ), /* @__PURE__ */ createElement(
      "filter",
      {
        id: "g",
        x: 86.874,
        y: 43.502,
        width: 32.731,
        height: 11.877,
        filterUnits: "userSpaceOnUse",
        colorInterpolationFilters: "sRGB"
      },
      /* @__PURE__ */ createElement("feFlood", { floodOpacity: 0, result: "BackgroundImageFix" }),
      /* @__PURE__ */ createElement(
        "feColorMatrix",
        {
          in: "SourceAlpha",
          values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
          result: "hardAlpha"
        }
      ),
      /* @__PURE__ */ createElement("feOffset", { dy: 4.42 }),
      /* @__PURE__ */ createElement("feGaussianBlur", { stdDeviation: 2.21 }),
      /* @__PURE__ */ createElement("feColorMatrix", { values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }),
      /* @__PURE__ */ createElement(
        "feBlend",
        {
          in2: "BackgroundImageFix",
          result: "effect1_dropShadow_4703_152"
        }
      ),
      /* @__PURE__ */ createElement(
        "feBlend",
        {
          in: "SourceGraphic",
          in2: "effect1_dropShadow_4703_152",
          result: "shape"
        }
      )
    ), /* @__PURE__ */ createElement(
      "filter",
      {
        id: "h",
        x: 83.142,
        y: 38.646,
        width: 22.072,
        height: 50.822,
        filterUnits: "userSpaceOnUse",
        colorInterpolationFilters: "sRGB"
      },
      /* @__PURE__ */ createElement("feFlood", { floodOpacity: 0, result: "BackgroundImageFix" }),
      /* @__PURE__ */ createElement(
        "feColorMatrix",
        {
          in: "SourceAlpha",
          values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
          result: "hardAlpha"
        }
      ),
      /* @__PURE__ */ createElement("feOffset", { dy: 4.42 }),
      /* @__PURE__ */ createElement("feGaussianBlur", { stdDeviation: 2.21 }),
      /* @__PURE__ */ createElement("feColorMatrix", { values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }),
      /* @__PURE__ */ createElement(
        "feBlend",
        {
          in2: "BackgroundImageFix",
          result: "effect1_dropShadow_4703_152"
        }
      ),
      /* @__PURE__ */ createElement(
        "feBlend",
        {
          in: "SourceGraphic",
          in2: "effect1_dropShadow_4703_152",
          result: "shape"
        }
      )
    ), /* @__PURE__ */ createElement(
      "filter",
      {
        id: "i",
        x: 92.688,
        y: 41.068,
        width: 22.072,
        height: 50.822,
        filterUnits: "userSpaceOnUse",
        colorInterpolationFilters: "sRGB"
      },
      /* @__PURE__ */ createElement("feFlood", { floodOpacity: 0, result: "BackgroundImageFix" }),
      /* @__PURE__ */ createElement(
        "feColorMatrix",
        {
          in: "SourceAlpha",
          values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
          result: "hardAlpha"
        }
      ),
      /* @__PURE__ */ createElement("feOffset", { dy: 4.42 }),
      /* @__PURE__ */ createElement("feGaussianBlur", { stdDeviation: 2.21 }),
      /* @__PURE__ */ createElement("feColorMatrix", { values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }),
      /* @__PURE__ */ createElement(
        "feBlend",
        {
          in2: "BackgroundImageFix",
          result: "effect1_dropShadow_4703_152"
        }
      ),
      /* @__PURE__ */ createElement(
        "feBlend",
        {
          in: "SourceGraphic",
          in2: "effect1_dropShadow_4703_152",
          result: "shape"
        }
      )
    ), /* @__PURE__ */ createElement(
      "linearGradient",
      {
        id: "b",
        x1: 7984.7,
        y1: 6352.37,
        x2: 4940.57,
        y2: 5739.01,
        gradientUnits: "userSpaceOnUse"
      },
      /* @__PURE__ */ createElement("stop", null),
      /* @__PURE__ */ createElement("stop", { offset: 1, stopOpacity: 0 })
    ), /* @__PURE__ */ createElement("clipPath", { id: "a" }, /* @__PURE__ */ createElement("path", { fill: "#fff", transform: "translate(43)", d: "M0 0h129v129H0z" })))
  );
  var BlueMitoFolk_default = BlueMitoFolk;

  // src/mito/components/icons/mitofolks/PinkMitoFolk.tsx
  init_react();
  var PinkMitoFolk = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { style: { transform: "scaleX(-1)", "margin": "75px 50px" }, width: "200", height: "200", viewBox: "0 0 139 152", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("line", { y1: "-2.5", x2: "44.7223", y2: "-2.5", transform: "matrix(0.282454 0.959281 0.969447 -0.245301 108.706 62.2981)", stroke: "black", strokeWidth: "5" }), /* @__PURE__ */ react_default.createElement("line", { y1: "-2.5", x2: "37.8202", y2: "-2.5", transform: "matrix(0.30917 0.951007 0.96312 -0.269071 94.2115 113.51)", stroke: "black", strokeWidth: "5" }), /* @__PURE__ */ react_default.createElement("line", { y1: "-2.5", x2: "42.026", y2: "-2.5", transform: "matrix(-0.404697 0.914451 0.934686 0.355474 60.7272 113.51)", stroke: "black", strokeWidth: "5" }), /* @__PURE__ */ react_default.createElement("path", { d: "M97.8672 111.365C100.871 108.702 103.275 104.518 105.076 99.388C107.277 93.1163 108.563 85.4693 108.954 77.5619C109.345 69.6555 108.841 61.498 107.468 54.208C106.094 46.9136 103.853 40.5075 100.785 36.0895L100.76 36.0525L100.749 36.0097C98.7055 27.7331 92.7735 21.362 85.4555 17.3707C78.1349 13.3779 69.4458 11.7774 61.9203 13.0292C57.7945 13.7155 54.0217 15.2578 51.0118 17.7322C55.1783 16.0594 59.747 15.1514 64.3541 14.9237C73.2372 14.4847 82.2938 16.5731 88.9362 20.6196C95.5578 24.6534 99.8036 30.6525 99.0257 38.0331C102.249 42.7078 104.564 49.1922 105.982 56.4278C107.408 63.705 107.929 71.7591 107.544 79.5305C107.159 87.301 105.867 94.7978 103.661 100.958C102.162 105.146 100.234 108.733 97.8672 111.365ZM95.2952 113.082C98.6041 110.526 101.236 106.2 103.172 100.792C105.359 94.6841 106.645 87.2331 107.029 79.4942C107.413 71.7562 106.893 63.7394 105.475 56.5022C104.057 49.2615 101.741 42.8184 98.5454 38.2157L98.4942 38.142L98.5037 38.0558C99.2981 30.8695 95.1951 25.0019 88.6645 21.0235C82.1291 17.0422 73.1858 14.9727 64.3958 15.4071C59.3271 15.6576 54.3197 16.74 49.8606 18.7609C47.927 20.6396 46.3826 22.9672 45.3622 25.7687C42.6639 33.177 43.6113 43.9486 50.8161 58.5846L50.8436 58.6404L50.84 58.7011C50.5751 63.2213 49.9909 67.5476 49.408 71.6934C49.364 72.0063 49.32 72.3181 49.2762 72.6289C48.7387 76.4394 48.2232 80.0942 47.9795 83.618C47.4528 91.2319 48.1984 98.1972 52.7144 104.709C63.4077 116.547 80.4686 118.31 95.2952 113.082ZM62.8353 115.579C73.9568 118.589 85.8248 118.727 93.7629 114.109C79.2069 118.663 62.7794 116.601 52.3142 105.004L52.3034 104.991L52.2942 104.978C47.6798 98.333 46.9349 91.2383 47.4651 83.573C47.71 80.0323 48.2278 76.3618 48.7647 72.5552C48.8087 72.2433 48.8528 71.9304 48.8969 71.6166C49.4773 67.4894 50.0564 63.1995 50.3218 58.7213C43.1139 44.0566 42.1191 33.1641 44.874 25.6005C45.7514 23.1915 47.0073 21.1253 48.5583 19.3861C45.7969 20.7884 43.2762 22.5738 41.1213 24.7697C35.2478 30.755 32.0615 39.8204 34.1633 52.5799C35.0021 56.12 34.973 60.0019 34.6133 64.0333C34.3912 66.5219 34.0413 69.0827 33.6891 71.6598C33.4713 73.2535 33.2526 74.8536 33.0628 76.4467C32.0655 84.8179 31.8563 93.0672 36.5571 99.8369C41.2648 106.617 51.622 112.545 62.8353 115.579Z", fill: "#00090F" }), /* @__PURE__ */ react_default.createElement("path", { d: "M97.8672 111.365C100.871 108.702 103.275 104.518 105.076 99.388C107.277 93.1163 108.563 85.4693 108.954 77.5619C109.345 69.6555 108.841 61.498 107.468 54.208C106.094 46.9136 103.853 40.5075 100.785 36.0895L100.76 36.0525L100.749 36.0097C98.7055 27.7331 92.7735 21.362 85.4555 17.3707C78.1349 13.3779 69.4458 11.7774 61.9203 13.0292C57.7945 13.7155 54.0217 15.2578 51.0118 17.7322C55.1783 16.0594 59.747 15.1514 64.3541 14.9237C73.2372 14.4847 82.2938 16.5731 88.9362 20.6196C95.5578 24.6534 99.8036 30.6525 99.0257 38.0331C102.249 42.7078 104.564 49.1922 105.982 56.4278C107.408 63.705 107.929 71.7591 107.544 79.5305C107.159 87.301 105.867 94.7978 103.661 100.958C102.162 105.146 100.234 108.733 97.8672 111.365ZM95.2952 113.082C98.6041 110.526 101.236 106.2 103.172 100.792C105.359 94.6841 106.645 87.2331 107.029 79.4942C107.413 71.7562 106.893 63.7394 105.475 56.5022C104.057 49.2615 101.741 42.8184 98.5454 38.2157L98.4942 38.142L98.5037 38.0558C99.2981 30.8695 95.1951 25.0019 88.6645 21.0235C82.1291 17.0422 73.1858 14.9727 64.3958 15.4071C59.3271 15.6576 54.3197 16.74 49.8606 18.7609C47.927 20.6396 46.3826 22.9672 45.3622 25.7687C42.6639 33.177 43.6113 43.9486 50.8161 58.5846L50.8436 58.6404L50.84 58.7011C50.5751 63.2213 49.9909 67.5476 49.408 71.6934C49.364 72.0063 49.32 72.3181 49.2762 72.6289C48.7387 76.4394 48.2232 80.0942 47.9795 83.618C47.4528 91.2319 48.1984 98.1972 52.7144 104.709C63.4077 116.547 80.4686 118.31 95.2952 113.082ZM62.8353 115.579C73.9568 118.589 85.8248 118.727 93.7629 114.109C79.2069 118.663 62.7794 116.601 52.3142 105.004L52.3034 104.991L52.2942 104.978C47.6798 98.333 46.9349 91.2383 47.4651 83.573C47.71 80.0323 48.2278 76.3618 48.7647 72.5552C48.8087 72.2433 48.8528 71.9304 48.8969 71.6166C49.4773 67.4894 50.0564 63.1995 50.3218 58.7213C43.1139 44.0566 42.1191 33.1641 44.874 25.6005C45.7514 23.1915 47.0073 21.1253 48.5583 19.3861C45.7969 20.7884 43.2762 22.5738 41.1213 24.7697C35.2478 30.755 32.0615 39.8204 34.1633 52.5799C35.0021 56.12 34.973 60.0019 34.6133 64.0333C34.3912 66.5219 34.0413 69.0827 33.6891 71.6598C33.4713 73.2535 33.2526 74.8536 33.0628 76.4467C32.0655 84.8179 31.8563 93.0672 36.5571 99.8369C41.2648 106.617 51.622 112.545 62.8353 115.579Z", fill: "url(#paint0_linear)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M97.8672 111.365C100.871 108.702 103.275 104.518 105.076 99.388C107.277 93.1163 108.563 85.4693 108.954 77.5619C109.345 69.6555 108.841 61.498 107.468 54.208C106.094 46.9136 103.853 40.5075 100.785 36.0895L100.76 36.0525L100.749 36.0097C98.7055 27.7331 92.7735 21.362 85.4555 17.3707C78.1349 13.3779 69.4458 11.7774 61.9203 13.0292C57.7945 13.7155 54.0217 15.2578 51.0118 17.7322C55.1783 16.0594 59.747 15.1514 64.3541 14.9237C73.2372 14.4847 82.2938 16.5731 88.9362 20.6196C95.5578 24.6534 99.8036 30.6525 99.0257 38.0331C102.249 42.7078 104.564 49.1922 105.982 56.4278C107.408 63.705 107.929 71.7591 107.544 79.5305C107.159 87.301 105.867 94.7978 103.661 100.958C102.162 105.146 100.234 108.733 97.8672 111.365ZM95.2952 113.082C98.6041 110.526 101.236 106.2 103.172 100.792C105.359 94.6841 106.645 87.2331 107.029 79.4942C107.413 71.7562 106.893 63.7394 105.475 56.5022C104.057 49.2615 101.741 42.8184 98.5454 38.2157L98.4942 38.142L98.5037 38.0558C99.2981 30.8695 95.1951 25.0019 88.6645 21.0235C82.1291 17.0422 73.1858 14.9727 64.3958 15.4071C59.3271 15.6576 54.3197 16.74 49.8606 18.7609C47.927 20.6396 46.3826 22.9672 45.3622 25.7687C42.6639 33.177 43.6113 43.9486 50.8161 58.5846L50.8436 58.6404L50.84 58.7011C50.5751 63.2213 49.9909 67.5476 49.408 71.6934C49.364 72.0063 49.32 72.3181 49.2762 72.6289C48.7387 76.4394 48.2232 80.0942 47.9795 83.618C47.4528 91.2319 48.1984 98.1972 52.7144 104.709C63.4077 116.547 80.4686 118.31 95.2952 113.082ZM62.8353 115.579C73.9568 118.589 85.8248 118.727 93.7629 114.109C79.2069 118.663 62.7794 116.601 52.3142 105.004L52.3034 104.991L52.2942 104.978C47.6798 98.333 46.9349 91.2383 47.4651 83.573C47.71 80.0323 48.2278 76.3618 48.7647 72.5552C48.8087 72.2433 48.8528 71.9304 48.8969 71.6166C49.4773 67.4894 50.0564 63.1995 50.3218 58.7213C43.1139 44.0566 42.1191 33.1641 44.874 25.6005C45.7514 23.1915 47.0073 21.1253 48.5583 19.3861C45.7969 20.7884 43.2762 22.5738 41.1213 24.7697C35.2478 30.755 32.0615 39.8204 34.1633 52.5799C35.0021 56.12 34.973 60.0019 34.6133 64.0333C34.3912 66.5219 34.0413 69.0827 33.6891 71.6598C33.4713 73.2535 33.2526 74.8536 33.0628 76.4467C32.0655 84.8179 31.8563 93.0672 36.5571 99.8369C41.2648 106.617 51.622 112.545 62.8353 115.579Z", stroke: "black", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("g", { filter: "url(#filter0_d)" }, /* @__PURE__ */ react_default.createElement("path", { d: "M50.5827 58.6809C49.5253 76.7216 43.3703 91.6895 52.5089 104.85C63.4182 116.939 80.8842 118.6 95.8988 113.127C112.216 103.39 113.383 53.7942 101 35.9614C92.7473 2.53842 21.7073 0.0230777 50.5827 58.6809Z", fill: "#FFEBEB" }), /* @__PURE__ */ react_default.createElement("path", { d: "M50.8161 58.5846L50.8436 58.6404L50.84 58.7011C50.5751 63.2213 49.9909 67.5476 49.408 71.6934C49.364 72.0063 49.32 72.3181 49.2762 72.6289C48.7387 76.4394 48.2232 80.0942 47.9795 83.618C47.4528 91.2319 48.1984 98.1972 52.7144 104.709C63.5237 116.675 80.8393 118.347 95.7767 112.909C99.7734 110.514 102.875 105.657 105.076 99.388C107.277 93.1163 108.563 85.4693 108.954 77.5619C109.345 69.6555 108.841 61.498 107.468 54.208C106.094 46.9136 103.853 40.5075 100.785 36.0895L100.76 36.0525L100.749 36.0097C98.7055 27.7331 92.7735 21.362 85.4555 17.3707C78.1349 13.3779 69.4458 11.7774 61.9203 13.0292C54.402 14.2799 48.056 18.3727 45.3622 25.7687C42.6639 33.177 43.6113 43.9486 50.8161 58.5846Z", stroke: "#0A0A0A", strokeWidth: "0.5" })), /* @__PURE__ */ react_default.createElement("g", { filter: "url(#filter1_d)" }, /* @__PURE__ */ react_default.createElement("line", { y1: "-0.125", x2: "26.0263", y2: "-0.125", transform: "matrix(-1.00036 -0.232717 -0.303964 0.923249 90.9426 103.996)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ react_default.createElement("g", { filter: "url(#filter2_d)" }, /* @__PURE__ */ react_default.createElement("line", { y1: "-0.125", x2: "26.6148", y2: "-0.125", transform: "matrix(-0.998412 -0.240755 -0.312384 0.920564 92.4263 92.9282)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ react_default.createElement("g", { filter: "url(#filter3_d)" }, /* @__PURE__ */ react_default.createElement("line", { y1: "-0.125", x2: "26.6148", y2: "-0.125", transform: "matrix(-0.998412 -0.240755 -0.312384 0.920564 91.7477 81.6816)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ react_default.createElement("g", { filter: "url(#filter4_d)" }, /* @__PURE__ */ react_default.createElement("line", { y1: "-0.125", x2: "26.6148", y2: "-0.125", transform: "matrix(-0.998412 -0.240755 -0.312384 0.920564 91.4735 70.5457)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ react_default.createElement("g", { filter: "url(#filter5_d)" }, /* @__PURE__ */ react_default.createElement("line", { y1: "-0.125", x2: "49.6473", y2: "-0.125", transform: "matrix(-0.056611 -0.972639 -1.01868 0.0895582 85.7439 108.932)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ react_default.createElement("g", { filter: "url(#filter6_d)" }, /* @__PURE__ */ react_default.createElement("line", { y1: "-0.125", x2: "49.0215", y2: "-0.125", transform: "matrix(-0.0447349 -0.972962 -1.01982 0.0794914 74.2345 109.899)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ react_default.createElement("path", { d: "M77.5748 21.6128C81.1721 21.0053 83.1051 22.723 84.446 24.1319C83.5748 25.0968 81.2156 27.1306 78.7489 27.5472C76.2822 27.9638 72.8613 27.3151 71.5987 26.3018C72.2742 24.3479 74.1847 22.1854 77.5748 21.6128Z", stroke: "black" }), /* @__PURE__ */ react_default.createElement("path", { d: "M77.1438 24.7826C77.2286 25.211 77.6735 25.4954 78.138 25.417C78.6025 25.3385 78.9097 24.9272 78.8249 24.4987C78.7401 24.0703 78.2952 23.7859 77.8307 23.8643C77.3662 23.9428 77.059 24.3541 77.1438 24.7826Z", stroke: "black", strokeWidth: "1.5" }), /* @__PURE__ */ react_default.createElement("path", { d: "M56.7304 23.0188C60.3276 22.4113 62.2607 24.129 63.6015 25.5379C62.7303 26.5028 60.3711 28.5366 57.9044 28.9532C55.4378 29.3698 52.0168 28.7211 50.7542 27.7078C51.4297 25.7539 53.3402 23.5914 56.7304 23.0188Z", stroke: "black" }), /* @__PURE__ */ react_default.createElement("path", { d: "M56.2062 26.2049C56.291 26.6334 56.7359 26.9177 57.2004 26.8393C57.6649 26.7609 57.9721 26.3496 57.8873 25.9211C57.8025 25.4926 57.3576 25.2083 56.8931 25.2867C56.4286 25.3651 56.1214 25.7765 56.2062 26.2049Z", stroke: "black", strokeWidth: "1.5" }), /* @__PURE__ */ react_default.createElement("path", { d: "M70.9027 31.9832L74.8034 33.746L74.6873 36.5264", stroke: "black" }), /* @__PURE__ */ react_default.createElement("ellipse", { rx: "5.52852", ry: "7.22499", transform: "matrix(-1.00798 0.230879 0.25069 0.931832 78.3648 46.1813)", fill: "#0B0B0B" }), /* @__PURE__ */ react_default.createElement("line", { y1: "-2.5", x2: "46.79", y2: "-2.5", transform: "matrix(0.181746 -0.947707 -1.01992 -0.168086 34.7046 107.134)", stroke: "black", strokeWidth: "5" }), /* @__PURE__ */ react_default.createElement("defs", null, /* @__PURE__ */ react_default.createElement("filter", { id: "filter0_d", x: "39.718", y: "12.3701", width: "73.6225", height: "111.741", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ react_default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ react_default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ react_default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ react_default.createElement("filter", { id: "filter1_d", x: "60.907", y: "97.7083", width: "34.1116", height: "14.2876", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ react_default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ react_default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ react_default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ react_default.createElement("filter", { id: "filter2_d", x: "61.8538", y: "86.2905", width: "34.6506", height: "14.6378", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ react_default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ react_default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ react_default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ react_default.createElement("filter", { id: "filter3_d", x: "61.1752", y: "75.0439", width: "34.6506", height: "14.6378", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ react_default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ react_default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ react_default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ react_default.createElement("filter", { id: "filter4_d", x: "60.901", y: "63.908", width: "34.6506", height: "14.6378", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ react_default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ react_default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ react_default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ react_default.createElement("filter", { id: "filter5_d", x: "78.9333", y: "60.6208", width: "11.0653", height: "56.3113", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ react_default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ react_default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ react_default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ react_default.createElement("filter", { id: "filter6_d", x: "68.0415", y: "62.1831", width: "10.4479", height: "55.716", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ react_default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ react_default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ react_default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ react_default.createElement("linearGradient", { id: "paint0_linear", x1: "25.393", y1: "64.5732", x2: "215.189", y2: "46.963", gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ react_default.createElement("stop", { stopColor: "#D17485" }), /* @__PURE__ */ react_default.createElement("stop", { offset: "1", stopColor: "white", stopOpacity: "0" }))));
  };
  var PinkMitoFolk_default = PinkMitoFolk;

  // src/mito/components/icons/mitofolks/YellowMitoFolk.tsx
  init_react();
  var YellowMitoFolk = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { style: { "margin": "75px 50px" }, width: "200", height: "200", viewBox: "0 0 105 133", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("line", { y1: "-2.5", x2: "47.2325", y2: "-2.5", transform: "matrix(-0.275217 0.961382 -0.963013 -0.269454 27.7317 82.8152)", stroke: "black", strokeWidth: "5" }), /* @__PURE__ */ react_default.createElement("path", { d: "M65.2668 85.4294L72.7953 132.508", stroke: "black", strokeWidth: "5" }), /* @__PURE__ */ react_default.createElement("line", { y1: "-2", x2: "17.4186", y2: "-2", transform: "matrix(0.447771 0.889458 -0.901022 0.443341 17.3323 33.123)", stroke: "black", strokeWidth: "4" }), /* @__PURE__ */ react_default.createElement("path", { d: "M26.9936 83.7798C25.4254 81.526 24.2862 78.4488 23.5471 74.8403C22.5156 69.8046 22.2722 63.7776 22.7024 57.6208C23.1326 51.465 24.2356 45.1891 25.8911 39.6575C27.5478 34.1218 29.7523 29.3505 32.3744 26.1886L32.4024 26.1548L32.4171 26.1136C34.6444 19.8851 39.5187 15.4489 45.1857 12.9669C50.8554 10.4837 57.2988 9.96562 62.6371 11.554C65.4373 12.3872 67.9311 13.7984 69.8536 15.8097C67.0517 14.2661 63.9247 13.2415 60.7165 12.7034C54.2889 11.6254 47.5057 12.4949 42.301 15.0867C37.1183 17.6675 33.4759 21.9734 33.3658 27.7745C30.6005 31.137 28.3333 35.9718 26.6505 41.4574C24.9553 46.9833 23.8481 53.1861 23.4254 59.2446C23.0027 65.3021 23.2638 71.2247 24.3113 76.1883C24.9241 79.0922 25.809 81.6819 26.9936 83.7798ZM29.3916 86.2218C27.2356 83.9806 25.7198 80.428 24.8034 76.0857C23.7678 71.1782 23.5065 65.3032 23.9269 59.2777C24.3472 53.2532 25.4484 47.0877 27.1316 41.6009C28.8158 36.1107 31.0778 31.3166 33.81 28.0218L33.866 27.9543L33.8672 27.867C33.9391 22.259 37.4335 18.0668 42.5263 15.5307C47.623 12.9927 54.2955 12.131 60.6314 13.1936C64.2807 13.8057 67.8085 15.0543 70.8547 16.9803C72.0807 18.5872 72.9856 20.5071 73.4708 22.7481C74.7573 28.6912 73.1036 36.9453 66.5484 47.686L66.5163 47.7385L66.5126 47.7996C66.2964 51.3271 66.33 54.7302 66.3789 57.9913C66.3826 58.2373 66.3864 58.4824 66.3901 58.7267C66.4363 61.7248 66.4806 64.5979 66.3393 67.347C66.0343 73.284 64.865 78.6058 61.007 83.2649C52.1908 91.5285 39.6704 91.4856 29.3916 86.2218ZM52.7019 90.8343C44.5671 92.2087 36.1804 91.4087 30.8271 87.4633C40.9137 91.9819 52.8249 91.6283 61.364 83.6145L61.3754 83.6038L61.3854 83.5918C65.3495 78.8115 66.5336 73.3615 66.8414 67.3712C66.9835 64.6049 66.939 61.7156 66.8929 58.7215C66.8891 58.476 66.8853 58.2298 66.8816 57.9829C66.833 54.7406 66.7999 51.3747 67.0107 47.8897C73.571 37.1225 75.2849 28.7521 73.9624 22.643C73.5645 20.8053 72.893 19.1769 72.0003 17.7535C73.7735 19.0302 75.3517 20.5593 76.6538 22.3498C80.3662 27.4544 81.8631 34.7227 79.1866 44.4238C78.2549 47.1052 77.9251 50.122 77.822 53.2776C77.7584 55.2255 77.7813 57.2417 77.8043 59.2693C77.8186 60.5222 77.8328 61.7795 77.8268 63.0277C77.7949 69.5968 77.2007 75.989 73.1861 80.8301C69.1638 85.6806 61.1166 89.4127 52.7019 90.8343Z", fill: "#00090F" }), /* @__PURE__ */ react_default.createElement("path", { d: "M26.9936 83.7798C25.4254 81.526 24.2862 78.4488 23.5471 74.8403C22.5156 69.8046 22.2722 63.7776 22.7024 57.6208C23.1326 51.465 24.2356 45.1891 25.8911 39.6575C27.5478 34.1218 29.7523 29.3505 32.3744 26.1886L32.4024 26.1548L32.4171 26.1136C34.6444 19.8851 39.5187 15.4489 45.1857 12.9669C50.8554 10.4837 57.2988 9.96562 62.6371 11.554C65.4373 12.3872 67.9311 13.7984 69.8536 15.8097C67.0517 14.2661 63.9247 13.2415 60.7165 12.7034C54.2889 11.6254 47.5057 12.4949 42.301 15.0867C37.1183 17.6675 33.4759 21.9734 33.3658 27.7745C30.6005 31.137 28.3333 35.9718 26.6505 41.4574C24.9553 46.9833 23.8481 53.1861 23.4254 59.2446C23.0027 65.3021 23.2638 71.2247 24.3113 76.1883C24.9241 79.0922 25.809 81.6819 26.9936 83.7798ZM29.3916 86.2218C27.2356 83.9806 25.7198 80.428 24.8034 76.0857C23.7678 71.1782 23.5065 65.3032 23.9269 59.2777C24.3472 53.2532 25.4484 47.0877 27.1316 41.6009C28.8158 36.1107 31.0778 31.3166 33.81 28.0218L33.866 27.9543L33.8672 27.867C33.9391 22.259 37.4335 18.0668 42.5263 15.5307C47.623 12.9927 54.2955 12.131 60.6314 13.1936C64.2807 13.8057 67.8085 15.0543 70.8547 16.9803C72.0807 18.5872 72.9856 20.5071 73.4708 22.7481C74.7573 28.6912 73.1036 36.9453 66.5484 47.686L66.5163 47.7385L66.5126 47.7996C66.2964 51.3271 66.33 54.7302 66.3789 57.9913C66.3826 58.2373 66.3864 58.4824 66.3901 58.7267C66.4363 61.7248 66.4806 64.5979 66.3393 67.347C66.0343 73.284 64.865 78.6058 61.007 83.2649C52.1908 91.5285 39.6704 91.4856 29.3916 86.2218ZM52.7019 90.8343C44.5671 92.2087 36.1804 91.4087 30.8271 87.4633C40.9137 91.9819 52.8249 91.6283 61.364 83.6145L61.3754 83.6038L61.3854 83.5918C65.3495 78.8115 66.5336 73.3615 66.8414 67.3712C66.9835 64.6049 66.939 61.7156 66.8929 58.7215C66.8891 58.476 66.8853 58.2298 66.8816 57.9829C66.833 54.7406 66.7999 51.3747 67.0107 47.8897C73.571 37.1225 75.2849 28.7521 73.9624 22.643C73.5645 20.8053 72.893 19.1769 72.0003 17.7535C73.7735 19.0302 75.3517 20.5593 76.6538 22.3498C80.3662 27.4544 81.8631 34.7227 79.1866 44.4238C78.2549 47.1052 77.9251 50.122 77.822 53.2776C77.7584 55.2255 77.7813 57.2417 77.8043 59.2693C77.8186 60.5222 77.8328 61.7795 77.8268 63.0277C77.7949 69.5968 77.2007 75.989 73.1861 80.8301C69.1638 85.6806 61.1166 89.4127 52.7019 90.8343Z", fill: "url(#paint0_linear)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M26.9936 83.7798C25.4254 81.526 24.2862 78.4488 23.5471 74.8403C22.5156 69.8046 22.2722 63.7776 22.7024 57.6208C23.1326 51.465 24.2356 45.1891 25.8911 39.6575C27.5478 34.1218 29.7523 29.3505 32.3744 26.1886L32.4024 26.1548L32.4171 26.1136C34.6444 19.8851 39.5187 15.4489 45.1857 12.9669C50.8554 10.4837 57.2988 9.96562 62.6371 11.554C65.4373 12.3872 67.9311 13.7984 69.8536 15.8097C67.0517 14.2661 63.9247 13.2415 60.7165 12.7034C54.2889 11.6254 47.5057 12.4949 42.301 15.0867C37.1183 17.6675 33.4759 21.9734 33.3658 27.7745C30.6005 31.137 28.3333 35.9718 26.6505 41.4574C24.9553 46.9833 23.8481 53.1861 23.4254 59.2446C23.0027 65.3021 23.2638 71.2247 24.3113 76.1883C24.9241 79.0922 25.809 81.6819 26.9936 83.7798ZM29.3916 86.2218C27.2356 83.9806 25.7198 80.428 24.8034 76.0857C23.7678 71.1782 23.5065 65.3032 23.9269 59.2777C24.3472 53.2532 25.4484 47.0877 27.1316 41.6009C28.8158 36.1107 31.0778 31.3166 33.81 28.0218L33.866 27.9543L33.8672 27.867C33.9391 22.259 37.4335 18.0668 42.5263 15.5307C47.623 12.9927 54.2955 12.131 60.6314 13.1936C64.2807 13.8057 67.8085 15.0543 70.8547 16.9803C72.0807 18.5872 72.9856 20.5071 73.4708 22.7481C74.7573 28.6912 73.1036 36.9453 66.5484 47.686L66.5163 47.7385L66.5126 47.7996C66.2964 51.3271 66.33 54.7302 66.3789 57.9913C66.3826 58.2373 66.3864 58.4824 66.3901 58.7267C66.4363 61.7248 66.4806 64.5979 66.3393 67.347C66.0343 73.284 64.865 78.6058 61.007 83.2649C52.1908 91.5285 39.6704 91.4856 29.3916 86.2218ZM52.7019 90.8343C44.5671 92.2087 36.1804 91.4087 30.8271 87.4633C40.9137 91.9819 52.8249 91.6283 61.364 83.6145L61.3754 83.6038L61.3854 83.5918C65.3495 78.8115 66.5336 73.3615 66.8414 67.3712C66.9835 64.6049 66.939 61.7156 66.8929 58.7215C66.8891 58.476 66.8853 58.2298 66.8816 57.9829C66.833 54.7406 66.7999 51.3747 67.0107 47.8897C73.571 37.1225 75.2849 28.7521 73.9624 22.643C73.5645 20.8053 72.893 19.1769 72.0003 17.7535C73.7735 19.0302 75.3517 20.5593 76.6538 22.3498C80.3662 27.4544 81.8631 34.7227 79.1866 44.4238C78.2549 47.1052 77.9251 50.122 77.822 53.2776C77.7584 55.2255 77.7813 57.2417 77.8043 59.2693C77.8186 60.5222 77.8328 61.7795 77.8268 63.0277C77.7949 69.5968 77.2007 75.989 73.1861 80.8301C69.1638 85.6806 61.1166 89.4127 52.7019 90.8343Z", stroke: "black", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("g", { filter: "url(#filter0_d)" }, /* @__PURE__ */ react_default.createElement("path", { d: "M66.7635 47.8141C65.9014 61.8826 69.0213 73.9921 61.1912 83.4343C52.1711 91.8995 39.3291 91.7402 28.9132 86.2544C17.9362 77.3573 21.5704 38.8254 32.1802 26.0312C41.1979 0.81291 93.0476 4.74773 66.7635 47.8141Z", fill: "#FFDAAE" }), /* @__PURE__ */ react_default.createElement("path", { d: "M66.5484 47.686L66.5163 47.7385L66.5126 47.7996C66.2964 51.3271 66.33 54.7302 66.3789 57.9914C66.3826 58.2373 66.3864 58.4824 66.3901 58.7267C66.4363 61.7248 66.4806 64.598 66.3393 67.347C66.0343 73.284 64.865 78.6058 61.007 83.2649C52.094 91.6193 39.395 91.4836 29.0537 86.0465C26.3875 83.8735 24.5781 79.8737 23.5471 74.8403C22.5156 69.8046 22.2722 63.7776 22.7024 57.6208C23.1326 51.465 24.2356 45.1891 25.8911 39.6575C27.5478 34.1218 29.7523 29.3505 32.3744 26.1886L32.4024 26.1548L32.4171 26.1136C34.6444 19.8851 39.5187 15.4489 45.1857 12.9669C50.8554 10.4837 57.2988 9.96562 62.6371 11.554C67.9675 13.14 72.1875 16.8205 73.4708 22.7481C74.7573 28.6912 73.1036 36.9453 66.5484 47.686Z", stroke: "#0A0A0A", strokeWidth: "0.5" })), /* @__PURE__ */ react_default.createElement("g", { filter: "url(#filter1_d)" }, /* @__PURE__ */ react_default.createElement("line", { y1: "-0.125", x2: "19.8557", y2: "-0.125", transform: "matrix(0.99225 -0.137652 0.173912 0.982961 33.1741 78.5916)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ react_default.createElement("g", { filter: "url(#filter2_d)" }, /* @__PURE__ */ react_default.createElement("line", { y1: "-0.125", x2: "20.3124", y2: "-0.125", transform: "matrix(0.991024 -0.146111 0.182398 0.98144 33.1637 69.7397)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ react_default.createElement("g", { filter: "url(#filter3_d)" }, /* @__PURE__ */ react_default.createElement("line", { y1: "-0.125", x2: "20.3124", y2: "-0.125", transform: "matrix(0.991024 -0.146111 0.182398 0.98144 34.7578 60.917)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ react_default.createElement("g", { filter: "url(#filter4_d)" }, /* @__PURE__ */ react_default.createElement("line", { y1: "-0.125", x2: "20.3124", y2: "-0.125", transform: "matrix(0.991024 -0.146112 0.182397 0.98144 36.0442 52.1494)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ react_default.createElement("g", { filter: "url(#filter5_d)" }, /* @__PURE__ */ react_default.createElement("line", { y1: "-0.125", x2: "38.568", y2: "-0.125", transform: "matrix(0.175504 -0.982432 0.981683 0.200291 36.5092 82.8962)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ react_default.createElement("g", { filter: "url(#filter6_d)" }, /* @__PURE__ */ react_default.createElement("line", { y1: "-0.125", x2: "38.067", y2: "-0.125", transform: "matrix(0.164387 -0.984346 0.983775 0.189794 44.8636 84.5642)", stroke: "#002540", strokeWidth: "0.25" })), /* @__PURE__ */ react_default.createElement("path", { d: "M49.2138 20.1738C46.9644 19.7261 45.7307 20.8571 44.8722 21.7876C45.407 22.4447 46.8621 23.8357 48.4045 24.1427C49.9469 24.4497 52.1011 24.0525 52.9056 23.3866C52.5057 22.068 51.3336 20.5957 49.2138 20.1738Z", stroke: "black" }), /* @__PURE__ */ react_default.createElement("mask", { id: "path-14-inside-1", fill: "white" }, /* @__PURE__ */ react_default.createElement("ellipse", { rx: "1.01839", ry: "1.01835", transform: "matrix(0.986125 0.196328 -0.198641 0.974457 47.6494 21.8588)" })), /* @__PURE__ */ react_default.createElement("path", { d: "M47.1744 21.7642C47.2273 21.505 47.4828 21.3372 47.7451 21.3894L47.1491 24.3128C48.5207 24.5859 49.8565 23.7086 50.1328 22.3532L47.1744 21.7642ZM47.7451 21.3894C48.0073 21.4417 48.1772 21.6941 48.1243 21.9533L45.1659 21.3644C44.8896 22.7197 45.7776 24.0398 47.1491 24.3128L47.7451 21.3894ZM48.1243 21.9533C48.0715 22.2126 47.816 22.3803 47.5537 22.3281L48.1496 19.4048C46.7781 19.1317 45.4422 20.009 45.1659 21.3644L48.1243 21.9533ZM47.5537 22.3281C47.2915 22.2759 47.1216 22.0235 47.1744 21.7642L50.1328 22.3532C50.4091 20.9978 49.5212 19.6778 48.1496 19.4048L47.5537 22.3281Z", fill: "black", mask: "url(#path-14-inside-1)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M62.2857 21.3483C60.0364 20.9006 58.8026 22.0317 57.9441 22.9622C58.4789 23.6193 59.9341 25.0103 61.4765 25.3173C63.0189 25.6243 65.1731 25.2271 65.9776 24.5612C65.5777 23.2426 64.4056 21.7703 62.2857 21.3483Z", stroke: "black" }), /* @__PURE__ */ react_default.createElement("mask", { id: "path-17-inside-2", fill: "white" }, /* @__PURE__ */ react_default.createElement("ellipse", { rx: "1.01839", ry: "1.01835", transform: "matrix(0.986125 0.196328 -0.198641 0.974457 60.7213 23.0333)" })), /* @__PURE__ */ react_default.createElement("path", { d: "M60.2464 22.9388C60.2993 22.6795 60.5548 22.5118 60.817 22.564L60.2211 25.4874C61.5926 25.7604 62.9285 24.8831 63.2048 23.5278L60.2464 22.9388ZM60.817 22.564C61.0793 22.6162 61.2491 22.8686 61.1963 23.1279L58.2379 22.5389C57.9616 23.8943 58.8496 25.2143 60.2211 25.4874L60.817 22.564ZM61.1963 23.1279C61.1434 23.3872 60.8879 23.5549 60.6257 23.5027L61.2216 20.5793C59.8501 20.3063 58.5142 21.1835 58.2379 22.5389L61.1963 23.1279ZM60.6257 23.5027C60.3634 23.4505 60.1936 23.198 60.2464 22.9388L63.2048 23.5278C63.4811 22.1724 62.5931 20.8524 61.2216 20.5793L60.6257 23.5027Z", fill: "black", mask: "url(#path-17-inside-2)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M55.1993 24.8215L51.5208 27.443L50.8515 30.2006", stroke: "black" }), /* @__PURE__ */ react_default.createElement("ellipse", { rx: "3.30062", ry: "3.81835", transform: "matrix(0.971768 0.25679 -0.259902 0.960306 49.3348 36.0427)", fill: "#0B0B0B" }), /* @__PURE__ */ react_default.createElement("line", { y1: "-2", x2: "22.0374", y2: "-2", transform: "matrix(-0.865141 0.508647 -0.513608 -0.853839 90.1277 43.4041)", stroke: "black", strokeWidth: "4" }), /* @__PURE__ */ react_default.createElement("line", { y1: "-2", x2: "37.4541", y2: "-2", transform: "matrix(-0.786693 -0.617627 0.626127 -0.779496 90.7851 44.7039)", stroke: "black", strokeWidth: "4" }), /* @__PURE__ */ react_default.createElement("line", { y1: "-2", x2: "24.946", y2: "-2", transform: "matrix(0.861194 -0.515172 0.263521 0.959152 18.4058 34.8635)", stroke: "black", strokeWidth: "4" }), /* @__PURE__ */ react_default.createElement("defs", null, /* @__PURE__ */ react_default.createElement("filter", { id: "filter0_d", x: "18.2485", y: "10.3994", width: "59.8773", height: "87.7246", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ react_default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ react_default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ react_default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ react_default.createElement("filter", { id: "filter1_d", x: "29.1307", y: "75.6125", width: "27.7453", height: "10.9789", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ react_default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ react_default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ react_default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ react_default.createElement("filter", { id: "filter2_d", x: "29.1181", y: "66.5266", width: "28.1757", height: "11.2132", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ react_default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ react_default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ react_default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ react_default.createElement("filter", { id: "filter3_d", x: "30.7122", y: "57.7039", width: "28.1757", height: "11.2132", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ react_default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ react_default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ react_default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ react_default.createElement("filter", { id: "filter4_d", x: "31.9986", y: "48.9363", width: "28.1757", height: "11.2133", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ react_default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ react_default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ react_default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ react_default.createElement("filter", { id: "filter5_d", x: "32.2638", y: "44.9558", width: "15.0143", height: "45.9405", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ react_default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ react_default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ react_default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ react_default.createElement("filter", { id: "filter6_d", x: "40.6176", y: "47.0457", width: "14.5037", height: "45.5186", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ react_default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ react_default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ react_default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ react_default.createElement("linearGradient", { id: "paint0_linear", x1: "-22.3171", y1: "36.4033", x2: "105.851", y2: "59.8025", gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ react_default.createElement("stop", { stopColor: "#8A2E28" }), /* @__PURE__ */ react_default.createElement("stop", { offset: "1", stopColor: "white", stopOpacity: "0" }))));
  };
  var YellowMitoFolk_default = YellowMitoFolk;

  // src/mito/utils/pro.tsx
  var unsafeDoNotUseElsewhereHash = (str) => {
    let hash = 0;
    for (let i = 0; i < str.length; i++) {
      const char = str.charCodeAt(i);
      hash = (hash << 5) - hash + char;
      hash = hash & hash;
    }
    return hash;
  };
  var checkProAccessCode = (accessCode) => {
    return unsafeDoNotUseElsewhereHash(accessCode) == 1979576830;
  };

  // src/mito/components/elements/Experiment.tsx
  init_react();

  // src/mito/utils/experiments.tsx
  var isExperimentActive = (analysisData, experimentID) => {
    var _a;
    return ((_a = analysisData.experiment) == null ? void 0 : _a.experiment_id) === experimentID;
  };
  var isVariantA = (analysisData) => {
    var _a;
    return ((_a = analysisData.experiment) == null ? void 0 : _a.variant) === "A";
  };

  // src/mito/components/elements/Experiment.tsx
  var Experiment = (props) => {
    if (!isExperimentActive(props.analysisData, props.experimentID)) {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, props.aElement);
    } else {
      if (isVariantA(props.analysisData)) {
        return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, props.aElement);
      } else {
        return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, props.bElement);
      }
    }
  };
  var Experiment_default = Experiment;

  // src/mito/components/modals/SignupModal.tsx
  var FirstQuestion = "Your Company/Organization";
  var FirstPlaceholder = "AppleSoftBook";
  var StepOne = (props) => {
    const onSubmit = (e) => __async(void 0, null, function* () {
      e.preventDefault();
      yield props.mitoAPI.updateSignUp(props.email);
      props.next();
    });
    return /* @__PURE__ */ react_default.createElement("div", { className: "signup-modal-left-column" }, /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement("h1", { className: "text-header-1", style: { margin: 0 } }, "Sign Up for Mito"), /* @__PURE__ */ react_default.createElement("p", { className: "signup-modal-text", style: { marginTop: "10px" } }, "We'll send you product updates, relevant documentation, and case studies.")), /* @__PURE__ */ react_default.createElement("form", { className: "signup-modal-email-form", onSubmit }, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1", style: { marginTop: "10px", marginBottom: 0 } }, "Work Email"), /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        value: props.email,
        onChange: (event) => {
          props.setEmail(event.target.value);
        },
        type: "email",
        width: "large",
        placeholder: "jake.diamond@apple.com",
        required: true,
        autoFocus: true
      }
    ), /* @__PURE__ */ react_default.createElement("label", null, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1", style: { marginTop: "10px", marginBottom: 0 } }, FirstQuestion)), /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        value: props.firstResponse,
        onChange: (e) => {
          props.setFirstResponse(e.target.value);
        },
        placeholder: FirstPlaceholder,
        required: true,
        style: { marginBottom: "10px" }
      }
    ), /* @__PURE__ */ react_default.createElement("div", { className: "mt-10px", style: { marginTop: "10px" } }, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "large",
        type: "submit"
      },
      "Sign Up"
    ))));
  };
  var StepTwo = (props) => {
    const [isPro, setIsPro] = useState(props.isPro);
    const [enteringProAccessCode, setEnteringProAccessCode] = useState(false);
    const [accessCode, setAccessCode] = useState("");
    const [invalidAccessCode, setInvalidAccessCode] = useState(false);
    const attemptSubmitAccessCode = () => {
      if (!checkProAccessCode(accessCode)) {
        setInvalidAccessCode(true);
        return;
      }
      setInvalidAccessCode(false);
      setEnteringProAccessCode(false);
      setIsPro(true);
      void props.mitoAPI.log("signup_completed_pro", { "location": "signup" });
      void props.mitoAPI.updateGoPro();
      props.next();
    };
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, !enteringProAccessCode && /* @__PURE__ */ react_default.createElement("div", { className: "signup-modal-left-column" }, /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement("h1", { className: "text-header-1", style: { marginTop: 0, marginBottom: 0 } }, isPro ? "You've Signed up for Mito Pro!" : "Want More Power? Consider Mito Pro"), /* @__PURE__ */ react_default.createElement("p", { className: "signup-modal-text", style: { marginTop: "10px" } }, isPro ? "Thanks for being a Mito Pro user! Paying for Mito gets you access to advanced functionality and turns off telemetry. In turn, it allows us to fund Mito's development." : "Mito Pro gives you access to advanced functionality, and allows you to turn off telemetry. It also allows us to continue to fund Mito's development!")), !isPro && /* @__PURE__ */ react_default.createElement("div", { className: "signup-modal-buttons", style: { marginTop: "10px" } }, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "light",
        width: "small",
        onClick: props.back
      },
      "Back"
    ), /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "small",
        href: "https://trymito.io/plans",
        target: "_blank",
        onClick: () => {
          setEnteringProAccessCode(true);
          void props.mitoAPI.log("signup_clicked_pro");
        }
      },
      "See Plans"
    ), /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "small",
        onClick: props.next,
        autoFocus: true
      },
      /* @__PURE__ */ react_default.createElement(Experiment_default, { analysisData: props.analysisData, experimentID: "title_name", aElement: "No Thanks", bElement: "Skip" })
    )), isPro && /* @__PURE__ */ react_default.createElement("div", { className: "signup-modal-buttons", style: { marginTop: "10px" } }, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "light",
        width: "small",
        onClick: props.back
      },
      "Back"
    ), /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "small",
        onClick: props.next,
        autoFocus: true
      },
      "Continue"
    ))), enteringProAccessCode && /* @__PURE__ */ react_default.createElement("div", { className: "signup-modal-left-column" }, /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement("h1", { className: "text-header-1", style: { marginTop: 0, marginBottom: 0 } }, "Access Pro"), /* @__PURE__ */ react_default.createElement("p", { className: "signup-modal-text" }, "Complete the checkout flow. In the Pro documentation, click ", /* @__PURE__ */ react_default.createElement("b", null, "Get Access Code"), " and enter it here."), /* @__PURE__ */ react_default.createElement("label", null, /* @__PURE__ */ react_default.createElement("h3", { className: "text-header-2", style: { marginTop: "5px", marginBottom: 0 } }, "Access Code:")), /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        placeholder: "mito-pro-access-code-XXXXXXXXXXXX",
        value: accessCode,
        onChange: (e) => {
          setAccessCode(e.target.value);
        },
        onKeyDown: (e) => {
          if (e.key === "Enter") {
            attemptSubmitAccessCode();
          }
        }
      }
    ), invalidAccessCode && /* @__PURE__ */ react_default.createElement("p", { className: "signup-modal-text signup-modal-text-error" }, "Invalid access code")), /* @__PURE__ */ react_default.createElement("div", { className: "signup-modal-buttons", style: { marginTop: "10px" } }, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "light",
        width: "small",
        onClick: () => {
          setEnteringProAccessCode(false);
        }
      },
      "Back"
    ), /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "small",
        onClick: attemptSubmitAccessCode,
        autoFocus: true
      },
      "Submit"
    ))));
  };
  var StepThree = (props) => {
    const onSubmit = () => __async(void 0, null, function* () {
      yield props.mitoAPI.updateFeedback("company/organization" /* COMPANY */, props.numUsages, [{ "question": FirstQuestion, "answer": props.firstResponse }]);
      props.next();
    });
    return /* @__PURE__ */ react_default.createElement("div", { className: "signup-modal-left-column" }, /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement("h1", { className: "text-header-1", style: { marginTop: 0, marginBottom: 0 } }, props.isPro && `Mito Pro is Totally Private`, !props.isPro && `Mito is Built for Privacy`), /* @__PURE__ */ react_default.createElement("p", { className: "signup-modal-text", style: { marginTop: "10px" } }, props.isPro && `As a Mito Pro user, no data leaves your computer, ever. Check out our CCPA compliant privacy policy`, !props.isPro && `We make sure none of your private data leaves your computer. Read our CCPA compliant privacy policy`, " ", " ", /* @__PURE__ */ react_default.createElement("a", { className: "text-link", href: "https://privacy.trymito.io/privacy-policy", target: "_blank", rel: "noreferrer" }, /* @__PURE__ */ react_default.createElement("u", null, "here")), ".")), /* @__PURE__ */ react_default.createElement("div", { className: "signup-modal-buttons", style: { marginTop: "10px" } }, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "light",
        width: "small",
        onClick: props.back
      },
      "Back"
    ), /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "small",
        onClick: onSubmit,
        autoFocus: true
      },
      "Accept"
    )));
  };
  var SignupModal = (props) => {
    const [step, setStep] = useState(1);
    const [email, setEmail] = useState("");
    const [firstResponse, setFirstResponse] = useState("");
    const next = () => {
      if (step + 1 > 3) {
        props.setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            currOpenModal: { type: "None" /* None */ },
            currOpenTaskpanel: { type: "import files" /* IMPORT_FILES */ }
          });
        });
        void props.mitoAPI.log("finished_signup");
      } else {
        const newStep = Math.min(step + 1, 3);
        setStep(newStep);
        void props.mitoAPI.log(
          "switched_signup_step",
          {
            "old_signup_step": step,
            "new_signup_step": newStep
          }
        );
      }
    };
    const back = () => {
      const newStep = Math.max(step - 1, 0);
      setStep(newStep);
      void props.mitoAPI.log(
        "switched_signup_step",
        {
          "old_signup_step": step,
          "new_signup_step": newStep
        }
      );
    };
    const backgroundColors = {
      1: "#FFEBEB",
      2: "#F0C5BB",
      3: "#FFDAAE"
    };
    return /* @__PURE__ */ react_default.createElement("div", { className: "overlay" }, /* @__PURE__ */ react_default.createElement("div", { className: classNames("signup-modal-container") }, /* @__PURE__ */ react_default.createElement("div", { className: "signup-modal-left-column-container" }, step === 1 && /* @__PURE__ */ react_default.createElement(
      StepOne,
      {
        next,
        email,
        setEmail,
        firstResponse,
        setFirstResponse,
        mitoAPI: props.mitoAPI
      }
    ), step === 2 && /* @__PURE__ */ react_default.createElement(
      StepTwo,
      {
        next,
        back,
        isPro: props.isPro,
        mitoAPI: props.mitoAPI,
        analysisData: props.analysisData
      }
    ), step === 3 && /* @__PURE__ */ react_default.createElement(
      StepThree,
      {
        next,
        back,
        firstResponse,
        numUsages: props.numUsages,
        mitoAPI: props.mitoAPI,
        isPro: props.isPro
      }
    )), /* @__PURE__ */ react_default.createElement("div", { className: "signup-modal-right-column-container", style: { backgroundColor: backgroundColors[step] } }, step === 1 && /* @__PURE__ */ react_default.createElement(PinkMitoFolk_default, null), step === 2 && /* @__PURE__ */ react_default.createElement(BlueMitoFolk_default, null), step === 3 && /* @__PURE__ */ react_default.createElement(YellowMitoFolk_default, null))));
  };
  var SignupModal_default = SignupModal;

  // src/mito/components/taskpanes/AITransformation/AITransformationTaskpane.tsx
  init_react();

  // src/mito/hooks/useSendEditOnClickNoParams.tsx
  function useSendEditOnClickNoParams(stepType, mitoAPI, analysisData) {
    const editEvent = stepType + "_edit";
    const edit = (params) => __async(this, null, function* () {
      const newStepID = getRandomId();
      const possibleError = yield mitoAPI._edit(editEvent, params, newStepID);
      if ("error" in possibleError) {
        return possibleError.error;
      }
    });
    const steps = analysisData.stepSummaryList.filter((step) => step.step_type === stepType);
    const previousParamsAndResults = steps.map((step) => {
      return {
        params: step.params,
        results: step.result
      };
    });
    return {
      edit,
      previousParamsAndResults
    };
  }
  var useSendEditOnClickNoParams_default = useSendEditOnClickNoParams;

  // src/mito/components/icons/SendArrowIcon.tsx
  init_react();
  var SendArrowIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "20", height: "17", viewBox: "0 0 20 17", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M12.7509 16.5995L19.5985 9.75201C20.1339 9.21791 20.1339 8.34964 19.5985 7.81553L12.7509 0.968013C12.2155 0.432537 11.3486 0.432537 10.8145 0.968013C10.2803 1.50349 10.279 2.37039 10.8145 2.90449L15.3242 7.41427H2.19616C1.4402 7.41427 0.82666 8.02781 0.82666 8.78377C0.82666 9.53974 1.4402 10.1533 2.19616 10.1533H15.3242L10.8145 14.6631C10.5474 14.9301 10.4132 15.2807 10.4132 15.6313C10.4132 15.9819 10.5474 16.3325 10.8145 16.5995C11.3499 17.135 12.2168 17.135 12.7509 16.5995Z", fill: "var(--mito-text)" }));
  };
  var SendArrowIcon_default = SendArrowIcon;

  // src/mito/components/taskpanes/AITransformation/AITransformationExamplesSection.tsx
  init_react();
  var getExample = (userInput, setUserInput, chatInputRef) => {
    return /* @__PURE__ */ react_default.createElement(
      Row_default,
      {
        onClick: () => {
          var _a;
          setUserInput(userInput);
          (_a = chatInputRef.current) == null ? void 0 : _a.focus();
        },
        justify: "center",
        align: "center",
        className: "ai-transformation-example"
      },
      /* @__PURE__ */ react_default.createElement("p", null, userInput)
    );
  };
  var getFirstColumnInSheet = (sheetDataArray, selectedSheetIndex) => {
    var _a;
    return sheetDataArray.length === 0 ? void 0 : (_a = sheetDataArray[selectedSheetIndex].data[0]) == null ? void 0 : _a.columnHeader;
  };
  var getDateColumnThatIsString = (sheetDataArray, selectedSheetIndex) => {
    var _a;
    return sheetDataArray.length === 0 ? void 0 : (_a = sheetDataArray[selectedSheetIndex].data.find((column) => {
      return isStringDtype(column.columnDtype) && getDisplayColumnHeader(column.columnHeader).toLowerCase().includes("date");
    })) == null ? void 0 : _a.columnHeader;
  };
  var getNumberColumnThatIsString = (sheetDataArray, selectedSheetIndex) => {
    var _a;
    return sheetDataArray.length === 0 ? void 0 : (_a = sheetDataArray[selectedSheetIndex].data.find((column) => {
      return isStringDtype(column.columnDtype) && getDisplayColumnHeader(column.columnHeader).toLowerCase().includes("number");
    })) == null ? void 0 : _a.columnHeader;
  };
  var getFirstColumnThatIsString = (sheetDataArray, selectedSheetIndex) => {
    var _a;
    return sheetDataArray.length === 0 ? void 0 : (_a = sheetDataArray[selectedSheetIndex].data.find((column) => {
      return isStringDtype(column.columnDtype);
    })) == null ? void 0 : _a.columnHeader;
  };
  var getFirstColumnThatIsNumber = (sheetDataArray, selectedSheetIndex) => {
    var _a;
    return sheetDataArray.length === 0 ? void 0 : (_a = sheetDataArray[selectedSheetIndex].data.find((column) => {
      return isNumberDtype(column.columnDtype);
    })) == null ? void 0 : _a.columnHeader;
  };
  var getFirstColumnThatIsDate = (sheetDataArray, selectedSheetIndex) => {
    var _a;
    return sheetDataArray.length === 0 ? void 0 : (_a = sheetDataArray[selectedSheetIndex].data.find((column) => {
      return isDatetimeDtype(column.columnDtype);
    })) == null ? void 0 : _a.columnHeader;
  };
  var AITransformationExamplesSection = (props) => {
    const firstColumnInSheet = getFirstColumnInSheet(props.sheetDataArray, props.selectedSheetIndex);
    const firstDateColumnThatIsString = getDateColumnThatIsString(props.sheetDataArray, props.selectedSheetIndex);
    const firstNumberColumnThatIsString = getNumberColumnThatIsString(props.sheetDataArray, props.selectedSheetIndex);
    const firstColumnThatIsString = getFirstColumnThatIsString(props.sheetDataArray, props.selectedSheetIndex);
    const firstColumnThatIsNumber = getFirstColumnThatIsNumber(props.sheetDataArray, props.selectedSheetIndex);
    const firstColumnThatIsDate = getFirstColumnThatIsDate(props.sheetDataArray, props.selectedSheetIndex);
    const numDefinedExamples = [firstColumnInSheet, firstDateColumnThatIsString, firstNumberColumnThatIsString, firstColumnThatIsString, firstColumnThatIsNumber, firstColumnThatIsDate].filter((column) => column !== void 0).length;
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("div", { className: "mito-blue-container" }, /* @__PURE__ */ react_default.createElement("div", { className: "text-header-3" }, "Examples"), props.sheetDataArray.length === 0 ? /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, getExample("create a dataframe named df with sample data", props.setUserInput, props.chatInputRef), getExample("import the most recent csv from the current folder", props.setUserInput, props.chatInputRef)) : /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, firstColumnInSheet && getExample(`sort the column ${getDisplayColumnHeader(firstColumnInSheet)} in ascending order`, props.setUserInput, props.chatInputRef), firstDateColumnThatIsString && getExample(`convert ${getDisplayColumnHeader(firstDateColumnThatIsString)} to a datetime`, props.setUserInput, props.chatInputRef), firstNumberColumnThatIsString && getExample(`convert ${getDisplayColumnHeader(firstNumberColumnThatIsString)} to a number`, props.setUserInput, props.chatInputRef), firstColumnThatIsString && getExample(`extract the first character from ${getDisplayColumnHeader(firstColumnThatIsString)}`, props.setUserInput, props.chatInputRef), firstColumnThatIsNumber && getExample(`add 100 to ${getDisplayColumnHeader(firstColumnThatIsNumber)}`, props.setUserInput, props.chatInputRef), firstColumnThatIsDate && getExample(`extract the month from ${getDisplayColumnHeader(firstColumnThatIsDate)}`, props.setUserInput, props.chatInputRef), numDefinedExamples < 3 && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, getExample("can you delete columns with any null values", props.setUserInput, props.chatInputRef), getExample("fully capitalize column headers", props.setUserInput, props.chatInputRef))), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "center" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-subtext-1" }, "or send any message to Mito AI below."))), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 10 }));
  };
  var AITransformationExamplesSection_default = AITransformationExamplesSection;

  // src/mito/components/taskpanes/AITransformation/AITransformationResultSection.tsx
  init_react();

  // src/mito/components/icons/EyeIcon.tsx
  init_react();
  var EyeIcon = (props) => {
    if (props.variant === "selected") {
      return /* @__PURE__ */ react_default.createElement("svg", { onClick: props.onClick, width: "18", height: "11", viewBox: "0 0 18 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M8.8 0C4.9621 0 1.6346 2.2352 0 5.5C1.6346 8.7648 4.9621 11 8.8 11C12.6379 11 15.9654 8.7648 17.6 5.5C15.9654 2.2352 12.6379 0 8.8 0ZM13.1395 2.9172C14.1735 3.5772 15.0502 4.4605 15.708 5.5C15.0502 6.5406 14.1735 7.4239 13.1395 8.0828C11.8404 8.9111 10.34 9.35 8.8011 9.35C7.2622 9.35 5.7618 8.9122 4.4616 8.0828C3.4276 7.4228 2.5509 6.5395 1.8931 5.5C2.5509 4.4594 3.4276 3.5761 4.4616 2.9172C4.5287 2.8743 4.5969 2.8325 4.6651 2.7918C4.4935 3.2615 4.4 3.7686 4.4 4.2977C4.4 6.7276 6.3701 8.6977 8.8 8.6977C11.2299 8.6977 13.2 6.7276 13.2 4.2977C13.2 3.7686 13.1065 3.2615 12.9349 2.7918C13.0031 2.8325 13.0724 2.8743 13.1395 2.9172ZM8.8 3.85C8.8 4.7608 8.0608 5.5 7.15 5.5C6.2392 5.5 5.5 4.7608 5.5 3.85C5.5 2.9392 6.2392 2.2 7.15 2.2C8.0608 2.2 8.8 2.9392 8.8 3.85Z", fill: "var(--mito-highlight)" }));
    } else {
      return /* @__PURE__ */ react_default.createElement("svg", { onClick: props.onClick, width: "19", height: "11", viewBox: "0 0 19 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M9.65693 0C5.81903 0 2.49153 2.2352 0.856934 5.5C2.49153 8.7648 5.81903 11 9.65693 11C13.4948 11 16.8223 8.7648 18.4569 5.5C16.8223 2.2352 13.4948 0 9.65693 0ZM13.9964 2.9172C15.0304 3.5772 15.9071 4.4605 16.5649 5.5C15.9071 6.5406 15.0304 7.4239 13.9964 8.0828C12.6973 8.9111 11.1969 9.35 9.65803 9.35C8.11913 9.35 6.61873 8.9122 5.31853 8.0828C4.28453 7.4228 3.40783 6.5395 2.75003 5.5C3.40783 4.4594 4.28453 3.5761 5.31853 2.9172C5.38563 2.8743 5.45383 2.8325 5.52203 2.7918C5.35043 3.2615 5.25693 3.7686 5.25693 4.2977C5.25693 6.7276 7.22703 8.6977 9.65693 8.6977C12.0868 8.6977 14.0569 6.7276 14.0569 4.2977C14.0569 3.7686 13.9634 3.2615 13.7918 2.7918C13.86 2.8325 13.9293 2.8743 13.9964 2.9172ZM9.65693 3.85C9.65693 4.7608 8.91773 5.5 8.00693 5.5C7.09613 5.5 6.35693 4.7608 6.35693 3.85C6.35693 2.9392 7.09613 2.2 8.00693 2.2C8.91773 2.2 9.65693 2.9392 9.65693 3.85Z", fill: "#767180" }));
    }
  };
  var EyeIcon_default = EyeIcon;

  // src/mito/components/taskpanes/AITransformation/AITransformationResultSection.tsx
  var AITransformationResultSection = (props) => {
    const [sentFeedback, setSentFeedback] = useState(void 0);
    const result = props.result;
    if (result === void 0) {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
    }
    const logParams = {
      prompt_version: props.params.prompt_version,
      prompt: props.params.prompt.split("\n"),
      completion: props.params.completion.split("\n"),
      edited_completion: props.params.edited_completion.split("\n")
    };
    return /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: "ai-transformation-result-section"
      },
      /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 22 }, result.last_line_value !== void 0 && result.last_line_value !== null && /* @__PURE__ */ react_default.createElement("p", null, /* @__PURE__ */ react_default.createElement("span", null, "Value:"), " ", result.last_line_value), result.prints.length > 0 && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("p", null, /* @__PURE__ */ react_default.createElement("span", null, "Printed:")), /* @__PURE__ */ react_default.createElement("pre", null, result.prints)), result.created_dataframe_names.map((dfName) => {
        const sheetIndex = props.sheetDataArray.findIndex((sd) => sd.dfName === dfName);
        const sheetData = props.sheetDataArray[sheetIndex];
        const numRows = (sheetData == null ? void 0 : sheetData.numRows) || 0;
        const numColumns = (sheetData == null ? void 0 : sheetData.numColumns) || 0;
        return /* @__PURE__ */ react_default.createElement(
          "div",
          {
            key: dfName,
            onClick: () => {
              props.setUIState((prevUIState) => {
                return __spreadProps(__spreadValues({}, prevUIState), {
                  selectedSheetIndex: sheetIndex !== -1 ? sheetIndex : prevUIState.selectedSheetIndex
                });
              });
            }
          },
          /* @__PURE__ */ react_default.createElement("span", { className: classNames({ "text-color-recon-created": props.isMostRecentResult }) }, "Created:"),
          " ",
          /* @__PURE__ */ react_default.createElement("span", { className: "text-underline" }, dfName),
          "  (",
          numRows,
          " rows, ",
          numColumns,
          " columns)"
        );
      }), Object.entries(result.modified_dataframes_recons).map(([dfName, modifiedDataframeRecon]) => {
        const columnReconData = modifiedDataframeRecon.column_recon;
        const sheetIndex = props.sheetDataArray.findIndex((sd) => sd.dfName === dfName);
        const rowChange = modifiedDataframeRecon.num_added_or_removed_rows;
        const rowChangeTest = rowChange !== 0 ? rowChange < 0 ? `(Removed ${rowChange * -1} rows)` : `(Added ${rowChange} rows)` : void 0;
        return /* @__PURE__ */ react_default.createElement("div", { key: dfName }, /* @__PURE__ */ react_default.createElement(
          "div",
          {
            onClick: () => {
              props.setUIState((prevUIState) => {
                return __spreadProps(__spreadValues({}, prevUIState), {
                  selectedSheetIndex: sheetIndex !== -1 ? sheetIndex : prevUIState.selectedSheetIndex
                });
              });
            }
          },
          /* @__PURE__ */ react_default.createElement("span", { className: classNames({ "text-color-recon-modified": props.isMostRecentResult }) }, "Modified:"),
          " ",
          /* @__PURE__ */ react_default.createElement("span", { className: "text-underline" }, dfName),
          " ",
          rowChangeTest
        ), columnReconData.created_columns.map((ch, index) => {
          return /* @__PURE__ */ react_default.createElement("div", { key: dfName + "added" + index, className: "ml-5px" }, /* @__PURE__ */ react_default.createElement("span", { className: classNames({ "text-color-recon-created": props.isMostRecentResult }) }, "Added column: "), getDisplayColumnHeader(ch));
        }), columnReconData.modified_columns.map((ch, index) => {
          return /* @__PURE__ */ react_default.createElement("div", { key: dfName + "modified" + index, className: "ml-5px" }, /* @__PURE__ */ react_default.createElement("span", { className: classNames({ "text-color-recon-modified": props.isMostRecentResult }) }, "Modified column: "), getDisplayColumnHeader(ch));
        }), Object.entries(columnReconData.renamed_columns).map(([oldCh, newCh], index) => {
          return /* @__PURE__ */ react_default.createElement("div", { key: dfName + "renamed" + index, className: "ml-5px" }, /* @__PURE__ */ react_default.createElement("span", { className: classNames({ "text-color-recon-modified": props.isMostRecentResult }) }, "Renamed column: "), getDisplayColumnHeader(oldCh), " to ", getDisplayColumnHeader(newCh), " ");
        }), columnReconData.deleted_columns.map((ch, index) => {
          return /* @__PURE__ */ react_default.createElement("div", { key: dfName + "removed" + index, className: "ml-5px" }, "Deleted column: ", getDisplayColumnHeader(ch));
        }));
      }), result.deleted_dataframe_names.map((dfName) => {
        return /* @__PURE__ */ react_default.createElement("div", { key: dfName }, /* @__PURE__ */ react_default.createElement("span", null, "Deleted:"), " ", /* @__PURE__ */ react_default.createElement("span", null, dfName));
      }), (result.last_line_value === void 0 || result.last_line_value === null) && result.created_dataframe_names.length === 0 && Object.entries(result.modified_dataframes_recons).length === 0 && result.prints.length === 0 && result.deleted_dataframe_names.length === 0 && /* @__PURE__ */ react_default.createElement("p", null, "No changes")), /* @__PURE__ */ react_default.createElement(Col_default, { offset: 0.5 }, (result.created_dataframe_names.length > 0 || Object.entries(result.modified_dataframes_recons).length > 0 || result.deleted_dataframe_names.length > 0) && props.isMostRecentResult && /* @__PURE__ */ react_default.createElement(
        EyeIcon_default,
        {
          variant: props.uiState.dataRecon !== void 0 ? "selected" : "unselected",
          onClick: () => {
            props.setUIState((prevUIState) => {
              if (prevUIState.dataRecon !== void 0) {
                props.setDisplayRecon(false);
                return __spreadProps(__spreadValues({}, prevUIState), {
                  dataRecon: void 0
                });
              }
              const newDataRecon = {
                created_dataframe_names: result.created_dataframe_names,
                deleted_dataframe_names: result.deleted_dataframe_names,
                modified_dataframes_recons: result.modified_dataframes_recons
              };
              return __spreadProps(__spreadValues({}, prevUIState), {
                dataRecon: newDataRecon
              });
            });
          }
        }
      ))),
      /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", suppressTopBottomMargin: true }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2" }, "How did Mito AI Assistant do?")), /* @__PURE__ */ react_default.createElement(Col_default, { offsetRight: 0.5 }, /* @__PURE__ */ react_default.createElement(Row_default, { suppressTopBottomMargin: true }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
        "p",
        {
          className: classNames("ai-transformation-feedback-button", { "ai-transformation-feedback-button-selected": sentFeedback === "Up" }),
          onClick: () => {
            setSentFeedback("Up");
            void props.mitoAPI.log("ai_transformation_feedback", __spreadValues({
              "feedback": "Up"
            }, logParams));
          }
        },
        "\u{1F44D}"
      )), /* @__PURE__ */ react_default.createElement(Col_default, { offset: 2 }, /* @__PURE__ */ react_default.createElement(
        "p",
        {
          className: classNames("ai-transformation-feedback-button", { "ai-transformation-feedback-button-selected": sentFeedback === "Down" }),
          onClick: () => {
            setSentFeedback("Down");
            void props.mitoAPI.log("ai_transformation_feedback", __spreadValues({
              "feedback": "Down"
            }, logParams));
          }
        },
        "\u{1F44E}"
      ))))),
      sentFeedback !== void 0 && /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2" }, "Thanks for the feedback - ", sentFeedback === "Down" ? "we're working hard to improve." : "we're glad things are working well!")
    );
  };
  var AITransformationResultSection_default = AITransformationResultSection;

  // src/mito/components/icons/LoadingCircle.tsx
  init_react();
  var LoadingCircle = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("circle", { cx: "8", cy: "8", r: "7.25", fill: "#F5F5F5", stroke: "var(--mito-highlight)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("path", { d: "M15 8C15 7.0256 14.7966 6.06193 14.4027 5.17067C14.0089 4.27941 13.4333 3.48019 12.7128 2.82416L8 8H15Z", fill: "var(--mito-highlight)" }, /* @__PURE__ */ react_default.createElement(
      "animateTransform",
      {
        attributeName: "transform",
        attributeType: "XML",
        type: "rotate",
        from: "0 8 8",
        to: "360 8 8",
        dur: "1s",
        repeatCount: "indefinite"
      }
    )), /* @__PURE__ */ react_default.createElement("circle", { cx: "8", cy: "8", r: "5", fill: "white", stroke: "var(--mito-highlight)", strokeWidth: "0.5" }));
  };
  var LoadingCircle_default = LoadingCircle;

  // src/mito/hooks/useEffectOnRedo.tsx
  init_react();
  var useEffectOnRedo = (effect, analysisData) => {
    const [startingRedoCount] = useState(analysisData.redoCount);
    useEffect(() => {
      if (analysisData.redoCount > startingRedoCount) {
        effect();
      }
    }, [analysisData.redoCount]);
  };

  // src/mito/hooks/useEffectOnUndo.tsx
  init_react();
  var useEffectOnUndo = (effect, analysisData) => {
    const [startingUndoCount] = useState(analysisData.undoCount);
    useEffect(() => {
      if (analysisData.undoCount > startingUndoCount) {
        effect();
      }
    }, [analysisData.undoCount]);
  };

  // src/mito/components/taskpanes/AITransformation/AIPrivacyPolicy.tsx
  init_react();
  var AITransformationResultSection2 = (props) => {
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Mito AI",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement("p", null, "Welcome to Mito AI powered by OpenAI. Before getting started, take a second to review our privacy policy."), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 10 }), /* @__PURE__ */ react_default.createElement(CollapsibleSection_default, { title: "What data does Mito AI collect?" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2" }, "Mito AI uses the instructions you provide (the prompt) and information about your dataframe to generate code that works in the context of your analysis. Without this information, the Mito generated code will require additional customization."), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 5 }), /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2" }, "Private data that is contained in the dataframe name, column headers, or first five rows of data might be shared with Mito and OpenAI.")), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 10 }), /* @__PURE__ */ react_default.createElement(CollapsibleSection_default, { title: "How is my data used?" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2" }, "The data collected by Mito AI is used to construct a prompt for OpenAI. Mito supplements the prompt you provide with additional information about your data to give OpenAI the best chance of generating helpful code."), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 5 }), /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2" }, "The data collected is also used to improve Mito AI. Such uses include:"), /* @__PURE__ */ react_default.createElement("li", { className: "text-body-2" }, "Evaluating Mito AI to determine its effectiveness."), /* @__PURE__ */ react_default.createElement("li", { className: "text-body-2" }, "Conducting research to improve Mito AI."), /* @__PURE__ */ react_default.createElement("li", { className: "text-body-2" }, "Detecting potential abuse of Mito AI."), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 5 }), /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2" }, "Read ", /* @__PURE__ */ react_default.createElement("a", { className: "text-underline text-color-mito-highlight", href: "https://privacy.trymito.io/privacy-policy", target: "_blank", rel: "noreferrer" }, "Mito"), " and ", /* @__PURE__ */ react_default.createElement("a", { className: "text-underline text-color-mito-highlight", href: "https://openai.com/policies/privacy-policy", target: "_blank", rel: "noreferrer" }, "OpenAI\u2019s"), " privacy policy for more information.")), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 10 }), /* @__PURE__ */ react_default.createElement(CollapsibleSection_default, { title: "How can I further protect my data?" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2" }, "Mito AI uses OpenAI to generate code by default. Doing so requires sending your information to OpenAI. To further protect your data, Mito Enterprise users can connect Mito AI to a self-hosted large language model. As a result, Mito would not need to collect or share any information about your data with OpenAI. Your data will never leave your system."), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 5 }), /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2" }, "To learn more about this option, reach out to the ", /* @__PURE__ */ react_default.createElement("a", { className: "text-underline text-color-mito-highlight", href: "mailto:founders@sagacollab.com?subject=Mito Enterprise AI" }, "Mito team"), ".")), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 10 }), /* @__PURE__ */ react_default.createElement(CollapsibleSection_default, { title: "Can I use my own OpenAI API key?" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2" }, "If you want to route your completion through OpenAI servers directly, you can provide your own OpenAI API key."), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 5 }), /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2" }, "To use your own OpenAI API key, set the environment variable OPENAI_API_KEY to your OpenAI key. You can get one ", /* @__PURE__ */ react_default.createElement("a", { className: "text-underline text-color-mito-highlight", href: "https://platform.openai.com/account/api-keys", target: "_blank", rel: "noreferrer" }, "here"), ".")), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 5 })), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        onClick: () => {
          void props.mitoAPI.updateAcceptAITransformationPrivacyPolicy();
        },
        variant: "dark"
      },
      "Accept Privacy Policy"
    )));
  };
  var AIPrivacyPolicy_default = AITransformationResultSection2;

  // src/mito/components/taskpanes/AITransformation/AITransformationTaskpane.tsx
  var NUMBER_OF_ATTEMPTS_TO_GET_COMPLETION = 3;
  var LOADING_HINTS = [
    "Mito AI can transform any sheet in Mito.",
    "Unhappy with the results? Try the Undo button.",
    "Mito AI is great at parsing strings.",
    "New columns will be colored green.",
    "Modified modified columns will be colored yellow.",
    "Try breaking big prompts into smaller prompts.",
    "Make sure to verify the AI generated code is correct.",
    "Mito AI can apply a transformation to multiple columns."
  ];
  var getRandomHint = () => {
    return LOADING_HINTS[Math.floor(Math.random() * LOADING_HINTS.length)];
  };
  var AILoadingCircle = () => {
    return /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LoadingCircle_default, null));
  };
  var AITransformationTaskpane = (props) => {
    const apiKeyNotDefined = props.userProfile.openAIAPIKey === null || props.userProfile.openAIAPIKey === void 0;
    const aiPrivacyPolicyAccepted = props.userProfile.aiPrivacyPolicy;
    const [userInput, setUserInput] = useState("");
    const [taskpaneState, setTaskpaneState] = useState({ type: "default" });
    const [displayRecon, setDisplayRecon] = useState(false);
    const chatInputRef = useRef(null);
    const setChatInputRef = (element) => {
      if (chatInputRef.current === null) {
        chatInputRef.current = element;
        element == null ? void 0 : element.focus();
      }
    };
    const taskpaneBodyRef = useRef(null);
    const setTaskpaneBodyRef = (element) => {
      taskpaneBodyRef.current = element;
    };
    const { previousParamsAndResults, edit } = useSendEditOnClickNoParams_default(
      "ai_transformation" /* AiTransformation */,
      props.mitoAPI,
      props.analysisData
    );
    useEffect(() => {
      void props.mitoAPI.log("opened_ai_transformation", { apiKeyNotDefined, aiPrivacyPolicyNotAccepted: !aiPrivacyPolicyAccepted });
    }, []);
    useEffect(() => {
      if (taskpaneBodyRef.current !== null) {
        taskpaneBodyRef.current.scrollTop = taskpaneBodyRef.current.scrollHeight;
      }
      props.setUIState((prevUIState) => {
        if (previousParamsAndResults.length === 0 || !displayRecon) {
          return __spreadProps(__spreadValues({}, prevUIState), {
            dataRecon: void 0
          });
        }
        const mostRecentResults = previousParamsAndResults[previousParamsAndResults.length - 1].results;
        const newDataRecon = {
          created_dataframe_names: mostRecentResults.created_dataframe_names,
          deleted_dataframe_names: mostRecentResults.deleted_dataframe_names,
          modified_dataframes_recons: mostRecentResults.modified_dataframes_recons
        };
        return __spreadProps(__spreadValues({}, prevUIState), {
          dataRecon: newDataRecon
        });
      });
    }, [previousParamsAndResults.length, taskpaneState.type, displayRecon]);
    useEffect(() => {
      return () => {
        props.setUIState(function(prevUIState) {
          return __spreadProps(__spreadValues({}, prevUIState), {
            dataRecon: void 0
          });
        });
      };
    }, []);
    useEffect(() => {
      if (taskpaneState.type === "loading completion") {
        const interval = setInterval(() => {
          setTaskpaneState((prevTaskpaneState) => {
            if (prevTaskpaneState.type === "loading completion") {
              return __spreadProps(__spreadValues({}, prevTaskpaneState), {
                loadingMessage: getRandomHint()
              });
            }
            return prevTaskpaneState;
          });
        }, 15e3);
        return () => clearInterval(interval);
      }
    }, [taskpaneState.type]);
    useEffectOnRedo(() => {
      setTaskpaneState({ type: "default" });
    }, props.analysisData);
    useEffectOnUndo(() => {
      setTaskpaneState({ type: "default" });
    }, props.analysisData);
    const submitChatInput = (userInput2) => __async(void 0, null, function* () {
      if (userInput2 === "") {
        return;
      }
      setTaskpaneState({ type: "loading completion", userInput: userInput2, loadingMessage: getRandomHint() });
      setUserInput("");
      const selections = getSelectionForCompletion(props.uiState, props.gridState, props.sheetDataArray);
      const previousFailedCompletions = [];
      for (let i = 0; i < NUMBER_OF_ATTEMPTS_TO_GET_COMPLETION; i++) {
        const completionOrError = yield props.mitoAPI.getAICompletion(
          userInput2,
          selections,
          previousFailedCompletions
        );
        if (completionOrError === void 0 || "error" in completionOrError) {
          setTaskpaneState({ type: "error loading completion", userInput: userInput2, error: (completionOrError == null ? void 0 : completionOrError.error) || "There was an error accessing the OpenAI API. This is likely due to internet connectivity problems or a firewall." });
          return;
        } else {
          const completion = completionOrError.result;
          if ("error" in completion) {
            setTaskpaneState({ type: "error loading completion", userInput: userInput2, error: completion.error || "There was an error accessing the OpenAI API. This is likely due to internet connectivity problems or a firewall." });
            return;
          }
          setTaskpaneState({ type: "executing code", completion, userInput: userInput2 });
          const possibleError = yield edit({
            user_input: userInput2,
            prompt_version: completion.prompt_version,
            prompt: completion.prompt,
            completion: completion.completion,
            edited_completion: completion.completion
          });
          if (possibleError !== void 0) {
            setTaskpaneState({ type: "error executing code", userInput: userInput2, attempt: i, error: possibleError });
            previousFailedCompletions.push([completion.completion, possibleError]);
          } else {
            console.log("Setting success to true");
            setTaskpaneState({ type: "default" });
            setDisplayRecon(true);
            return;
          }
        }
      }
      setTaskpaneState((prevTaskpaneState) => {
        if (prevTaskpaneState.type === "error executing code") {
          return __spreadProps(__spreadValues({}, prevTaskpaneState), { attempt: prevTaskpaneState.attempt + 1 });
        } else {
          return prevTaskpaneState;
        }
      });
    });
    const chatHeight = getChatHeight(userInput, chatInputRef);
    const shouldDisplayExamples = previousParamsAndResults.length === 0 && taskpaneState.type === "default";
    if (!aiPrivacyPolicyAccepted) {
      return /* @__PURE__ */ react_default.createElement(AIPrivacyPolicy_default, { mitoAPI: props.mitoAPI, setUIState: props.setUIState });
    }
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Mito AI",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, { setRef: setTaskpaneBodyRef }, shouldDisplayExamples && /* @__PURE__ */ react_default.createElement(
      AITransformationExamplesSection_default,
      {
        selectedSheetIndex: props.uiState.selectedSheetIndex,
        sheetDataArray: props.sheetDataArray,
        setUserInput,
        previousParamsAndResults,
        chatInputRef
      }
    ), /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: "ai-transformation-chat-container"
      },
      previousParamsAndResults.map((paramAndResult, idx) => {
        return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
          Row_default,
          {
            justify: "start",
            align: "center",
            className: "ai-transformation-message ai-transformation-message-user"
          },
          /* @__PURE__ */ react_default.createElement("p", null, paramAndResult.params.user_input)
        ), /* @__PURE__ */ react_default.createElement(
          Row_default,
          {
            justify: "start",
            align: "center",
            className: "ai-transformation-message ai-transformation-message-ai"
          },
          /* @__PURE__ */ react_default.createElement(
            AITransformationResultSection_default,
            {
              uiState: props.uiState,
              setUIState: props.setUIState,
              result: paramAndResult.results,
              sheetDataArray: props.sheetDataArray,
              mitoAPI: props.mitoAPI,
              params: paramAndResult.params,
              isMostRecentResult: idx === previousParamsAndResults.length - 1,
              setDisplayRecon
            }
          )
        ));
      }),
      taskpaneState.type === "loading completion" && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
        Row_default,
        {
          justify: "start",
          align: "center",
          className: "ai-transformation-message ai-transformation-message-user"
        },
        /* @__PURE__ */ react_default.createElement("p", null, taskpaneState.userInput)
      ), /* @__PURE__ */ react_default.createElement(
        Row_default,
        {
          justify: "space-between",
          align: "center",
          className: "ai-transformation-message ai-transformation-message-ai"
        },
        /* @__PURE__ */ react_default.createElement(Col_default, { span: 21 }, /* @__PURE__ */ react_default.createElement("p", null, "Generating code..."), /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2 text-overflow-wrap" }, "Hint: ", taskpaneState.loadingMessage)),
        /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(AILoadingCircle, null))
      )),
      taskpaneState.type === "executing code" && (previousParamsAndResults.length === 0 || previousParamsAndResults[previousParamsAndResults.length - 1].params.user_input !== taskpaneState.userInput) && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
        Row_default,
        {
          justify: "start",
          align: "center",
          className: "ai-transformation-message ai-transformation-message-user"
        },
        /* @__PURE__ */ react_default.createElement("p", null, taskpaneState.userInput)
      ), /* @__PURE__ */ react_default.createElement(
        Row_default,
        {
          justify: "space-between",
          align: "center",
          className: "ai-transformation-message ai-transformation-message-ai"
        },
        /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", null, "Executing code...")),
        /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(AILoadingCircle, null))
      )),
      taskpaneState.type === "error loading completion" && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
        Row_default,
        {
          justify: "start",
          align: "center",
          className: "ai-transformation-message ai-transformation-message-user"
        },
        /* @__PURE__ */ react_default.createElement("p", null, taskpaneState.userInput)
      ), /* @__PURE__ */ react_default.createElement(
        Row_default,
        {
          justify: "start",
          align: "center",
          className: classNames("ai-transformation-message", "ai-transformation-message-ai")
        },
        /* @__PURE__ */ react_default.createElement("div", { className: "flexbox-column" }, /* @__PURE__ */ react_default.createElement("p", null, "Error loading completion"), /* @__PURE__ */ react_default.createElement("p", null, taskpaneState.error, taskpaneState.error.includes("There was an error accessing the OpenAI API") && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, "\xA0 To learn about self-hosted LLMs for Mito Enterprise, contact ", /* @__PURE__ */ react_default.createElement("a", { className: "text-underline text-color-mito-highlight", href: "mailto:founders@sagacollab.com?subject=Mito Enterprise AI" }, "the Mito team"), "."), taskpaneState.error.includes("You have used Mito AI") && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, "\xA0 Please ", /* @__PURE__ */ react_default.createElement("a", { className: "text-underline", href: "https://trymito.io/plans", target: "_blank", rel: "noreferrer" }, "upgrade to Mito Pro"), " or ", /* @__PURE__ */ react_default.createElement("a", { className: "text-underline", href: DOCUMENTATION_LINK_AI_TRANSFORM, target: "_blank", rel: "noreferrer" }, "set your own OPENAI_API key in your environment variables."))))
      )),
      taskpaneState.type === "error executing code" && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
        Row_default,
        {
          justify: "start",
          align: "center",
          className: "ai-transformation-message ai-transformation-message-user"
        },
        /* @__PURE__ */ react_default.createElement("p", null, taskpaneState.userInput)
      ), /* @__PURE__ */ react_default.createElement(
        Row_default,
        {
          justify: "space-between",
          align: "center",
          className: classNames("ai-transformation-message", "ai-transformation-message-ai")
        },
        /* @__PURE__ */ react_default.createElement("div", { className: "flexbox-column", style: { width: "90%" } }, /* @__PURE__ */ react_default.createElement("p", null, "Execution failed. ", taskpaneState.attempt < NUMBER_OF_ATTEMPTS_TO_GET_COMPLETION ? `Trying again (Attempt ${taskpaneState.attempt + 1}/${NUMBER_OF_ATTEMPTS_TO_GET_COMPLETION})` : "Please change the prompt and try again."), taskpaneState.attempt >= NUMBER_OF_ATTEMPTS_TO_GET_COMPLETION && /* @__PURE__ */ react_default.createElement("code", null, taskpaneState.error)),
        taskpaneState.attempt < NUMBER_OF_ATTEMPTS_TO_GET_COMPLETION && /* @__PURE__ */ react_default.createElement(AILoadingCircle, null)
      ))
    )), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "end" }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 22, style: { height: "100%" } }, /* @__PURE__ */ react_default.createElement(
      "div",
      {
        style: {
          height: `${chatHeight}px`,
          width: "100%"
        }
      },
      /* @__PURE__ */ react_default.createElement(
        "textarea",
        {
          ref: setChatInputRef,
          className: "ai-transformation-user-input-text-area",
          placeholder: "Send a message.",
          value: userInput,
          onChange: (e) => {
            setUserInput(e.target.value);
          },
          onKeyDown: (e) => {
            if (e.key === "Enter") {
              if (!e.shiftKey) {
                e.preventDefault();
                void submitChatInput(userInput);
              }
            }
          },
          onKeyUp: (e) => {
            if (e.key === "Enter") {
              if (e.shiftKey) {
                setUserInput(userInput + "\n");
              }
            }
          }
        }
      )
    )), /* @__PURE__ */ react_default.createElement(Col_default, { onClick: () => {
      var _a;
      void submitChatInput(userInput);
      (_a = chatInputRef.current) == null ? void 0 : _a.focus();
    } }, /* @__PURE__ */ react_default.createElement(SendArrowIcon_default, null)))));
  };
  var AITransformationTaskpane_default = AITransformationTaskpane;

  // src/mito/components/taskpanes/CannotCreateComm/CannotCreateCommTaskpane.tsx
  init_react();
  var CannotCreateCommTaskpane = (props) => {
    let header = "";
    let firstLine = "";
    let secondLine = "";
    if (props.commCreationErrorStatus === "no_backend_comm_registered_error") {
      header = "Rerun Cell Above";
      firstLine = "Looks like you restarted your kernel.";
      secondLine = /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, "Rerun the ", /* @__PURE__ */ react_default.createElement("code", null, "mitosheet.sheet()"), " call above to refresh this mitosheet.");
    } else if (props.commCreationErrorStatus === "non_valid_location_error") {
      header = "Unsupported Enviornment";
      firstLine = "Mito only supports JupyterLab and Jupyter Notebook, not wherever this is.";
      secondLine = /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, "To install Mito in JupyterLab and Jupyter Notebook, follow our ", /* @__PURE__ */ react_default.createElement("a", { href: DOCUMENTATION_LINK_INSTALL, target: "_blank", rel: "noreferrer" }, /* @__PURE__ */ react_default.createElement("span", { className: "text-body-1-link" }, "installation instructions.")));
    } else if (props.commCreationErrorStatus === "non_working_extension_error") {
      header = "Invalid installation";
      firstLine = "Try restarting your JupyterLab. Mito was unable to connect to your Python kernel.";
      secondLine = /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, "If this does not resolve this error, please ensure you have followed our ", /* @__PURE__ */ react_default.createElement("a", { href: DOCUMENTATION_LINK_INSTALL, target: "_blank", rel: "noreferrer" }, /* @__PURE__ */ react_default.createElement("span", { className: "text-body-1-link" }, "installation instructions.")));
    }
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header,
        setUIState: props.setUIState,
        notCloseable: true
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement("p", null, firstLine), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 15 }), /* @__PURE__ */ react_default.createElement("p", null, secondLine), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 15 }), /* @__PURE__ */ react_default.createElement("p", null, "If you are still receiving this error message, join our slack to get support!"), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 15 }), /* @__PURE__ */ react_default.createElement(GetSupportButton_default, { userProfile: props.userProfile, setUIState: props.setUIState, width: "block" })));
  };
  var CannotCreateCommTaskpane_default = CannotCreateCommTaskpane;

  // src/mito/components/taskpanes/CodeOptions/CodeOptionsTaskpane.tsx
  init_react();

  // src/mito/components/taskpanes/CodeOptions/CodeOptionsParameters.tsx
  init_react();
  var getParamDisplayString = (paramValue, isFile) => {
    if (isFile) {
      return getFileNameFromParamValue(paramValue);
    } else {
      return paramValue;
    }
  };
  var getParamDescriptionString = (paramSubtype) => {
    if (paramSubtype === "import_dataframe") {
      return "Dataframe";
    } else if (paramSubtype === "file_name_import_csv") {
      return "CSV Import File Path";
    } else if (paramSubtype === "file_name_import_excel") {
      return "Excel Import File Path";
    } else if (paramSubtype === "file_name_export_csv") {
      return "CSV Export File Path";
    } else if (paramSubtype === "file_name_export_excel") {
      return "Excel Export File Path";
    } else if (paramSubtype === "all") {
      return "All Possible Parameters";
    } else {
      return paramSubtype;
    }
  };
  var getFileNameFromParamValue = (paramValue) => {
    let fileName = paramValue.replace(/^.*[\\\/]/, "");
    fileName = fileName.substring(0, fileName.length - 1);
    if (fileName.startsWith('r"') || fileName.startsWith("r'")) {
      fileName = fileName.substring(2);
    } else if (fileName.startsWith("'") || fileName.startsWith('"')) {
      fileName = fileName.substring(1);
    }
    return fileName;
  };
  var getDefaultParamName = (paramValue, paramSubType) => {
    if (paramSubType === "import_dataframe") {
      return paramValue;
    } else {
      const fileName = getFileNameFromParamValue(paramValue);
      const noExt = fileName.substring(0, fileName.indexOf("."));
      const withUnderscores = noExt.replace(/[^a-zA-Z0-9]/g, "_");
      return withUnderscores + "_path";
    }
  };
  function isFunctionParamsDict(functionParams) {
    return typeof functionParams === "object" && !Array.isArray(functionParams);
  }
  var CodeOptionsParameters = (props) => {
    const [parameterizableParams] = useStateFromAPIAsync(
      [],
      () => __async(void 0, null, function* () {
        const response = yield props.mitoAPI.getParameterizableParams();
        return "error" in response ? void 0 : response.result;
      }),
      void 0,
      []
    );
    const unparametizedParams = parameterizableParams.filter(([paramName]) => {
      return !Object.values(props.codeOptions.function_params).includes(paramName);
    });
    const functionParams = props.codeOptions.function_params;
    const disabled = parameterizableParams.length === 0 || props.codeOptions.as_function === false || !isFunctionParamsDict(functionParams);
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: "Parameterize your analysis, making it easier to pass in different values." }, "Function Parameters")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      DropdownButton_default,
      {
        text: "+ Add",
        width: "small",
        searchable: true,
        disabled,
        title: !props.codeOptions.as_function ? "Toggle Generate Function before adding parameters." : parameterizableParams.length === 0 ? "There are no available options to parameterize. Import data first." : void 0
      },
      unparametizedParams.map((paramInfo, index) => {
        const paramValue = paramInfo[0];
        const paramSubtype = paramInfo[2];
        const paramDescription = getParamDescriptionString(paramSubtype);
        return /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: index,
            title: getParamDisplayString(paramValue, paramSubtype !== "import_dataframe"),
            subtext: paramDescription,
            onClick: () => {
              props.setCodeOptions((prevCodeOptions) => {
                const newCodeOptions = __spreadValues({}, prevCodeOptions);
                if (!isFunctionParamsDict(newCodeOptions.function_params)) {
                  return prevCodeOptions;
                }
                const paramName = getDefaultParamName(paramValue, paramSubtype);
                newCodeOptions.function_params[paramName] = paramValue;
                return newCodeOptions;
              });
            }
          }
        );
      })
    ))), Object.entries(props.codeOptions.function_params).length > 0 && /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 8, offsetRight: 2 }, /* @__PURE__ */ react_default.createElement("p", null, "Value")), /* @__PURE__ */ react_default.createElement(Col_default, { span: 10, offsetRight: 2 }, /* @__PURE__ */ react_default.createElement("p", null, "Param Name")), /* @__PURE__ */ react_default.createElement(Col_default, { span: 2 })), !isFunctionParamsDict(functionParams) && /* @__PURE__ */ react_default.createElement("p", null, "Function params have been set by the mitosheet creator and cannot be edited."), isFunctionParamsDict(functionParams) && Object.entries(functionParams).sort((a, b) => a[1].localeCompare(b[1])).map(
      ([paramName, paramValue], index) => {
        return /* @__PURE__ */ react_default.createElement(Row_default, { key: index, justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 8, offsetRight: 2 }, /* @__PURE__ */ react_default.createElement("p", { title: paramValue }, getParamDisplayString(paramValue, paramValue.startsWith('r"') || paramValue.startsWith("r'") || paramValue.startsWith("'")))), /* @__PURE__ */ react_default.createElement(Col_default, { span: 10, offsetRight: 2 }, /* @__PURE__ */ react_default.createElement(
          Input_default,
          {
            width: "block",
            value: paramName,
            onChange: (e) => {
              const newParamName = e.target.value;
              let finalNewParamName = newParamName;
              const newCodeOptions = __spreadValues({}, props.codeOptions);
              if (!isFunctionParamsDict(newCodeOptions.function_params)) {
                return;
              }
              if (Object.keys(newCodeOptions.function_params).includes(newParamName)) {
                let i = 1;
                finalNewParamName = newParamName + i;
                while (Object.keys(newCodeOptions.function_params).includes(newParamName + i)) {
                  i++;
                  finalNewParamName = newParamName + i;
                }
              } else {
                finalNewParamName = newParamName;
              }
              newCodeOptions.function_params[finalNewParamName] = newCodeOptions.function_params[paramName];
              delete newCodeOptions.function_params[paramName];
              props.setCodeOptions(newCodeOptions);
            }
          }
        )), /* @__PURE__ */ react_default.createElement(Col_default, { span: 2 }, /* @__PURE__ */ react_default.createElement(
          XIcon_default,
          {
            onClick: () => {
              const newCodeOptions = __spreadValues({}, props.codeOptions);
              if (!isFunctionParamsDict(newCodeOptions.function_params)) {
                return;
              }
              delete newCodeOptions.function_params[paramName];
              props.setCodeOptions(newCodeOptions);
            }
          }
        )));
      }
    ));
  };
  var CodeOptionsParameters_default = CodeOptionsParameters;

  // src/mito/components/taskpanes/CodeOptions/CodeOptionsTaskpane.tsx
  var CodeOptionsTaskpane = (props) => {
    const [codeOptions, setCodeOptions] = useState(() => props.analysisData.codeOptions);
    useDebouncedEffect(() => {
      void props.mitoAPI.updateCodeOptions(codeOptions);
    }, [codeOptions], 500);
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Generated Code Options",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneBody_default,
      {
        requiresEnterprise: {
          featureName: "code_options",
          mitoAPI: props.mitoAPI
        },
        userProfile: props.userProfile
      },
      /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: "A Python function is a reusable block of code that performs a specific task. It takes input, processes it, and returns output, making your code more organized and able to be easily rerun on new datasets." }, "Generate Function")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
        Toggle_default,
        {
          value: codeOptions.as_function,
          onChange: function() {
            const newCodeOptions = __spreadValues({}, codeOptions);
            newCodeOptions.as_function = !newCodeOptions.as_function;
            setCodeOptions(newCodeOptions);
          }
        }
      ))),
      /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 14 }, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: "Give your function a short, descriptive name descring what it does." }, "Function Name")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
        Input_default,
        {
          disabled: !codeOptions.as_function,
          value: codeOptions.function_name,
          onChange: (e) => {
            const newCodeOptions = __spreadValues({}, codeOptions);
            newCodeOptions.function_name = e.target.value;
            setCodeOptions(newCodeOptions);
          }
        }
      ))),
      /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: "You can optionally configure the code to not call your generated function. Toggling this to false in a Jupyter notebook may break later cells." }, "Call Function")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
        Toggle_default,
        {
          value: props.analysisData.codeOptions.call_function,
          disabled: !codeOptions.as_function,
          onChange: function() {
            const newCodeOptions = __spreadValues({}, codeOptions);
            newCodeOptions.call_function = !newCodeOptions.call_function;
            setCodeOptions(newCodeOptions);
          }
        }
      ))),
      /* @__PURE__ */ react_default.createElement(
        CodeOptionsParameters_default,
        {
          mitoAPI: props.mitoAPI,
          codeOptions,
          setCodeOptions
        }
      )
    ));
  };
  var CodeOptionsTaskpane_default = CodeOptionsTaskpane;

  // src/mito/components/taskpanes/CodeSnippets/CodeSnippetsTaskpane.tsx
  init_react();

  // src/mito/utils/copy.tsx
  var getCopyStringForValue = (value, columnDtype, columnFormatType) => {
    if (isValueNone(value)) {
      return "";
    }
    return formatCellData(value, columnDtype, columnFormatType);
  };
  var getCopyStringForRow = (sheetData, rowIndex, lowColIndex, highColIndex) => {
    let copyString = "";
    for (let columnIndex = lowColIndex; columnIndex <= highColIndex; columnIndex++) {
      if (rowIndex === -1) {
        if (columnIndex === -1) {
        } else {
          copyString += getDisplayColumnHeader(sheetData.data[columnIndex].columnHeader);
        }
      } else {
        if (columnIndex === -1) {
          copyString += sheetData.index[rowIndex];
        } else {
          const columnID = getColumnIDByIndex(sheetData, columnIndex);
          copyString += getCopyStringForValue(
            sheetData.data[columnIndex].columnData[rowIndex],
            sheetData.data[columnIndex].columnDtype,
            sheetData.dfFormat.columns[columnID]
          );
        }
      }
      if (columnIndex !== highColIndex) {
        copyString += "	";
      }
    }
    return copyString;
  };
  var getSelectionsToCopy = (selections) => {
    const lowRowIndex = Math.min(selections[0].startingRowIndex, selections[0].endingRowIndex);
    const highRowIndex = Math.max(selections[0].startingRowIndex, selections[0].endingRowIndex);
    const finalSelections = [selections[0]];
    for (let i = 1; i < selections.length; i++) {
      const selection = selections[i];
      const selectionLowRowIndex = Math.min(selection.startingRowIndex, selection.endingRowIndex);
      const selectionHighRowIndex = Math.max(selection.startingRowIndex, selection.endingRowIndex);
      if (selectionLowRowIndex === lowRowIndex && selectionHighRowIndex === highRowIndex) {
        finalSelections.push(selection);
      } else {
        break;
      }
    }
    finalSelections.sort((selectionOne, selectionTwo) => {
      return selectionOne.startingColumnIndex - selectionTwo.startingColumnIndex;
    });
    return finalSelections;
  };
  var getCopyStringForSelections = (sheetData, selections) => {
    const lowRowIndex = Math.min(selections[0].startingRowIndex, selections[0].endingRowIndex);
    let highRowIndex = Math.max(selections[0].startingRowIndex, selections[0].endingRowIndex);
    if (lowRowIndex === -1 && highRowIndex === -1) {
      highRowIndex = Math.min(sheetData.numRows - 1, MAX_ROWS - 1);
    }
    let copyString = "";
    for (let rowIndex = lowRowIndex; rowIndex <= highRowIndex; rowIndex++) {
      selections.forEach((selection, selectionIndex) => {
        const lowColIndex = Math.min(selection.startingColumnIndex, selection.endingColumnIndex);
        let highColIndex = Math.max(selection.startingColumnIndex, selection.endingColumnIndex);
        if (lowColIndex === -1 && highColIndex === -1) {
          highColIndex = sheetData.numColumns - 1;
        }
        copyString += getCopyStringForRow(sheetData, rowIndex, lowColIndex, highColIndex);
        if (selectionIndex !== selections.length - 1) {
          copyString += "	";
        }
      });
      if (rowIndex !== highRowIndex) {
        copyString += "\n";
      }
    }
    return copyString;
  };
  var getCopyStringForClipboard = (sheetData, selections) => {
    if (sheetData === void 0 || selections.length === 0) {
      return void 0;
    }
    const selectionsToCopy = getSelectionsToCopy(selections);
    return [getCopyStringForSelections(sheetData, selectionsToCopy), selectionsToCopy];
  };
  var writeTextToClipboard = (text) => {
    if (navigator.clipboard && window.isSecureContext) {
      return navigator.clipboard.writeText(text);
    } else {
      const textArea = document.createElement("textarea");
      textArea.value = text;
      textArea.style.position = "absolute";
      textArea.style.opacity = "0";
      document.body.appendChild(textArea);
      const currentFocusedElement = document.activeElement;
      textArea.select();
      return new Promise((res, rej) => {
        document.execCommand("copy") ? res() : rej();
        textArea.remove();
        try {
          currentFocusedElement == null ? void 0 : currentFocusedElement.focus();
        } catch (e) {
          console.log("Error refocusing on element", e);
        }
      });
    }
  };

  // src/mito/components/icons/CodeSnippetIcon.tsx
  init_react();
  var CodeSnippetIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "20", height: "11", viewBox: "0 0 20 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1.24316 5.40625L5.9668 7.32031V8.66016L0.375 6.06934V5.2832L1.24316 5.40625ZM5.9668 3.83398L1.25 5.77539L0.375 5.87109V5.07812L5.9668 2.49414V3.83398ZM12.3721 0.046875L8.22266 10.8545H7.13574L11.292 0.046875H12.3721ZM18.5723 5.67969L13.7119 3.78613V2.48047L19.5498 5.06445V5.86426L18.5723 5.67969ZM13.7119 7.34766L18.5859 5.41309L19.5498 5.26953V6.0625L13.7119 8.65332V7.34766Z", fill: "var(--mito-highlight)" }));
  };
  var CodeSnippetIcon_default = CodeSnippetIcon;

  // src/mito/components/icons/DropdownIcon.tsx
  init_react();
  var DropdownIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "20", height: "16", viewBox: "0 0 4 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("circle", { cx: "2", cy: "2", r: "2", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("circle", { cx: "2", cy: "8", r: "2", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("circle", { cx: "2", cy: "14", r: "2", fill: "var(--mito-text)" }));
  };
  var DropdownIcon_default = DropdownIcon;

  // src/mito/components/taskpanes/CodeSnippets/CodeSnippetsTaskpane.tsx
  var CONFIRMATION_TEXT_COPIED = "Copied code snippet to clipboard. Paste it in a code cell below.";
  var CONFIRMATION_TEXT_CODE_WRITTEN = "Code snippet written to code cell below. Scroll down to see it.";
  var CodeSnippetsTaskpane = (props) => {
    const [codeSnippetAPIResult] = useStateFromAPIAsync(void 0, () => __async(void 0, null, function* () {
      const response = yield props.mitoAPI.getCodeSnippets();
      return "error" in response ? void 0 : response.result;
    }), void 0, []);
    const [searchString, setSearchString] = useState("");
    const [openDropdownIndex, setOpenDropdownIndex] = useState(void 0);
    const [confirmationText, setConfirmationText] = useState(void 0);
    useDebouncedEffect(() => {
      if (confirmationText !== void 0) {
        setConfirmationText(void 0);
      }
    }, [confirmationText], 3e3);
    if ((codeSnippetAPIResult == null ? void 0 : codeSnippetAPIResult.status) === "error") {
      return /* @__PURE__ */ react_default.createElement(
        DefaultEmptyTaskpane_default,
        {
          setUIState: props.setUIState,
          header: "Error loading code snippets",
          message: codeSnippetAPIResult.error_message,
          errorMessage: true,
          suppressImportLink: true
        }
      );
    }
    const codeSnippetsToDisplay = codeSnippetAPIResult == null ? void 0 : codeSnippetAPIResult.code_snippets.filter((codeSnippet) => {
      return fuzzyMatch(codeSnippet.Name, searchString) > 0.75 || fuzzyMatch(codeSnippet.Description, searchString) > 0.75 || fuzzyMatch(codeSnippet.Code.join(" "), searchString) > 0.75;
    });
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Code Snippets",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        value: searchString,
        onChange: (e) => {
          setSearchString(e.target.value);
        },
        placeholder: "Search for a code snippet by name or content"
      }
    ), confirmationText !== void 0 && /* @__PURE__ */ react_default.createElement("p", { className: "text-color-success" }, confirmationText), codeSnippetsToDisplay == null ? void 0 : codeSnippetsToDisplay.map((codeSnippet, codeSnippetIndex) => {
      var _a;
      const copyToClipboard = () => {
        setConfirmationText(CONFIRMATION_TEXT_COPIED);
        void writeTextToClipboard(codeSnippet.Code.join("\n"));
        void props.mitoAPI.log("code_snippet_copied", { "code_snippet_name": codeSnippet.Name });
      };
      const writeToCell = () => {
        setConfirmationText(CONFIRMATION_TEXT_CODE_WRITTEN);
        if (props.writeCodeSnippetCell) {
          props.writeCodeSnippetCell(props.analysisData.analysisName, codeSnippet.Code.join("\n"));
        }
        void props.mitoAPI.log("code_snippet_written_to_cell", { "code_snippet_name": codeSnippet.Name });
      };
      let openLocation = DISCORD_INVITE_LINK;
      const codeSnippetSupportEmail = (_a = props.userProfile.mitoConfig.MITO_CONFIG_CODE_SNIPPETS) == null ? void 0 : _a.MITO_CONFIG_CODE_SNIPPETS_SUPPORT_EMAIL;
      if (codeSnippetSupportEmail !== void 0 && codeSnippetSupportEmail !== null) {
        openLocation = `mailto:${codeSnippetSupportEmail}?subject=Mito Code Snippet Support. Snippet Name: "${codeSnippet.Name}" Snippet ID: "${codeSnippet.Id}"`;
      }
      const items = [
        /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "Copy Code Snippet",
            title: "Copy Code Snippet",
            onClick: copyToClipboard
          }
        ),
        !isInDashboard() ? /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "Write to Notebook",
            title: "Write to Notebook",
            onClick: writeToCell
          }
        ) : void 0,
        /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "Get Support",
            title: "Get Support",
            onClick: () => {
              var _a2;
              window.open(openLocation);
              void ((_a2 = props.mitoAPI) == null ? void 0 : _a2.log("clicked_code_snippet_get_support_button"));
            }
          }
        )
      ].filter((x) => x !== void 0);
      return /* @__PURE__ */ react_default.createElement(
        Row_default,
        {
          key: codeSnippetIndex,
          align: "center",
          className: classNames("highlight-on-hover", DROPDOWN_IGNORE_CLICK_CLASS),
          justify: "space-between",
          onClick: () => {
            setOpenDropdownIndex((prevOpenDropdownIndex) => {
              if (prevOpenDropdownIndex === codeSnippetIndex) {
                return void 0;
              }
              return codeSnippetIndex;
            });
          }
        },
        /* @__PURE__ */ react_default.createElement(Col_default, { offsetRight: 0.5 }, /* @__PURE__ */ react_default.createElement(CodeSnippetIcon_default, null)),
        /* @__PURE__ */ react_default.createElement(Col_default, { span: 20 }, /* @__PURE__ */ react_default.createElement("div", { className: "text-bold" }, codeSnippet.Name), /* @__PURE__ */ react_default.createElement("div", { className: "text-overflow-wrap pb-5px" }, codeSnippet.Description)),
        /* @__PURE__ */ react_default.createElement(
          Col_default,
          {
            offset: 2
          },
          /* @__PURE__ */ react_default.createElement(DropdownIcon_default, null)
        ),
        /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
          Dropdown_default,
          {
            display: codeSnippetIndex === openDropdownIndex,
            width: "medium",
            closeDropdown: () => {
              setOpenDropdownIndex(void 0);
            }
          },
          items
        ))
      );
    }), codeSnippetAPIResult === void 0 && /* @__PURE__ */ react_default.createElement("p", { className: "mt-20px" }, "Loading code snippets ", /* @__PURE__ */ react_default.createElement(LoadingDots_default, null))));
  };
  var CodeSnippetsTaskpane_default = CodeSnippetsTaskpane;

  // src/mito/components/taskpanes/ColumnHeadersTransform/ColumnHeadersTransformTaskpane.tsx
  init_react();

  // src/mito/components/taskpanes/ColumnHeadersTransform/ColumnHeadersTransformReplace.tsx
  init_react();

  // src/mito/hooks/useSendEditOnClick.tsx
  init_react();
  function useSendEditOnClick(defaultParams, stepType, mitoAPI, analysisData, options, onUndoAndRedo) {
    const [params, _setParams] = useState(defaultParams);
    const [error, setError] = useState(void 0);
    const [loading, setLoading] = useState(false);
    const [appliedEditInLastTwoSeconds, setAppliedEditInLastTwoSeconds] = useState(false);
    const [stepIDData, setStepIDData] = useState({
      stepIDs: [],
      currStepIDIndex: 0
    });
    const [paramsApplied, setParamsApplied] = useState(false);
    const [attemptedEditWithTheseParamsMultipleTimes, setAttemptedEditWithTheseParamsMultipleTimes] = useState(false);
    useEffectOnUndo(() => {
      void refreshOnUndo();
    }, analysisData);
    useEffectOnRedo(() => {
      void refreshOnRedo();
    }, analysisData);
    useEffect(() => {
      if (appliedEditInLastTwoSeconds) {
        const timeout = setTimeout(() => {
          setAppliedEditInLastTwoSeconds(false);
        }, 2e3);
        return () => clearTimeout(timeout);
      }
    }, [appliedEditInLastTwoSeconds]);
    const editEvent = stepType + "_edit";
    const setParams = useCallback(
      (args) => {
        _setParams(args);
        setParamsApplied(false);
        setAttemptedEditWithTheseParamsMultipleTimes(false);
      },
      []
    );
    const edit = (finalTransform) => __async(this, null, function* () {
      if (params === void 0) {
        return;
      } else if (!(options == null ? void 0 : options.allowSameParamsToReapplyTwice) && paramsApplied) {
        setAttemptedEditWithTheseParamsMultipleTimes(true);
        return;
      }
      const finalParams = finalTransform ? finalTransform(params) : params;
      setLoading(true);
      let newStepID = getRandomId();
      if ((options == null ? void 0 : options.overwiteStepIfClickedMultipleTimes) && stepIDData.stepIDs.length > 0) {
        newStepID = stepIDData.stepIDs[stepIDData.stepIDs.length - 1];
      }
      const possibleError = yield mitoAPI._edit(editEvent, finalParams, newStepID);
      setLoading(false);
      if ("error" in possibleError) {
        setError(possibleError.error);
      } else {
        setStepIDData((prevStepIDData) => {
          const newStepIDData = { stepIDs: [...prevStepIDData.stepIDs], currStepIDIndex: prevStepIDData.currStepIDIndex };
          newStepIDData.stepIDs.splice(newStepIDData.currStepIDIndex + 1, newStepIDData.stepIDs.length);
          newStepIDData.stepIDs.push(newStepID);
          newStepIDData.currStepIDIndex = newStepIDData.stepIDs.length - 1;
          return newStepIDData;
        });
        setError(void 0);
        setParamsApplied(true);
        setAppliedEditInLastTwoSeconds(true);
      }
    });
    const refreshOnUndo = () => __async(this, null, function* () {
      const stepID = stepIDData.stepIDs[stepIDData.currStepIDIndex - 1];
      setStepIDData((prevStepIDData) => {
        const newStepIDData = { stepIDs: [...prevStepIDData.stepIDs], currStepIDIndex: prevStepIDData.currStepIDIndex };
        newStepIDData.currStepIDIndex -= 1;
        return newStepIDData;
      });
      const response = yield mitoAPI.getParams(stepType, stepID, {});
      const newParams = "error" in response ? void 0 : response.result;
      if (newParams !== void 0) {
        if ((options == null ? void 0 : options.doNotRefreshParamsOnUndoAndRedo) !== true) {
          _setParams(newParams);
        }
        if (onUndoAndRedo !== void 0) {
          onUndoAndRedo(newParams);
        }
      } else {
        if ((options == null ? void 0 : options.doNotRefreshParamsOnUndoAndRedo) !== true) {
          _setParams(defaultParams);
        }
        setParamsApplied(false);
        if (onUndoAndRedo !== void 0) {
          onUndoAndRedo(defaultParams());
        }
      }
      setError(void 0);
    });
    const refreshOnRedo = () => __async(this, null, function* () {
      const stepID = stepIDData.stepIDs[stepIDData.currStepIDIndex + 1];
      setStepIDData((prevStepIDData) => {
        const newStepIDData = { stepIDs: [...prevStepIDData.stepIDs], currStepIDIndex: prevStepIDData.currStepIDIndex };
        newStepIDData.currStepIDIndex += 1;
        return newStepIDData;
      });
      const response = yield mitoAPI.getParams(stepType, stepID, {});
      const newParams = "error" in response ? void 0 : response.result;
      if (newParams !== void 0) {
        if ((options == null ? void 0 : options.doNotRefreshParamsOnUndoAndRedo) !== true) {
          _setParams(newParams);
        }
        if (onUndoAndRedo !== void 0) {
          onUndoAndRedo(newParams);
        }
        setParamsApplied(true);
      }
      setError(void 0);
    });
    let result = void 0;
    if (paramsApplied && analysisData.stepSummaryList[analysisData.stepSummaryList.length - 1].step_type === stepType) {
      result = analysisData.lastResult;
    }
    return {
      params,
      setParams,
      error,
      loading,
      edit,
      editApplied: paramsApplied,
      attemptedEditWithTheseParamsMultipleTimes,
      result,
      appliedEditInLastTwoSeconds
    };
  }
  var useSendEditOnClick_default = useSendEditOnClick;

  // src/mito/components/taskpanes/ColumnHeadersTransform/ColumnHeadersTransformReplace.tsx
  var ColumnHeadersTransformReplace = (props) => {
    const { params, setParams, edit } = useSendEditOnClick_default(
      () => {
        return {
          sheet_index: props.selectedSheetIndex,
          transformation: { "type": "replace", "old": "", "new": "" }
        };
      },
      "column_headers_transform" /* ColumnHeadersTransform */,
      props.mitoAPI,
      props.analysisData
    );
    useEffect(() => {
      setParams((prevParams) => {
        if (prevParams === void 0) {
          return prevParams;
        }
        return {
          sheet_index: props.selectedSheetIndex,
          transformation: prevParams.transformation
        };
      });
    }, [props.selectedSheetIndex]);
    if (params === void 0) {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
    }
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "start", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: "Find and replace in all string column headers." }, "Find and Replace in Column Headers"))), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", null, "Find")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        value: params.transformation.type === "replace" ? params.transformation.old : "",
        onChange: (e) => {
          const newParams = __spreadValues({}, params);
          newParams.transformation = {
            "type": "replace",
            "old": e.target.value,
            "new": params.transformation.type === "replace" ? params.transformation.new : ""
          };
          setParams(newParams);
        }
      }
    ))), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", null, "Replace")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        value: params.transformation.type === "replace" ? params.transformation.new : "",
        onChange: (e) => {
          const newParams = __spreadValues({}, params);
          newParams.transformation = {
            "type": "replace",
            "old": params.transformation.type === "replace" ? params.transformation.old : "",
            "new": e.target.value
          };
          setParams(newParams);
        }
      }
    ))), /* @__PURE__ */ react_default.createElement(Row_default, null, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        disabled: params.transformation.type !== "replace",
        variant: "dark",
        onClick: () => {
          edit();
        }
      },
      "Replace in ",
      props.numHeaders,
      " Headers"
    )));
  };
  var ColumnHeadersTransformReplace_default = ColumnHeadersTransformReplace;

  // src/mito/components/taskpanes/ColumnHeadersTransform/ColumnHeadersTransformTaskpane.tsx
  var ColumnHeadersTransformTaskpane = (props) => {
    const sheetData = props.sheetDataArray[props.selectedSheetIndex];
    if (sheetData === void 0) {
      return /* @__PURE__ */ react_default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    const numHeaders = sheetData.data.length;
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Column Headers Transformations",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneBody_default,
      {
        requiresPro: {
          featureName: "column_headers_transform",
          mitoAPI: props.mitoAPI
        },
        userProfile: props.userProfile
      },
      /* @__PURE__ */ react_default.createElement(Row_default, null, /* @__PURE__ */ react_default.createElement(
        TextButton_default,
        {
          variant: "dark",
          onClick: () => {
            void props.mitoAPI.editColumnHeadersTransform({
              sheet_index: props.selectedSheetIndex,
              transformation: { "type": "uppercase" }
            });
          }
        },
        "Uppercase ",
        numHeaders,
        " Headers"
      )),
      /* @__PURE__ */ react_default.createElement(Row_default, null, /* @__PURE__ */ react_default.createElement(
        TextButton_default,
        {
          variant: "dark",
          onClick: () => {
            void props.mitoAPI.editColumnHeadersTransform({
              sheet_index: props.selectedSheetIndex,
              transformation: { "type": "lowercase" }
            });
          }
        },
        "Lowercase ",
        numHeaders,
        " Headers"
      )),
      /* @__PURE__ */ react_default.createElement(
        ColumnHeadersTransformReplace_default,
        {
          mitoAPI: props.mitoAPI,
          userProfile: props.userProfile,
          analysisData: props.analysisData,
          selectedSheetIndex: props.selectedSheetIndex,
          numHeaders
        }
      )
    ));
  };
  var ColumnHeadersTransformTaskpane_default = ColumnHeadersTransformTaskpane;

  // src/mito/components/taskpanes/Concat/ConcatTaskpane.tsx
  init_react();
  var getColumnHeadersIncludedMessage = (notIncludedColumnsArray, arrIndex) => {
    if (notIncludedColumnsArray[arrIndex].length === 0) {
      return /* @__PURE__ */ react_default.createElement("p", null, "\u2713 All columns are included in the concatenated sheet.");
    }
    const [columnHeadersString, numOtherColumnHeaders] = getFirstCharactersOfColumnHeaders(notIncludedColumnsArray[arrIndex], 25);
    if (numOtherColumnHeaders === 0) {
      return /* @__PURE__ */ react_default.createElement("p", null, "Columns ", /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, columnHeadersString), " are not included.");
    } else {
      return /* @__PURE__ */ react_default.createElement("p", null, "Columns ", /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, columnHeadersString), " and ", /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, numOtherColumnHeaders), " others are not included.");
    }
  };
  var ConcatTaskpane = (props) => {
    var _a;
    const { params, setParams } = useLiveUpdatingParams_default(
      {
        join: "inner",
        ignore_index: true,
        sheet_indexes: []
      },
      "concat" /* Concat */,
      props.mitoAPI,
      props.analysisData,
      50
    );
    const [selectableSheetIndexes] = useState(props.sheetDataArray.map((sd, index) => index));
    const concatSheetColumnHeaders = Object.values(((_a = props.sheetDataArray[props.sheetDataArray.length - 1]) == null ? void 0 : _a.columnIDsMap) || {});
    const notIncludedColumnsArray = params == null ? void 0 : params.sheet_indexes.map((sheetIndex) => {
      var _a2;
      return Object.values(((_a2 = props.sheetDataArray[sheetIndex]) == null ? void 0 : _a2.columnIDsMap) || {}).filter((columnHeader) => {
        return !concatSheetColumnHeaders.includes(columnHeader);
      });
    });
    if (params === void 0) {
      return /* @__PURE__ */ react_default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState, message: "Import at least two datasets before concating." });
    }
    const dataframeCards = params.sheet_indexes.map((sheetIndex, arrIndex) => {
      return /* @__PURE__ */ react_default.createElement("div", { key: arrIndex }, /* @__PURE__ */ react_default.createElement(
        SelectAndXIconCard_default,
        {
          titleMap: Object.fromEntries(props.sheetDataArray.map((sheetData, index) => {
            return [index + "", sheetData.dfName];
          })),
          value: sheetIndex + "",
          onChange: (newSheetIndexStr) => {
            const newSheetIndex = parseInt(newSheetIndexStr);
            setParams((prevConcatParams) => {
              const newSheetIndexes = [...prevConcatParams.sheet_indexes];
              newSheetIndexes[arrIndex] = newSheetIndex;
              return __spreadProps(__spreadValues({}, prevConcatParams), {
                sheet_indexes: newSheetIndexes
              });
            });
          },
          onDelete: () => {
            setParams((prevConcatParams) => {
              const newSheetIndexes = [...prevConcatParams.sheet_indexes];
              newSheetIndexes.splice(arrIndex, 1);
              return __spreadProps(__spreadValues({}, prevConcatParams), {
                sheet_indexes: newSheetIndexes
              });
            });
          },
          selectableValues: Object.keys(props.sheetDataArray)
        }
      ), notIncludedColumnsArray !== void 0 && /* @__PURE__ */ react_default.createElement(Row_default, { className: "text-subtext-1" }, getColumnHeadersIncludedMessage(notIncludedColumnsArray, arrIndex)));
    });
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Concatenate Sheet",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Join Type")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        value: params.join,
        onChange: (newJoin) => {
          setParams((prevConcatParams) => {
            return __spreadProps(__spreadValues({}, prevConcatParams), {
              join: newJoin
            });
          });
        },
        width: "medium"
      },
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "inner",
          subtext: "Only includes columns that exist in all sheets"
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "outer",
          subtext: "Includes all columns from all sheets, regardless of if these columns are in the other sheets."
        }
      )
    ))), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: "When on, the resulting dataframe will have indexes 0, 1, 2, etc.. This is useful if you're concatenating objects that don't have meaningful index information." }, "Ignore Existing Indexes")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Toggle_default,
      {
        value: params.ignore_index,
        onChange: () => {
          setParams((prevConcatParams) => {
            return __spreadProps(__spreadValues({}, prevConcatParams), {
              ignore_index: !prevConcatParams.ignore_index
            });
          });
        }
      }
    ))), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Concatenate Dataframes")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      DropdownButton_default,
      {
        text: "+ Add",
        width: "small",
        searchable: true
      },
      [
        /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: -1,
            title: "Add all sheets",
            onClick: () => {
              setParams((prevConcatParams) => {
                const newSheetIndexes = [...selectableSheetIndexes];
                return __spreadProps(__spreadValues({}, prevConcatParams), {
                  sheet_indexes: newSheetIndexes
                });
              });
            }
          }
        )
      ].concat(props.sheetDataArray.filter((sheetData, index) => {
        if (!selectableSheetIndexes.includes(index)) {
          return false;
        }
        return true;
      }).map((sheetData, index) => {
        return /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: index,
            title: sheetData.dfName,
            onClick: () => {
              setParams((prevConcatParams) => {
                const newSheetIndexes = [...prevConcatParams.sheet_indexes];
                newSheetIndexes.push(index);
                return __spreadProps(__spreadValues({}, prevConcatParams), {
                  sheet_indexes: newSheetIndexes
                });
              });
            }
          }
        );
      }))
    ))), dataframeCards));
  };
  var ConcatTaskpane_default = ConcatTaskpane;

  // src/mito/components/taskpanes/DataframeImport/DataframeImportTaskpane.tsx
  init_react();

  // src/mito/components/import/DataframeImportScreen.tsx
  init_react();
  var getButtonMessage = (params) => {
    if (params.df_names.length === 0) {
      return `Select dataframes to import them`;
    }
    return `Import ${params.df_names.length} Selected dataframe${params.df_names.length === 1 ? "" : "s"}`;
  };
  var DataframeImportScreen = (props) => {
    var _a, _b;
    const [dfNamesInNotebook] = useStateFromAPIAsync(
      [],
      () => __async(void 0, null, function* () {
        const response = yield props.mitoAPI.getDefinedDfNames();
        return "error" in response ? void 0 : response.result;
      }),
      void 0,
      []
    );
    const dataframeCards = (((_a = props.params) == null ? void 0 : _a.df_names) || []).map((dfName, arrIndex) => {
      return /* @__PURE__ */ react_default.createElement(
        SelectAndXIconCard_default,
        {
          key: arrIndex,
          value: dfName,
          onChange: (newDfName) => {
            props.setParams((prevParams) => {
              const newDfNames = [...prevParams.df_names];
              newDfNames[arrIndex] = newDfName;
              return __spreadProps(__spreadValues({}, prevParams), {
                df_names: newDfNames
              });
            });
          },
          onDelete: () => {
            props.setParams((prevParams) => {
              const newDfNames = [...prevParams.df_names];
              newDfNames.splice(arrIndex, 1);
              return __spreadProps(__spreadValues({}, prevParams), {
                df_names: newDfNames
              });
            });
          },
          selectableValues: dfNamesInNotebook
        }
      );
    });
    if (props.params === void 0) {
      return /* @__PURE__ */ react_default.createElement("div", { className: "text-body-1" }, "There has been an error loading dataframes to import. Please try again, or contact support.");
    }
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: props.isUpdate ? "Update Import" : "Import Dataframes",
        setUIState: props.setUIState,
        backCallback: props.backCallback
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: "Dataframes that have been created elsewhere in this notebook can be imported through this taskpane." }, "Dataframes to Import")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      DropdownButton_default,
      {
        text: "+ Add",
        width: "small",
        searchable: true
      },
      dfNamesInNotebook.map((dfName, index) => {
        return /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: index,
            title: dfName,
            onClick: () => {
              props.setParams((prevParams) => {
                const newDfNames = [...prevParams.df_names];
                newDfNames.push(dfName);
                return __spreadProps(__spreadValues({}, prevParams), {
                  df_names: newDfNames
                });
              });
            }
          }
        );
      })
    ))), dataframeCards, dataframeCards.length === 0 && /* @__PURE__ */ react_default.createElement(Row_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-subtext-1" }, "Import an existing dataframe as a new sheet tab in Mito"))), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => {
          props.edit();
        },
        disabled: (((_b = props.params) == null ? void 0 : _b.df_names.length) || 0) === 0
      },
      getButtonMessage(props.params)
    )));
  };
  var DataframeImportScreen_default = DataframeImportScreen;

  // src/mito/components/taskpanes/DataframeImport/DataframeImportTaskpane.tsx
  var DataframeImportTaskpane = (props) => {
    const { params, setParams, edit } = useSendEditOnClick_default(
      () => {
        return { df_names: [] };
      },
      "dataframe_import" /* DataframeImport */,
      props.mitoAPI,
      props.analysisData,
      { allowSameParamsToReapplyTwice: true }
    );
    return /* @__PURE__ */ react_default.createElement(
      DataframeImportScreen_default,
      {
        mitoAPI: props.mitoAPI,
        analysisData: props.analysisData,
        setUIState: props.setUIState,
        isUpdate: false,
        params,
        setParams,
        edit
      }
    );
  };
  var DataframeImportTaskpane_default = DataframeImportTaskpane;

  // src/mito/components/taskpanes/Download/DownloadTaskpane.tsx
  init_react();

  // src/mito/components/taskpanes/Download/ExcelDownloadConfigSection.tsx
  init_react();

  // src/mito/components/elements/MultiToggleDataframes.tsx
  init_react();
  var MultiToggleDataframes = (props) => {
    const selectedSheetIndexes = [...props.selectedSheetIndexes].sort();
    return /* @__PURE__ */ react_default.createElement(
      MultiToggleBox_default,
      {
        width: "block",
        height: props.height || "small",
        onToggleAll: (newIndexes) => {
          newIndexes.sort();
          props.onChange(newIndexes);
        }
      },
      props.sheetDataArray.map((sheetData, index) => {
        const dfName = sheetData.dfName;
        return /* @__PURE__ */ react_default.createElement(
          MultiToggleItem_default,
          {
            key: index,
            title: dfName,
            toggled: selectedSheetIndexes.includes(index),
            index,
            onToggle: () => {
              const newSheetIndexes = [...selectedSheetIndexes];
              toggleInArray(newSheetIndexes, index);
              newSheetIndexes.sort();
              props.onChange(newSheetIndexes);
            }
          }
        );
      })
    );
  };
  var MultiToggleDataframes_default = MultiToggleDataframes;

  // src/mito/components/taskpanes/Download/ExcelDownloadConfigSection.tsx
  var ExcelDownloadConfigSection = (props) => {
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Dataframes to Export"), /* @__PURE__ */ react_default.createElement(
      MultiToggleDataframes_default,
      {
        sheetDataArray: props.sheetDataArray,
        selectedSheetIndexes: props.exportState.sheetIndexes,
        setUIState: props.setUIState,
        onChange: (newSelectedSheetIndexes) => {
          props.setUIState((prevUiState) => {
            return __spreadProps(__spreadValues({}, prevUiState), {
              exportConfiguration: { exportType: "excel", sheetIndexes: newSelectedSheetIndexes }
            });
          });
        }
      }
    ));
  };
  var ExcelDownloadConfigSection_default = ExcelDownloadConfigSection;

  // src/mito/components/taskpanes/Download/CSVDownloadConfigSection.tsx
  init_react();
  var CSVDownloadConfigSection = (props) => {
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
      DataframeSelect_default,
      {
        title: "Dataframe to Export",
        sheetDataArray: props.sheetDataArray,
        sheetIndex: props.selectedSheetIndex,
        onChange: (newSheetIndex) => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              selectedSheetIndex: newSheetIndex,
              exportConfiguration: { exportType: "csv" }
            });
          });
        }
      }
    ), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-around" }, /* @__PURE__ */ react_default.createElement("p", { className: "ma-25px text-align-center" }, "CSV exports will not reflect any formatting changes made in Mito.")));
  };
  var CSVDownloadConfigSection_default = CSVDownloadConfigSection;

  // src/mito/utils/filename.tsx
  var INVALID_CHARACTERS_IN_FILENAME = [
    "\\",
    "/",
    "<",
    ">",
    ":",
    '"',
    "|",
    "?",
    "*"
  ];
  var getInvalidFileNameError = (fileName) => {
    let invalidFileNameWarning = void 0;
    INVALID_CHARACTERS_IN_FILENAME.forEach((char) => {
      if (fileName.includes(char)) {
        invalidFileNameWarning = `The File Name cannot include ${char}`;
      }
    });
    return invalidFileNameWarning;
  };

  // src/mito/components/elements/LoadingCounter.tsx
  init_react();
  var LoadingCounter = () => {
    const [timeLoading, setTimeLoading] = useState(1);
    useEffect(() => {
      const interval = setInterval(() => {
        setTimeLoading((timeLoading2) => timeLoading2 + 1);
      }, 1e3);
      return () => clearInterval(interval);
    }, []);
    return /* @__PURE__ */ react_default.createElement("span", null, " \xA0( ", timeLoading, "s )");
  };
  var LoadingCounter_default = LoadingCounter;

  // src/mito/components/taskpanes/Download/DownloadTaskpane.tsx
  var DownloadTaskpane = (props) => {
    var _a, _b;
    const [newlyFormattedColumns, setNewlyFormattedColumns] = useState(() => {
      const newlyFormattedColumnsInitial = {};
      props.sheetDataArray.forEach((_, idx) => {
        newlyFormattedColumnsInitial[idx] = [];
      });
      return newlyFormattedColumnsInitial;
    });
    const [exportHRef, setExportHref] = useState("");
    const [exportFormatting, setExportFormatting] = useState(props.userProfile.isPro);
    const emptySheet = props.sheetDataArray.length === 0;
    const numRows = (_a = props.sheetDataArray[props.selectedSheetIndex]) == null ? void 0 : _a.numRows;
    const loadExport = () => __async(void 0, null, function* () {
      if (emptySheet) {
        return;
      }
      if (props.uiState.exportConfiguration.exportType === "csv") {
        const response = yield props.mitoAPI.getDataframeAsCSV(props.selectedSheetIndex);
        const csvString = "error" in response ? "" : response.result;
        setExportHref(URL.createObjectURL(new Blob(
          [csvString],
          { type: "text/csv" }
        )));
      } else if (props.uiState.exportConfiguration.exportType === "excel") {
        const response = yield props.mitoAPI.getDataframesAsExcel(props.uiState.exportConfiguration.sheetIndexes, exportFormatting);
        const excelString = "error" in response ? "" : response.result;
        try {
          const arr = [Uint8Array.from(window.atob(excelString), (c) => c.charCodeAt(0))];
          setExportHref(URL.createObjectURL(new Blob(
            arr,
            { type: "text/csv" }
          )));
        } catch (e) {
          console.error(e);
        }
      }
    });
    useDebouncedEffect(() => {
      setExportHref("");
      void loadExport();
    }, [props.uiState.exportConfiguration, props.selectedSheetIndex, props.sheetDataArray, exportFormatting], 500);
    const onDownload = () => {
      if (invalidFileNameWarning) {
        return;
      }
      void props.mitoAPI.log(
        "button_download_log_event",
        {
          sheet_index: props.selectedSheetIndex,
          export_type: props.uiState.exportConfiguration.exportType
        }
      );
    };
    if (emptySheet) {
      return /* @__PURE__ */ react_default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    let exportName = "";
    let fileName = props.uiState.exportConfiguration.fileName;
    if (!fileName || fileName === "") {
      fileName = "MitoExport";
    }
    if (props.uiState.exportConfiguration.exportType === "csv") {
      exportName = `${fileName}.csv`;
    } else if (props.uiState.exportConfiguration.exportType === "excel") {
      exportName = `${fileName}.xlsx`;
    }
    const invalidFileNameWarning = getInvalidFileNameError(fileName);
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Download",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "File Name"), /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        width: "medium",
        value: (_b = props.uiState.exportConfiguration.fileName) != null ? _b : "",
        onChange: (event) => {
          props.setUIState((prevUiState) => {
            return __spreadProps(__spreadValues({}, prevUiState), {
              exportConfiguration: __spreadProps(__spreadValues({}, prevUiState.exportConfiguration), {
                fileName: event.target.value
              })
            });
          });
        },
        placeholder: "MitoExport"
      }
    )), invalidFileNameWarning !== void 0 && /* @__PURE__ */ react_default.createElement(Row_default, { justify: "end", align: "end" }, " ", /* @__PURE__ */ react_default.createElement("p", { className: "text-color-error" }, invalidFileNameWarning), " "), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "File Type"), /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        width: "medium",
        value: props.uiState.exportConfiguration.exportType,
        onChange: (newExportType) => {
          setExportHref("");
          props.setUIState((prevUIState) => {
            if (newExportType === "csv") {
              return __spreadProps(__spreadValues({}, prevUIState), {
                exportConfiguration: {
                  exportType: "csv",
                  fileName: prevUIState.exportConfiguration.fileName
                }
              });
            } else {
              return __spreadProps(__spreadValues({}, prevUIState), {
                exportConfiguration: {
                  exportType: "excel",
                  fileName: prevUIState.exportConfiguration.fileName,
                  sheetIndexes: [props.selectedSheetIndex]
                }
              });
            }
          });
        }
      },
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "csv",
          subtext: "Exporting as a csv will not preserve any formatting."
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "excel",
          subtext: numRows > 1048576 ? `An Excel file holds at most 1,048,576 rows, but there are ${numRows} rows in this dataframe. We'll export the first 1,048,576 rows, but this may take several minutes.` : `Due to Python limitations, Excel export can be slower than CSV export.`
        }
      )
    )), props.uiState.exportConfiguration.exportType === "excel" && /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(Row_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Export with formatting"), "\xA0", !props.userProfile.isPro && /* @__PURE__ */ react_default.createElement(ProIcon_default, null)), /* @__PURE__ */ react_default.createElement(Row_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-subtext-1" }, "Exporting with formatting may take several minutes"))), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Toggle_default,
      {
        value: exportFormatting,
        disabled: !props.userProfile.isPro,
        onChange: () => {
          setExportFormatting(!exportFormatting);
        }
      }
    ))), /* @__PURE__ */ react_default.createElement(
      ExcelDownloadConfigSection_default,
      {
        dfNames: props.dfNames,
        mitoAPI: props.mitoAPI,
        userProfile: props.userProfile,
        sheetDataArray: props.sheetDataArray,
        exportState: props.uiState.exportConfiguration,
        setUIState: props.setUIState,
        newlyFormattedColumns,
        setNewlyFormattedColumns
      }
    )), props.uiState.exportConfiguration.exportType === "csv" && /* @__PURE__ */ react_default.createElement(
      CSVDownloadConfigSection_default,
      {
        sheetDataArray: props.sheetDataArray,
        mitoAPI: props.mitoAPI,
        selectedSheetIndex: props.selectedSheetIndex,
        setUIState: props.setUIState
      }
    ))), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneFooter_default, null, exportHRef === "" && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, "Preparing file. This may take several minutes ", /* @__PURE__ */ react_default.createElement(LoadingCounter_default, null)), /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        disabled: !!invalidFileNameWarning || exportHRef === "",
        href: exportHRef,
        download: exportName,
        onClick: onDownload
      },
      exportHRef === "" ? /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, "Preparing file ", /* @__PURE__ */ react_default.createElement(LoadingDots_default, null)) : `Download ${props.uiState.exportConfiguration.exportType === "csv" ? "CSV file" : "Excel workbook"}`
    )));
  };
  var DownloadTaskpane_default = DownloadTaskpane;

  // src/mito/components/taskpanes/DropDuplicates/DropDuplicates.tsx
  init_react();

  // src/mito/components/elements/MultiToggleColumns.tsx
  init_react();

  // src/mito/components/elements/ExpandableWarning.tsx
  init_react();

  // src/mito/components/icons/TriangleExpandCollapseIcon.tsx
  init_react();
  var TriangleExpandCollapseIcon = (props) => {
    if (props.action === "collapse") {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "8px", height: "8px", viewBox: "0 0 8 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M3.72339 6L0.259287 0L7.18749 0L3.72339 6Z", fill: "var(--mito-status-warning-dark)" }));
    } else {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "8px", height: "8px", viewBox: "0 0 7 8", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M6.72339 4L0.723389 7.4641L0.723389 0.535898L6.72339 4Z", fill: "var(--mito-status-warning-dark)" }));
    }
  };
  var TriangleExpandCollapseIcon_default = TriangleExpandCollapseIcon;

  // src/mito/components/elements/ExpandableWarning.tsx
  var ExpandableWarning = (props) => {
    const [isExpanded, setIsExpanded] = react_default.useState(false);
    if (props.warningState === void 0 || props.warningState.warningStrings.length === 0 || props.warningState.dismissed) {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
    } else if (props.warningState.warningStrings.length === 1) {
      return /* @__PURE__ */ react_default.createElement("div", { className: "caution-text-container" }, /* @__PURE__ */ react_default.createElement(CautionIcon_default, { width: "25px", height: "30px", color: "var(--mito-status-warning-dark)" }), /* @__PURE__ */ react_default.createElement("p", { className: "caution-text" }, props.warningState.warningStrings[0]), /* @__PURE__ */ react_default.createElement(
        XIcon_default,
        {
          onClick: props.warningState.dismiss,
          strokeColor: "var(--mito-status-warning-dark)",
          rounded: true,
          width: "12px",
          style: { cursor: "pointer" }
        }
      ));
    } else {
      return /* @__PURE__ */ react_default.createElement(
        "div",
        {
          className: "caution-text-container expandable-caution-text-container",
          style: {
            background: "var(--mito-status-warning)",
            border: "1px solid var(--mito-status-warning-dark)"
          },
          onClick: (e) => {
            setIsExpanded(!isExpanded);
            e.stopPropagation();
          }
        },
        /* @__PURE__ */ react_default.createElement(
          "div",
          {
            style: { display: "flex", width: "100%", alignItems: "center", justifyContent: "space-between" }
          },
          /* @__PURE__ */ react_default.createElement(CautionIcon_default, { width: "54px", height: "30px", color: "var(--mito-status-warning-dark)" }),
          /* @__PURE__ */ react_default.createElement("p", { className: "caution-text" }, /* @__PURE__ */ react_default.createElement(
            TriangleExpandCollapseIcon_default,
            {
              action: isExpanded ? "collapse" : "expand"
            }
          ), `${props.warningState.warningStrings.length} merge key pairings were removed because at least one of the merge keys was missing from the source tabs.`),
          /* @__PURE__ */ react_default.createElement(
            XIcon_default,
            {
              onClick: props.warningState.dismiss,
              strokeColor: "var(--mito-status-warning-dark)",
              rounded: true,
              width: "23px",
              style: { cursor: "pointer" }
            }
          )
        ),
        isExpanded && /* @__PURE__ */ react_default.createElement("ul", { style: { margin: "4px 0" } }, props.warningState.warningStrings.map((warning, index) => {
          return /* @__PURE__ */ react_default.createElement("li", { className: "caution-text", key: index }, warning);
        }))
      );
    }
  };
  var ExpandableWarning_default = ExpandableWarning;

  // src/mito/components/elements/MultiToggleColumns.tsx
  var MultiToggleColumns = (props) => {
    var _a, _b;
    const columnIDsMap = ((_a = props.sheetData) == null ? void 0 : _a.columnIDsMap) || {};
    const columnIDsAndDtype = Object.entries(((_b = props.sheetData) == null ? void 0 : _b.columnDtypeMap) || {});
    const columnIDs = columnIDsAndDtype.map(([cid]) => {
      return cid;
    });
    return /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(
      ExpandableWarning_default,
      {
        warningState: props.warningState
      }
    ), /* @__PURE__ */ react_default.createElement(
      MultiToggleBox_default,
      {
        searchable: true,
        onToggleAll: (newSelectedIndexes) => {
          const newSelectedColumnIDs = newSelectedIndexes.map((index) => {
            return columnIDs[index];
          });
          props.onChange(newSelectedColumnIDs);
        },
        height: "medium"
      },
      [
        ...columnIDsAndDtype.map(([columnID, columnDtype], index) => {
          const columnHeader = columnIDsMap[columnID];
          const toggle = props.selectedColumnIDs.includes(columnID);
          const disabled = props.disabledColumnIDs !== void 0 && props.disabledColumnIDs.includes(columnID) || props.getIsDisabledColumnID !== void 0 && props.getIsDisabledColumnID(columnID, columnHeader, columnDtype);
          const displayColumnHeader = props.getDisplayColumnHeaderOverride !== void 0 ? props.getDisplayColumnHeaderOverride(columnID, columnHeader) : getDisplayColumnHeader(columnHeader);
          return /* @__PURE__ */ react_default.createElement(
            MultiToggleItem_default,
            {
              key: index,
              index,
              title: displayColumnHeader,
              rightText: getDtypeValue(columnDtype),
              toggled: toggle,
              onToggle: () => {
                const newSelectedColumnIds = [...props.selectedColumnIDs];
                toggleInArray(newSelectedColumnIds, columnID);
                props.onChange(newSelectedColumnIds);
              },
              disabled
            }
          );
        })
      ]
    ));
  };
  var MultiToggleColumns_default = MultiToggleColumns;

  // src/mito/components/taskpanes/DropDuplicates/DropDuplicates.tsx
  var getDefaultParams2 = (selectedSheetIndex, sheetDataArray) => {
    var _a;
    if (sheetDataArray.length === 0) {
      return void 0;
    }
    return {
      sheet_index: selectedSheetIndex,
      column_ids: Object.keys((_a = sheetDataArray[selectedSheetIndex]) == null ? void 0 : _a.columnIDsMap),
      keep: "first"
    };
  };
  var DropDuplicatesTaskpane = (props) => {
    const { params, setParams, loading, edit, editApplied, attemptedEditWithTheseParamsMultipleTimes, result } = useSendEditOnClick_default(
      () => getDefaultParams2(props.selectedSheetIndex, props.sheetDataArray),
      "drop_duplicates" /* DropDuplicates */,
      props.mitoAPI,
      props.analysisData
    );
    if (props.sheetDataArray.length === 0 || params === void 0) {
      return /* @__PURE__ */ react_default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    if (props.sheetDataArray[params.sheet_index] === void 0) {
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenTaskpane: { type: "none" /* NONE */ }
        });
      });
      return /* @__PURE__ */ react_default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Drop Duplicates",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement(
      DataframeSelect_default,
      {
        title: "Dataframe to drop duplicates within.",
        sheetDataArray: props.sheetDataArray,
        sheetIndex: params.sheet_index,
        onChange: (newSheetIndex) => {
          setParams((dropDuplicateParams) => {
            return __spreadProps(__spreadValues({}, dropDuplicateParams), {
              sheet_index: newSheetIndex,
              column_ids: props.sheetDataArray[newSheetIndex].data.map((c) => c.columnID)
            });
          });
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              selectedSheetIndex: newSheetIndex
            });
          });
        }
      }
    ), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Duplicates to Keep")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        width: "small",
        value: params.keep + "",
        onChange: (newKeep) => {
          if (newKeep === "false") {
            newKeep = false;
          }
          setParams((dropDuplicateParams) => {
            return __spreadProps(__spreadValues({}, dropDuplicateParams), {
              keep: newKeep
            });
          });
        }
      },
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "first",
          subtext: "Keep the first instance of the duplicated row."
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "last",
          subtext: "Keep the last instance of the duplicated row."
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          id: "false",
          title: "none",
          subtext: "Keep none of the duplicated rows."
        }
      )
    ))), /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3 mt-10px" }, "Columns to Deduplicate On"), /* @__PURE__ */ react_default.createElement(
      MultiToggleColumns_default,
      {
        sheetData: props.sheetDataArray[params.sheet_index],
        selectedColumnIDs: params.column_ids,
        onChange: (newSelectedColumnIDs) => {
          setParams((oldDropDuplicateParams) => {
            return __spreadProps(__spreadValues({}, oldDropDuplicateParams), {
              column_ids: newSelectedColumnIDs
            });
          });
        }
      }
    ), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 25 }), /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => edit(),
        disabled: false
      },
      !loading ? `Drop duplicates in ${params.column_ids.length} columns` : "Dropping duplicates..."
    ), editApplied && !loading && /* @__PURE__ */ react_default.createElement(Row_default, { className: "mt-5" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-subtext-1" }, "Removed ", /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, !attemptedEditWithTheseParamsMultipleTimes ? (result == null ? void 0 : result.num_rows_dropped) || 0 : 0), " rows."))));
  };
  var DropDuplicates_default = DropDuplicatesTaskpane;

  // src/mito/components/taskpanes/ExcelRangeImport/ExcelRangeImportTaskpane.tsx
  init_react();

  // src/mito/components/elements/ExpandableContentCard.tsx
  init_react();
  var ExpandableContentCard = (props) => {
    const XElement = /* @__PURE__ */ react_default.createElement(Col_default, { title: "Delete conditional formatting rule" }, /* @__PURE__ */ react_default.createElement(
      XIcon_default,
      {
        onClick: (e) => {
          e.stopPropagation();
          props.onDelete();
        }
      }
    ));
    if (!props.isExpanded) {
      return /* @__PURE__ */ react_default.createElement("div", { className: "expandable-content-card", onClick: () => props.setExpanded(true) }, /* @__PURE__ */ react_default.createElement(Row_default, { suppressTopBottomMargin: true, align: "center", justify: "start" }, props.icon !== void 0 && /* @__PURE__ */ react_default.createElement(Col_default, { offsetRight: 1, title: props.iconTitle }, props.icon), /* @__PURE__ */ react_default.createElement(Col_default, { span: 17.5 }, /* @__PURE__ */ react_default.createElement("div", { className: "flex flex-column" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1" }, props.title), /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2" }, props.subtitle))), props.icon === void 0 && /* @__PURE__ */ react_default.createElement(Col_default, { offsetRight: 4 }), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(Row_default, { align: "top", justify: "end", suppressTopBottomMargin: true }, /* @__PURE__ */ react_default.createElement(Col_default, { className: "mr-5px" }, /* @__PURE__ */ react_default.createElement(UpArrowIcon_default, null)), XElement))));
    } else {
      return /* @__PURE__ */ react_default.createElement("div", { className: "expandable-content-card" }, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", onClick: () => props.setExpanded(false) }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 22 }, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, props.expandedTitle)), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "end" }, /* @__PURE__ */ react_default.createElement(Col_default, { className: "mr-5px" }, /* @__PURE__ */ react_default.createElement(DownArrowIcon_default, null)), XElement)), props.children);
    }
  };
  var ExpandableContentCard_default = ExpandableContentCard;

  // src/mito/components/taskpanes/ExcelRangeImport/ExcelRangeDynamicImportSection.tsx
  init_react();

  // src/mito/components/taskpanes/ExcelRangeImport/ExcelRangeDynamicCondition.tsx
  init_react();
  function ExcelRangeDynamicCondition(props) {
    const currentSubtext = props.conditionOptions[props.condition.type].subtext;
    const placeholderValue = props.conditionOptions[props.condition.type].placeholderValue;
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, props.title))), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1" }, "Find By")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        width: "medium",
        value: props.condition.type,
        onChange: (newType) => {
          const newConditionType = newType;
          const newCondition = __spreadProps(__spreadValues({}, props.condition), { type: newConditionType });
          if (props.conditionOptions[newConditionType].placeholderValue !== void 0) {
            newCondition.value = "";
          } else if ("value" in newCondition) {
            delete newCondition.value;
          }
          props.setCondition(newCondition);
        }
      },
      Object.entries(props.conditionOptions).map(([type, option]) => {
        return /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            title: option.title,
            id: type,
            subtext: option.subtext,
            key: type
          }
        );
      })
    ))), "value" in props.condition && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      LabelAndTooltip_default,
      {
        textBody: true,
        tooltip: currentSubtext
      },
      "Value"
    )), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        width: "medium",
        placeholder: placeholderValue,
        value: "" + props.condition.value,
        onChange: (e) => {
          const newValue = e.target.value;
          props.setCondition(__spreadProps(__spreadValues({}, props.condition), { value: newValue }));
        }
      }
    )))));
  }
  var ExcelRangeDynamicCondition_default = ExcelRangeDynamicCondition;

  // src/mito/components/taskpanes/ExcelRangeImport/ExcelRangeDynamicImportSection.tsx
  var ExcelRangeDynamicSection = (props) => {
    const rangeImport = props.rangeImport;
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
      ExcelRangeDynamicCondition_default,
      {
        title: "Starting Row Condition",
        condition: rangeImport.start_condition,
        setCondition: (newCondition) => {
          props.setParams((prevParams) => {
            const newRangeImports = window.structuredClone(prevParams.range_imports);
            const newRangeImport = window.structuredClone(rangeImport);
            newRangeImport.start_condition = newCondition;
            newRangeImports[props.index] = newRangeImport;
            return __spreadProps(__spreadValues({}, prevParams), {
              range_imports: newRangeImports
            });
          });
        },
        conditionOptions: {
          "upper left corner value": { "title": "Top Left Corner Value", "subtext": "Mito will search for this exact value (including whitespace).", "placeholderValue": "start value" },
          "upper left corner value starts with": { "title": "Top Left Corner Starts With", "subtext": "Mito will search for a cell that starts with this value.", "placeholderValue": "start value" },
          "upper left corner value contains": { "title": "Top Left Corner Contains", "subtext": "Mito will search for a cell that contains this value.", "placeholderValue": "start value" }
        }
      }
    ), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 10, seperatingLine: true }), /* @__PURE__ */ react_default.createElement(
      ExcelRangeDynamicCondition_default,
      {
        title: "Ending Row Condition",
        condition: rangeImport.end_condition,
        setCondition: (newCondition) => {
          props.setParams((prevParams) => {
            const newRangeImports = window.structuredClone(prevParams.range_imports);
            const newRangeImport = window.structuredClone(rangeImport);
            newRangeImport.end_condition = newCondition;
            newRangeImports[props.index] = newRangeImport;
            return __spreadProps(__spreadValues({}, prevParams), {
              range_imports: newRangeImports
            });
          });
        },
        conditionOptions: {
          "first empty cell": { "title": "First Empty Cell", "subtext": "Mito will take all rows until it hits an empty cell in the first column." },
          "bottom left corner value": { "title": "Bottom Left Corner Value", "subtext": "Mito will take all rows until it finds this exact value (including whitespace) in the first column.", "placeholderValue": "end value" },
          "bottom left corner value starts with": { "title": "Bottom Left Corner Starts With", "subtext": "Mito will take all rows until it finds a cell that starts with this value in the first column.", "placeholderValue": "end value" },
          "bottom left corner value contains": { "title": "Bottom Left Corner Contains", "subtext": "Mito will take all rows until it finds a cell that contains with this value in the first column.", "placeholderValue": "end value" },
          "bottom left corner consecutive empty cells": { "title": "Number of Empty Cells in Row", "subtext": "Mito will take all rows until it finds a row with at least this number of empty cells.", "placeholderValue": "4" },
          "bottom left corner consecutive empty cells in first column": { "title": "Consecutive Empty in Column", "subtext": "Mito will take all rows until the first column has this number of empty cells in a row.", "placeholderValue": "4" },
          "row entirely empty": { "title": "Row Entirely Empty", "subtext": "Mito will take all rows unitl it finds a row where all the columns have empty values." },
          "cumulative number of empty rows": { "title": "Cumulative # of Empty Rows", "subtext": "Mito will take all rows until it finds this number of empty rows. They do not need to be consecutive.", "placeholderValue": "4" },
          "consecutive number of empty rows": { "title": "Consecutive # of Empty Rows", "subtext": "Mito will take all rows until it finds this number of consecutive empty rows.", "placeholderValue": "4" }
        }
      }
    ), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 10, seperatingLine: true }), /* @__PURE__ */ react_default.createElement(
      ExcelRangeDynamicCondition_default,
      {
        title: "Ending Column Condition",
        condition: rangeImport.column_end_condition,
        setCondition: (newCondition) => {
          props.setParams((prevParams) => {
            const newRangeImports = window.structuredClone(prevParams.range_imports);
            const newRangeImport = window.structuredClone(rangeImport);
            newRangeImport.column_end_condition = newCondition;
            newRangeImports[props.index] = newRangeImport;
            return __spreadProps(__spreadValues({}, prevParams), {
              range_imports: newRangeImports
            });
          });
        },
        conditionOptions: {
          "first empty cell": { "title": "First Empty Cell", "subtext": "Mito will continue take all columns until it hits an empty cell in the first row." },
          "num columns": { "title": "Number of Columns", "subtext": "Mito will take this number of columns.", "placeholderValue": "4" }
        }
      }
    ));
  };
  var ExcelRangeDynamicImportSection_default = ExcelRangeDynamicSection;

  // src/mito/components/taskpanes/ExcelRangeImport/ExcelRangeRangeSection.tsx
  init_react();
  var ExcelRangeRangeSection = (props) => {
    const rangeImport = props.rangeImport;
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      LabelAndTooltip_default,
      {
        textBody: true,
        tooltip: "The proper format is COLUMNROW:COLUMNROW. For example, A1:B10, C10:G1000."
      },
      "Excel Range"
    )), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        width: "medium",
        placeholder: "A10:C100",
        value: "" + rangeImport.value,
        onChange: (e) => {
          const newValue = e.target.value;
          props.setParams((prevParams) => {
            const newRangeImports = window.structuredClone(prevParams.range_imports);
            const newRangeImport = window.structuredClone(rangeImport);
            newRangeImport.value = newValue;
            newRangeImports[props.index] = newRangeImport;
            return __spreadProps(__spreadValues({}, prevParams), {
              range_imports: newRangeImports
            });
          });
        }
      }
    ))));
  };
  var ExcelRangeRangeSection_default = ExcelRangeRangeSection;

  // src/mito/components/taskpanes/ExcelRangeImport/ExcelRangeSheetSelection.tsx
  init_react();
  function ExcelRangeSheetSelection(props) {
    const params = props.params;
    const setParams = props.setParams;
    const sheet_name = props.sheet_name;
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(CollapsibleSection_default, { title: "Select Sheet" }, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Select By")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        width: "medium",
        value: params.sheet.type,
        onChange: (newType) => {
          const newParams = __spreadValues({}, params);
          newParams.sheet.type = newType;
          if (newType === "sheet name") {
            newParams.sheet.value = props.sheet_names[0];
          } else {
            newParams.sheet.value = 0;
          }
          setParams(newParams);
        }
      },
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "Sheet Name",
          id: "sheet name",
          subtext: "Select a sheet by name to import multiple ranges from."
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "Sheet Index",
          id: "sheet index",
          subtext: "Select a sheet by index in the Excel file. Use a negative index to count backwards from the end of the sheet list"
        }
      )
    ))), params.sheet.type === "sheet name" && /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Sheet Name")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        width: "medium",
        value: params.sheet.value,
        onChange: (newValue) => {
          const newParams = __spreadValues({}, params);
          newParams.sheet.value = newValue;
          setParams(newParams);
        }
      },
      props.sheet_names.map((sheet_name2, sheet_index) => {
        return /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            title: sheet_name2,
            key: sheet_index
          }
        );
      })
    ))), params.sheet.type === "sheet index" && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(
      LabelAndTooltip_default,
      {
        tooltip: "Indexes are 0-based. Use a negative index to count backwards from the end of the sheet list."
      },
      "Sheet Index"
    ), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        width: "medium",
        type: "number",
        value: "" + params.sheet.value,
        onChange: (e) => {
          let newValue = e.target.value;
          const parsedValue = parseInt(newValue);
          if (!isNaN(parsedValue)) {
            newValue = parsedValue;
          }
          const newParams = __spreadValues({}, params);
          newParams.sheet.value = newValue;
          setParams(newParams);
        }
      }
    ))), /* @__PURE__ */ react_default.createElement("p", { className: "text-subtext-1" }, sheet_name !== void 0 && `${sheet_name} is selected.`, sheet_name === void 0 && `No sheet is selected. The index is out of bounds or invalid.`))), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 10 }));
  }
  var ExcelRangeSheetSelection_default = ExcelRangeSheetSelection;

  // src/mito/components/taskpanes/ExcelRangeImport/ExcelRangeImportTaskpane.tsx
  var getDefaultParams3 = (file_path, sheet_name) => {
    return {
      file_path,
      sheet: {
        type: "sheet name",
        value: sheet_name
      },
      range_imports: [{ "type": "range", "df_name": "", "value": "" }],
      convert_csv_to_xlsx: !file_path.endsWith("xlsx") && !file_path.endsWith("xlsm")
    };
  };
  function castConditionValueToNumberIfPossible(condition) {
    if ("value" in condition) {
      const value = condition.value;
      if (typeof value === "string") {
        const parsedValue = parseFloat(value);
        const isOnlyNumber = /^[+-]?\d+(\.\d+)?$/.test(value);
        if (!isNaN(parsedValue) && isOnlyNumber) {
          return __spreadProps(__spreadValues({}, condition), {
            value: parsedValue
          });
        }
      } else {
        return condition;
      }
    }
    return condition;
  }
  var ExcelRangeImportTaskpane = (props) => {
    const { params, setParams, edit, error } = useSendEditOnClick_default(
      () => getDefaultParams3(props.file_path, props.sheet_name),
      "excel_range_import" /* ExcelRangeImport */,
      props.mitoAPI,
      props.analysisData,
      { overwiteStepIfClickedMultipleTimes: true }
    );
    const [expandedIndex, setExpandedIndex] = useState(0);
    if (params === void 0) {
      return /* @__PURE__ */ react_default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    let sheet_name = "";
    if (params.sheet.type === "sheet name") {
      sheet_name = params.sheet.value;
    } else {
      sheet_name = props.sheet_names[params.sheet.value < 0 ? props.sheet_names.length + params.sheet.value : params.sheet.value];
    }
    let disabledTooltip = void 0;
    if (params.range_imports.length === 0) {
      disabledTooltip = "Please add range imports above before importing them.";
    } else if (sheet_name === void 0) {
      disabledTooltip = "Select a sheet to import from. The sheet index is out of bounds.";
    } else {
      params.range_imports.forEach((rangeImport) => {
        if (rangeImport.df_name === "") {
          disabledTooltip = "Please ensure all range imports have a defined dataframe name.";
        }
        if (rangeImport.type === "dynamic") {
          if ("value" in rangeImport.start_condition && rangeImport.start_condition.value === "") {
            disabledTooltip = "Please ensure all range imports have a defined start condition.";
          }
          if ("value" in rangeImport.end_condition && rangeImport.end_condition.value === "") {
            disabledTooltip = "Please ensure all range imports have a defined row end condition.";
          }
          if ("value" in rangeImport.column_end_condition && rangeImport.column_end_condition.value === "") {
            disabledTooltip = "Please ensure all range imports have a defined column end condition.";
          }
        } else {
          if (rangeImport.value === "") {
            disabledTooltip = "Please ensure all range imports have a defined range.";
          }
        }
      });
    }
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Excel Range Import",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement(
      ExcelRangeSheetSelection_default,
      {
        params,
        setParams,
        sheet_names: props.sheet_names,
        sheet_name
      }
    ), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Range Imports")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        onClick: () => {
          setParams((prevParams) => {
            const newRangeImports = window.structuredClone(prevParams.range_imports);
            const previousType = newRangeImports.length > 0 ? newRangeImports[0].type : "range";
            if (previousType === "range") {
              newRangeImports.unshift({ "type": "range", "df_name": "", "value": "" });
            } else {
              newRangeImports.unshift({ "type": "dynamic", "df_name": "", "start_condition": { "type": "upper left corner value", "value": "" }, "end_condition": { "type": "first empty cell" }, "column_end_condition": { "type": "first empty cell" } });
            }
            return __spreadProps(__spreadValues({}, prevParams), {
              range_imports: newRangeImports
            });
          });
          setExpandedIndex(0);
        },
        width: "small"
      },
      "+ Add"
    ))), error !== void 0 && /* @__PURE__ */ react_default.createElement("p", { className: "text-color-error" }, error), params.range_imports.map((range_import, index) => {
      return /* @__PURE__ */ react_default.createElement(
        ExpandableContentCard_default,
        {
          key: index,
          title: range_import.df_name === "" ? "Unnamed dataframe" : `Importing ${range_import.df_name}`,
          subtitle: "Expand to configure range import.",
          expandedTitle: "Edit Range Import",
          isExpanded: index === expandedIndex,
          setExpanded: (newIsExpanded) => {
            if (newIsExpanded) {
              setExpandedIndex(index);
            } else {
              setExpandedIndex(-1);
            }
          },
          onDelete: () => {
            setParams((prevParams) => {
              const newRangeImports = window.structuredClone(prevParams.range_imports);
              newRangeImports.splice(index, 1);
              return __spreadProps(__spreadValues({}, prevParams), {
                range_imports: newRangeImports
              });
            });
            if (expandedIndex >= index) {
              setExpandedIndex(expandedIndex - 1);
            }
          }
        },
        /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1" }, "Name")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
          Input_default,
          {
            width: "medium",
            autoFocus: true,
            placeholder: "company_ids",
            value: range_import.df_name,
            onChange: (e) => {
              const newDfName = e.target.value;
              setParams((prevParams) => {
                const newRangeImports = window.structuredClone(prevParams.range_imports);
                newRangeImports[index].df_name = newDfName;
                return __spreadProps(__spreadValues({}, prevParams), {
                  range_imports: newRangeImports
                });
              });
            }
          }
        ))),
        /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1" }, "Locate By")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
          Select_default,
          {
            width: "medium",
            value: range_import.type,
            onChange: (newType) => {
              setParams((prevParams) => {
                const newRangeImports = window.structuredClone(prevParams.range_imports);
                const newRangeImportType = newType;
                const previousRangeImport = prevParams.range_imports[index];
                let newRangeImport = prevParams.range_imports[index];
                if (newRangeImportType === "range") {
                  newRangeImport = {
                    "type": newRangeImportType,
                    "df_name": previousRangeImport.df_name,
                    "value": "value" in previousRangeImport ? previousRangeImport.value : ""
                  };
                } else {
                  newRangeImport = {
                    "type": "dynamic",
                    "df_name": previousRangeImport.df_name,
                    "start_condition": { "type": "upper left corner value", "value": "" },
                    "end_condition": { "type": "first empty cell" },
                    "column_end_condition": { "type": "first empty cell" }
                  };
                }
                newRangeImports[index] = newRangeImport;
                return __spreadProps(__spreadValues({}, prevParams), {
                  range_imports: newRangeImports
                });
              });
            }
          },
          /* @__PURE__ */ react_default.createElement(
            DropdownItem_default,
            {
              title: "Exact Range",
              id: "range",
              subtext: "Specify the exact range to import as a sheet."
            }
          ),
          /* @__PURE__ */ react_default.createElement(
            DropdownItem_default,
            {
              title: "Dynamic",
              id: "Dynamic",
              subtext: "Specify values and dynamic conditions to find the bounds of the data."
            }
          )
        ))),
        /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 10, seperatingLine: true }),
        range_import.type === "range" && /* @__PURE__ */ react_default.createElement(
          ExcelRangeRangeSection_default,
          {
            rangeImport: range_import,
            index,
            setParams
          }
        ),
        range_import.type === "dynamic" && /* @__PURE__ */ react_default.createElement(
          ExcelRangeDynamicImportSection_default,
          {
            rangeImport: range_import,
            index,
            setParams
          }
        )
      );
    })), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => {
          edit((params2) => {
            const finalRangeImports = params2.range_imports.map((rangeImport) => {
              let finalRangeImport = rangeImport;
              if (finalRangeImport.type === "dynamic") {
                const startCondition = castConditionValueToNumberIfPossible(finalRangeImport.start_condition);
                const endCondition = castConditionValueToNumberIfPossible(finalRangeImport.end_condition);
                const columnEndCondition = castConditionValueToNumberIfPossible(finalRangeImport.column_end_condition);
                finalRangeImport = __spreadProps(__spreadValues({}, finalRangeImport), {
                  start_condition: startCondition,
                  end_condition: endCondition,
                  column_end_condition: columnEndCondition
                });
              }
              return finalRangeImport;
            });
            finalRangeImports.reverse();
            return __spreadProps(__spreadValues({}, params2), {
              range_imports: finalRangeImports
            });
          });
        },
        disabled: disabledTooltip !== void 0,
        disabledTooltip
      },
      "Import Ranges"
    )));
  };
  var ExcelRangeImportTaskpane_default = ExcelRangeImportTaskpane;

  // src/mito/components/taskpanes/ExportToFile/ExportToFileTaskpane.tsx
  init_react();
  var getDefaultParams4 = (sheetDataArray, sheetIndex, isPro) => {
    if (sheetDataArray.length === 0 || sheetDataArray[sheetIndex] === void 0) {
      return void 0;
    }
    const sheetName = sheetDataArray[sheetIndex].dfName;
    return {
      type: "csv",
      sheet_indexes: [sheetIndex],
      file_name: `${sheetName}_export`,
      export_formatting: isPro != null ? isPro : false
    };
  };
  var ExportToFileTaskpane = (props) => {
    const { params, setParams, edit, editApplied, loading } = useSendEditOnClick_default(
      () => getDefaultParams4(props.sheetDataArray, props.selectedSheetIndex, props.userProfile.isPro),
      "export_to_file" /* ExportToFile */,
      props.mitoAPI,
      props.analysisData
    );
    if (params === void 0) {
      return /* @__PURE__ */ react_default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState, message: "Please import a dataframe before attempting to export it" });
    }
    let invalidFileNameWarning = void 0;
    if (params.type === "csv" && params.file_name.endsWith(".xlsx")) {
      invalidFileNameWarning = "The .xlsx file extension does not match the CSV File Type.";
    } else if (params.type === "excel" && (params.file_name.endsWith(".txt") || params.file_name.endsWith(".csv"))) {
      invalidFileNameWarning = "The file extension ending does not match the Excel file type.";
    } else {
      invalidFileNameWarning = getInvalidFileNameError(params.file_name);
    }
    let exportFileDisabledMessage = void 0;
    if (!props.userProfile.isPro) {
      exportFileDisabledMessage = "Upgrade to Mito Pro to export with formatting.";
    } else if (params.type !== "excel") {
      exportFileDisabledMessage = "CSV files cannot be formatted. Switch to Excel export to export formatting.";
    }
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Export To File",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", title: "TODO" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "File Name")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        autoFocus: true,
        placeholder: "MitoExport",
        width: "medium",
        value: "" + params.file_name,
        onChange: (e) => {
          const newValue = e.target.value;
          setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              file_name: newValue
            });
          });
        }
      }
    ))), invalidFileNameWarning !== void 0 && /* @__PURE__ */ react_default.createElement("p", { className: "text-color-error" }, invalidFileNameWarning), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "File Type")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        width: "medium",
        value: params.type,
        onChange: (newType) => {
          setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              type: newType
            });
          });
        }
      },
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: "CSV", id: "csv", subtext: "Each dataframe will be exported as a seperate CSV file. If multiple dataframes are exported, their names will be appended to the file name." }),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: "Excel", id: "excel", subtext: "Each exported dataframe will be exported as a seperate sheet." })
    ))), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", title: exportFileDisabledMessage }, /* @__PURE__ */ react_default.createElement(Col_default, { style: { display: "flex" } }, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Export with formatting"), "\xA0", !props.userProfile.isPro && /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(ProIcon_default, null))), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Toggle_default,
      {
        value: params.type === "excel" ? params.export_formatting : false,
        disabled: !props.userProfile.isPro || params.type !== "excel",
        title: exportFileDisabledMessage,
        onChange: () => {
          setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              export_formatting: !prevParams.export_formatting
            });
          });
        }
      }
    ))), /* @__PURE__ */ react_default.createElement(Row_default, null, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Dataframes to Export"))), /* @__PURE__ */ react_default.createElement(
      MultiToggleDataframes_default,
      {
        height: "medium",
        sheetDataArray: props.sheetDataArray,
        selectedSheetIndexes: params.sheet_indexes,
        setUIState: props.setUIState,
        onChange: (newSelectedSheetIndexes) => {
          setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              sheet_indexes: newSelectedSheetIndexes
            });
          });
        }
      }
    )), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneFooter_default, null, editApplied && /* @__PURE__ */ react_default.createElement("p", { className: "text-subtext-1" }, "Export code generated."), /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => {
          edit();
        },
        disabled: params.file_name === "" || params.sheet_indexes.length === 0 || invalidFileNameWarning !== void 0 || loading
      },
      loading ? "Generating..." : "Generate Export Code"
    )));
  };
  var ExportToFileTaskpane_default = ExportToFileTaskpane;

  // src/mito/components/taskpanes/FileImport/FileImportTaskpane.tsx
  init_react();

  // src/mito/components/import/FileBrowser/FileBrowser.tsx
  init_react();

  // src/mito/components/icons/ConfigureIcon.tsx
  init_react();
  var ConfigureIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M8.89617 1.82873L7.80328 2.57459L6.92896 2.04972V1H4.96175V2.04972L4.1694 2.57459L3.24044 1.82873L1.81967 3.18232L2.55738 4.09392C2.46135 4.43914 2.31148 5.06077 2.31148 5.06077L1 5.19889V6.96685L2.31148 7.1326L2.55738 8.20994L1.81967 9.14917L3.13115 10.3094L4.1694 9.50829L5.07104 10.0884V11H6.92896V10.0884L7.80328 9.50829L8.89617 10.3094L10.153 9.14917L9.44262 8.20994L9.79781 7.1326L11 6.96685V5.19889L9.79781 4.9779L9.44262 4.09392L10.153 3.18232L8.89617 1.82873Z", stroke: "var(--mito-highlight)" }));
  };
  var ConfigureIcon_default = ConfigureIcon;

  // src/mito/utils/packageVersion.tsx
  var isAtLeastBenchmarkVersion = (currentVersion, benchmarkVersion) => {
    const currentVersionParts = currentVersion.split(".").map((versionPart) => parseInt(versionPart));
    const benchmarkVersionParts = benchmarkVersion.split(".").map((versionPart) => parseInt(versionPart));
    if (currentVersionParts.length == 1) {
      currentVersionParts[1] = 0;
    }
    if (currentVersionParts.length == 2) {
      currentVersionParts[2] = 0;
    }
    for (let i = 0; i < currentVersionParts.length; i++) {
      if (currentVersionParts[i] > benchmarkVersionParts[i]) {
        return true;
      }
      if (currentVersionParts[i] < benchmarkVersionParts[i]) {
        return false;
      }
    }
    return true;
  };
  var isExcelImportEnabled = (userProfile) => {
    return isAtLeastBenchmarkVersion(userProfile.pythonVersion, "3.6.0") && isAtLeastBenchmarkVersion(userProfile.pandasVersion, "0.25.0");
  };

  // src/mito/components/taskpanes/FileImport/importUtils.tsx
  var PARENT_FOLDER_NAME = "Parent Folder";
  var getFileEnding = (elementName) => {
    try {
      const nameSplit = elementName.split(".");
      return nameSplit[nameSplit.length - 1];
    } catch (e) {
      return void 0;
    }
  };
  var getInvalidFileError = (selectedElement, userProfile) => {
    if (selectedElement.isDirectory) {
      return void 0;
    }
    const VALID_FILE_ENDINGS = [
      "csv",
      "tsv",
      "txt",
      "tab"
    ];
    if (isExcelImportEnabled(userProfile)) {
      VALID_FILE_ENDINGS.push("xlsx");
      if (userProfile.pandasVersion !== void 0 && isAtLeastBenchmarkVersion(userProfile.pandasVersion, "1.0.0")) {
        VALID_FILE_ENDINGS.push("xlsm");
      }
    }
    for (const ending of VALID_FILE_ENDINGS) {
      if (selectedElement.name.toLowerCase().endsWith(ending)) {
        return void 0;
      }
    }
    const fileEnding = getFileEnding(selectedElement.name);
    if (fileEnding === void 0) {
      return "Sorry, we don't support that file type.";
    } else if (fileEnding == "xlsx") {
      return "Upgrade to pandas>=0.25.0 and Python>3.6 to import Excel files.";
    } else {
      return `Sorry, we don't support ${fileEnding} files.`;
    }
  };
  var getImportButtonStatus = (selectedElement, userProfile, loadingImport, isUpdate) => {
    if (selectedElement === void 0) {
      return {
        disabled: true,
        buttonText: "Select a File to Import"
      };
    }
    if (selectedElement.isDirectory) {
      return {
        disabled: true,
        buttonText: "That's a Directory. Select a File"
      };
    }
    const invalidFileError = getInvalidFileError(selectedElement, userProfile);
    if (invalidFileError !== void 0) {
      return {
        disabled: true,
        buttonText: "Select a Supported File Type"
      };
    }
    if (loadingImport) {
      return {
        disabled: false,
        buttonText: "Importing..."
      };
    }
    return {
      disabled: false,
      buttonText: (!isUpdate ? "Import " : "Update to ") + selectedElement.name
    };
  };
  var isExcelFile = (element) => {
    return element !== void 0 && !(element == null ? void 0 : element.isDirectory) && ((element == null ? void 0 : element.name.toLowerCase().endsWith(".xlsx")) || (element == null ? void 0 : element.name.toLowerCase().endsWith(".xlsm")));
  };
  var getElementsToDisplay = (importState, analysisData) => {
    var _a;
    const allElements = [...importState.pathContents.elements];
    if (!inRootFolder(importState.pathContents.path_parts) && !inImportFolder(importState.pathContents.path_parts, (_a = analysisData.importFolderData) == null ? void 0 : _a.pathParts)) {
      allElements.push({
        isDirectory: true,
        isParentDirectory: true,
        name: PARENT_FOLDER_NAME,
        lastModified: 0
      });
    }
    const searchedElements = allElements.filter((element) => {
      return fuzzyMatch(element.name, importState.searchString) > 0.8;
    });
    return searchedElements.sort((elementOne, elementTwo) => {
      if (elementOne.name === PARENT_FOLDER_NAME) {
        return -1;
      } else if (elementTwo.name === PARENT_FOLDER_NAME) {
        return 1;
      }
      if (importState.sort === "name_ascending") {
        return elementOne.name < elementTwo.name ? -1 : 1;
      } else if (importState.sort === "name_descending") {
        return elementOne.name >= elementTwo.name ? -1 : 1;
      } else if (typeof elementOne.lastModified !== "number" || typeof elementTwo.lastModified !== "number") {
        return 1;
      } else if (importState.sort === "last_modified_ascending") {
        return elementOne.lastModified < elementTwo.lastModified ? -1 : 1;
      } else {
        return elementOne.lastModified >= elementTwo.lastModified ? -1 : 1;
      }
    });
  };
  var inRootFolder = (pathParts) => {
    pathParts = pathParts.filter((pathPart) => pathPart !== "");
    return pathParts.length === 1 && (pathParts[0] === "/" || pathParts[0] === "\\");
  };
  var inImportFolder = (pathParts, importFolderDataPathParts) => {
    if (importFolderDataPathParts === void 0) {
      return false;
    }
    if (pathParts.length !== importFolderDataPathParts.length) {
      return false;
    }
    for (let i = 0; i < pathParts.length; i++) {
      if (pathParts[i] !== importFolderDataPathParts[i]) {
        return false;
      }
    }
    return true;
  };
  var getFilePath = (mitoAPI, pathParts, file) => __async(void 0, null, function* () {
    const fullPath = [...pathParts];
    if (file === void 0) {
      return;
    }
    fullPath.push(file == null ? void 0 : file.name);
    const response = yield mitoAPI.getPathJoined(fullPath);
    return "error" in response ? void 0 : response.result;
  });

  // src/mito/components/import/FileBrowser/FileBrowserBody.tsx
  init_react();

  // src/mito/components/icons/SortArrowIcon.tsx
  init_react();
  var SortArrowIcon = (props) => {
    if (props.direction === "ascending") {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "8", height: "4", viewBox: "0 0 8 4", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M4.00073 4L0.536631 0.25H7.46483L4.00073 4Z", fill: "#C4C4C4" }));
    } else {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "8", height: "4", viewBox: "0 0 8 4", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M4.00073 0L0.536631 3.75H7.46483L4.00073 0Z", fill: "#C4C4C4" }));
    }
  };
  var SortArrowIcon_default = SortArrowIcon;

  // src/mito/components/import/FileBrowser/FileBrowserElement.tsx
  init_react();

  // src/mito/utils/time.tsx
  var MINUTE = 60;
  var HOUR = 60 * MINUTE;
  var DAY = 24 * HOUR;
  var WEEK = 7 * DAY;
  var MONTH = 4 * WEEK;
  var YEAR = 365 * DAY;
  var getLastModifiedString = (timestamp) => {
    if (timestamp === null || timestamp === void 0) {
      return "--";
    }
    const delta = Math.floor(Date.now() / 1e3) - timestamp;
    if (delta < HOUR) {
      const numMinutes = Math.round(delta / MINUTE);
      return `${numMinutes} mins`;
    } else if (delta < DAY) {
      const numHours = Math.round(delta / HOUR);
      return `${numHours} hours`;
    } else if (delta < WEEK) {
      const numDays = Math.round(delta / DAY);
      return `${numDays} days`;
    } else if (delta < MONTH) {
      const numWeeks = Math.round(delta / WEEK);
      return `${numWeeks} weeks`;
    } else if (delta < YEAR) {
      const numMonths = Math.round(delta / MONTH);
      return `${numMonths} months`;
    } else {
      const numYears = Math.round(delta / YEAR);
      return `${numYears} years`;
    }
  };

  // src/mito/components/icons/CSVFileIcon.tsx
  init_react();
  var CSVFileIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 8 7", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1 3.75V6C1 6.13807 1.11193 6.25 1.25 6.25H4M1 3.75V1.5C1 1.36193 1.11193 1.25 1.25 1.25H4M1 3.75H7M7 3.75V1.5C7 1.36193 6.88807 1.25 6.75 1.25H4M7 3.75V6C7 6.13807 6.88807 6.25 6.75 6.25H4M4 1.25V6.25", stroke: "var(--mito-text)", strokeWidth: "0.75", strokeLinecap: "round", strokeLinejoin: "round" }));
  };
  var CSVFileIcon_default = CSVFileIcon;

  // src/mito/components/icons/DirectoryIcon.tsx
  init_react();
  var DirectoryIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 8 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M3.86144 1H1.25C1.11193 1 1 1.11193 1 1.25V4.75C1 4.88807 1.11193 5 1.25 5H6.75C6.88807 5 7 4.88807 7 4.75V2.05C7 1.91193 6.88807 1.8 6.75 1.8H4.63856C4.55236 1.8 4.47225 1.75559 4.42656 1.6825L4.07344 1.1175C4.02775 1.0444 3.94764 1 3.86144 1Z", stroke: "var(--mito-text)", strokeWidth: "0.75", strokeLinecap: "round", strokeLinejoin: "round" }));
  };
  var DirectoryIcon_default = DirectoryIcon;

  // src/mito/components/icons/FileIcon.tsx
  init_react();
  var FileIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 8 7", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1 1.25V5.75C1 5.88807 1.11193 6 1.25 6H6.75C6.88807 6 7 5.88807 7 5.75V2.94244C7 2.89827 6.9883 2.85489 6.96609 2.81671L5.9814 1.12428C5.93663 1.04733 5.85433 1 5.76531 1H1.25C1.11193 1 1 1.11193 1 1.25Z", stroke: "var(--mito-text)", strokeWidth: "0.75", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M2.63647 2.71875H5.36375", stroke: "var(--mito-text)", strokeWidth: "0.75", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M2.63647 4.28125H5.36375", stroke: "var(--mito-text)", strokeWidth: "0.75", strokeLinecap: "round", strokeLinejoin: "round" }));
  };
  var FileIcon_default = FileIcon;

  // src/mito/components/import/FileBrowser/FileBrowserElement.tsx
  function FileBrowserElement(props) {
    const elementRef = useRef(null);
    const isSelected = props.index === props.fileBrowserState.selectedElementIndex;
    useEffect(() => {
      var _a;
      const element = elementRef.current;
      const parent = (_a = elementRef.current) == null ? void 0 : _a.parentElement;
      if (isSelected && element && parent) {
        ensureInView(parent, elementRef.current, 0);
      }
    }, [isSelected]);
    const invalidFileError = getInvalidFileError(props.element, props.userProfile);
    return /* @__PURE__ */ react_default.createElement(
      "div",
      {
        ref: elementRef,
        className: "highlight-on-hover file-browser-element p-5px text-unselectable",
        title: props.element.name,
        style: { background: isSelected ? "var(--mito-highlight-medium)" : "" },
        onClick: (e) => {
          if (e.detail > 1) {
            return;
          }
          if (isSelected) {
            props.setFileBrowserState((prevImportState) => {
              return __spreadProps(__spreadValues({}, prevImportState), {
                selectedElementIndex: -1
              });
            });
          } else {
            props.setFileBrowserState((prevImportState) => {
              return __spreadProps(__spreadValues({}, prevImportState), {
                selectedElementIndex: props.index
              });
            });
          }
        },
        onDoubleClick: () => {
          if (props.element.isParentDirectory) {
            const newPathParts = [...props.fileBrowserState.pathContents.path_parts];
            newPathParts.pop();
            props.setCurrPathParts(newPathParts);
          } else if (props.element.isDirectory) {
            const newPathParts = props.fileBrowserState.pathContents.path_parts || [];
            newPathParts.push(props.element.name);
            props.setCurrPathParts(newPathParts);
          } else {
            if (isExcelFile(props.element)) {
              const openExcelImport = () => __async(this, null, function* () {
                const filePath = yield getFilePath(props.mitoAPI, props.currPathParts, props.element);
                if (filePath === void 0) {
                  return;
                }
                props.setImportState({
                  screen: "xlsx_import_config",
                  fileName: props.element.name,
                  filePath
                });
              });
              void openExcelImport();
            } else {
              void props.importCSVFile(props.element);
            }
          }
        }
      },
      /* @__PURE__ */ react_default.createElement(Row_default, { suppressTopBottomMargin: true, justify: "space-between" }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 17, offsetRight: 1 }, /* @__PURE__ */ react_default.createElement("div", { className: "flexbox-row" }, /* @__PURE__ */ react_default.createElement("div", { className: "mr-5px mt-2px" }, props.element.isDirectory && props.element.isParentDirectory && /* @__PURE__ */ react_default.createElement(BackArrowIcon_default, { width: "14px" }), props.element.isDirectory && !props.element.isParentDirectory && /* @__PURE__ */ react_default.createElement(DirectoryIcon_default, null), !props.element.isDirectory && invalidFileError === void 0 && /* @__PURE__ */ react_default.createElement(CSVFileIcon_default, null), !props.element.isDirectory && invalidFileError !== void 0 && /* @__PURE__ */ react_default.createElement(FileIcon_default, null)), /* @__PURE__ */ react_default.createElement("div", null, props.element.name))), /* @__PURE__ */ react_default.createElement(Col_default, { span: 6 }, /* @__PURE__ */ react_default.createElement("p", { className: "text-align-right" }, props.element.lastModified !== 0 && getLastModifiedString(props.element.lastModified)))),
      isSelected && invalidFileError !== void 0 && /* @__PURE__ */ react_default.createElement("div", { className: "pl-5px pr-5px" }, /* @__PURE__ */ react_default.createElement("span", null, " ", invalidFileError, " "))
    );
  }
  var FileBrowserElement_default = FileBrowserElement;

  // src/mito/components/import/FileBrowser/FileBrowserPathSelector.tsx
  init_react();

  // src/mito/components/icons/DriveIcon.tsx
  init_react();
  var DriveIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "17", height: "13", viewBox: "0 0 17 13", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M15.6711 7.6579V11.5C15.6711 11.9142 15.3353 12.25 14.9211 12.25H1.5C1.08579 12.25 0.75 11.9142 0.75 11.5V7.6579C0.75 7.24368 1.08579 6.9079 1.5 6.9079H4.10526H14.9211C15.3353 6.9079 15.6711 7.24368 15.6711 7.6579Z", stroke: "var(--mito-text)", strokeWidth: "1.5" }), /* @__PURE__ */ react_default.createElement("path", { d: "M14.5503 2.63128L15.4318 6.43421H0.989295L1.87037 2.63151C2.08764 1.69377 2.16023 1.44349 2.28529 1.26975C2.42019 1.08234 2.60436 0.935958 2.81738 0.846842C3.01487 0.764224 3.27508 0.75 4.23766 0.75H8.21021H12.183C13.1455 0.75 13.4057 0.764222 13.6032 0.846828C13.8162 0.935931 14.0003 1.08229 14.1352 1.26968C14.2603 1.4434 14.3329 1.69365 14.5503 2.63128Z", stroke: "var(--mito-text)", strokeWidth: "1.5" }), /* @__PURE__ */ react_default.createElement("circle", { cx: "10.6052", cy: "9.23683", r: "1.02632", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M14.3683 9.23683C14.3683 9.80364 13.9088 10.2631 13.342 10.2631C12.7752 10.2631 12.3157 9.80364 12.3157 9.23683C12.3157 8.67001 12.7752 8.21051 13.342 8.21051C13.9088 8.21051 14.3683 8.67001 14.3683 9.23683Z", fill: "var(--mito-text)" }));
  };
  var DriveIcon_default = DriveIcon;

  // src/mito/components/import/FileBrowser/FileBrowserPathSelector.tsx
  function FileBrowserPathSelector(props) {
    var _a, _b, _c;
    const updateSelectedPath = (i) => {
      if (props.pathParts === void 0) {
        return;
      }
      const subPathParts = props.pathParts.slice(0, i + 1);
      props.setCurrPathParts(subPathParts);
    };
    const pathPartsAndIndexes = (_a = props.pathParts) == null ? void 0 : _a.map((pathPart, i) => {
      return {
        pathPart,
        index: i
      };
    });
    const pathPartsAndIndexesToDisplay = props.importFolderData ? pathPartsAndIndexes == null ? void 0 : pathPartsAndIndexes.slice(((_c = (_b = props.importFolderData) == null ? void 0 : _b.pathParts.length) != null ? _c : 1) - 1) : pathPartsAndIndexes;
    return /* @__PURE__ */ react_default.createElement("div", { className: "file-browser-path-selector" }, pathPartsAndIndexesToDisplay == null ? void 0 : pathPartsAndIndexesToDisplay.map((pathPartAndIndex) => {
      const pathPart = pathPartAndIndex.pathPart;
      const i = pathPartAndIndex.index;
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, { key: i }, /* @__PURE__ */ react_default.createElement("div", { className: "highlight-on-hover file-browser-path-part", key: i, onClick: () => {
        updateSelectedPath(i);
      } }, i === 0 ? /* @__PURE__ */ react_default.createElement(DriveIcon_default, null) : pathPart), /* @__PURE__ */ react_default.createElement("div", { className: "file-browser-path-seperator text-body-1" }, ">"));
    }));
  }
  var FileBrowserPathSelector_default = FileBrowserPathSelector;

  // src/mito/components/import/FileBrowser/FileBrowserBody.tsx
  var addImportFolderParamMessage = () => {
    if (isInStreamlit()) {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
        "p",
        {
          className: classNames("text-body-1", "text-overflow-wrap"),
          style: { whiteSpace: "pre-wrap" }
        },
        "To use the file browser, configure the folder you want to allow users to import from."
      ), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 10 }), /* @__PURE__ */ react_default.createElement(
        "p",
        {
          className: classNames("text-body-1", "text-overflow-wrap"),
          style: { whiteSpace: "pre-wrap" }
        },
        "This is configurable with the ",
        /* @__PURE__ */ react_default.createElement("code", null, "import_folder"),
        " parameter in the ",
        /* @__PURE__ */ react_default.createElement("code", null, "spreadsheet"),
        " component in your Streamlit application."
      ), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 10 }), /* @__PURE__ */ react_default.createElement(
        "p",
        {
          className: classNames("text-body-1", "text-overflow-wrap"),
          style: { whiteSpace: "pre-wrap" }
        },
        "See our ",
        /* @__PURE__ */ react_default.createElement("a", { className: "text-body-link-1", href: "https://docs.trymito.io/mito-for-streamlit/api-reference", target: "_blank", rel: "noreferrer" }, "docs"),
        " for more information."
      ));
    } else {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
        "p",
        {
          className: classNames("text-body-1", "text-overflow-wrap"),
          style: { whiteSpace: "pre-wrap" }
        },
        "To use the file browser, configure the folder you want to allow users to import from."
      ), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 10 }), /* @__PURE__ */ react_default.createElement(
        "p",
        {
          className: classNames("text-body-1", "text-overflow-wrap"),
          style: { whiteSpace: "pre-wrap" }
        },
        "This is configurable with the ",
        /* @__PURE__ */ react_default.createElement("code", null, "import_folder"),
        " parameter in the ",
        /* @__PURE__ */ react_default.createElement("code", null, "Spreadsheet"),
        " component in your Dash application."
      ), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 10 }), /* @__PURE__ */ react_default.createElement(
        "p",
        {
          className: classNames("text-body-1", "text-overflow-wrap"),
          style: { whiteSpace: "pre-wrap" }
        },
        "See our ",
        /* @__PURE__ */ react_default.createElement("a", { className: "text-body-link-1", href: "https://docs.trymito.io/mito-for-dash/api-reference", target: "_blank", rel: "noreferrer" }, "docs"),
        " for more information."
      ));
    }
  };
  function FileBrowserBody(props) {
    const inputRef = useRef(null);
    const elementsToDisplay = getElementsToDisplay(props.fileBrowserState, props.analysisData);
    const selectedFile = elementsToDisplay[props.fileBrowserState.selectedElementIndex];
    useEffect(() => {
      var _a;
      props.setFileBrowserState((prevImportState) => {
        return __spreadProps(__spreadValues({}, prevImportState), {
          searchString: ""
        });
      });
      (_a = inputRef.current) == null ? void 0 : _a.focus();
    }, [props.fileBrowserState.pathContents.path_parts]);
    useEffect(() => {
      var _a;
      (_a = inputRef.current) == null ? void 0 : _a.focus();
    }, [props.fileBrowserState.selectedElementIndex, props.fileBrowserState.sort]);
    const displayUpgradeToPro = inRootFolder(props.fileBrowserState.pathContents.path_parts) && !props.userProfile.isPro;
    if (isInDashboard() && !props.analysisData.importFolderData) {
      return addImportFolderParamMessage();
    }
    return /* @__PURE__ */ react_default.createElement("div", { className: "file-browser flexbox-column" }, /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(
      FileBrowserPathSelector_default,
      {
        importFolderData: props.analysisData.importFolderData,
        setCurrPathParts: props.setCurrPathParts,
        pathParts: props.fileBrowserState.pathContents.path_parts
      }
    )), /* @__PURE__ */ react_default.createElement(Row_default, { className: "border-t-light-gray border-b-light-gray", justify: "space-between" }, /* @__PURE__ */ react_default.createElement(
      Col_default,
      {
        span: 16,
        className: "flexbox-row flexbox-space-between border-r-light-gray",
        onClick: () => {
          props.setFileBrowserState((prevImportState) => {
            return __spreadProps(__spreadValues({}, prevImportState), {
              sort: prevImportState.sort === "name_descending" ? "name_ascending" : "name_descending"
            });
          });
        }
      },
      /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2 pt-5px pb-5px" }, "Name"),
      props.fileBrowserState.sort.startsWith("name") && /* @__PURE__ */ react_default.createElement("div", { className: "mr-5px ml-5px" }, /* @__PURE__ */ react_default.createElement(SortArrowIcon_default, { direction: props.fileBrowserState.sort.endsWith("descending") ? "descending" : "ascending" }))
    ), /* @__PURE__ */ react_default.createElement(
      Col_default,
      {
        span: 8,
        className: "flexbox-row flexbox-justify-end text-align-right",
        onClick: () => {
          props.setFileBrowserState((prevImportState) => {
            return __spreadProps(__spreadValues({}, prevImportState), {
              sort: prevImportState.sort === "last_modified_descending" ? "last_modified_ascending" : "last_modified_descending"
            });
          });
        }
      },
      props.fileBrowserState.sort.startsWith("last_modified") && /* @__PURE__ */ react_default.createElement("div", { className: "mr-5px ml-5px" }, /* @__PURE__ */ react_default.createElement(SortArrowIcon_default, { direction: props.fileBrowserState.sort.endsWith("descending") ? "descending" : "ascending" })),
      /* @__PURE__ */ react_default.createElement(
        "p",
        {
          className: "text-body-2 pt-5px pb-5px"
        },
        "Last Modified"
      )
    )), /* @__PURE__ */ react_default.createElement("div", { className: "mt-5px mb-5px" }, /* @__PURE__ */ react_default.createElement(
      "input",
      {
        className: classNames("mito-input", "text-body-2", "element-width-block"),
        ref: inputRef,
        value: props.fileBrowserState.searchString,
        placeholder: "Search the current folder",
        onChange: (e) => {
          const newSearchString = e.target.value;
          props.setFileBrowserState((prevImportState) => {
            return __spreadProps(__spreadValues({}, prevImportState), {
              searchString: newSearchString
            });
          });
        },
        onKeyDown: (e) => {
          if (e.key == "ArrowUp") {
            props.setFileBrowserState((prevImportState) => {
              return __spreadProps(__spreadValues({}, prevImportState), {
                selectedElementIndex: Math.max(prevImportState.selectedElementIndex - 1, -1)
              });
            });
            e.preventDefault();
          } else if (e.key === "ArrowDown") {
            props.setFileBrowserState((prevImportState) => {
              return __spreadProps(__spreadValues({}, prevImportState), {
                selectedElementIndex: Math.min(prevImportState.selectedElementIndex + 1, elementsToDisplay.length - 1)
              });
            });
            e.preventDefault();
          } else if (e.key === "Enter") {
            if (!selectedFile) {
              return;
            }
            if (selectedFile.isParentDirectory) {
              const newPathParts = [...props.fileBrowserState.pathContents.path_parts];
              newPathParts.pop();
              props.setCurrPathParts(newPathParts);
            } else if (selectedFile.isDirectory) {
              const newPathParts = props.fileBrowserState.pathContents.path_parts || [];
              newPathParts.push(selectedFile.name);
              props.setCurrPathParts(newPathParts);
            } else {
              if (isExcelFile(selectedFile)) {
                const openExcelImport = () => __async(this, null, function* () {
                  const filePath = yield getFilePath(props.mitoAPI, props.currPathParts, selectedFile);
                  if (filePath === void 0 || selectedFile === void 0) {
                    return;
                  }
                  props.setImportState({
                    screen: "xlsx_import_config",
                    fileName: selectedFile.name,
                    filePath
                  });
                });
                void openExcelImport();
              } else {
                void props.importCSVFile(selectedFile);
              }
            }
          }
        },
        width: "block",
        autoFocus: true
      }
    )), /* @__PURE__ */ react_default.createElement("div", { className: "file-browser-element-list" }, displayUpgradeToPro && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-around" }, /* @__PURE__ */ react_default.createElement("p", { className: "ma-25px text-align-center text-body-1" }, "Want to import from a different drive? Consider\xA0", /* @__PURE__ */ react_default.createElement(
      "a",
      {
        onClick: () => {
          void props.mitoAPI.log("clicked_pro_button", {
            "pro_button_location": "import_taskpane_root_folder_import"
          });
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "upgrade_to_pro" /* UPGRADE_TO_PRO */, proOrEnterprise: "Pro" },
              selectedTabType: "data"
            });
          });
        },
        className: "text-body-1-link"
      },
      "upgrading to Mito Pro"
    ), " or\xA0", /* @__PURE__ */ react_default.createElement(
      "a",
      {
        onClick: () => {
          props.setCurrPathParts(["."]);
        },
        className: "text-body-1-link"
      },
      "go back to current directory."
    )))), !displayUpgradeToPro && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, !props.fileBrowserState.loadingFolder && (elementsToDisplay == null ? void 0 : elementsToDisplay.map((element, i) => {
      return /* @__PURE__ */ react_default.createElement(
        FileBrowserElement_default,
        {
          key: i,
          mitoAPI: props.mitoAPI,
          index: i,
          element,
          fileBrowserState: props.fileBrowserState,
          setFileBrowserState: props.setFileBrowserState,
          currPathParts: props.currPathParts,
          setCurrPathParts: props.setCurrPathParts,
          excelImportEnabled: isExcelImportEnabled(props.userProfile),
          setImportState: props.setImportState,
          importCSVFile: props.importCSVFile,
          userProfile: props.userProfile
        }
      );
    })), props.fileBrowserState.loadingFolder && /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1" }, "Loading folder contents..."))));
  }
  var FileBrowserBody_default = FileBrowserBody;

  // src/mito/components/import/FileBrowser/FileBrowser.tsx
  function FileBrowser(props) {
    const [fileBrowserState, setFileBrowserState] = useState({
      pathContents: {
        path_parts: props.currPathParts,
        elements: []
      },
      sort: "last_modified_descending",
      searchString: "",
      selectedElementIndex: -1,
      loadingFolder: false,
      loadingImport: false
    });
    const selectedFile = getElementsToDisplay(fileBrowserState, props.analysisData)[fileBrowserState.selectedElementIndex];
    useEffect(() => {
      void loadPathContents(props.currPathParts);
      setFileBrowserState((prevImportState) => {
        return __spreadProps(__spreadValues({}, prevImportState), {
          selectedElementIndex: -1
        });
      });
      void props.mitoAPI.log("curr_path_changed", { "path_parts_length": props.currPathParts.length });
    }, [props.currPathParts]);
    useEffect(() => {
      let selectedElementName = "";
      if (selectedFile === void 0) {
        selectedElementName = "undefined";
      } else if (selectedFile.isDirectory) {
        selectedElementName = "directory";
      } else {
        const fileEnding = getFileEnding(selectedFile.name);
        if (fileEnding !== void 0) {
          selectedElementName = fileEnding;
        } else {
          selectedElementName = "No File Ending";
        }
      }
      void props.mitoAPI.log(
        "selected_element_changed",
        { "selected_element": selectedElementName }
      );
    }, [selectedFile]);
    function loadPathContents(currPathParts) {
      return __async(this, null, function* () {
        var _a;
        setFileBrowserState((prevImportState) => {
          return __spreadProps(__spreadValues({}, prevImportState), {
            loadingFolder: true
          });
        });
        const response = yield props.mitoAPI.getPathContents(currPathParts, (_a = props.analysisData.importFolderData) == null ? void 0 : _a.path);
        const _pathContents = "error" in response ? void 0 : response.result;
        if (_pathContents) {
          setFileBrowserState((prevImportState) => {
            return __spreadProps(__spreadValues({}, prevImportState), {
              pathContents: _pathContents,
              loadingFolder: false
            });
          });
        } else {
          setFileBrowserState((prevImportState) => {
            return __spreadProps(__spreadValues({}, prevImportState), {
              loadingFolder: false
            });
          });
        }
      });
    }
    const importButtonStatus = getImportButtonStatus(
      selectedFile,
      props.userProfile,
      fileBrowserState.loadingImport,
      props.isUpdate
    );
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: !props.isUpdate ? "Import Files" : "Update Import",
        setUIState: props.setUIState,
        backCallback: props.backCallback,
        notCloseable: props.notCloseable
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, { noScroll: true }, /* @__PURE__ */ react_default.createElement(
      FileBrowserBody_default,
      {
        mitoAPI: props.mitoAPI,
        userProfile: props.userProfile,
        analysisData: props.analysisData,
        setUIState: props.setUIState,
        currPathParts: props.currPathParts,
        setCurrPathParts: props.setCurrPathParts,
        fileBrowserState,
        setFileBrowserState,
        importCSVFile: props.importCSVFile,
        setImportState: props.setImportState
      }
    )), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between" }, !importButtonStatus.disabled && !isExcelFile(selectedFile) && /* @__PURE__ */ react_default.createElement(Col_default, { style: { overflow: "unset", marginRight: "3px", display: "flex" } }, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "light",
        width: "hug-contents",
        style: { display: "flex", alignItems: "center", flexDirection: "row", width: "max-content" },
        onClick: () => {
          const openCSVImport = () => __async(this, null, function* () {
            const filePath = yield getFilePath(props.mitoAPI, props.currPathParts, selectedFile);
            if (filePath === void 0 || selectedFile === void 0) {
              return;
            }
            props.setImportState({
              screen: "csv_import_config",
              fileName: selectedFile.name,
              filePath
            });
          });
          void openCSVImport();
        },
        disabled: importButtonStatus.disabled
      },
      /* @__PURE__ */ react_default.createElement(ConfigureIcon_default, null),
      /* @__PURE__ */ react_default.createElement("p", { className: "ml-2px" }, "Configure")
    )), /* @__PURE__ */ react_default.createElement(Col_default, { style: { width: "100%" } }, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => {
          if (isExcelFile(selectedFile)) {
            const openExcelImport = () => __async(this, null, function* () {
              const filePath = yield getFilePath(props.mitoAPI, props.currPathParts, selectedFile);
              if (filePath === void 0 || selectedFile === void 0) {
                return;
              }
              props.setImportState({
                screen: "xlsx_import_config",
                fileName: selectedFile.name,
                filePath
              });
            });
            void openExcelImport();
          } else {
            void props.importCSVFile(selectedFile);
          }
        },
        disabled: importButtonStatus.disabled
      },
      importButtonStatus.buttonText
    )))));
  }
  var FileBrowser_default = FileBrowser;

  // src/mito/components/taskpanes/FileImport/CSVImportConfigTaskpane.tsx
  init_react();

  // src/mito/components/import/CSVImportConfigScreen.tsx
  init_react();
  var ENCODINGS = [
    "utf_8",
    "ascii",
    "latin_1",
    "big5",
    "big5hkscs",
    "cp037",
    "cp273",
    "cp424",
    "cp437",
    "cp500",
    "cp720",
    "cp737",
    "cp775",
    "cp850",
    "cp852",
    "cp855",
    "cp856",
    "cp857",
    "cp858",
    "cp860",
    "cp861",
    "cp862",
    "cp863",
    "cp864",
    "cp865",
    "cp866",
    "cp869",
    "cp874",
    "cp875",
    "cp932",
    "cp949",
    "cp950",
    "cp1006",
    "cp1026",
    "cp1125",
    "cp1140",
    "cp1250",
    "cp1251",
    "cp1252",
    "cp1253",
    "cp1254",
    "cp1255",
    "cp1256",
    "cp1257",
    "cp1258",
    "euc_jp",
    "euc_jis_2004",
    "euc_jisx0213",
    "euc_kr",
    "gb2312",
    "gbk",
    "gb18030",
    "hz",
    "iso2022_jp",
    "iso2022_jp_1",
    "iso2022_jp_2",
    "iso2022_jp_2004",
    "iso2022_jp_3",
    "iso2022_jp_ext",
    "iso2022_kr",
    "iso8859_2",
    "iso8859_3",
    "iso8859_4",
    "iso8859_5",
    "iso8859_6",
    "iso8859_7",
    "iso8859_8",
    "iso8859_9",
    "iso8859_10",
    "iso8859_11",
    "iso8859_13",
    "iso8859_14",
    "iso8859_15",
    "iso8859_16",
    "johab",
    "koi8_r",
    "koi8_t",
    "koi8_u",
    "kz1048",
    "mac_cyrillic",
    "mac_greek",
    "mac_iceland",
    "mac_latin2",
    "mac_roman",
    "mac_turkish",
    "ptcp154",
    "shift_jis",
    "shift_jis_2004",
    "shift_jisx0213",
    "utf_32",
    "utf_32_be",
    "utf_32_le",
    "utf_16",
    "utf_16_be",
    "utf_16_le",
    "utf_7",
    "utf_8_sig"
  ];
  var decimalCharToTitle = {
    ["." /* PERIOD */]: "period",
    ["," /* COMMA */]: "comma"
  };
  var DELIMITER_TOOLTIP = "The seperator that seperates one column from another.";
  var ENCODING_TOOLTIP = "The encoding used to save this file.";
  var DECIMAL_TOOLTIP = "The character used to separate the decimal places in numbers.";
  var SKIP_ROWS_TOOLTIP = "The number of rows at the top of the file to skip when reading data into the dataframe.";
  var ERROR_BAD_LINES_TOOLTIP = "Turn on to skip any lines that error when being read in.";
  var DEFAULT_DELIMITER = ",";
  var DEFAULT_ENCODING = "utf-8";
  var DEFAULT_DECIMAL = "." /* PERIOD */;
  var DEFAULT_SKIPROWS = 0;
  var DEFAULT_ERROR_BAD_LINES = true;
  var getButtonMessage2 = (fileName, loading, isUpdate) => {
    if (loading) {
      return `Importing...`;
    } else if (isUpdate) {
      return `Update to ${fileName}`;
    }
    return `Import ${fileName}`;
  };
  function getSuccessMessage(fileName) {
    return `Imported ${fileName}`;
  }
  function CSVImportConfigScreen(props) {
    const [fileMetadata] = useStateFromAPIAsync(
      void 0,
      () => __async(this, null, function* () {
        var _a;
        const response = yield props.mitoAPI.getCSVFilesMetadata(((_a = props.params) == null ? void 0 : _a.file_names) || []);
        return "error" in response ? void 0 : response.result;
      }),
      (loadedData) => {
        props.setParams((prevParams) => {
          return __spreadProps(__spreadValues({}, prevParams), {
            delimeters: (loadedData == null ? void 0 : loadedData.delimeters) || [DEFAULT_DELIMITER],
            encodings: (loadedData == null ? void 0 : loadedData.encodings) || [DEFAULT_ENCODING],
            decimals: (loadedData == null ? void 0 : loadedData.decimals) || [DEFAULT_DECIMAL],
            skiprows: (loadedData == null ? void 0 : loadedData.skiprows) || [DEFAULT_SKIPROWS]
          });
        });
      },
      []
    );
    const resetParams = () => {
      props.setParams((prevParams) => {
        return __spreadProps(__spreadValues({}, prevParams), {
          delimeters: (fileMetadata == null ? void 0 : fileMetadata.delimeters) || [DEFAULT_DELIMITER],
          encodings: (fileMetadata == null ? void 0 : fileMetadata.encodings) || [DEFAULT_ENCODING],
          decimals: (fileMetadata == null ? void 0 : fileMetadata.decimals) || [DEFAULT_DECIMAL],
          skiprows: (fileMetadata == null ? void 0 : fileMetadata.skiprows) || [DEFAULT_SKIPROWS],
          error_bad_lines: [DEFAULT_ERROR_BAD_LINES]
        });
      });
    };
    if (props.params === void 0 || props.fileName === void 0 || props.filePath === void 0) {
      return /* @__PURE__ */ react_default.createElement("div", { className: "text-body-1" }, "There has been an error loading your CSV file encodings. Please try again, or contact support.");
    }
    const delimeters = props.params.delimeters;
    const encodings = props.params.encodings;
    const decimals = props.params.decimals;
    const skiprows = props.params.skiprows;
    const error_bad_lines = props.params.error_bad_lines;
    const currentDelimiter = delimeters !== void 0 ? delimeters[0] : DEFAULT_DELIMITER;
    const currentEncoding = encodings !== void 0 ? encodings[0] : DEFAULT_ENCODING;
    const currentDecimal = decimals !== void 0 ? decimals[0] : DEFAULT_DECIMAL;
    const currentSkiprows = skiprows !== void 0 ? skiprows[0] : DEFAULT_SKIPROWS;
    const currentErrorBadLines = error_bad_lines !== void 0 ? error_bad_lines[0] : DEFAULT_ERROR_BAD_LINES;
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: !props.isUpdate ? `Import ${props.fileName}` : `Update to ${props.fileName}`,
        setUIState: props.setUIState,
        backCallback: props.backCallback,
        notCloseable: props.notCloseable
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, { noScroll: true }, props.error !== void 0 && /* @__PURE__ */ react_default.createElement("p", { className: "text-color-error" }, " ", props.error, " "), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", title: DELIMITER_TOOLTIP }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: DELIMITER_TOOLTIP }, "Delimiter")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        width: "medium",
        value: currentDelimiter,
        onChange: (e) => {
          const newDelimiter = e.target.value;
          props.setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              delimeters: [newDelimiter]
            });
          });
        },
        onKeyDown: (e) => {
          if (e.key === "Tab") {
            e.preventDefault();
            props.setParams((prevParams) => {
              const delimeters2 = prevParams.delimeters;
              return __spreadProps(__spreadValues({}, prevParams), {
                delimeters: [(delimeters2 !== void 0 ? delimeters2[0] : DEFAULT_DELIMITER) + "	"]
              });
            });
          }
        },
        selectTextOnFocus: true
      }
    ))), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", title: ENCODING_TOOLTIP }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: ENCODING_TOOLTIP }, "Encoding")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        searchable: true,
        width: "medium",
        value: currentEncoding,
        onChange: (newEncoding) => {
          props.setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              encodings: [newEncoding]
            });
          });
        }
      },
      ENCODINGS.map((encoding) => {
        return /* @__PURE__ */ react_default.createElement(DropdownItem_default, { key: encoding, title: encoding });
      })
    ))), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", title: DECIMAL_TOOLTIP }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: DECIMAL_TOOLTIP }, "Decimal Separator")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        width: "small",
        value: decimalCharToTitle[currentDecimal],
        onChange: (newDecimalSeparator) => {
          props.setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              decimals: [newDecimalSeparator]
            });
          });
        }
      },
      Object.keys(decimalCharToTitle).map((decimalCharacter) => {
        const decimalTitle = decimalCharToTitle[decimalCharacter];
        return /* @__PURE__ */ react_default.createElement(DropdownItem_default, { key: decimalTitle, title: decimalTitle, id: decimalCharacter });
      })
    ))), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", title: SKIP_ROWS_TOOLTIP }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: SKIP_ROWS_TOOLTIP }, "Rows to Skip")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        value: "" + currentSkiprows,
        type: "number",
        width: "small",
        onChange: (e) => {
          const newSkiprows = e.target.value;
          const newSkiprowsNumber = Math.floor(parseFloat(newSkiprows));
          props.setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              skiprows: [newSkiprowsNumber]
            });
          });
        },
        selectTextOnFocus: true
      }
    ))), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", title: ERROR_BAD_LINES_TOOLTIP }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: ERROR_BAD_LINES_TOOLTIP }, "Skip Invalid Lines")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(Toggle_default, { value: !currentErrorBadLines, onChange: () => {
      props.setParams((prevParams) => {
        const error_bad_lines2 = prevParams.error_bad_lines;
        return __spreadProps(__spreadValues({}, prevParams), {
          error_bad_lines: [error_bad_lines2 !== void 0 ? !error_bad_lines2[0] : DEFAULT_ERROR_BAD_LINES]
        });
      });
    } }))), /* @__PURE__ */ react_default.createElement(Row_default, null, /* @__PURE__ */ react_default.createElement(
      "p",
      {
        onClick: () => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: {
                type: "Excel Range Import" /* EXCEL_RANGE_IMPORT */,
                file_path: props.filePath,
                sheet_name: "Sheet1",
                sheet_names: ["Sheet1"]
              }
            });
          });
        }
      },
      /* @__PURE__ */ react_default.createElement("span", { className: "text-underline" }, "Click here"),
      " to import multiple ranges."
    ))), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2 text-color-medium-important mb-5px" }, /* @__PURE__ */ react_default.createElement("span", { className: "text-body-2-link", onClick: resetParams }, "Reset parameters to automatically detected parameters. ")), /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => {
          props.edit();
        },
        autoFocus: true
      },
      getButtonMessage2(props.fileName, props.loading, props.isUpdate)
    ), props.editApplied && !props.loading && /* @__PURE__ */ react_default.createElement("p", { className: "text-subtext-1" }, getSuccessMessage(props.fileName)), !props.editApplied && /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 16 })));
  }
  var CSVImportConfigScreen_default = CSVImportConfigScreen;

  // src/mito/components/taskpanes/FileImport/CSVImportConfigTaskpane.tsx
  var getDefaultCSVParams = (filePath) => {
    return {
      file_names: [filePath],
      delimeters: [DEFAULT_DELIMITER],
      encodings: [DEFAULT_ENCODING],
      error_bad_lines: [DEFAULT_ERROR_BAD_LINES]
    };
  };
  function CSVImportConfigTaskpane(props) {
    const { params, setParams, loading, edit, editApplied, error } = useSendEditOnClick_default(
      () => getDefaultCSVParams(props.filePath),
      "simple_import" /* SimpleImport */,
      props.mitoAPI,
      props.analysisData,
      { allowSameParamsToReapplyTwice: true }
    );
    return /* @__PURE__ */ react_default.createElement(
      CSVImportConfigScreen_default,
      {
        mitoAPI: props.mitoAPI,
        analysisData: props.analysisData,
        setUIState: props.setUIState,
        isUpdate: false,
        fileName: props.fileName,
        filePath: props.filePath,
        params,
        setParams,
        edit,
        editApplied,
        loading,
        error: error !== void 0 ? error : props.error,
        backCallback: () => {
          props.setScreen({ screen: "file_browser" });
        }
      }
    );
  }
  var CSVImportConfigTaskpane_default = CSVImportConfigTaskpane;

  // src/mito/components/taskpanes/FileImport/XLSXImportConfigTaskpane.tsx
  init_react();

  // src/mito/components/import/XLSXImportConfigScreen.tsx
  init_react();

  // src/mito/components/elements/RadioButtonBox.tsx
  init_react();

  // src/mito/components/elements/RadioButtonItem.tsx
  init_react();
  var RadioButtonItem = (props) => {
    return /* @__PURE__ */ react_default.createElement(
      "div",
      {
        key: props.value,
        onClick: () => {
          props.onClick();
        },
        className: classNames("radio-button-box-row", { "radio-button-box-row-selected": props.checked })
      },
      /* @__PURE__ */ react_default.createElement("input", { type: "radio", name: props.value, value: props.value, checked: props.checked }),
      /* @__PURE__ */ react_default.createElement("label", { htmlFor: props.value }, props.value)
    );
  };
  var RadioButtonItem_default = RadioButtonItem;

  // src/mito/components/elements/RadioButtonBox.tsx
  var RadioButtonBoxMessage = (props) => {
    if (props.loading) {
      return /* @__PURE__ */ react_default.createElement(Row_default, { justify: "center" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1" }, "Loading..."));
    } else if (props.values.length === 0) {
      return /* @__PURE__ */ react_default.createElement(Row_default, { justify: "center" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1" }, "No items to display."));
    }
    return null;
  };
  var RadioButtonBox = (props) => {
    const height = props.height || "block";
    const width = props.width || "block";
    const heightClass = `element-height-${height}`;
    const widthClass = `element-width-${width}`;
    return /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: classNames("text-body-2", "radio-button-box", heightClass, widthClass, props.className)
      },
      /* @__PURE__ */ react_default.createElement(
        RadioButtonBoxMessage,
        {
          values: props.values,
          loading: props.loading
        }
      ),
      props.values.map((value) => {
        return /* @__PURE__ */ react_default.createElement(
          RadioButtonItem_default,
          {
            key: value,
            value,
            checked: value == props.selectedValue,
            onClick: () => {
              props.onChange(value);
            }
          }
        );
      })
    );
  };
  var RadioButtonBox_default = RadioButtonBox;

  // src/mito/components/import/XLSXImportConfigScreen.tsx
  var getButtonMessage3 = (params, loading, isUpdate) => {
    if (loading) {
      return `Importing...`;
    } else if (params.sheet_names.length === 0) {
      return `Select sheets to import them`;
    } else if (isUpdate) {
      return `Update to ${params.sheet_names[0]}`;
    }
    return `Import ${params.sheet_names.length} Selected Sheet${params.sheet_names.length === 1 ? "" : "s"}`;
  };
  function getSuccessMessage2(params) {
    return `Imported ${params.sheet_names.length} sheet${params.sheet_names.length === 1 ? "" : "s"}.`;
  }
  var HAS_HEADER_ROW_TOOLTIP = 'Select "Yes" if Mito should set the first non-skipped row as the column headers. Select "No" if Mito should generate column headers';
  function XLSXImportConfigScreen(props) {
    var _a;
    const [fileMetadata, loading] = useStateFromAPIAsync(
      { sheet_names: [], size: 0 },
      (filePath) => __async(this, null, function* () {
        const response = yield props.mitoAPI.getExcelFileMetadata(filePath);
        return "error" in response ? void 0 : response.result;
      }),
      (loadedData) => {
        if (loadedData !== void 0) {
          props.setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              sheet_names: !props.isUpdate ? loadedData.sheet_names : loadedData.sheet_names.slice(0, 1)
            });
          });
        }
      },
      [props.filePath]
    );
    const params = props.params;
    if (params === void 0) {
      return /* @__PURE__ */ react_default.createElement("div", { className: "text-body-1" }, "There has been an error loading your Excel file metadata. Please try again, or contact support.");
    }
    const numSelectedSheets = params.sheet_names.length;
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: !props.isUpdate ? `Import ${props.fileName}` : `Update to ${props.fileName}`,
        setUIState: props.setUIState,
        backCallback: props.backCallback,
        notCloseable: props.notCloseable
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement("div", null, !props.isUpdate && /* @__PURE__ */ react_default.createElement(
      MultiToggleBox_default,
      {
        loading,
        searchable: true,
        height: "medium",
        emptyMessage: "There are no sheets to choose from. Either the workbook is empty or password protected.",
        onToggleAll: (newSelectedIndexes) => {
          props.setParams((prevParams) => {
            const newSheetNames = newSelectedIndexes.map((index) => fileMetadata.sheet_names[index]);
            return __spreadProps(__spreadValues({}, prevParams), {
              sheet_names: newSheetNames
            });
          });
        }
      },
      (_a = fileMetadata.sheet_names) == null ? void 0 : _a.map((sheetName, idx) => {
        return /* @__PURE__ */ react_default.createElement(
          MultiToggleItem_default,
          {
            key: idx,
            title: sheetName,
            toggled: params.sheet_names.includes(sheetName),
            onToggle: () => {
              props.setParams((prevParams) => {
                const newSheetNames = [...prevParams.sheet_names];
                toggleInArray(newSheetNames, sheetName);
                return __spreadProps(__spreadValues({}, prevParams), {
                  sheet_names: newSheetNames
                });
              });
            },
            index: idx
          }
        );
      })
    ), props.isUpdate && /* @__PURE__ */ react_default.createElement(
      RadioButtonBox_default,
      {
        values: fileMetadata.sheet_names,
        selectedValue: params.sheet_names[0],
        height: "medium",
        onChange: (value) => props.setParams((prevParams) => {
          return __spreadProps(__spreadValues({}, prevParams), {
            sheet_names: [value]
          });
        }),
        loading
      }
    ), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", title: HAS_HEADER_ROW_TOOLTIP }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: HAS_HEADER_ROW_TOOLTIP }, "Has Header Row")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        value: params.has_headers ? "Yes" : "No",
        width: "small",
        onChange: (newValue) => props.setParams((prevParams) => {
          return __spreadProps(__spreadValues({}, prevParams), {
            has_headers: newValue === "Yes"
          });
        })
      },
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "Yes"
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "No"
        }
      )
    ))), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", title: SKIP_ROWS_TOOLTIP }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: SKIP_ROWS_TOOLTIP }, "Rows to Skip")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        value: "" + params.skiprows,
        type: "number",
        width: "small",
        onChange: (e) => {
          const newValue = e.target.value;
          props.setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              skiprows: newValue
            });
          });
        }
      }
    ))), isAtLeastBenchmarkVersion(props.userProfile.pandasVersion, "1.4.0") && /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", title: DECIMAL_TOOLTIP }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: DECIMAL_TOOLTIP }, "Decimal Separator")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        width: "small",
        value: decimalCharToTitle[params.decimal],
        onChange: (newDecimalSeparator) => {
          props.setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              decimals: [newDecimalSeparator]
            });
          });
        }
      },
      Object.keys(decimalCharToTitle).map((decimalCharacter) => {
        const decimalTitle = decimalCharToTitle[decimalCharacter];
        return /* @__PURE__ */ react_default.createElement(DropdownItem_default, { key: decimalTitle, title: decimalTitle, id: decimalCharacter });
      })
    ))), !props.isUpdate && params.sheet_names.length === 1 && /* @__PURE__ */ react_default.createElement(
      "p",
      {
        onClick: () => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: {
                type: "Excel Range Import" /* EXCEL_RANGE_IMPORT */,
                file_path: props.filePath,
                sheet_name: params.sheet_names[0],
                sheet_names: fileMetadata.sheet_names
              }
            });
          });
        }
      },
      /* @__PURE__ */ react_default.createElement("span", { className: "text-underline" }, "Click here"),
      " to import multiple ranges."
    ), fileMetadata.size >= 1e5 && fileMetadata.size < 1e7 && /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2 mt-20px" }, "Due to Python limitations, large Excel files take minutes to import."), fileMetadata.size >= 1e7 && /* @__PURE__ */ react_default.createElement("p", { className: "text-body-2 mt-20px" }, "Due to Python limitations, massive Excel files take many minutes to import. If possible, save the Excel file as a CSV before importing."))), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => props.edit((params2) => {
          const parsedSkipRows = parseInt("" + params2.skiprows);
          return __spreadProps(__spreadValues({}, params2), {
            skiprows: parsedSkipRows
          });
        }),
        disabled: numSelectedSheets === 0,
        autoFocus: true
      },
      getButtonMessage3(params, props.loading, props.isUpdate)
    ), props.editApplied && !props.loading && /* @__PURE__ */ react_default.createElement("p", { className: "text-subtext-1" }, getSuccessMessage2(params)), !props.editApplied && /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 18 })));
  }
  var XLSXImportConfigScreen_default = XLSXImportConfigScreen;

  // src/mito/components/taskpanes/FileImport/XLSXImportConfigTaskpane.tsx
  var getDefaultXLSXParams = (filePath) => {
    return {
      file_name: filePath,
      sheet_names: [],
      has_headers: true,
      decimal: DEFAULT_DECIMAL,
      skiprows: 0
    };
  };
  function XLSXImportConfigTaskpane(props) {
    const { params, setParams, loading, edit, editApplied } = useSendEditOnClick_default(
      () => {
        return getDefaultXLSXParams(props.filePath);
      },
      "excel_import" /* ExcelImport */,
      props.mitoAPI,
      props.analysisData,
      { allowSameParamsToReapplyTwice: true }
    );
    return /* @__PURE__ */ react_default.createElement(
      XLSXImportConfigScreen_default,
      {
        mitoAPI: props.mitoAPI,
        analysisData: props.analysisData,
        userProfile: props.userProfile,
        setUIState: props.setUIState,
        isUpdate: false,
        fileName: props.fileName,
        filePath: props.filePath,
        params,
        setParams,
        edit,
        editApplied,
        loading,
        backCallback: () => {
          props.setImportState({ screen: "file_browser" });
        }
      }
    );
  }
  var XLSXImportConfigTaskpane_default = XLSXImportConfigTaskpane;

  // src/mito/components/taskpanes/FileImport/FileImportTaskpane.tsx
  function FileImportTaskpane(props) {
    const [importState, setImportState] = useState({ screen: "file_browser" });
    if (importState.screen === "file_browser") {
      return /* @__PURE__ */ react_default.createElement(
        FileBrowser_default,
        {
          mitoAPI: props.mitoAPI,
          analysisData: props.analysisData,
          userProfile: props.userProfile,
          setUIState: props.setUIState,
          isUpdate: false,
          currPathParts: props.currPathParts,
          setCurrPathParts: props.setCurrPathParts,
          setImportState,
          importCSVFile: (file) => __async(this, null, function* () {
            const response = yield props.mitoAPI.getPathJoined([...props.currPathParts, file.name]);
            const filePath = "error" in response ? void 0 : response.result;
            if (filePath === void 0) {
              return;
            }
            const result = yield props.mitoAPI.editSimpleImport([filePath]);
            if ("error" in result) {
              setImportState({
                screen: "csv_import_config",
                fileName: file.name,
                filePath,
                error: result.error
              });
            }
          })
        }
      );
    } else if (importState.screen == "csv_import_config") {
      return /* @__PURE__ */ react_default.createElement(
        CSVImportConfigTaskpane_default,
        {
          mitoAPI: props.mitoAPI,
          analysisData: props.analysisData,
          setUIState: props.setUIState,
          fileName: importState.fileName,
          filePath: importState.filePath,
          error: importState.error,
          setScreen: setImportState
        }
      );
    } else if (importState.screen == "xlsx_import_config") {
      return /* @__PURE__ */ react_default.createElement(
        XLSXImportConfigTaskpane_default,
        {
          mitoAPI: props.mitoAPI,
          analysisData: props.analysisData,
          userProfile: props.userProfile,
          setUIState: props.setUIState,
          fileName: importState.fileName,
          filePath: importState.filePath,
          setImportState
        }
      );
    } else {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
    }
  }
  var FileImportTaskpane_default = FileImportTaskpane;

  // src/mito/components/taskpanes/FillNa/FillNaTaskpane.tsx
  init_react();
  var BOOLEAN_STRINGS = ["True", "true", "False", "false"];
  var getDefaultParams5 = (sheetDataArray, sheetIndex, defaultFillMethod, startingColumnIDs) => {
    if (sheetDataArray.length === 0 || sheetDataArray[sheetIndex] === void 0) {
      return void 0;
    }
    const sheetData = sheetDataArray[sheetIndex];
    let finalFillMethod = defaultFillMethod || { type: "value", "value": 0 };
    if (finalFillMethod.type === "mean" || finalFillMethod.type === "median") {
      const onlyMeanAndMedianColumnSelected = Object.values(sheetData.columnDtypeMap).map((columnDtype) => isNumberDtype(columnDtype) || isDatetimeDtype(columnDtype) || isTimedeltaDtype(columnDtype)).every((hasDefinedMeanAndMedian) => hasDefinedMeanAndMedian === true);
      if (!onlyMeanAndMedianColumnSelected) {
        finalFillMethod = { type: "value", "value": 0 };
      }
    }
    const columnIDs = startingColumnIDs === void 0 ? Object.keys(sheetData.columnIDsMap) : intersection(Object.keys(sheetData.columnIDsMap), startingColumnIDs);
    return {
      sheet_index: sheetIndex,
      column_ids: columnIDs,
      fill_method: finalFillMethod
    };
  };
  var getButtonMessage4 = (sheetData, columnIDs) => {
    if (columnIDs.length === 0) {
      return "Select columns to fill NaN values";
    }
    const columnHeaders = columnIDs.map((columnID) => sheetData == null ? void 0 : sheetData.columnIDsMap[columnID]).filter((columnHeader) => columnHeader !== void 0);
    const [columnHeadersString, numOtherColumnHeaders] = getFirstCharactersOfColumnHeaders(columnHeaders, 25);
    if (numOtherColumnHeaders === 0) {
      return `Fill NaNs in ${columnHeadersString}`;
    } else {
      return `Fill NaNs in ${columnHeadersString} and ${numOtherColumnHeaders} others`;
    }
  };
  var getSuccessMessage3 = (sheetData, columnIDs) => {
    const columnHeaders = columnIDs.map((columnID) => sheetData == null ? void 0 : sheetData.columnIDsMap[columnID]).filter((columnHeader) => columnHeader !== void 0);
    const [columnHeadersString, numOtherColumnHeaders] = getFirstCharactersOfColumnHeaders(columnHeaders, 25);
    if (numOtherColumnHeaders === 0) {
      return /* @__PURE__ */ react_default.createElement("p", null, "Filled NaNs in ", /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, columnHeadersString), ".");
    } else {
      return /* @__PURE__ */ react_default.createElement("p", null, "Filled NaNs in ", /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, columnHeadersString), " and ", /* @__PURE__ */ react_default.createElement("span", { className: "tetext-color-medium-important" }, numOtherColumnHeaders), " other columns.");
    }
  };
  var FillNaTaskpane = (props) => {
    const { params, setParams, loading, edit, editApplied } = useSendEditOnClick_default(
      () => getDefaultParams5(props.sheetDataArray, props.selectedSheetIndex, void 0, props.startingColumnIDs),
      "fill_na" /* FillNa */,
      props.mitoAPI,
      props.analysisData
    );
    useEffect(() => {
      setParams((prevParams) => {
        const newParams = getDefaultParams5(props.sheetDataArray, props.selectedSheetIndex, prevParams.fill_method, props.startingColumnIDs);
        if (newParams) {
          return newParams;
        }
        return prevParams;
      });
    }, [props.startingColumnIDs]);
    if (params === void 0) {
      return /* @__PURE__ */ react_default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState, message: "Import a dataset before filling NaN values." });
    }
    const sheetData = props.sheetDataArray[params.sheet_index];
    const columnDtypeMap = (sheetData == null ? void 0 : sheetData.columnDtypeMap) || {};
    const onlyMeanAndMedianColumnSelected = params.column_ids.length === 0 || params.column_ids.map((columnID) => columnDtypeMap[columnID]).filter((columnDtype) => columnDtype !== void 0).map((columnDtype) => isNumberDtype(columnDtype) || isDatetimeDtype(columnDtype) || isTimedeltaDtype(columnDtype)).every((hasDefinedMeanAndMedian) => hasDefinedMeanAndMedian === true);
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Fill NaN Values",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement(
      DataframeSelect_default,
      {
        title: "Select the dataframe to fill nan values in.",
        sheetDataArray: props.sheetDataArray,
        sheetIndex: params.sheet_index,
        onChange: (newSheetIndex) => {
          setParams((prevParams) => {
            const newParams = getDefaultParams5(props.sheetDataArray, newSheetIndex, prevParams.fill_method);
            if (newParams) {
              return newParams;
            }
            return __spreadProps(__spreadValues({}, prevParams), {
              sheet_index: newSheetIndex
            });
          });
        }
      }
    ), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", title: "Select the columns to fill nan values in." }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Columns to Fill NaN Values In"))), /* @__PURE__ */ react_default.createElement(
      MultiToggleColumns_default,
      {
        sheetData,
        selectedColumnIDs: params.column_ids,
        getIsDisabledColumnID: (columnID, columnHeader, columnDtype) => {
          const disabled = (params.fill_method.type === "mean" || params.fill_method.type === "median") && !(isNumberDtype(columnDtype) || isTimedeltaDtype(columnDtype) || isDatetimeDtype(columnDtype));
          return disabled;
        },
        onChange: (newSelectedColumnIDs) => {
          setParams((oldDropDuplicateParams) => {
            return __spreadProps(__spreadValues({}, oldDropDuplicateParams), {
              column_ids: newSelectedColumnIDs
            });
          });
        }
      }
    ), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", title: "Select the method for filling nan values" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Fill Method")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        value: params.fill_method.type,
        onChange: (newFillMethodType) => {
          setParams((prevConcatParams) => {
            let newFillMethod = { type: "bfill" };
            if (newFillMethodType === "value") {
              newFillMethod = { type: "value", value: 0 };
            } else {
              newFillMethod = { type: newFillMethodType };
            }
            return __spreadProps(__spreadValues({}, prevConcatParams), {
              fill_method: newFillMethod
            });
          });
        },
        width: "medium"
      },
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          id: "value",
          title: "Value",
          subtext: "Replaces NaN values with a specific value that you input."
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          id: "ffill",
          title: "Forward Fill",
          subtext: "Replaces NaNs in the column with the value in the row before."
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          id: "bfill",
          title: "Back Fill",
          subtext: "Replaces NaNs in the column with the value in the row after."
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          id: "mean",
          title: "Column Mean",
          subtext: !onlyMeanAndMedianColumnSelected ? "Only number, datetime, and timedetla columns support fill with mean." : "Replaces NaN values in number columns with the average of the column.",
          disabled: !onlyMeanAndMedianColumnSelected
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          id: "median",
          title: "Column Median",
          subtext: !onlyMeanAndMedianColumnSelected ? "Only number, datetime, and timedetla columns support fill with median." : "Replaces NaN values in number columns with the median of the column.",
          disabled: !onlyMeanAndMedianColumnSelected
        }
      )
    ))), params.fill_method.type === "value" && /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", title: "Select the dataframe to fill nan values in." }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Fill Value")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        autoFocus: true,
        width: "medium",
        value: "" + params.fill_method.value,
        onChange: (e) => {
          const newValue = e.target.value;
          setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              fill_method: {
                type: "value",
                value: newValue
              }
            });
          });
        }
      }
    ))), editApplied && !loading && /* @__PURE__ */ react_default.createElement(Row_default, { className: "mt-5" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-subtext-1" }, getSuccessMessage3(sheetData, params.column_ids))), /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => {
          edit((prevParams) => {
            if (prevParams.fill_method.type === "value" && typeof prevParams.fill_method.value === "string") {
              let finalValue = prevParams.fill_method.value;
              if (BOOLEAN_STRINGS.includes(finalValue)) {
                finalValue = finalValue.toLowerCase().startsWith("t") ? true : false;
              } else if (isOnlyNumberString(prevParams.fill_method.value)) {
                finalValue = parseFloat(prevParams.fill_method.value);
              }
              return __spreadProps(__spreadValues({}, prevParams), {
                fill_method: { type: "value", value: finalValue }
              });
            }
            return prevParams;
          });
        },
        disabled: params.column_ids.length === 0,
        disabledTooltip: "Select at least one column to fill NaN values in"
      },
      getButtonMessage4(sheetData, params.column_ids)
    )));
  };
  var FillNaTaskpane_default = FillNaTaskpane;

  // src/mito/components/taskpanes/Graph/GraphSidebar.tsx
  init_react();
  var import_react_dom2 = __toESM(require_react_dom());

  // src/mito/components/icons/EditIcon.tsx
  init_react();
  var EditIcon = (props) => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: props.width || "25", height: props.height || "25", viewBox: "0 0 13 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "8.67323", y: "2.56851", width: "2.27778", height: "9.93478", transform: "rotate(36.5296 8.67323 2.56851)", stroke: "var(--mito-text)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("rect", { x: "0.349697", y: "-0.0520781", width: "2.27778", height: "2.1087", transform: "matrix(0.80355 0.595237 0.595237 -0.80355 8.33261 2.44081)", stroke: "var(--mito-text)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("path", { d: "M1.9732 13.5266L4.22513 12.7599L2.05046 11.149L1.9732 13.5266Z", fill: "var(--mito-text)" }));
  };
  var EditIcon_default = EditIcon;

  // src/mito/components/icons/TrashIcon.tsx
  init_react();
  var TrashIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "10", height: "14", viewBox: "0 0 10 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1.25 2.07668C1.25 2.07668 1.25 10.0463 1.25 9.27798C1.25 9 1.25 9.85175 1.25 11.7261C1.25 12.7426 3.75 12.6117 5 12.6117C6.25 12.6117 8.75 12.6451 8.75 11.7261C8.75 10.3476 8.75 10.4415 8.75 9.27798C8.75 8.50962 8.75 2.07668 8.75 2.07668M10 2.07668H0M3.43095 1.375H6.40375M3.75 4.37416V10.4415M6.25 4.37416V10.4415", stroke: "var(--mito-text)" }));
  };
  var TrashIcon_default = TrashIcon;

  // src/mito/components/taskpanes/Graph/LoadingSpinner.tsx
  init_react();
  function LoadingSpinner() {
    const circles = [...Array(12)].map((_, index) => {
      return /* @__PURE__ */ react_default.createElement("div", { key: index }, /* @__PURE__ */ react_default.createElement("div", { className: "div-after" }));
    });
    return /* @__PURE__ */ react_default.createElement("div", { className: "lds-spinner" }, circles);
  }

  // src/mito/components/taskpanes/Graph/GraphSidebar.tsx
  var GraphTitleEditorPopup = (props) => {
    var _a, _b, _c, _d, _e, _f, _g;
    if (((_a = props.selectedGraphElement) == null ? void 0 : _a.display) !== "popup-title-editor") {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
    }
    const [temporaryValue, setTemporaryValue] = react_default.useState((_b = props.selectedGraphElement) == null ? void 0 : _b.defaultValue);
    react_default.useEffect(() => {
      var _a2;
      setTemporaryValue((_a2 = props.selectedGraphElement) == null ? void 0 : _a2.defaultValue);
    }, [(_c = props.selectedGraphElement) == null ? void 0 : _c.defaultValue]);
    react_default.useEffect(() => {
      const input = document.getElementsByClassName("popup-input")[0];
      input == null ? void 0 : input.focus();
    }, [(_d = props.selectedGraphElement) == null ? void 0 : _d.popupPosition]);
    const caretPosition = ((_e = props.selectedGraphElement) == null ? void 0 : _e.element) === "gtitle" ? "above" : ((_f = props.selectedGraphElement) == null ? void 0 : _f.element) === "ytitle" ? "below-left" : "below-centered";
    if (!props.mitoContainerRef) {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
    }
    return import_react_dom2.default.createPortal(
      /* @__PURE__ */ react_default.createElement(
        "div",
        {
          className: `graph-element-popup-div ${caretPosition === "above" ? "graph-element-popup-div-caret-above" : caretPosition === "below-left" ? "graph-element-popup-div-caret-below-left" : "graph-element-popup-div-caret-below-centered"}`,
          style: __spreadValues({
            position: "absolute",
            height: "32px"
          }, (_g = props.selectedGraphElement) == null ? void 0 : _g.popupPosition)
        },
        /* @__PURE__ */ react_default.createElement("div", { className: "graph-element-popup-div-caret" }),
        /* @__PURE__ */ react_default.createElement(
          Input_default,
          {
            className: "popup-input",
            value: temporaryValue != null ? temporaryValue : "",
            style: {
              zIndex: 1,
              position: "relative",
              width: getInputWidth(temporaryValue != null ? temporaryValue : "", 150)
            },
            onKeyDown: (e) => {
              if (e.key === "Backspace") {
                e.stopPropagation();
              }
              if (e.key === "Enter") {
                props.setValue(temporaryValue != null ? temporaryValue : "");
              }
            },
            autoFocus: true,
            onChange: (e) => {
              setTemporaryValue(e.target.value);
            }
          }
        )
      ),
      props.mitoContainerRef.current
    );
  };
  var GraphTitleContextMenu = (props) => {
    var _a, _b;
    if (!props.mitoContainerRef || ((_a = props.selectedGraphElement) == null ? void 0 : _a.display) !== "context-menu") {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
    }
    return import_react_dom2.default.createPortal(
      /* @__PURE__ */ react_default.createElement(
        "div",
        {
          className: "mito-dropdown mito-dropdown-item-horizontal",
          style: __spreadValues({
            position: "absolute"
          }, (_b = props.selectedGraphElement) == null ? void 0 : _b.popupPosition)
        },
        /* @__PURE__ */ react_default.createElement("div", { className: "mito-dropdown-items-container" }, /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            icon: /* @__PURE__ */ react_default.createElement(TrashIcon_default, null),
            onClick: () => {
              props.deleteSelectedGraphElement();
              props.setSelectedGraphElement(void 0);
            },
            supressFocusSettingOnClose: true,
            title: "Delete Title"
          }
        ), /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            icon: /* @__PURE__ */ react_default.createElement(EditIcon_default, { width: "15px" }),
            onClick: () => {
              var _a2, _b2;
              if (props.selectedGraphElement !== void 0) {
                const graphElementObjects = getGraphElementObjects(props.graphOutput);
                if (graphElementObjects === void 0) {
                  return;
                }
                const elementInfo = getGraphElementInfoFromHTMLElement(graphElementObjects[props.selectedGraphElement.element], props.selectedGraphElement.element, props.graphOutput, (_b2 = (_a2 = props.mitoContainerRef) == null ? void 0 : _a2.current) != null ? _b2 : null, "popup-title-editor");
                props.setSelectedGraphElement(elementInfo);
              }
            },
            supressFocusSettingOnClose: true,
            title: "Edit Title"
          }
        ))
      ),
      props.mitoContainerRef.current
    );
  };
  var GraphSidebar = (props) => {
    var _a;
    const { params: graphParams, setParams: setGraphParams, startNewStep, loading } = useLiveUpdatingParams_default(
      () => getDefaultGraphParams(props.mitoContainerRef, props.sheetDataArray, props.uiState.selectedSheetIndex, props.openGraph),
      "graph" /* Graph */,
      props.mitoAPI,
      props.analysisData,
      1e3,
      {
        getBackendFromFrontend: convertFrontendtoBackendGraphParams,
        getFrontendFromBackend: convertBackendtoFrontendGraphParams
      }
    );
    const dataSourceSheetIndex = graphParams == null ? void 0 : graphParams.graphCreation.sheet_index;
    const graphData = props.graphDataArray.find((graphData2) => graphData2.graph_id === props.openGraph.graphID);
    const graphOutput = graphData == null ? void 0 : graphData.graph_output;
    const currOpenTaskpane = props.uiState.currOpenTaskpane;
    if (currOpenTaskpane.type !== "graph" /* GRAPH */) {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
    }
    useEffect(() => {
      startNewStep();
      const newParams = getDefaultGraphParams(props.mitoContainerRef, props.sheetDataArray, props.uiState.selectedSheetIndex, props.openGraph);
      setGraphParams(newParams);
    }, [props.openGraph]);
    useEffect(() => {
      if (!window.Plotly) {
        void props.mitoAPI.log("plotly_define_failed");
      }
    }, []);
    useEffectOnResizeElement(() => {
      setGraphParams((prevGraphParams) => {
        return __spreadProps(__spreadValues({}, prevGraphParams), {
          graphRendering: getGraphRenderingParams(props.mitoContainerRef)
        });
      });
    }, [currOpenTaskpane.graphSidebarOpen], props.mitoContainerRef, "#mito-center-content-container");
    const selectedGraphElement = props.uiState.currOpenTaskpane.type === "graph" /* GRAPH */ ? props.uiState.currOpenTaskpane.currentGraphElement : void 0;
    const setSelectedGraphElement = (graphElement) => {
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenTaskpane: __spreadProps(__spreadValues({}, prevUIState.currOpenTaskpane), {
            currentGraphElement: graphElement
          })
        });
      });
    };
    useEffect(() => {
      try {
        if (graphOutput === void 0) {
          return;
        }
        const executeScript = new Function(graphOutput.graphScript);
        executeScript();
        const graphObjects = getGraphElementObjects(graphOutput);
        graphObjects == null ? void 0 : graphObjects.div.on("plotly_afterplot", () => {
          var _a2;
          registerClickEventsForGraphElements(graphOutput, setSelectedGraphElement, (_a2 = props.mitoContainerRef) == null ? void 0 : _a2.current);
        });
      } catch (e) {
        console.error("Failed to execute graph function", e);
      }
    }, [graphOutput]);
    if (props.sheetDataArray.length === 0 || graphParams === void 0 || dataSourceSheetIndex === void 0) {
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenTaskpane: { type: "none" /* NONE */ }
        });
      });
      return /* @__PURE__ */ react_default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    const selectedGraphElementClass = selectedGraphElement !== void 0 ? `${selectedGraphElement.element}-highlighted` : void 0;
    const containerRef = react_default.useRef(null);
    const deleteSelectedGraphElement = () => {
      const newGraphParams = {};
      if ((selectedGraphElement == null ? void 0 : selectedGraphElement.element) === "gtitle") {
        newGraphParams.graphStyling = { title: { visible: false } };
      } else if ((selectedGraphElement == null ? void 0 : selectedGraphElement.element) === "xtitle") {
        newGraphParams.graphStyling = { xaxis: { visible: false } };
      } else if ((selectedGraphElement == null ? void 0 : selectedGraphElement.element) === "ytitle") {
        newGraphParams.graphStyling = { yaxis: { visible: false } };
      }
      setGraphParams(updateObjectWithPartialObject(graphParams, newGraphParams));
    };
    const graphSidebarOpen = currOpenTaskpane.graphSidebarOpen || graphParams.graphCreation.x_axis_column_ids.length === 0 && graphParams.graphCreation.y_axis_column_ids.length === 0;
    return /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: classNames("graph-sidebar-div", selectedGraphElementClass),
        tabIndex: 0,
        ref: containerRef,
        onKeyDown: (e) => {
          if (e.key === "Backspace") {
            deleteSelectedGraphElement();
          }
          if ((e.key === "Escape" || e.key === "Enter") && selectedGraphElement !== void 0) {
            setSelectedGraphElement(void 0);
          }
        }
      },
      /* @__PURE__ */ react_default.createElement(
        "div",
        {
          className: "graph-sidebar-graph-div",
          id: "graph-div",
          style: {
            backgroundColor: graphParams == null ? void 0 : graphParams.graphStyling.paper_bgcolor,
            color: graphParams == null ? void 0 : graphParams.graphStyling.title.title_font_color
          }
        },
        graphOutput === void 0 && /* @__PURE__ */ react_default.createElement("p", { className: "graph-sidebar-welcome-text text-align-center-important" }, "To generate a graph, select an axis."),
        graphOutput !== void 0 && /* @__PURE__ */ react_default.createElement("div", { dangerouslySetInnerHTML: { __html: graphOutput.graphHTML } }),
        /* @__PURE__ */ react_default.createElement(
          GraphTitleEditorPopup,
          {
            setSelectedGraphElement,
            selectedGraphElement,
            graphOutput,
            setValue: (value) => {
              var _a2, _b;
              const update = {
                graphStyling: {
                  title: (selectedGraphElement == null ? void 0 : selectedGraphElement.element) === "gtitle" ? { title: value } : graphParams == null ? void 0 : graphParams.graphStyling.title,
                  xaxis: (selectedGraphElement == null ? void 0 : selectedGraphElement.element) === "xtitle" ? { title: value } : graphParams == null ? void 0 : graphParams.graphStyling.xaxis,
                  yaxis: (selectedGraphElement == null ? void 0 : selectedGraphElement.element) === "ytitle" ? { title: value } : graphParams == null ? void 0 : graphParams.graphStyling.yaxis
                }
              };
              const currOpenTaskpane2 = props.uiState.currOpenTaskpane;
              const stepSummaryList = props.analysisData.stepSummaryList;
              const currGraphStep = stepSummaryList[stepSummaryList.length - 1];
              const params = currGraphStep.params;
              if (currOpenTaskpane2.type !== "graph" /* GRAPH */ || params === void 0) {
                return;
              }
              void props.mitoAPI.editGraph(
                currOpenTaskpane2.openGraph.graphID,
                updateObjectWithPartialObject(graphParams, update),
                (_a2 = graphParams.graphRendering.height) != null ? _a2 : "100%",
                (_b = graphParams.graphRendering.width) != null ? _b : "100%",
                currGraphStep.step_id,
                true
              );
            },
            containerRef,
            mitoContainerRef: props.mitoContainerRef
          }
        ),
        /* @__PURE__ */ react_default.createElement(
          GraphTitleContextMenu,
          {
            setSelectedGraphElement,
            selectedGraphElement,
            graphOutput,
            setUIState: props.setUIState,
            deleteSelectedGraphElement,
            mitoContainerRef: props.mitoContainerRef
          }
        )
      ),
      graphSidebarOpen && /* @__PURE__ */ react_default.createElement("div", { className: "graph-sidebar-toolbar-container" }, /* @__PURE__ */ react_default.createElement("div", { className: "graph-sidebar-toolbar-content-container" }, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-2" }, "Select Data")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
        XIcon_default,
        {
          onClick: () => {
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenTaskpane: __spreadProps(__spreadValues({}, prevUIState.currOpenTaskpane), {
                  graphSidebarOpen: false
                })
              });
            });
          }
        }
      ))), /* @__PURE__ */ react_default.createElement(
        GraphSetupTab_default,
        {
          graphParams,
          setGraphParams,
          uiState: props.uiState,
          mitoAPI: props.mitoAPI,
          graphID: props.openGraph.graphID,
          sheetDataArray: props.sheetDataArray,
          columnDtypesMap: ((_a = props.sheetDataArray[dataSourceSheetIndex]) == null ? void 0 : _a.columnDtypeMap) || {},
          setUIState: props.setUIState,
          mitoContainerRef: props.mitoContainerRef,
          openGraph: props.openGraph
        }
      ))),
      loading && /* @__PURE__ */ react_default.createElement("div", { className: "popup-div" }, /* @__PURE__ */ react_default.createElement(LoadingSpinner, null), /* @__PURE__ */ react_default.createElement("p", { className: "popup-text-div" }, "loading"))
    );
  };
  var GraphSidebar_default = GraphSidebar;

  // src/mito/components/taskpanes/Melt/MeltTaskpane.tsx
  init_react();
  var getDefaultParams6 = (sheetDataArray, sheetIndex) => {
    if (sheetDataArray.length === 0 || sheetDataArray[sheetIndex] === void 0) {
      return void 0;
    }
    return {
      sheet_index: sheetIndex,
      id_var_column_ids: [],
      value_var_column_ids: Object.keys(sheetDataArray[sheetIndex].columnDtypeMap || {})
    };
  };
  var MeltTaskpane = (props) => {
    const { params, setParams } = useLiveUpdatingParams_default(
      () => getDefaultParams6(props.sheetDataArray, props.selectedSheetIndex),
      "melt" /* Melt */,
      props.mitoAPI,
      props.analysisData,
      50
    );
    if (params === void 0) {
      return /* @__PURE__ */ react_default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    const sheetData = props.sheetDataArray[params.sheet_index];
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Unpivot Dataframe",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement(
      DataframeSelect_default,
      {
        title: "Select a dataframe to unpivot.",
        sheetDataArray: props.sheetDataArray,
        sheetIndex: params.sheet_index,
        onChange: (newSheetIndex) => {
          setParams((prevParams) => {
            const newParams = getDefaultParams6(props.sheetDataArray, newSheetIndex);
            if (newParams) {
              return newParams;
            }
            return __spreadProps(__spreadValues({}, prevParams), {
              sheet_index: newSheetIndex
            });
          });
        }
      }
    ), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "start", align: "center", title: "Column to use as identifier variables." }, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: "Column to use as identifier variables. These columns will be present in the unpivoted dataframe." }, "ID Variables")), /* @__PURE__ */ react_default.createElement(
      MultiToggleColumns_default,
      {
        sheetData,
        selectedColumnIDs: params.id_var_column_ids,
        onChange: (newSelectedColumnIDs) => {
          setParams((oldDropDuplicateParams) => {
            return __spreadProps(__spreadValues({}, oldDropDuplicateParams), {
              id_var_column_ids: newSelectedColumnIDs
            });
          });
        }
      }
    ), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 10 }), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "start", align: "center", title: "Columns to unpivot." }, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: "Column to unpivot. Each column header will go in the variables column, and the column values will go in the values column." }, "Values")), /* @__PURE__ */ react_default.createElement(
      MultiToggleColumns_default,
      {
        sheetData,
        selectedColumnIDs: params.value_var_column_ids.filter((cid) => !params.id_var_column_ids.includes(cid)),
        disabledColumnIDs: params.id_var_column_ids,
        onChange: (newSelectedColumnIDs) => {
          setParams((oldDropDuplicateParams) => {
            return __spreadProps(__spreadValues({}, oldDropDuplicateParams), {
              value_var_column_ids: newSelectedColumnIDs
            });
          });
        }
      }
    )));
  };
  var MeltTaskpane_default = MeltTaskpane;

  // src/mito/components/taskpanes/Merge/MergeTaskpane.tsx
  init_react();

  // src/mito/components/taskpanes/Merge/MergeKeysSelection.tsx
  init_react();

  // src/mito/components/taskpanes/Merge/mergeUtils.ts
  var getFirstSuggestedMergeKeys = (sheetDataArray, sheetOneIndex, sheetTwoIndex, existingMergeKeys) => {
    var _a, _b;
    const sheetOneEntries = Object.entries(((_a = sheetDataArray[sheetOneIndex]) == null ? void 0 : _a.columnIDsMap) || {});
    const sheetTwoEntries = Object.entries(((_b = sheetDataArray[sheetTwoIndex]) == null ? void 0 : _b.columnIDsMap) || {});
    const columnIDsWithSharedColumnHeaders = sheetOneEntries.map(([columnID, columnHeader]) => {
      const matchingIndex = sheetTwoEntries.findIndex(([, otherColumnHeader]) => {
        return getDisplayColumnHeader(columnHeader) === getDisplayColumnHeader(otherColumnHeader);
      });
      if (matchingIndex > -1) {
        return [columnID, sheetTwoEntries[matchingIndex][0]];
      } else {
        return void 0;
      }
    });
    const allSuggestions = columnIDsWithSharedColumnHeaders.filter((cid) => cid !== void 0);
    if (allSuggestions.length === 0) {
      if (sheetOneEntries[0] === void 0 || sheetTwoEntries[0] === void 0) {
        return void 0;
      }
      return [sheetOneEntries[0][0], sheetTwoEntries[0][0]];
    } else {
      if (!existingMergeKeys) {
        return allSuggestions[0];
      } else {
        const notIncludedSuggestions = allSuggestions.filter(([columnIDOne, columnIDTwo]) => {
          const columnIDOneUsed = existingMergeKeys.findIndex(([mergeKeyOne]) => {
            return columnIDOne === mergeKeyOne;
          }) !== -1;
          const columnIDTwoUsed = existingMergeKeys.findIndex(([, mergeKeyTwo]) => {
            return columnIDTwo === mergeKeyTwo;
          }) !== -1;
          return !columnIDOneUsed && !columnIDTwoUsed;
        });
        if (notIncludedSuggestions.length === 0) {
          return allSuggestions[0];
        } else {
          return notIncludedSuggestions[0];
        }
      }
    }
  };

  // src/mito/components/taskpanes/Merge/MergeKeysSelection.tsx
  var MergeKeysSelectionSection = (props) => {
    const sheetDataOne = props.sheetDataArray[props.params.sheet_index_one];
    const sheetDataTwo = props.sheetDataArray[props.params.sheet_index_two];
    const noPossibleMergeKeys = Object.keys((sheetDataOne == null ? void 0 : sheetDataOne.columnDtypeMap) || {}).length === 0 || Object.keys((sheetDataTwo == null ? void 0 : sheetDataTwo.columnDtypeMap) || {}).length === 0;
    return /* @__PURE__ */ react_default.createElement("div", { className: "expandable-content-card" }, /* @__PURE__ */ react_default.createElement(Row_default, { suppressTopBottomMargin: true }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Match rows where:"))), props.params.merge_key_column_ids.map(([mergeKeyColumnIDOne, mergeKeyColumnIDTwo], index) => {
      return /* @__PURE__ */ react_default.createElement(Row_default, { key: index, justify: "start", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 10 }, /* @__PURE__ */ react_default.createElement(
        Select_default,
        {
          value: mergeKeyColumnIDOne,
          onChange: (columnID) => {
            props.setParams((prevParams) => {
              const newMergeKeys = [...prevParams.merge_key_column_ids];
              newMergeKeys[index][0] = columnID;
              return __spreadProps(__spreadValues({}, prevParams), {
                merge_key_column_ids: newMergeKeys
              });
            });
          },
          searchable: true
        },
        Object.entries((sheetDataOne == null ? void 0 : sheetDataOne.columnIDsMap) || {}).map(([columnID, columnHeader]) => {
          return /* @__PURE__ */ react_default.createElement(
            DropdownItem_default,
            {
              key: columnID,
              id: columnID,
              title: getDisplayColumnHeader(columnHeader)
            }
          );
        })
      )), /* @__PURE__ */ react_default.createElement(Col_default, { className: "text-header-3", span: 0.5, offset: 0.5, offsetRight: 0.5 }, "="), /* @__PURE__ */ react_default.createElement(Col_default, { span: 10 }, /* @__PURE__ */ react_default.createElement(
        Select_default,
        {
          value: mergeKeyColumnIDTwo,
          onChange: (columnID) => {
            props.setParams((prevParams) => {
              const newMergeKeys = [...prevParams.merge_key_column_ids];
              newMergeKeys[index][1] = columnID;
              return __spreadProps(__spreadValues({}, prevParams), {
                merge_key_column_ids: newMergeKeys
              });
            });
          },
          searchable: true
        },
        Object.entries((sheetDataTwo == null ? void 0 : sheetDataTwo.columnIDsMap) || {}).map(([columnID, columnHeader]) => {
          return /* @__PURE__ */ react_default.createElement(
            DropdownItem_default,
            {
              key: columnID,
              id: columnID,
              title: getDisplayColumnHeader(columnHeader)
            }
          );
        })
      )), /* @__PURE__ */ react_default.createElement(Col_default, { span: 2, offset: 0.5 }, /* @__PURE__ */ react_default.createElement(
        XIcon_default,
        {
          onClick: () => {
            props.setParams((prevParams) => {
              const newMergeKeys = [...prevParams.merge_key_column_ids];
              newMergeKeys.splice(index, 1);
              return __spreadProps(__spreadValues({}, prevParams), {
                merge_key_column_ids: newMergeKeys
              });
            });
          }
        }
      )));
    }), props.error !== void 0 && /* @__PURE__ */ react_default.createElement("p", { className: "text-color-error" }, props.error), /* @__PURE__ */ react_default.createElement(
      ExpandableWarning_default,
      {
        warningState: props.warningState
      }
    ), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 15 }), /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        width: "hug-contents",
        variant: "dark",
        onClick: () => {
          props.setParams((prevParams) => {
            const newMergeKeys = [...prevParams.merge_key_column_ids];
            const newSuggestedMergeKeys = getFirstSuggestedMergeKeys(props.sheetDataArray, props.params.sheet_index_one, props.params.sheet_index_two, props.params.merge_key_column_ids);
            if (newSuggestedMergeKeys) {
              newMergeKeys.push(newSuggestedMergeKeys);
            }
            return __spreadProps(__spreadValues({}, prevParams), {
              merge_key_column_ids: newMergeKeys
            });
          });
        },
        disabled: noPossibleMergeKeys,
        disabledTooltip: "One of these dataframes has no columns, so no merge keys can be added."
      },
      "+ Add Merge Keys"
    ));
  };
  var MergeKeysSelection_default = MergeKeysSelectionSection;

  // src/mito/components/taskpanes/Merge/MergeSheetSelection.tsx
  init_react();
  var MergeSheetSection = (props) => {
    const [dfNames] = useState(props.sheetDataArray.map((sheetData) => sheetData.dfName));
    return /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 10 }, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "First Dataframe"), /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        value: dfNames[props.params.sheet_index_one] || "",
        onChange: (dfName) => {
          const newSheetIndex = dfNames.indexOf(dfName);
          props.setParams((prevParams) => {
            const newParams = getDefaultMergeParams(props.sheetDataArray, newSheetIndex, prevParams.sheet_index_two, prevParams);
            return newParams ? newParams : prevParams;
          });
        }
      },
      dfNames.map((dfName) => {
        return /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: dfName,
            title: dfName
          }
        );
      })
    )), /* @__PURE__ */ react_default.createElement(Col_default, { span: 11 }, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Second Dataframe"), /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        value: dfNames[props.params.sheet_index_two] || "",
        onChange: (dfName) => {
          const newSheetIndex = dfNames.indexOf(dfName);
          props.setParams((prevParams) => {
            const newParams = getDefaultMergeParams(props.sheetDataArray, prevParams.sheet_index_one, newSheetIndex, prevParams);
            return newParams ? newParams : prevParams;
          });
        }
      },
      dfNames.map((dfName) => {
        return /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: dfName,
            title: dfName
          }
        );
      })
    ))));
  };
  var MergeSheetSelection_default = MergeSheetSection;

  // src/mito/components/taskpanes/Merge/MergeTaskpane.tsx
  var getDefaultMergeParams = (sheetDataArray, _sheetIndexOne, _sheetIndexTwo, previousParams, defaultMergeType) => {
    var _a, _b;
    if (sheetDataArray.length < 2) {
      return void 0;
    }
    const sheetIndexOne = _sheetIndexOne;
    const sheetIndexTwo = _sheetIndexTwo !== void 0 ? _sheetIndexTwo : sheetIndexOne + 1 <= sheetDataArray.length - 1 ? sheetIndexOne + 1 : sheetIndexOne - 1 >= 0 ? sheetIndexOne - 1 : sheetIndexOne;
    if (previousParams && previousParams.sheet_index_one == sheetIndexOne && previousParams.sheet_index_two === sheetIndexTwo) {
      return previousParams;
    }
    const suggestedMergeKeys = getFirstSuggestedMergeKeys(sheetDataArray, sheetIndexOne, sheetIndexTwo);
    let selectedColumnIDsOne = [];
    let selectedColumnIDsTwo = [];
    if (previousParams && previousParams.sheet_index_one == sheetIndexOne) {
      selectedColumnIDsOne = previousParams.selected_column_ids_one;
    } else {
      selectedColumnIDsOne = [...Object.keys(((_a = sheetDataArray[sheetIndexOne]) == null ? void 0 : _a.columnIDsMap) || {})];
    }
    if (previousParams && previousParams.sheet_index_two == sheetIndexTwo) {
      selectedColumnIDsTwo = previousParams.selected_column_ids_two;
    } else {
      selectedColumnIDsTwo = [...Object.keys(((_b = sheetDataArray[sheetIndexTwo]) == null ? void 0 : _b.columnIDsMap) || {})];
    }
    return {
      how: previousParams ? previousParams.how : defaultMergeType != null ? defaultMergeType : "lookup",
      sheet_index_one: sheetIndexOne,
      sheet_index_two: sheetIndexTwo,
      merge_key_column_ids: suggestedMergeKeys ? [suggestedMergeKeys] : [],
      selected_column_ids_one: selectedColumnIDsOne,
      selected_column_ids_two: selectedColumnIDsTwo
    };
  };
  var getValidMergeParams = (params, sheetDataArray) => {
    const {
      merge_key_column_ids,
      selected_column_ids_one,
      selected_column_ids_two
    } = params;
    const sheetDataOne = sheetDataArray[params.sheet_index_one];
    const sheetDataTwo = sheetDataArray[params.sheet_index_two];
    const validMergeKeyColumnIDs = merge_key_column_ids.filter(([mergeKeyColumnIDOne, mergeKeyColumnIDTwo]) => {
      return sheetDataOne.columnIDsMap[mergeKeyColumnIDOne] !== void 0 && sheetDataTwo.columnIDsMap[mergeKeyColumnIDTwo] !== void 0;
    });
    const validSelectedColumnIDsOne = selected_column_ids_one.filter((columnID) => {
      return sheetDataOne.columnIDsMap[columnID] !== void 0;
    });
    const validSelectedColumnIDsTwo = selected_column_ids_two.filter((columnID) => {
      return sheetDataTwo.columnIDsMap[columnID] !== void 0;
    });
    return __spreadProps(__spreadValues({}, params), {
      merge_key_column_ids: validMergeKeyColumnIDs,
      selected_column_ids_one: validSelectedColumnIDsOne,
      selected_column_ids_two: validSelectedColumnIDsTwo
    });
  };
  var getEditMergeWarnings = (params, sheetDataOne, sheetDataTwo) => {
    const {
      merge_key_column_ids,
      selected_column_ids_one,
      selected_column_ids_two
    } = params;
    const invalidMergeKeys = merge_key_column_ids.filter(([mergeKeyColumnIDOne, mergeKeyColumnIDTwo]) => {
      return sheetDataOne.columnIDsMap[mergeKeyColumnIDOne] === void 0 || sheetDataTwo.columnIDsMap[mergeKeyColumnIDTwo] === void 0;
    });
    const mergeKeyWarnings = invalidMergeKeys.map(([mergeKeyColumnIDOne, mergeKeyColumnIDTwo]) => {
      const sheetOneColumnHeader = sheetDataOne.columnIDsMap[mergeKeyColumnIDOne];
      const sheetTwoColumnHeader = sheetDataTwo.columnIDsMap[mergeKeyColumnIDTwo];
      if (sheetOneColumnHeader === void 0 && sheetTwoColumnHeader === void 0) {
        return `The merge keys ${mergeKeyColumnIDOne} and \u201C${mergeKeyColumnIDTwo}\u201D were removed because they no longer exist in \u201C${sheetDataOne.dfName}\u201D and \u201C${sheetDataTwo.dfName}\u201D.`;
      } else if (sheetOneColumnHeader === void 0) {
        return `The merge key pairing (${mergeKeyColumnIDOne}, ${mergeKeyColumnIDTwo}) was removed because \u201C${mergeKeyColumnIDOne}\u201D no longer exists in \u201C${sheetDataOne.dfName}\u201D.`;
      } else {
        return `The merge key pairing (${mergeKeyColumnIDOne}, ${mergeKeyColumnIDTwo}) was removed because \u201C${mergeKeyColumnIDTwo}\u201D no longer exists in \u201C${sheetDataTwo.dfName}\u201D.`;
      }
    });
    const getSelectedColumnWarningString = (invalidSelectedColumns, sheetData) => {
      if (invalidSelectedColumns.length === 1) {
        return `The column \u201C${invalidSelectedColumns[0]}\u201D was removed because it no longer exists in \u201C${sheetData.dfName}\u201D.`;
      } else if (invalidSelectedColumns.length > 1) {
        return `The columns \u201C${invalidSelectedColumns.join(", ")}\u201D were removed because they no longer exist in \u201C${sheetData.dfName}\u201D.`;
      } else {
        return void 0;
      }
    };
    const invalidSelectedColumnsOne = selected_column_ids_one.filter((columnID) => {
      return sheetDataOne.columnIDsMap[columnID] === void 0;
    });
    const selectedColumnsOneWarning = getSelectedColumnWarningString(invalidSelectedColumnsOne, sheetDataOne);
    const invalidSelectedColumnsTwo = selected_column_ids_two.filter((columnID) => {
      return sheetDataTwo.columnIDsMap[columnID] === void 0;
    });
    const selectedColumnsTwoWarning = getSelectedColumnWarningString(invalidSelectedColumnsTwo, sheetDataTwo);
    return {
      mergeKeyWarnings,
      selectedColumnsOneWarnings: selectedColumnsOneWarning,
      selectedColumnsTwoWarnings: selectedColumnsTwoWarning
    };
  };
  var MergeTaskpane = (props) => {
    const { params, setParams, error } = useLiveUpdatingParams_default(
      () => props.existingParams ? getValidMergeParams(props.existingParams, props.sheetDataArray) : getDefaultMergeParams(props.sheetDataArray, props.selectedSheetIndex, void 0, void 0, props.defaultMergeType),
      "merge" /* Merge */,
      props.mitoAPI,
      props.analysisData,
      50,
      void 0,
      {
        doNotSendDefaultParams: props.existingParams !== void 0
      }
    );
    const [dismissedWarnings, setDismissedWarnings] = react_default.useState([false, false, false]);
    if (params === void 0) {
      return /* @__PURE__ */ react_default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState, message: "You need two dataframes before you can merge them." });
    }
    const sheetDataOne = props.sheetDataArray[params.sheet_index_one];
    const sheetDataTwo = props.sheetDataArray[params.sheet_index_two];
    const editMergeWarnings = props.existingParams !== void 0 ? getEditMergeWarnings(props.existingParams, sheetDataOne, sheetDataTwo) : void 0;
    const mergeKeyColumnIDsOne = params.merge_key_column_ids.map(([one]) => {
      return one;
    });
    const mergeKeyColumnIDsTwo = params.merge_key_column_ids.map(([, two]) => {
      return two;
    });
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Merge Dataframes",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", suppressTopBottomMargin: true }, /* @__PURE__ */ react_default.createElement(Col_default, { offsetRight: 1, span: 7 }, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Merge Type")), /* @__PURE__ */ react_default.createElement(Col_default, { span: 14 }, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        value: params.how,
        onChange: (mergeType) => {
          const newMergeTypeEnum = mergeType;
          setParams((prevParams) => {
            return __spreadProps(__spreadValues({}, prevParams), {
              how: newMergeTypeEnum
            });
          });
        },
        width: "block"
      },
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "lookup" /* LOOKUP */,
          subtext: "Includes all rows from the first sheet and only matching rows from the second sheet. If there are multiple matches in the second sheet, only takes the first."
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "left" /* LEFT */,
          subtext: "Includes all rows from the first sheet and only matching rows from the second sheet. Includes all matches."
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "right" /* RIGHT */,
          subtext: "Includes all rows from the second sheet and only matching rows from the  first sheet. Includes all matches."
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "inner" /* INNER */,
          subtext: "Only includes rows that have matches in both sheets."
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "outer" /* OUTER */,
          subtext: "Includes all rows from both sheets, regardless of whether there is a match in the other sheet."
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "unique in left" /* UNIQUE_IN_LEFT */,
          subtext: "Includes each row from the first sheet that doesn't have a match in the second sheet."
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "unique in right" /* UNIQUE_IN_RIGHT */,
          subtext: "Includes each row from second sheet that doesn't have a match in the first sheet."
        }
      )
    ))), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 20 }), /* @__PURE__ */ react_default.createElement(
      MergeSheetSelection_default,
      {
        params,
        setParams,
        sheetDataArray: props.sheetDataArray
      }
    ), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 20 }), /* @__PURE__ */ react_default.createElement(
      MergeKeysSelection_default,
      {
        params,
        setParams,
        sheetDataArray: props.sheetDataArray,
        error,
        warningState: (editMergeWarnings == null ? void 0 : editMergeWarnings.mergeKeyWarnings) !== void 0 ? {
          warningStrings: editMergeWarnings == null ? void 0 : editMergeWarnings.mergeKeyWarnings,
          dismissed: dismissedWarnings[0],
          dismiss: () => {
            setDismissedWarnings((oldDismissedWarnings) => {
              return [true, oldDismissedWarnings[1], oldDismissedWarnings[2]];
            });
          }
        } : void 0
      }
    ), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 20 }), /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Columns to Keep from First Dataframe"), params.how !== "unique in right" /* UNIQUE_IN_RIGHT */ && /* @__PURE__ */ react_default.createElement(
      MultiToggleColumns_default,
      {
        sheetData: sheetDataOne,
        selectedColumnIDs: params.selected_column_ids_one,
        disabledColumnIDs: mergeKeyColumnIDsOne,
        onChange: (newSelectedColumnIDs) => {
          setParams((oldDropDuplicateParams) => {
            return __spreadProps(__spreadValues({}, oldDropDuplicateParams), {
              selected_column_ids_one: newSelectedColumnIDs
            });
          });
        },
        warningState: {
          warningStrings: (editMergeWarnings == null ? void 0 : editMergeWarnings.selectedColumnsOneWarnings) !== void 0 ? [editMergeWarnings == null ? void 0 : editMergeWarnings.selectedColumnsOneWarnings] : [],
          dismissed: dismissedWarnings[1],
          dismiss: () => {
            setDismissedWarnings((oldDismissedWarnings) => {
              return [oldDismissedWarnings[0], true, oldDismissedWarnings[2]];
            });
          }
        }
      }
    ), params.how === "unique in right" /* UNIQUE_IN_RIGHT */ && /* @__PURE__ */ react_default.createElement("p", null, "Finding the unique values in the second sheet doesn't keep any columns from the first sheet."), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 20 }), /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Columns to Keep from Second Dataframe"), params.how !== "unique in left" /* UNIQUE_IN_LEFT */ && /* @__PURE__ */ react_default.createElement(
      MultiToggleColumns_default,
      {
        sheetData: sheetDataTwo,
        selectedColumnIDs: params.selected_column_ids_two,
        disabledColumnIDs: mergeKeyColumnIDsTwo,
        onChange: (newSelectedColumnIDs) => {
          setParams((oldDropDuplicateParams) => {
            return __spreadProps(__spreadValues({}, oldDropDuplicateParams), {
              selected_column_ids_two: newSelectedColumnIDs
            });
          });
        },
        warningState: {
          warningStrings: (editMergeWarnings == null ? void 0 : editMergeWarnings.selectedColumnsTwoWarnings) !== void 0 ? [editMergeWarnings == null ? void 0 : editMergeWarnings.selectedColumnsTwoWarnings] : [],
          dismissed: dismissedWarnings[2],
          dismiss: () => {
            setDismissedWarnings((oldDismissedWarnings) => {
              return [oldDismissedWarnings[0], oldDismissedWarnings[1], true];
            });
          }
        }
      }
    ), params.how === "unique in left" /* UNIQUE_IN_LEFT */ && /* @__PURE__ */ react_default.createElement("p", null, "Finding the unique values in the first sheet doesn't keep any columns from the second sheet."))));
  };
  var MergeTaskpane_default = MergeTaskpane;

  // src/mito/components/taskpanes/PivotTable/PivotTaskpane.tsx
  init_react();

  // src/mito/components/taskpanes/PivotTable/PivotTableFilterSection.tsx
  init_react();

  // src/mito/components/taskpanes/PivotTable/PivotInvalidSelectedColumnsError.tsx
  init_react();
  var PivotInvalidSelectedColumnsError = (props) => {
    const invalidSelectedColumnIDs = props.selectedColumnIDs.filter(
      (columnID) => props.columnIDsMap[columnID] === void 0
    );
    useEffect(() => {
      if (invalidSelectedColumnIDs.length > 0) {
        void props.mitoAPI.log("pivot_invalid_selected_columns", {
          "pivot_section": props.pivotSection,
          "num_invalid": invalidSelectedColumnIDs.length
        });
      }
    }, []);
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, invalidSelectedColumnIDs.length > 0 && /* @__PURE__ */ react_default.createElement("div", { className: "text-color-error", style: { overflowX: "hidden" } }, "The ", invalidSelectedColumnIDs.length === 1 ? "column" : "columns", " ", invalidSelectedColumnIDs.length === 1 ? invalidSelectedColumnIDs[0] : invalidSelectedColumnIDs.join(", "), " ", invalidSelectedColumnIDs.length === 1 ? "does" : "do", " not exist in this sheet anymore. Delete ", invalidSelectedColumnIDs.length === 1 ? "it" : "them", " to make this pivot valid."));
  };
  var PivotInvalidSelectedColumnsError_default = PivotInvalidSelectedColumnsError;

  // src/mito/components/taskpanes/PivotTable/PivotTableFilterSection.tsx
  var FILTERS_TOOLTIP = "Filters are used to only include a subset of the source data in the pivot table.";
  var PivotTableFilterSection = (props) => {
    var _a;
    const columnIDsMap = ((_a = props.sheetData) == null ? void 0 : _a.columnIDsMap) || {};
    const allColumnIDs = Object.keys(columnIDsMap);
    const columnIDsToDisplayHeaders = {};
    Object.entries(columnIDsMap).map(([columnID, columnHeader]) => {
      columnIDsToDisplayHeaders[columnID] = getDisplayColumnHeader(columnHeader);
    });
    return /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: FILTERS_TOOLTIP }, "Filters")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      DropdownButton_default,
      {
        text: "+ Add",
        width: "small",
        searchable: true
      },
      Object.entries(columnIDsMap).map(([columnID, columnHeader]) => {
        return /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: columnID,
            title: getDisplayColumnHeader(columnHeader),
            onClick: () => {
              props.setParams((prevParams) => {
                const newFiltersArray = [{
                  "column_id": columnID,
                  "filter": {
                    "condition": "not_empty",
                    "value": ""
                  }
                }];
                const newFilters = newFiltersArray.concat(prevParams.pivotFilters);
                return __spreadProps(__spreadValues({}, prevParams), {
                  pivotFilters: newFilters
                });
              });
            }
          }
        );
      })
    ))), props.error !== void 0 && props.error.includes("filter") && /* @__PURE__ */ react_default.createElement("p", { className: "text-color-error" }, props.error), /* @__PURE__ */ react_default.createElement(
      PivotInvalidSelectedColumnsError_default,
      {
        columnIDsMap,
        pivotSection: "values",
        selectedColumnIDs: props.params.pivotFilters.map(({ column_id }) => column_id),
        mitoAPI: props.mitoAPI
      }
    ), props.params.pivotFilters.map(({ column_id, filter }, index) => {
      var _a2;
      const columnDtype = ((_a2 = props.sheetData) == null ? void 0 : _a2.columnDtypeMap[column_id]) || "";
      return /* @__PURE__ */ react_default.createElement("div", { className: "mito-blue-container mb-5px", key: index }, /* @__PURE__ */ react_default.createElement(Row_default, { suppressTopBottomMargin: true }, /* @__PURE__ */ react_default.createElement(
        SelectAndXIconCard_default,
        {
          value: column_id,
          titleMap: columnIDsToDisplayHeaders,
          onChange: (newColumnId) => {
            props.setParams((prevParams) => {
              const newFilters = [...prevParams.pivotFilters];
              newFilters[index]["column_id"] = newColumnId;
              return __spreadProps(__spreadValues({}, prevParams), {
                pivotFilters: newFilters
              });
            });
          },
          onDelete: () => {
            props.setParams((prevParams) => {
              const newFilters = [...prevParams.pivotFilters];
              newFilters.splice(index, 1);
              return __spreadProps(__spreadValues({}, prevParams), {
                pivotFilters: newFilters
              });
            });
          },
          selectableValues: allColumnIDs
        }
      )), /* @__PURE__ */ react_default.createElement(Row_default, { suppressTopBottomMargin: true }, /* @__PURE__ */ react_default.createElement(
        Filter,
        {
          filter,
          operator: "And",
          displayOperator: false,
          setFilter: (newFilter) => {
            props.setParams((prevParams) => {
              const newFilters = [...prevParams.pivotFilters];
              newFilters[index]["filter"] = newFilter;
              return __spreadProps(__spreadValues({}, prevParams), {
                pivotFilters: newFilters
              });
            });
          },
          columnDtype,
          nameLength: "short_name",
          suppressTopBottomMargin: true
        }
      ), /* @__PURE__ */ react_default.createElement(Col_default, { span: 3.5 })));
    }));
  };
  var PivotTableFilterSection_default = PivotTableFilterSection;

  // src/mito/components/taskpanes/PivotTable/PivotTableKeySelection.tsx
  init_react();
  var PIVOT_COLUMN_TRANSFORM_TITLES = {
    "no-op": "exact time",
    "year": "year",
    "year-quarter": "year-quarter",
    "year-month": "year-month",
    "year-month-day": "year-month-day",
    "year-month-day-hour": "year-month-day-hour",
    "year-month-day-hour-minute": "year-month-day-hour-minute",
    "quarter": "quarter",
    "month": "month",
    "week": "week",
    "day of month": "day of month",
    "day of week": "day of week",
    "hour": "hour",
    "minute": "minute",
    "second": "second",
    "month-day": "month-day",
    "day-hour": "day-hour",
    "hour-minute": "hour-minute"
  };
  var GROUP_DATE_BY_TOOLTIP = "Date columns can be further processed before being aggregated. For example, if you want to compare the aggregated values across months, then select `months` in this dropdown.";
  var ROWS_TOOLTIP = "Rows are used to group your source data into distinct buckets. The unique values that create the buckets are placed in the first column of the resulting pivot table.";
  var COLUMNS_TOOLTIP = "Columns are used to group your source data into distinct buckets. The unique values that create the buckets are placed across the top of the resulting pivot table. For the best performance, select columns with a small number of unique values.";
  var PivotTableKeySelection = (props) => {
    var _a, _b;
    const columnIDsMap = ((_a = props.sheetData) == null ? void 0 : _a.columnIDsMap) || {};
    const columnDtypeMap = ((_b = props.sheetData) == null ? void 0 : _b.columnDtypeMap) || {};
    const columnIdsWithTransforms = props.rowOrColumn === "pivotRowColumnIDsWithTransforms" ? [...props.params.pivotRowColumnIDsWithTransforms] : [...props.params.pivotColumnsColumnIDsWithTransforms];
    const pivotTableKeyCards = columnIdsWithTransforms.map(({ column_id, transformation }, keyIndex) => {
      const columnID = columnDtypeMap[column_id];
      const selectAndXIcon = /* @__PURE__ */ react_default.createElement(
        SelectAndXIconCard_default,
        {
          key: keyIndex,
          value: column_id,
          titleMap: columnIDMapToDisplayHeadersMap(columnIDsMap),
          onChange: (columnID2) => {
            props.setParams((oldPivotParams) => {
              const newColumnIDsWithTransforms = [...columnIdsWithTransforms];
              newColumnIDsWithTransforms[keyIndex].column_id = columnID2;
              return __spreadProps(__spreadValues({}, oldPivotParams), {
                [props.rowOrColumn]: newColumnIDsWithTransforms
              });
            });
          },
          onDelete: () => {
            props.setParams((oldPivotParams) => {
              const newColumnIDsWithTransforms = [...columnIdsWithTransforms];
              newColumnIDsWithTransforms.splice(keyIndex, 1);
              return __spreadProps(__spreadValues({}, oldPivotParams), {
                [props.rowOrColumn]: newColumnIDsWithTransforms
              });
            });
          },
          selectableValues: Object.keys(columnIDsMap)
        }
      );
      if (columnID !== void 0 && isDatetimeDtype(columnID)) {
        return /* @__PURE__ */ react_default.createElement("div", { className: "mito-blue-container mt-4px mb-4px", key: keyIndex }, selectAndXIcon, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "start", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, { offset: 0.25 }, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: GROUP_DATE_BY_TOOLTIP, textBody: true }, "group by")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
          Select_default,
          {
            value: transformation,
            onChange: (newTransformation) => {
              props.setParams((oldPivotParams) => {
                const newColumnIDsWithTransforms = [...columnIdsWithTransforms];
                newColumnIDsWithTransforms[keyIndex].transformation = newTransformation;
                return __spreadProps(__spreadValues({}, oldPivotParams), {
                  [props.rowOrColumn]: newColumnIDsWithTransforms
                });
              });
            },
            searchable: true,
            width: "medium"
          },
          Object.entries(PIVOT_COLUMN_TRANSFORM_TITLES).map(([key2, value]) => {
            return /* @__PURE__ */ react_default.createElement(
              DropdownItem_default,
              {
                key: key2,
                id: key2,
                title: value
              }
            );
          })
        ))));
      }
      return selectAndXIcon;
    });
    return /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: props.rowOrColumn === "pivotRowColumnIDsWithTransforms" ? ROWS_TOOLTIP : COLUMNS_TOOLTIP }, props.sectionTitle)), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      DropdownButton_default,
      {
        text: "+ Add",
        width: "small",
        searchable: true
      },
      Object.entries(columnIDsMap).map(([columnID, columnHeader]) => {
        return /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: columnID,
            title: getDisplayColumnHeader(columnHeader),
            onClick: () => {
              props.setParams((oldPivotParams) => {
                const newColumnIDsWithTransforms = [...columnIdsWithTransforms];
                newColumnIDsWithTransforms.push({
                  "column_id": columnID,
                  "transformation": "no-op"
                });
                return __spreadProps(__spreadValues({}, oldPivotParams), {
                  [props.rowOrColumn]: newColumnIDsWithTransforms
                });
              });
            }
          }
        );
      })
    ))), /* @__PURE__ */ react_default.createElement(
      PivotInvalidSelectedColumnsError_default,
      {
        columnIDsMap,
        selectedColumnIDs: columnIdsWithTransforms.map(({ column_id }) => column_id),
        pivotSection: props.rowOrColumn === "pivotRowColumnIDsWithTransforms" ? "row" : "column",
        mitoAPI: props.mitoAPI
      }
    ), pivotTableKeyCards);
  };
  var PivotTableKeySelection_default = PivotTableKeySelection;

  // src/mito/components/taskpanes/PivotTable/PivotTableValueSelection.tsx
  init_react();

  // src/mito/components/taskpanes/PivotTable/PivotTableValueAggregationCard.tsx
  init_react();

  // src/mito/components/taskpanes/PivotTable/pivotUtils.tsx
  var STRING_AGGREGATIONS = [
    "count" /* COUNT */,
    "count unique" /* COUNT_UNIQUE */
  ];
  var DATETIME_AGGREGATIONS = [
    "count" /* COUNT */,
    "count unique" /* COUNT_UNIQUE */,
    "mean" /* MEAN */,
    "median" /* MEDIAN */,
    "min" /* MIN */,
    "max" /* MAX */
  ];
  var TIMEDELTA_AGGREGATIONS = [
    "count" /* COUNT */,
    "count unique" /* COUNT_UNIQUE */,
    "sum" /* SUM */,
    "mean" /* MEAN */,
    "median" /* MEDIAN */,
    "min" /* MIN */,
    "max" /* MAX */
  ];
  var getDefaultPivotParams = (sheetDataArray, sourceSheetIndex, existingPivotParams) => {
    if (sheetDataArray.length === 0) {
      return void 0;
    }
    if (existingPivotParams === void 0) {
      return {
        sourceSheetIndex,
        pivotRowColumnIDsWithTransforms: [],
        pivotColumnsColumnIDsWithTransforms: [],
        pivotValuesColumnIDsArray: [],
        pivotFilters: [],
        flattenColumnHeaders: true,
        destinationSheetIndex: void 0
      };
    }
    return getPivotFrontendParamsFromBackendParams(existingPivotParams);
  };
  var getPivotFrontendParamsFromBackendParams = (pivotParams) => {
    return {
      sourceSheetIndex: pivotParams.sheet_index,
      pivotRowColumnIDsWithTransforms: pivotParams.pivot_rows_column_ids_with_transforms,
      pivotColumnsColumnIDsWithTransforms: pivotParams.pivot_columns_column_ids_with_transforms,
      pivotValuesColumnIDsArray: valuesRecordToArray(pivotParams.values_column_ids_map),
      pivotFilters: pivotParams.pivot_filters,
      flattenColumnHeaders: pivotParams.flatten_column_headers,
      destinationSheetIndex: pivotParams.destination_sheet_index
    };
  };
  var getPivotBackendParamsFromFrontendParams = (params, sheetDataArray) => {
    var _a;
    const columnDtypeMap = sheetDataArray !== void 0 ? ((_a = sheetDataArray[params.sourceSheetIndex]) == null ? void 0 : _a.columnDtypeMap) || {} : {};
    const pivotFiltersToApply = params.pivotFilters.map(({ column_id, filter }) => {
      const columnDtype = columnDtypeMap[column_id] || "";
      const finalFilters = getFiltersToApply([filter], columnDtype);
      if (finalFilters.length === 0) {
        return void 0;
      }
      return {
        "column_id": column_id,
        "filter": finalFilters[0]
      };
    }).filter((pf) => pf !== void 0);
    return {
      sheet_index: params.sourceSheetIndex,
      pivot_rows_column_ids_with_transforms: params.pivotRowColumnIDsWithTransforms,
      pivot_columns_column_ids_with_transforms: params.pivotColumnsColumnIDsWithTransforms,
      values_column_ids_map: valuesArrayToRecord(params.pivotValuesColumnIDsArray),
      pivot_filters: pivotFiltersToApply,
      flatten_column_headers: params.flattenColumnHeaders,
      destination_sheet_index: params.destinationSheetIndex
    };
  };
  var valuesRecordToArray = (valuesRecord) => {
    const valuesArray = [];
    Object.keys(valuesRecord).forEach((columnHeader) => {
      valuesRecord[columnHeader].forEach((aggregationType) => {
        valuesArray.push([columnHeader, aggregationType]);
      });
    });
    return valuesArray;
  };
  var valuesArrayToRecord = (valuesArray) => {
    const valuesRecord = {};
    for (let i = 0; i < valuesArray.length; i++) {
      const [columnHeader, aggregationType] = valuesArray[i];
      if (valuesRecord[columnHeader] === void 0) {
        valuesRecord[columnHeader] = [];
      }
      valuesRecord[columnHeader].push(aggregationType);
    }
    return valuesRecord;
  };
  var getPivotAggregationDisabledMessage = (aggregationType, columnDtype) => {
    if (isStringDtype(columnDtype) && !STRING_AGGREGATIONS.includes(aggregationType)) {
      return `Not valid for string column`;
    } else if (isDatetimeDtype(columnDtype) && !DATETIME_AGGREGATIONS.includes(aggregationType)) {
      return `Not valid for datetime column`;
    } else if (isTimedeltaDtype(columnDtype) && !TIMEDELTA_AGGREGATIONS.includes(aggregationType)) {
      return `Not valid for timedelta column`;
    }
    return void 0;
  };

  // src/mito/components/taskpanes/PivotTable/PivotTableValueAggregationCard.tsx
  var PivotTableValueAggregationCard = (props) => {
    const aggregationTypeList = Object.values(AggregationType);
    const setAggregationType = (aggregationType) => {
      const aggregationTypeCast = aggregationType;
      if (aggregationTypeList.includes(aggregationTypeCast)) {
        props.editPivotValueAggregation(aggregationTypeCast, props.columnID);
      }
    };
    return /* @__PURE__ */ react_default.createElement(Row_default, { align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        value: props.aggregationType,
        onChange: setAggregationType,
        width: "small",
        dropdownWidth: "medium"
      },
      aggregationTypeList.map((aggregationType) => {
        const disabledMessage = getPivotAggregationDisabledMessage(aggregationType, props.columnDtype);
        return /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: aggregationType,
            title: aggregationType,
            disabled: disabledMessage !== void 0,
            subtext: disabledMessage,
            hideSubtext: true,
            displaySubtextOnHover: true
          }
        );
      })
    )), /* @__PURE__ */ react_default.createElement(Col_default, { offset: 1, flex: "1" }, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        value: props.columnID,
        onChange: (columnID) => {
          props.editPivotValueAggregation(
            props.aggregationType,
            columnID
          );
        },
        searchable: true
      },
      Object.keys(props.columnIDsMap).map((columnID) => {
        const columnHeader = props.columnIDsMap[columnID];
        return /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: columnID,
            id: columnID,
            title: getDisplayColumnHeader(columnHeader)
          }
        );
      })
    )), /* @__PURE__ */ react_default.createElement(Col_default, { offset: 1, offsetRight: 1 }, /* @__PURE__ */ react_default.createElement(
      XIcon_default,
      {
        onClick: () => props.removePivotValueAggregation()
      }
    )));
  };
  var PivotTableValueAggregationCard_default = PivotTableValueAggregationCard;

  // src/mito/components/taskpanes/PivotTable/PivotTableValueSelection.tsx
  var VALUES_TOOLTIP = "Values are used to summarize your source data for each of the pivot table buckets. These buckets are created by the rows and/or columns selected above.";
  var PivotTableValueSelection = (props) => {
    var _a, _b;
    const columnIDsMap = ((_a = props.sheetData) == null ? void 0 : _a.columnIDsMap) || {};
    const columnDtypeMap = ((_b = props.sheetData) == null ? void 0 : _b.columnDtypeMap) || {};
    return /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: VALUES_TOOLTIP }, "Values")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      DropdownButton_default,
      {
        text: "+ Add",
        width: "small",
        searchable: true
      },
      Object.entries(columnIDsMap).map(([columnID, columnHeader]) => {
        return /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: columnID,
            title: getDisplayColumnHeader(columnHeader),
            onClick: () => {
              props.setParams((oldPivotParams) => {
                const newPivotValuesIDs = [...oldPivotParams.pivotValuesColumnIDsArray];
                newPivotValuesIDs.push([columnID, "count" /* COUNT */]);
                return __spreadProps(__spreadValues({}, oldPivotParams), {
                  pivotValuesColumnIDsArray: newPivotValuesIDs
                });
              });
            }
          }
        );
      })
    ))), /* @__PURE__ */ react_default.createElement(
      PivotInvalidSelectedColumnsError_default,
      {
        columnIDsMap,
        pivotSection: "values",
        selectedColumnIDs: props.params.pivotValuesColumnIDsArray.map(([columnID]) => columnID),
        mitoAPI: props.mitoAPI
      }
    ), props.params.pivotValuesColumnIDsArray.map(([columnID, aggregationType], valueIndex) => {
      var _a2;
      const columnDtype = ((_a2 = props.sheetData) == null ? void 0 : _a2.columnDtypeMap[columnID]) || "";
      return /* @__PURE__ */ react_default.createElement(
        PivotTableValueAggregationCard_default,
        {
          key: columnID + valueIndex + aggregationType,
          columnIDsMap,
          columnID,
          columnDtype,
          aggregationType,
          removePivotValueAggregation: () => {
            props.setParams((oldPivotParams) => {
              const newPivotValuesIDs = [...oldPivotParams.pivotValuesColumnIDsArray];
              newPivotValuesIDs.splice(valueIndex, 1);
              return __spreadProps(__spreadValues({}, oldPivotParams), {
                pivotValuesColumnIDsArray: newPivotValuesIDs
              });
            });
          },
          editPivotValueAggregation: (newAggregationType, newColumnID) => {
            props.setParams((oldPivotParams) => {
              const newPivotValuesIDs = [...oldPivotParams.pivotValuesColumnIDsArray];
              const columnDtype2 = columnDtypeMap[newColumnID] || "";
              const isInvalidAggregation = getPivotAggregationDisabledMessage(aggregationType, columnDtype2) !== void 0;
              if (isInvalidAggregation) {
                newAggregationType = "count" /* COUNT */;
              }
              newPivotValuesIDs[valueIndex] = [newColumnID, newAggregationType];
              return __spreadProps(__spreadValues({}, oldPivotParams), {
                pivotValuesColumnIDsArray: newPivotValuesIDs
              });
            });
          }
        }
      );
    }));
  };
  var PivotTableValueSelection_default = PivotTableValueSelection;

  // src/mito/components/taskpanes/PivotTable/PivotTaskpane.tsx
  var PivotTaskpane = (props) => {
    const { params, setParams, error } = useLiveUpdatingParams_default(
      () => getDefaultPivotParams(props.sheetDataArray, props.sourceSheetIndex, props.existingPivotParams),
      "pivot" /* Pivot */,
      props.mitoAPI,
      props.analysisData,
      0,
      {
        getBackendFromFrontend: getPivotBackendParamsFromFrontendParams,
        getFrontendFromBackend: getPivotFrontendParamsFromBackendParams
      },
      {
        doNotSendDefaultParams: props.destinationSheetIndex !== void 0
      },
      props.sheetDataArray
    );
    if (params === void 0) {
      return /* @__PURE__ */ react_default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    const sheetData = props.sheetDataArray[params.sourceSheetIndex];
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: props.destinationSheetIndex ? `Edit Pivot Table ${props.dfNames[props.destinationSheetIndex]}` : `Create Pivot Table ${props.dfNames[props.dfNames.length - 1]}`,
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, error !== void 0 && !error.includes("filter") && /* @__PURE__ */ react_default.createElement("p", { className: "text-color-error" }, error), /* @__PURE__ */ react_default.createElement(
      DataframeSelect_default,
      {
        title: "Dataframe to pivot",
        sheetDataArray: props.sheetDataArray,
        sheetIndex: params.sourceSheetIndex,
        onChange: (newSheetIndex) => {
          const newParams = getDefaultPivotParams(props.sheetDataArray, newSheetIndex, void 0);
          setParams((prevParams) => {
            return newParams || prevParams;
          });
        },
        sheetIndexToIgnore: props.destinationSheetIndex
      }
    ), /* @__PURE__ */ react_default.createElement("div", { className: "default-taskpane-body-section-div" }, /* @__PURE__ */ react_default.createElement(
      PivotTableKeySelection_default,
      {
        mitoAPI: props.mitoAPI,
        sheetData,
        sectionTitle: "Rows",
        params,
        setParams,
        rowOrColumn: "pivotRowColumnIDsWithTransforms"
      }
    )), /* @__PURE__ */ react_default.createElement("div", { className: "default-taskpane-body-section-div" }, /* @__PURE__ */ react_default.createElement(
      PivotTableKeySelection_default,
      {
        mitoAPI: props.mitoAPI,
        sheetData,
        sectionTitle: "Columns",
        params,
        setParams,
        rowOrColumn: "pivotColumnsColumnIDsWithTransforms"
      }
    )), /* @__PURE__ */ react_default.createElement("div", { className: "default-taskpane-body-section-div" }, /* @__PURE__ */ react_default.createElement(
      PivotTableValueSelection_default,
      {
        mitoAPI: props.mitoAPI,
        sheetData,
        params,
        setParams
      }
    )), /* @__PURE__ */ react_default.createElement("div", { className: "default-taskpane-body-section-div" }, /* @__PURE__ */ react_default.createElement(
      PivotTableFilterSection_default,
      {
        error,
        sheetData,
        params,
        setParams,
        mitoAPI: props.mitoAPI
      }
    ))));
  };
  var PivotTaskpane_default = PivotTaskpane;

  // src/mito/components/taskpanes/SnowflakeImport/SnowflakeImportTaskpane.tsx
  init_react();

  // src/mito/components/elements/AuthenticateToSnowflakeCard.tsx
  init_react();
  var getDefaultCredentials = () => {
    return { type: "username/password", username: "", password: "", account: "" };
  };
  var AuthenticateToSnowflakeCard = (props) => {
    const [credentials, setCredentials] = useState(() => props.defaultCredentials || getDefaultCredentials());
    const [snowflakeCredentialsValidityCheckResult, setSnowflakeCredentialsValidityCheckResult] = useState(props.defaultCredentials ? { "type": "success" } : void 0);
    const [loading, setLoading] = useState(false);
    const validateSnowflakeCredentials = (credentials2) => __async(void 0, null, function* () {
      setLoading(true);
      const response = yield props.mitoAPI.validateSnowflakeCredentials(credentials2);
      const credentialsValidityCheckResult = "error" in response ? void 0 : response.result;
      setSnowflakeCredentialsValidityCheckResult(credentialsValidityCheckResult);
      if ((credentialsValidityCheckResult == null ? void 0 : credentialsValidityCheckResult.type) === "success") {
        props.onValidCredentials();
      } else if (props.onInvalidCredentials !== void 0) {
        props.onInvalidCredentials();
      }
      setLoading(false);
    });
    return /* @__PURE__ */ react_default.createElement("div", { className: "mito-collapsible-content-card-container" }, /* @__PURE__ */ react_default.createElement(
      CollapsibleSection_default,
      {
        title: /* @__PURE__ */ react_default.createElement("div", { className: classNames("text-header-3", { "text-color-disabled": loading }) }, "Connection"),
        open: props.isOpen
      },
      /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
        "p",
        {
          className: classNames("text-body-1", { "text-color-disabled": loading })
        },
        "Username"
      )), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
        Input_default,
        {
          value: credentials.username,
          disabled: loading,
          onChange: (e) => {
            const newUsername = e.target.value;
            setCredentials((prevCredentials) => {
              return updateObjectWithPartialObject(prevCredentials, { username: newUsername });
            });
          }
        }
      ))),
      /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: classNames("text-body-1", { "text-color-disabled": loading }) }, "Password")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
        Input_default,
        {
          value: credentials.password,
          type: "password",
          disabled: loading,
          onChange: (e) => {
            const newPassword = e.target.value;
            setCredentials((prevCredentials) => {
              return updateObjectWithPartialObject(prevCredentials, { password: newPassword });
            });
          }
        }
      ))),
      /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: classNames("text-body-1", { "text-color-disabled": loading }) }, "Account")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
        Input_default,
        {
          value: credentials.account,
          disabled: loading,
          onChange: (e) => {
            const newAccount = e.target.value;
            setCredentials((prevCredentials) => {
              return updateObjectWithPartialObject(prevCredentials, { account: newAccount });
            });
          }
        }
      ))),
      /* @__PURE__ */ react_default.createElement(
        TextButton_default,
        {
          disabled: credentials.username.length === 0 || credentials.password.length === 0 || credentials.account.length === 0 || loading,
          disabledTooltip: "Please fill out the username, password, and account fields below.",
          onClick: () => __async(void 0, null, function* () {
            yield validateSnowflakeCredentials(credentials);
          }),
          variant: "dark"
        },
        "Connect to Snowflake"
      )
    ), !loading && snowflakeCredentialsValidityCheckResult !== void 0 && /* @__PURE__ */ react_default.createElement("div", { className: classNames({ "text-color-error": snowflakeCredentialsValidityCheckResult.type === "error", "text-color-success": snowflakeCredentialsValidityCheckResult.type === "success" }, "mito-collapsible-content-card-subtext") }, snowflakeCredentialsValidityCheckResult.type === "success" && "Successfully connected to Snowflake instance.", snowflakeCredentialsValidityCheckResult.type === "error" && snowflakeCredentialsValidityCheckResult.error_message), loading && /* @__PURE__ */ react_default.createElement(Row_default, { suppressTopBottomMargin: true, className: classNames("text-subtext-1", "mito-collapsible-content-card-subtext") }, /* @__PURE__ */ react_default.createElement("p", null, "Connecting to Snowflake"), /* @__PURE__ */ react_default.createElement(LoadingCounter_default, null)));
  };
  var AuthenticateToSnowflakeCard_default = AuthenticateToSnowflakeCard;

  // src/mito/components/taskpanes/SnowflakeImport/SnowflakeImportTaskpane.tsx
  var LIMIT_TOOLTIP = "Used to specify the number of rows to return. When working with large datasets, it might be helpful to begin with a subset of your data.";
  var getDefaultParams7 = () => {
    return {
      table_loc_and_warehouse: { role: void 0, warehouse: void 0, database: void 0, schema: void 0, table_or_view: void 0 },
      query_params: { columns: [], limit: void 0 }
    };
  };
  var getNewParams = (prevParams, newSnowflakeTableLocationAndWarehouse) => {
    const paramsCopy = window.structuredClone(prevParams);
    const newParams = __spreadProps(__spreadValues({}, paramsCopy), {
      "table_loc_and_warehouse": {
        "role": newSnowflakeTableLocationAndWarehouse.role,
        "warehouse": newSnowflakeTableLocationAndWarehouse.warehouse,
        "database": newSnowflakeTableLocationAndWarehouse.database,
        "schema": newSnowflakeTableLocationAndWarehouse.schema,
        "table_or_view": newSnowflakeTableLocationAndWarehouse.table_or_view
      },
      "query_params": {
        "columns": [],
        "limit": void 0
      }
    });
    if (JSON.stringify(newParams) === JSON.stringify(prevParams)) {
      return prevParams;
    }
    return newParams;
  };
  var SnowflakeImportTaskpane = (props) => {
    var _a;
    const { params, setParams: setParamsWithoutRefreshOptionsAndDefaults, edit, loading: executingQuery, error } = useSendEditOnClick_default(
      () => getDefaultParams7(),
      "snowflake_import" /* SnowflakeImport */,
      props.mitoAPI,
      props.analysisData,
      void 0,
      (newParams) => {
        if (newParams !== void 0) {
          void loadAndSetOptionsAndDefaults(newParams);
        }
      }
    );
    const [validCredentials, setValidCredentials] = useState(props.userProfile.snowflakeCredentials !== null);
    const [credentialsSectionIsOpen, setCredentialsSectionIsOpen] = useState(props.userProfile.snowflakeCredentials === null);
    const [availableSnowflakeOptionsAndDefaults, setAvailableSnowflakeOptionsAndDefaults] = useState(void 0);
    const [loadingAvailableOptionsAndDefaults, setLoadingAvailableOptionsAndDefaults] = useState(false);
    useEffect(() => {
      if (props.userProfile.snowflakeCredentials !== null && params !== void 0) {
        void loadAndSetOptionsAndDefaults(params);
      }
    }, []);
    const setParamsAndRefreshOptionsAndDefaults = (newParams) => {
      setParamsWithoutRefreshOptionsAndDefaults(newParams);
      void loadAndSetOptionsAndDefaults(newParams);
    };
    if (params === void 0) {
      return /* @__PURE__ */ react_default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    const loadAndSetOptionsAndDefaults = (newParams) => __async(void 0, null, function* () {
      setLoadingAvailableOptionsAndDefaults(true);
      const response = yield props.mitoAPI.getAvailableSnowflakeOptionsAndDefaults(newParams.table_loc_and_warehouse);
      const availableSnowflakeOptionsAndDefaults2 = "error" in response ? void 0 : response.result;
      setAvailableSnowflakeOptionsAndDefaults(availableSnowflakeOptionsAndDefaults2);
      if ((availableSnowflakeOptionsAndDefaults2 == null ? void 0 : availableSnowflakeOptionsAndDefaults2.type) === "success") {
        setParamsWithoutRefreshOptionsAndDefaults((prevParams) => {
          return __spreadProps(__spreadValues({}, prevParams), {
            table_loc_and_warehouse: availableSnowflakeOptionsAndDefaults2.default_values
          });
        });
      }
      setLoadingAvailableOptionsAndDefaults(false);
    });
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Import from Snowflake",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneBody_default,
      {
        userProfile: props.userProfile,
        requiresEnterprise: props.userProfile.mitoConfig["MITO_CONFIG_FEATURE_ENABLE_SNOWFLAKE_IMPORT"] ? void 0 : {
          featureName: "snowflake_import",
          mitoAPI: props.mitoAPI
        }
      },
      /* @__PURE__ */ react_default.createElement(
        AuthenticateToSnowflakeCard_default,
        {
          mitoAPI: props.mitoAPI,
          defaultCredentials: props.userProfile.snowflakeCredentials,
          onValidCredentials: () => {
            setCredentialsSectionIsOpen(false);
            setValidCredentials(true);
            void loadAndSetOptionsAndDefaults(params);
          },
          onInvalidCredentials: () => {
            setValidCredentials(false);
            setParamsWithoutRefreshOptionsAndDefaults(getDefaultParams7());
            setAvailableSnowflakeOptionsAndDefaults(void 0);
          },
          isOpen: credentialsSectionIsOpen
        }
      ),
      /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 20 }),
      /* @__PURE__ */ react_default.createElement(
        CollapsibleSection_default,
        {
          title: /* @__PURE__ */ react_default.createElement("div", { className: classNames("text-header-3", { "text-color-disabled": loadingAvailableOptionsAndDefaults }) }, "Configure Query"),
          open: (availableSnowflakeOptionsAndDefaults == null ? void 0 : availableSnowflakeOptionsAndDefaults.type) === "success"
        },
        /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: classNames({ "text-color-disabled": loadingAvailableOptionsAndDefaults }) }, "Role")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
          Select_default,
          {
            width: "medium",
            value: params.table_loc_and_warehouse.role || "None available",
            disabled: loadingAvailableOptionsAndDefaults,
            onChange: (newRole) => {
              const newParams = getNewParams(
                params,
                {
                  role: newRole,
                  warehouse: void 0,
                  database: void 0,
                  schema: void 0,
                  table_or_view: void 0
                }
              );
              setParamsAndRefreshOptionsAndDefaults(newParams);
            }
          },
          (availableSnowflakeOptionsAndDefaults == null ? void 0 : availableSnowflakeOptionsAndDefaults.type) === "success" ? availableSnowflakeOptionsAndDefaults.config_options.roles.map((role) => {
            return /* @__PURE__ */ react_default.createElement(DropdownItem_default, { key: role, id: role, title: role });
          }) : []
        ))),
        /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: classNames({ "text-color-disabled": loadingAvailableOptionsAndDefaults }) }, "Warehouse")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
          Select_default,
          {
            width: "medium",
            value: params.table_loc_and_warehouse.warehouse || "None available",
            disabled: loadingAvailableOptionsAndDefaults,
            onChange: (newWarehouse) => {
              setParamsWithoutRefreshOptionsAndDefaults((prevParams) => {
                return updateObjectWithPartialObject(prevParams, { table_loc_and_warehouse: { warehouse: newWarehouse } });
              });
            }
          },
          (availableSnowflakeOptionsAndDefaults == null ? void 0 : availableSnowflakeOptionsAndDefaults.type) === "success" ? availableSnowflakeOptionsAndDefaults.config_options.warehouses.map((warehouse) => {
            return /* @__PURE__ */ react_default.createElement(DropdownItem_default, { key: warehouse, id: warehouse, title: warehouse });
          }) : []
        ))),
        /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: classNames({ "text-color-disabled": loadingAvailableOptionsAndDefaults }) }, "Database")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
          Select_default,
          {
            width: "medium",
            value: params.table_loc_and_warehouse.database || "None available",
            disabled: loadingAvailableOptionsAndDefaults,
            onChange: (newDatabase) => {
              const newParams = getNewParams(
                params,
                {
                  role: params.table_loc_and_warehouse.role,
                  warehouse: params.table_loc_and_warehouse.warehouse,
                  database: newDatabase,
                  schema: void 0,
                  table_or_view: void 0
                }
              );
              setParamsAndRefreshOptionsAndDefaults(newParams);
            }
          },
          (availableSnowflakeOptionsAndDefaults == null ? void 0 : availableSnowflakeOptionsAndDefaults.type) === "success" ? availableSnowflakeOptionsAndDefaults.config_options.databases.map((database) => {
            return /* @__PURE__ */ react_default.createElement(DropdownItem_default, { key: database, id: database, title: database });
          }) : []
        ))),
        /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: classNames({ "text-color-disabled": loadingAvailableOptionsAndDefaults }) }, "Schema")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
          Select_default,
          {
            width: "medium",
            value: params.table_loc_and_warehouse.schema || "None available",
            disabled: loadingAvailableOptionsAndDefaults,
            onChange: (newSchema) => {
              const newParams = getNewParams(
                params,
                {
                  role: params.table_loc_and_warehouse.role,
                  warehouse: params.table_loc_and_warehouse.warehouse,
                  database: params.table_loc_and_warehouse.database,
                  schema: newSchema,
                  table_or_view: void 0
                }
              );
              setParamsAndRefreshOptionsAndDefaults(newParams);
            }
          },
          (availableSnowflakeOptionsAndDefaults == null ? void 0 : availableSnowflakeOptionsAndDefaults.type) === "success" ? availableSnowflakeOptionsAndDefaults.config_options.schemas.map((schema) => {
            return /* @__PURE__ */ react_default.createElement(DropdownItem_default, { key: schema, id: schema, title: schema });
          }) : []
        ))),
        /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: classNames({ "text-color-disabled": loadingAvailableOptionsAndDefaults }) }, "Table/View")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
          Select_default,
          {
            width: "medium",
            value: params.table_loc_and_warehouse.table_or_view || "None available",
            disabled: loadingAvailableOptionsAndDefaults,
            onChange: (newTableOrView) => {
              const newParams = getNewParams(
                params,
                {
                  role: params.table_loc_and_warehouse.role,
                  warehouse: params.table_loc_and_warehouse.warehouse,
                  database: params.table_loc_and_warehouse.database,
                  schema: params.table_loc_and_warehouse.schema,
                  table_or_view: newTableOrView
                }
              );
              setParamsAndRefreshOptionsAndDefaults(newParams);
            }
          },
          (availableSnowflakeOptionsAndDefaults == null ? void 0 : availableSnowflakeOptionsAndDefaults.type) === "success" ? availableSnowflakeOptionsAndDefaults.config_options.tables_and_views.map((tableOrView) => {
            return /* @__PURE__ */ react_default.createElement(DropdownItem_default, { key: tableOrView, title: tableOrView });
          }) : []
        ))),
        loadingAvailableOptionsAndDefaults && /* @__PURE__ */ react_default.createElement(Row_default, { className: classNames("text-subtext-1") }, /* @__PURE__ */ react_default.createElement("p", null, "Loading Snowflake options"), /* @__PURE__ */ react_default.createElement(LoadingCounter_default, null))
      ),
      (availableSnowflakeOptionsAndDefaults == null ? void 0 : availableSnowflakeOptionsAndDefaults.type) === "success" && /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "start" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Columns to Import")), /* @__PURE__ */ react_default.createElement(
        MultiToggleBox_default,
        {
          disabled: loadingAvailableOptionsAndDefaults,
          height: "medium",
          onToggleAll: (newSelectedIndexes) => {
            setParamsWithoutRefreshOptionsAndDefaults((prevParams) => {
              const newColumns = newSelectedIndexes.map((index) => availableSnowflakeOptionsAndDefaults.config_options.columns[index]);
              return updateObjectWithPartialObject(prevParams, { query_params: { columns: newColumns } });
            });
          }
        },
        availableSnowflakeOptionsAndDefaults.config_options.columns.map((column, index) => {
          const isToggled = params.query_params.columns.includes(column);
          return /* @__PURE__ */ react_default.createElement(
            MultiToggleItem_default,
            {
              key: column,
              title: column,
              toggled: isToggled,
              onToggle: () => {
                setParamsWithoutRefreshOptionsAndDefaults((prevParams) => {
                  const newColumns = [...prevParams.query_params.columns];
                  toggleInArray(newColumns, column);
                  return updateObjectWithPartialObject(prevParams, { query_params: { columns: newColumns } });
                });
              },
              index
            }
          );
        })
      ), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center", title: LIMIT_TOOLTIP }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: LIMIT_TOOLTIP }, "Limit")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
        Input_default,
        {
          width: "medium",
          value: ((_a = params.query_params.limit) == null ? void 0 : _a.toString()) || "",
          placeholder: "100000",
          disabled: loadingAvailableOptionsAndDefaults,
          onChange: (e) => {
            let newLimitNumber = parseInt(e.target.value);
            if (isNaN(newLimitNumber)) {
              newLimitNumber = void 0;
            }
            setParamsWithoutRefreshOptionsAndDefaults((prevParams) => {
              return updateObjectWithPartialObject(prevParams, { query_params: { limit: newLimitNumber } });
            });
          }
        }
      ))), executingQuery && /* @__PURE__ */ react_default.createElement(Row_default, { className: classNames("text-subtext-1") }, /* @__PURE__ */ react_default.createElement("p", null, "Executing query"), /* @__PURE__ */ react_default.createElement(LoadingCounter_default, null)), error !== void 0 && /* @__PURE__ */ react_default.createElement("p", { className: "text-color-error" }, error)),
      /* @__PURE__ */ react_default.createElement(Row_default, null, /* @__PURE__ */ react_default.createElement(
        TextButton_default,
        {
          disabled: !validCredentials || params.table_loc_and_warehouse.role === void 0 || params.table_loc_and_warehouse.warehouse === void 0 || params.table_loc_and_warehouse.database === void 0 || params.table_loc_and_warehouse.schema === void 0 || params.table_loc_and_warehouse.table_or_view === void 0 || params.query_params.columns.length === 0,
          disabledTooltip: "Fill out all required fields",
          onClick: () => edit(),
          variant: "dark"
        },
        "Run Query"
      ))
    ));
  };
  var SnowflakeImportTaskpane_default = SnowflakeImportTaskpane;

  // src/mito/components/taskpanes/SplitTextToColumns/SplitTextToColumnsTaskpane.tsx
  init_react();

  // src/mito/components/elements/MulitSelectButtonItem.tsx
  init_react();
  var MultiSelectButtonItem = (props) => {
    return /* @__PURE__ */ react_default.createElement(
      "div",
      {
        key: props.title,
        onClick: () => {
          props.onToggle(props.id ? props.id : props.title);
        },
        className: "text-body-2"
      },
      /* @__PURE__ */ react_default.createElement("input", { type: "checkbox", name: props.title, value: props.id ? props.id : props.title, checked: props.checked }),
      /* @__PURE__ */ react_default.createElement("label", { style: { marginRight: "3px" }, htmlFor: props.title }, props.title)
    );
  };
  var MulitSelectButtonItem_default = MultiSelectButtonItem;

  // src/mito/components/taskpanes/SplitTextToColumns/SplitTextToColumnsTaskpane.tsx
  var delimiters = { ",": "Comma", "-": "Dash", "	": "Tab", " ": "Space" };
  var getDefaultParams8 = (startingColumnID, sheetDataArray, sheetIndex) => {
    var _a;
    if (sheetDataArray.length === 0 || sheetDataArray[sheetIndex] === void 0) {
      return void 0;
    }
    let columnID = void 0;
    if (startingColumnID !== void 0 && Object.keys(sheetDataArray[sheetIndex].columnIDsMap).includes(startingColumnID)) {
      columnID = startingColumnID;
    } else {
      columnID = Object.keys(((_a = sheetDataArray[sheetIndex]) == null ? void 0 : _a.columnIDsMap) || {})[0];
    }
    return {
      sheet_index: sheetIndex,
      column_id: columnID,
      delimiters: [],
      new_column_header_suffix: getNewColumnHeader()
    };
  };
  var SplitTextToColumnsTaskpane = (props) => {
    var _a, _b;
    const { params, setParams, loading, edit, editApplied, result } = useSendEditOnClick_default(
      () => getDefaultParams8(props.startingColumnID, props.sheetDataArray, props.selectedSheetIndex),
      "split_text_to_columns" /* SplitTextToColumns */,
      props.mitoAPI,
      props.analysisData
    );
    const [preview, setPreview] = useState([]);
    useEffect(() => {
      setParams((prevParams) => {
        const newParams = getDefaultParams8(props.startingColumnID, props.sheetDataArray, props.selectedSheetIndex);
        if (newParams) {
          return newParams;
        }
        return prevParams;
      });
    }, [props.startingColumnID]);
    useEffect(() => {
      void loadSplitTextToColumnsPreview();
    }, [params]);
    function loadSplitTextToColumnsPreview() {
      return __async(this, null, function* () {
        if (params !== void 0 && params.column_id !== void 0 && params.delimiters.length > 0) {
          const response = yield props.mitoAPI.getSplitTextToColumnsPreview(params);
          const _splitTextToColumnsPreviewArray = "error" in response ? void 0 : response.result;
          if (_splitTextToColumnsPreviewArray !== void 0) {
            setPreview(_splitTextToColumnsPreviewArray.dfPreviewRowDataArray);
          } else {
            setPreview([]);
          }
        } else {
          setPreview([]);
        }
      });
    }
    if (params === void 0 || params.column_id === void 0) {
      return /* @__PURE__ */ react_default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Split Text to Columns",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement(
      DataframeSelect_default,
      {
        title: "Dataframe to select a column to split text within",
        sheetDataArray: props.sheetDataArray,
        sheetIndex: params.sheet_index,
        onChange: (newSheetIndex) => {
          setParams((prevParams) => {
            const newParams = getDefaultParams8(void 0, props.sheetDataArray, newSheetIndex);
            if (newParams) {
              return newParams;
            }
            return __spreadProps(__spreadValues({}, prevParams), {
              sheet_index: newSheetIndex
            });
          });
        }
      }
    ), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Column")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        width: "medium",
        value: getDisplayColumnHeader(((_a = props.sheetDataArray[params.sheet_index]) == null ? void 0 : _a.columnIDsMap[params.column_id]) || "select a column"),
        searchable: true
      },
      Object.entries(((_b = props.sheetDataArray[params.sheet_index]) == null ? void 0 : _b.columnIDsMap) || {}).map(([columnID, columnHeader]) => {
        return /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: columnID,
            title: getDisplayColumnHeader(columnHeader),
            onClick: () => {
              setParams((prevParams) => {
                return __spreadProps(__spreadValues({}, prevParams), {
                  column_id: columnID
                });
              });
            }
          }
        );
      })
    ))), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 6 }, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Delimiters")), /* @__PURE__ */ react_default.createElement(Col_default, { className: "expandable-content-card element-width-medium" }, Object.entries(delimiters).map(([delimiter, delimiterTitle]) => {
      return /* @__PURE__ */ react_default.createElement(
        MulitSelectButtonItem_default,
        {
          key: delimiterTitle,
          id: delimiter,
          title: delimiterTitle,
          checked: params.delimiters.includes(delimiter),
          onToggle: (delimiter2) => {
            setParams((prevParams) => {
              const newDelimiters = [...prevParams.delimiters];
              toggleInArray(newDelimiters, delimiter2);
              return __spreadProps(__spreadValues({}, prevParams), {
                delimiters: newDelimiters
              });
            });
          }
        }
      );
    }), /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        value: params.delimiters.filter((params_delimiter) => !Object.keys(delimiters).includes(params_delimiter))[0],
        placeholder: "Custom Delimiter",
        className: "mt-5px",
        onChange: (e) => {
          const newValue = e.target.value;
          setParams((prevParams) => {
            const newDelimiters = [...prevParams.delimiters].filter((delimiter) => Object.keys(delimiters).includes(delimiter));
            if (newValue !== "") {
              newDelimiters.push(newValue);
            }
            return __spreadProps(__spreadValues({}, prevParams), {
              delimiters: newDelimiters
            });
          });
        }
      }
    ))), /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(Row_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Columns Preview")), preview.length > 0 && /* @__PURE__ */ react_default.createElement(Row_default, { style: { width: "100%", overflowX: "auto" }, suppressTopBottomMargin: true }, /* @__PURE__ */ react_default.createElement("table", { className: "preview-table", cellSpacing: "0" }, /* @__PURE__ */ react_default.createElement("tbody", null, preview.map((rowData, idx) => {
      return /* @__PURE__ */ react_default.createElement("tr", { className: "preview-table-table-row", key: idx }, rowData.map((cellData, idx2) => {
        return /* @__PURE__ */ react_default.createElement("td", { className: "preview-table-table-data", key: idx2 }, "" + cellData);
      }));
    })))), preview.length === 0 && /* @__PURE__ */ react_default.createElement(Row_default, { style: { width: "100%" }, justify: "center" }, /* @__PURE__ */ react_default.createElement("p", { className: "mt-10px" }, "Select a delimiter to preview the split")))), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => edit((prevParams) => {
          return __spreadProps(__spreadValues({}, prevParams), {
            new_column_header_suffix: getNewColumnHeader()
          });
        }),
        disabled: params.delimiters.length === 0,
        disabledTooltip: "Select at least one delimiter"
      },
      !editApplied ? `Split on delimiter${params.delimiters.length > 1 ? "s" : ""}` : loading ? "Splitting column ..." : `Split on delimiter${params.delimiters.length > 1 ? "s" : ""}`
    ), editApplied && /* @__PURE__ */ react_default.createElement("p", { className: "text-subtext-1" }, "Created ", result == null ? void 0 : result.num_cols_created, " new columns"), !editApplied && /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 18 })));
  };
  var SplitTextToColumnsTaskpane_default = SplitTextToColumnsTaskpane;

  // src/mito/components/taskpanes/UpdateImports/UpdateImportsTaskpane.tsx
  init_react();

  // src/mito/components/taskpanes/UpdateImports/UpdateDataframeImportTaskpane.tsx
  init_react();
  var getButtonMessage5 = (params) => {
    if (params.df_names.length === 0) {
      return `Select dataframe to update`;
    }
    return `Update to ${params.df_names[0]}`;
  };
  var UpdateDataframeImportScreen = (props) => {
    var _a, _b;
    const [dfNamesInNotebook, loading] = useStateFromAPIAsync(
      [],
      () => __async(void 0, null, function* () {
        const response = yield props.mitoAPI.getDefinedDfNames();
        return "error" in response ? void 0 : response.result;
      }),
      void 0,
      []
    );
    const radioButtonBox = /* @__PURE__ */ react_default.createElement(
      RadioButtonBox_default,
      {
        values: dfNamesInNotebook,
        selectedValue: (_a = props.params) == null ? void 0 : _a.df_names[0],
        onChange: (newDfName) => props.setParams((prevParams) => {
          return __spreadProps(__spreadValues({}, prevParams), {
            df_names: [newDfName]
          });
        }),
        loading
      }
    );
    if (props.params === void 0) {
      return /* @__PURE__ */ react_default.createElement("div", { className: "text-body-1" }, "There has been an error loading dataframes to import. Please try again, or ", /* @__PURE__ */ react_default.createElement("a", { className: "text-body-1-link", href: "https://join.slack.com/t/trymito/shared_invite/zt-1h6t163v7-xLPudO7pjQNKccXz7h7GSg", target: "_blank", rel: "noreferrer" }, "contact support"), ".");
    }
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: props.isUpdate ? "Import Dataframes" : "Update Import",
        setUIState: props.setUIState,
        backCallback: props.backCallback,
        notCloseable: props.notCloseable
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "start", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: "Dataframes that have been created elsewhere in this notebook can be imported through this taskpane." }, "Dataframes to Import"))), radioButtonBox, /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 10 })), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => {
          props.edit();
        },
        disabled: (((_b = props.params) == null ? void 0 : _b.df_names.length) || 0) === 0
      },
      getButtonMessage5(props.params)
    )));
  };
  var UpdateDataframeImportTaskpane_default = UpdateDataframeImportScreen;

  // src/mito/components/taskpanes/UpdateImports/UpdateImportsPostReplayTaskpane.tsx
  init_react();

  // src/mito/components/taskpanes/UpdateImports/UpdateImportCard.tsx
  init_react();

  // src/mito/components/icons/RightPointerIcon.tsx
  init_react();
  var RightPointerIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "10", height: "15", viewBox: "0 0 10 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1.36401 1.13672L7.72797 7.50068L1.36401 13.8646", stroke: "#494650", strokeWidth: "2", strokeLinecap: "round" }));
  };
  var RightPointerIcon_default = RightPointerIcon;

  // src/mito/components/taskpanes/UpdateImports/updateImportsUtils.tsx
  function isCSVImportParams(params) {
    return params !== void 0 && "file_names" in params && !("sheet_names" in params);
  }
  function isExcelImportParams(params) {
    return params !== void 0 && "sheet_names" in params;
  }
  function isDataframeImportParams(params) {
    return params !== void 0 && "df_names" in params;
  }
  var getBaseOfPath = (fullPath) => {
    return fullPath.replace(/^.*[\\\\/]/, "");
  };
  function updateStepImportDataList(stepImportDataList, newDataframeCreationIndex, newDataframeCreationData) {
    const newStepImportDataList = [...stepImportDataList];
    let numSeen = 0;
    newStepImportDataList.forEach((stepImportData) => {
      if (numSeen + stepImportData.imports.length > newDataframeCreationIndex) {
        stepImportData.imports[newDataframeCreationIndex - numSeen] = newDataframeCreationData;
      }
      numSeen += stepImportData.imports.length;
    });
    return newStepImportDataList;
  }
  var getAllDataframeCreationData = (stepImportDataList) => {
    if (stepImportDataList === void 0) {
      return [];
    }
    return stepImportDataList.map((stepImportData) => {
      return stepImportData.imports;
    }).flat();
  };
  var getOriginalAndUpdatedDataframeCreationDataPairs = (originalStepImportData, updatedStepImportData) => {
    const originalImports = getAllDataframeCreationData(originalStepImportData);
    const newImports = originalStepImportData !== void 0 && updatedStepImportData === void 0 ? originalImports : getAllDataframeCreationData(updatedStepImportData);
    return originalImports.map((dfCreationData, index) => {
      return [dfCreationData, newImports[index]];
    });
  };
  var updateDataframeCreation = (dataframeCreationIndex, dataframeCreationData, setUpdatedStepImportData, setUpdatedIndexes, setInvalidImportMessages, setReplacingDataframeState) => {
    setUpdatedStepImportData((prevUpdatedStepImportData) => {
      if (prevUpdatedStepImportData === void 0) {
        return void 0;
      }
      return updateStepImportDataList(
        prevUpdatedStepImportData,
        dataframeCreationIndex,
        dataframeCreationData
      );
    });
    setUpdatedIndexes((prevUpdatedIndexes) => {
      if (prevUpdatedIndexes.includes(dataframeCreationIndex)) {
        return prevUpdatedIndexes;
      }
      const newUpdatedIndexes = [...prevUpdatedIndexes];
      newUpdatedIndexes.push(dataframeCreationIndex);
      return newUpdatedIndexes;
    });
    setInvalidImportMessages((prevInvalidImportMessage) => {
      const newInvalidImportMessage = __spreadValues({}, prevInvalidImportMessage);
      if (newInvalidImportMessage[dataframeCreationIndex] !== void 0) {
        delete newInvalidImportMessage[dataframeCreationIndex];
      }
      return newInvalidImportMessage;
    });
    setReplacingDataframeState(void 0);
  };
  var updateAllSnowflakeImports = (updatedStepImportData, setUpdatedStepImportData, setUpdatedIndexes, setInvalidImportMessages, setReplacingDataframeState) => {
    if (updatedStepImportData === void 0) {
      return;
    }
    updatedStepImportData.forEach((updatedStepImport, idx) => {
      if (updatedStepImport.imports[0].step_type === "snowflake_import") {
        updateDataframeCreation(
          idx,
          updatedStepImport.imports[0],
          setUpdatedStepImportData,
          setUpdatedIndexes,
          setInvalidImportMessages,
          setReplacingDataframeState
        );
      }
    });
  };
  var getErrorTextFromToFix = (toFix) => {
    return toFix + " Update imports to fix this error.";
  };

  // src/mito/utils/userDefinedFunctionUtils.tsx
  var getInitialParamNameToParamValueMap = (sheetDataArray, paramNameToType) => {
    let previousSheetData = void 0;
    return Object.fromEntries(
      Object.entries(paramNameToType).map(([paramName, paramType]) => {
        if (paramType == "DataFrame") {
          const sheetData = sheetDataArray[0];
          previousSheetData = sheetData;
          if (sheetData !== void 0) {
            return [paramName, sheetData.dfName];
          }
        } else if (paramType === "ColumnHeader") {
          const firstColumnID = Object.keys((previousSheetData == null ? void 0 : previousSheetData.columnIDsMap) || { "": "" })[0];
          return [paramName, firstColumnID];
        }
        return [paramName, ""];
      })
    );
  };
  var getParamTypeDisplay = (paramType) => {
    if (paramType === "str") {
      return "string";
    } else if (paramType == "float") {
      return "float";
    } else if (paramType == "int") {
      return "int";
    } else if (paramType == "bool") {
      return "bool";
    } else if (paramType == "DataFrame") {
      return "Dataframe";
    } else if (paramType == "ColumnHeader") {
      return "Column Header";
    } else {
      return void 0;
    }
  };
  var getDisplayNameOfPythonVariable = (pythonVariableName) => {
    if (pythonVariableName === "df") {
      return "Dataframe";
    }
    const words = pythonVariableName.replace(/_/g, " ").split(" ");
    return words.map((word) => {
      if (word.length <= 1) {
        return word;
      }
      return word[0].toUpperCase() + word.substring(1);
    }).join(" ");
  };

  // src/mito/components/taskpanes/UpdateImports/UpdateImportCard.tsx
  var getFileNameSpanFromFilePath = (filePath) => {
    const fileName = getBaseOfPath(filePath);
    return /* @__PURE__ */ react_default.createElement("span", { title: filePath }, fileName);
  };
  var getSimpleNameSpan = (name) => {
    return /* @__PURE__ */ react_default.createElement("span", { title: name || "not definend" }, name);
  };
  var getUpdateImportCardTitle = (dataframeCreationData) => {
    var _a;
    if (dataframeCreationData.step_type === "excel_import") {
      return /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, "Imported "), " ", getSimpleNameSpan(dataframeCreationData.params.sheet_names[0]), " ", /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, "from "), " ", getFileNameSpanFromFilePath(dataframeCreationData.params.file_name));
    } else if (dataframeCreationData.step_type === "simple_import") {
      return /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, "Imported "), " ", getFileNameSpanFromFilePath(dataframeCreationData.params.file_names[0]));
    } else if (dataframeCreationData.step_type === "dataframe_import") {
      return /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, "Imported "), " ", getSimpleNameSpan(dataframeCreationData.params.df_names[0]));
    } else if (dataframeCreationData.step_type === "excel_range_import") {
      return /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, "Imported "), " ", getSimpleNameSpan(dataframeCreationData.params.range_imports[0].df_name), " ", /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, "from "), " ", getFileNameSpanFromFilePath(dataframeCreationData.params.file_path));
    } else if (dataframeCreationData.step_type === "snowflake_import") {
      return /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, "Imported "), " ", getSimpleNameSpan(dataframeCreationData.params.table_loc_and_warehouse.table_or_view), " ", /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, "from Snowflake "));
    } else if (dataframeCreationData.step_type === "user_defined_import") {
      return /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, "Imported custom importer "), " ", getSimpleNameSpan((_a = dataframeCreationData.params) == null ? void 0 : _a.importer));
    } else {
      return /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(react_default.Fragment, null));
    }
  };
  var getUpdateImportCardSubtitle = (updatedDataframeCreationData, invalidImportMessage, isUpdated) => {
    var _a;
    if (!isUpdated) {
      if (invalidImportMessage !== void 0) {
        return /* @__PURE__ */ react_default.createElement("div", { className: "mt-3px" }, /* @__PURE__ */ react_default.createElement("span", { className: "text-color-error-important text-overflow-wrap" }, invalidImportMessage));
      }
      return null;
    }
    if (updatedDataframeCreationData.step_type === "excel_import") {
      return /* @__PURE__ */ react_default.createElement("div", { className: "mt-3px" }, /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, "Update to "), " ", getSimpleNameSpan(updatedDataframeCreationData.params.sheet_names[0]), " ", /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, "from "), " ", getFileNameSpanFromFilePath(updatedDataframeCreationData.params.file_name));
    } else if (updatedDataframeCreationData.step_type === "simple_import") {
      return /* @__PURE__ */ react_default.createElement("div", { className: "mt-3px" }, /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, "Update to "), " ", getFileNameSpanFromFilePath(updatedDataframeCreationData.params.file_names[0]));
    } else if (updatedDataframeCreationData.step_type === "dataframe_import") {
      return /* @__PURE__ */ react_default.createElement("div", { className: "mt-3px" }, /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, "Update to "), " ", getSimpleNameSpan(updatedDataframeCreationData.params.df_names[0]));
    } else if (updatedDataframeCreationData.step_type === "excel_range_import") {
      return /* @__PURE__ */ react_default.createElement("div", { className: "mt-3px" }, /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, "Update to "), " ", getSimpleNameSpan(updatedDataframeCreationData.params.range_imports[0].df_name), " ", /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, "from "), " ", getFileNameSpanFromFilePath(updatedDataframeCreationData.params.file_path));
    } else if (updatedDataframeCreationData.step_type === "snowflake_import") {
      return /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(react_default.Fragment, null));
    } else if (updatedDataframeCreationData.step_type === "user_defined_import") {
      return /* @__PURE__ */ react_default.createElement("div", { className: "mt-3px" }, /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, "Update using "), " ", getSimpleNameSpan((_a = updatedDataframeCreationData.params) == null ? void 0 : _a.importer));
    } else {
      return /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(react_default.Fragment, null));
    }
  };
  var UpdateImportCard = (props) => {
    const displayDropdown = props.displayedImportCardDropdown === props.dataframeCreationIndex;
    const openDropdown = () => {
      props.setDisplayedImportCardDropdown(props.dataframeCreationIndex);
    };
    const closeDropdown = () => {
      props.setDisplayedImportCardDropdown((prevValue) => {
        if (prevValue !== props.dataframeCreationIndex) {
          return prevValue;
        }
        return void 0;
      });
    };
    const getUpdateImportOptionDropdownItems = () => {
      let dropdownItems = [];
      if (props.dataframeCreationData.step_type === "snowflake_import") {
        dropdownItems.push(
          /* @__PURE__ */ react_default.createElement(
            DropdownItem_default,
            {
              key: "Connect to Snowflake",
              title: "Connect to Snowflake",
              onClick: () => {
                props.setReplacingDataframeState({
                  dataframeCreationIndex: props.dataframeCreationIndex,
                  importState: { screen: "authenticate_to_snowflake" },
                  params: void 0
                });
              }
            }
          )
        );
      }
      dropdownItems = dropdownItems.concat([
        /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "Replace with file",
            title: "Replace with file",
            onClick: () => {
              props.setReplacingDataframeState({
                dataframeCreationIndex: props.dataframeCreationIndex,
                importState: { screen: "file_browser" },
                params: void 0
              });
            }
          }
        ),
        /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: "Replace with dataframe",
            title: "Replace with dataframe",
            onClick: () => {
              props.setReplacingDataframeState({
                dataframeCreationIndex: props.dataframeCreationIndex,
                importState: { screen: "dataframe_import" },
                params: { df_names: [] }
              });
            }
          }
        )
      ]);
      props.analysisData.userDefinedImporters.forEach((f) => {
        const displayName = getDisplayNameOfPythonVariable(f.name);
        dropdownItems.push(/* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: `Replace with ${displayName}`,
            title: `Replace with ${displayName}`,
            onClick: () => {
              props.setReplacingDataframeState({
                dataframeCreationIndex: props.dataframeCreationIndex,
                importState: {
                  screen: "user_defined_import",
                  importer_name: f.name
                },
                params: void 0
              });
            },
            disabled: !props.userProfile.isEnterprise,
            subtext: !props.userProfile.isEnterprise ? "Requires Mito Enterprise" : void 0
          }
        ));
      });
      return dropdownItems;
    };
    return /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "top", onClick: () => {
      openDropdown();
    } }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 22 }, /* @__PURE__ */ react_default.createElement(Row_default, { align: "top" }, /* @__PURE__ */ react_default.createElement("div", { className: "mt-1px" }, /* @__PURE__ */ react_default.createElement(CSVFileIcon_default, null)), /* @__PURE__ */ react_default.createElement(Col_default, { span: 22, offset: 0.25 }, getUpdateImportCardTitle(props.dataframeCreationData), getUpdateImportCardSubtitle(props.updatedDataframeCreationData, props.preUpdateInvalidImportMessage, props.isUpdated))), props.postUpdateInvalidImportMessage && /* @__PURE__ */ react_default.createElement(Row_default, { align: "top" }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 22, offset: 1.2 }, /* @__PURE__ */ react_default.createElement("span", { className: "text-color-error-important text-overflow-wrap" }, props.postUpdateInvalidImportMessage)))), /* @__PURE__ */ react_default.createElement(Col_default, { className: "mt-3px" }, /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(RightPointerIcon_default, null), /* @__PURE__ */ react_default.createElement(
      Dropdown_default,
      {
        display: displayDropdown,
        closeDropdown: () => closeDropdown(),
        width: "large"
      },
      getUpdateImportOptionDropdownItems()
    ))));
  };
  var UpdateImportCard_default = UpdateImportCard;

  // src/mito/components/taskpanes/UpdateImports/UpdateImportsPostReplayTaskpane.tsx
  var PASSED_DATAFRAMES_CHANGE_MESSAGE = "You can change imports by changing the data passed to the mitosheet.sheet call above.";
  if (isInStreamlit()) {
    PASSED_DATAFRAMES_CHANGE_MESSAGE = "You can change imports by changing the data passed to the spreadsheet call.";
  }
  if (isInDash()) {
    PASSED_DATAFRAMES_CHANGE_MESSAGE = "You can change imports by changing the data passed to the Spreadsheet call.";
  }
  var UpdateImportsPostReplayTaskpane = (props) => {
    var _a, _b, _c;
    const [loadingUpdate, setLoadingUpdate] = useState(false);
    let updateImportBody = null;
    if (props.importDataAndErrors === void 0) {
      updateImportBody = /* @__PURE__ */ react_default.createElement("p", null, "Loading previously imported data...");
    } else {
      if ((((_a = props.importDataAndErrors) == null ? void 0 : _a.importData.length) || 0) === 0 && props.sheetDataArray.length === 0) {
        return /* @__PURE__ */ react_default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState, message: "Before changing imports, you need to import something." });
      } else if ((((_b = props.importDataAndErrors) == null ? void 0 : _b.importData.length) || 0) === 0) {
        return /* @__PURE__ */ react_default.createElement(DefaultEmptyTaskpane_default, { header: "Update passed dataframes", setUIState: props.setUIState, message: PASSED_DATAFRAMES_CHANGE_MESSAGE, suppressImportLink: true });
      }
      const originalAndUpdatedDataframeCreationPairs = getOriginalAndUpdatedDataframeCreationDataPairs(((_c = props.importDataAndErrors) == null ? void 0 : _c.importData) || [], props.updatedStepImportData);
      updateImportBody = originalAndUpdatedDataframeCreationPairs.map(([originalDfCreationData, updatedDfCreationData], index) => {
        return /* @__PURE__ */ react_default.createElement(
          UpdateImportCard_default,
          {
            key: index,
            dataframeCreationIndex: index,
            dataframeCreationData: originalDfCreationData,
            isUpdated: props.updatedIndexes.includes(index),
            updatedDataframeCreationData: updatedDfCreationData,
            displayedImportCardDropdown: props.displayedImportCardDropdown,
            setDisplayedImportCardDropdown: props.setDisplayedImportCardDropdown,
            setReplacingDataframeState: props.setReplacingDataframeState,
            preUpdateInvalidImportMessage: void 0,
            postUpdateInvalidImportMessage: props.invalidImportMessages[index],
            userProfile: props.userProfile,
            analysisData: props.analysisData
          }
        );
      });
    }
    const anyUpdated = props.updatedIndexes.length > 0;
    const invalidPostUpdate = Object.keys(props.invalidImportMessages).length > 0;
    const retryButtonDisabled = !anyUpdated || invalidPostUpdate || loadingUpdate;
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Change Imports",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, props.invalidReplayError && /* @__PURE__ */ react_default.createElement("p", { className: "text-color-error" }, props.invalidReplayError), updateImportBody), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        onClick: () => __async(void 0, null, function* () {
          const doUpdate = () => __async(void 0, null, function* () {
            if (props.updatedStepImportData === void 0) {
              return;
            }
            const response = yield props.mitoAPI.getTestImports(props.updatedStepImportData);
            const _invalidImportIndexes = "error" in response ? void 0 : response.result;
            if (_invalidImportIndexes === void 0) {
              return;
            }
            props.setInvalidImportMessages(_invalidImportIndexes);
            void props.mitoAPI.log("clicked_update_from_post_replay_update_imports");
            void props.mitoAPI.log("get_test_import_results", {
              "open_due_to_replay_error": false,
              "num_invalid_imports": Object.keys(_invalidImportIndexes).length
            });
            if (Object.keys(_invalidImportIndexes).length === 0) {
              const possibleMitoError = yield props.mitoAPI.updateExistingImports(props.updatedStepImportData);
              if ("error" in possibleMitoError) {
                props.setInvalidReplayError(getErrorTextFromToFix(possibleMitoError.error));
              } else {
                props.setUIState((prevUIState) => {
                  return __spreadProps(__spreadValues({}, prevUIState), {
                    currOpenTaskpane: { type: "none" /* NONE */ },
                    currOpenPopups: __spreadProps(__spreadValues({}, prevUIState.currOpenPopups), {
                      ["top_right" /* TopRight */]: {
                        type: "ephemeral_message" /* EphemeralMessage */,
                        message: "Successfully replayed analysis on new data"
                      }
                    })
                  });
                });
              }
            }
          });
          setLoadingUpdate(true);
          yield doUpdate();
          setLoadingUpdate(false);
        }),
        disabled: retryButtonDisabled,
        disabledTooltip: retryButtonDisabled ? "Please resolve all errors with above imports." : void 0
      },
      /* @__PURE__ */ react_default.createElement("p", { className: "text-align-center-important" }, !loadingUpdate ? "Change Imports" : "Changing Imports...")
    )));
  };
  var UpdateImportsPostReplayTaskpane_default = UpdateImportsPostReplayTaskpane;

  // src/mito/components/taskpanes/UpdateImports/UpdateImportsPreReplayTaskpane.tsx
  init_react();
  var PRE_REPLAY_IMPORT_ERROR_TEXT = "Please fix failed data imports to replay analysis.";
  var UpdateImportsPreReplayTaskpane = (props) => {
    var _a;
    const [loadingUpdate, setLoadingUpdate] = useState(false);
    let updateImportBody = null;
    const loadingImportDataAndErrors = props.importDataAndErrors === void 0;
    if (props.importDataAndErrors === void 0) {
      updateImportBody = /* @__PURE__ */ react_default.createElement("p", null, "Loading previously imported data...");
    } else {
      const originalAndUpdatedDataframeCreationPairs = getOriginalAndUpdatedDataframeCreationDataPairs(props.importDataAndErrors.importData, props.updatedStepImportData);
      updateImportBody = originalAndUpdatedDataframeCreationPairs.map(([originalDfCreationData, updatedDfCreationData], index) => {
        var _a2;
        return /* @__PURE__ */ react_default.createElement(
          UpdateImportCard_default,
          {
            key: index,
            dataframeCreationIndex: index,
            dataframeCreationData: originalDfCreationData,
            isUpdated: props.updatedIndexes.includes(index),
            updatedDataframeCreationData: updatedDfCreationData,
            displayedImportCardDropdown: props.displayedImportCardDropdown,
            setDisplayedImportCardDropdown: props.setDisplayedImportCardDropdown,
            setReplacingDataframeState: props.setReplacingDataframeState,
            preUpdateInvalidImportMessage: (_a2 = props.importDataAndErrors) == null ? void 0 : _a2.invalidImportMessages[index],
            postUpdateInvalidImportMessage: props.postUpdateInvalidImportMessages[index],
            userProfile: props.userProfile,
            analysisData: props.analysisData
          }
        );
      });
    }
    const allErrorsUpdated = Object.keys(((_a = props.importDataAndErrors) == null ? void 0 : _a.invalidImportMessages) || {}).filter((index) => !props.updatedIndexes.includes(parseInt(index))).length === 0;
    const invalidPostUpdate = Object.keys(props.postUpdateInvalidImportMessages).length > 0;
    const retryButtonDisabled = !allErrorsUpdated || invalidPostUpdate || loadingImportDataAndErrors || loadingUpdate;
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Change Imports to Replay Analysis",
        setUIState: props.setUIState,
        notCloseable: true
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, (props.invalidReplayError === PRE_REPLAY_IMPORT_ERROR_TEXT && !allErrorsUpdated || props.invalidReplayError !== void 0 && props.invalidReplayError !== PRE_REPLAY_IMPORT_ERROR_TEXT) && /* @__PURE__ */ react_default.createElement("p", { className: "text-color-error" }, props.invalidReplayError), updateImportBody), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "light",
        width: "medium",
        onClick: () => {
          if (props.overwriteAnalysisToReplayToMitosheetCall) {
            props.overwriteAnalysisToReplayToMitosheetCall(
              props.failedReplayData.analysisName,
              props.analysisData.analysisName,
              props.mitoAPI
            );
          }
          void props.mitoAPI.log("clicked_start_new_analysis_from_pre_replay_update_imports");
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "none" /* NONE */ }
            });
          });
        },
        tooltip: "This will start a new analysis with no steps in this mitosheet."
      },
      "Start New Analysis"
    )), /* @__PURE__ */ react_default.createElement(Col_default, { span: 12 }, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        onClick: () => __async(void 0, null, function* () {
          const doUpdate = () => __async(void 0, null, function* () {
            if (props.updatedStepImportData === void 0) {
              return;
            }
            const response = yield props.mitoAPI.getTestImports(props.updatedStepImportData);
            const _invalidImportIndexes = "error" in response ? void 0 : response.result;
            if (_invalidImportIndexes === void 0) {
              return;
            }
            props.setPostUpdateInvalidImportMessages(_invalidImportIndexes);
            void props.mitoAPI.log("clicked_update_from_pre_replay_update_imports");
            void props.mitoAPI.log("get_test_import_results", {
              "num_invalid_imports": Object.keys(_invalidImportIndexes).length,
              "open_due_to_replay_error": true
            });
            if (Object.keys(_invalidImportIndexes).length === 0) {
              props.setInvalidReplayError(void 0);
              const replayAnalysisError = yield props.mitoAPI.updateReplayAnalysis(props.failedReplayData.analysisName, props.failedReplayData.args, props.updatedStepImportData);
              if ("error" in replayAnalysisError) {
                props.setInvalidReplayError(getErrorTextFromToFix(replayAnalysisError.error));
              } else {
                props.setUIState((prevUIState) => {
                  return __spreadProps(__spreadValues({}, prevUIState), {
                    currOpenTaskpane: { type: "none" /* NONE */ },
                    currOpenPopups: __spreadProps(__spreadValues({}, prevUIState.currOpenPopups), {
                      ["top_right" /* TopRight */]: {
                        type: "ephemeral_message" /* EphemeralMessage */,
                        message: "Successfully replayed analysis on new data"
                      }
                    })
                  });
                });
              }
            }
          });
          setLoadingUpdate(true);
          yield doUpdate();
          setLoadingUpdate(false);
        }),
        disabled: retryButtonDisabled,
        disabledTooltip: retryButtonDisabled ? "Please resolve all errors with above imports." : void 0
      },
      /* @__PURE__ */ react_default.createElement("p", { className: "text-align-center-important" }, !loadingUpdate ? "Retry With Updated Imports" : "Updating Imports...")
    )))));
  };
  var UpdateImportsPreReplayTaskpane_default = UpdateImportsPreReplayTaskpane;

  // src/mito/components/taskpanes/UpdateImports/UpdateSnowflakeCredentialsScreen.tsx
  init_react();
  var UpdateSnowflakeCredentialsScreen = (props) => {
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Connect to Snowflake",
        setUIState: props.setUIState,
        backCallback: props.backCallback,
        notCloseable: props.notCloseable
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement(
      AuthenticateToSnowflakeCard_default,
      {
        mitoAPI: props.mitoAPI,
        onValidCredentials: () => props.edit(),
        isOpen: true
      }
    )));
  };
  var UpdateSnowflakeCredentialsScreen_default = UpdateSnowflakeCredentialsScreen;

  // src/mito/components/taskpanes/UpdateImports/UserDefinedImportScreen.tsx
  init_react();

  // src/mito/components/taskpanes/UserDefinedImport/UserDefinedImportTaskpane.tsx
  init_react();

  // src/mito/components/taskpanes/UserDefinedImport/UserDefinedImportConfig.tsx
  init_react();

  // src/mito/components/taskpanes/UserDefinedImport/UserDefinedFunctionDocumentationSection.tsx
  init_react();
  var UserDefinedFunctionDocumentationSection = (props) => {
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(CollapsibleSection_default, { title: "Importer Documentation" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-subtext-1" }, /* @__PURE__ */ react_default.createElement("span", { className: "text-bold" }, "Function Name:"), " ", props.userDefinedFunction.name), props.userDefinedFunction.docstring !== void 0 && props.userDefinedFunction.docstring !== null && props.userDefinedFunction.docstring !== "" && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 5 }), /* @__PURE__ */ react_default.createElement("p", { className: "text-subtext-1" }, /* @__PURE__ */ react_default.createElement("span", { className: "text-bold" }, "Description:"), " ", props.userDefinedFunction.docstring)), props.userDefinedFunction.domain !== void 0 && props.userDefinedFunction.domain !== null && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 5 }), /* @__PURE__ */ react_default.createElement("p", { className: "text-subtext-1" }, /* @__PURE__ */ react_default.createElement("span", { className: "text-bold" }, "Domain:"), "  ", props.userDefinedFunction.domain))), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 10 }));
  };
  var UserDefinedFunctionDocumentationSection_default = UserDefinedFunctionDocumentationSection;

  // src/mito/components/taskpanes/UserDefinedImport/UserDefinedFunctionParamConfigSection.tsx
  init_react();
  var UserDefinedFunctionParamConfigSection = (props) => {
    const { paramNameToType, params } = props;
    if (paramNameToType === void 0 || params === void 0) {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
    }
    const paramNameAndTypeTuples = Object.entries(paramNameToType);
    const paramRowElements = [];
    let previousSheetIndex = -1;
    for (let paramIndex = 0; paramIndex < paramNameAndTypeTuples.length; paramIndex++) {
      const [paramName, paramType] = paramNameAndTypeTuples[paramIndex];
      const paramValue = params[paramName];
      const paramDisplayName = getDisplayNameOfPythonVariable(paramName);
      let inputElement = null;
      if (paramType === "DataFrame") {
        const sheetIndex = paramValue !== "" ? props.sheetDataArray.findIndex((sheetData) => sheetData.dfName === paramValue) : 0;
        previousSheetIndex = sheetIndex;
        paramRowElements.push(
          /* @__PURE__ */ react_default.createElement(
            DataframeSelect_default,
            {
              sheetDataArray: props.sheetDataArray,
              sheetIndex,
              title: paramDisplayName,
              span: 8,
              onChange: (newSheetIndex) => {
                const newSheetData = props.sheetDataArray[newSheetIndex];
                const newValue = newSheetData.dfName;
                const newParams = window.structuredClone(params);
                newParams[paramName] = newValue;
                for (let laterParamIndex = paramIndex + 1; laterParamIndex < paramNameAndTypeTuples.length; laterParamIndex++) {
                  const [laterParamName, laterParamType] = paramNameAndTypeTuples[laterParamIndex];
                  if (laterParamType === "ColumnHeader") {
                    newParams[laterParamName] = Object.keys(newSheetData.columnIDsMap)[0] || "";
                  } else if (laterParamType === "DataFrame") {
                    break;
                  }
                }
                props.setParams(newParams);
              }
            }
          )
        );
      } else {
        if (paramType === "ColumnHeader") {
          const sheetData = props.sheetDataArray[previousSheetIndex];
          if (sheetData === void 0) {
            inputElement = /* @__PURE__ */ react_default.createElement("p", { className: "text-color-error" }, "The parameter ", paramName, " of type Column Header has no preceding dataframe to reference, and as such cannot be set.");
          } else {
            inputElement = /* @__PURE__ */ react_default.createElement(
              Select_default,
              {
                value: paramValue,
                onChange: (newID) => {
                  const newParams = window.structuredClone(params);
                  newParams[paramName] = newID;
                  props.setParams(newParams);
                },
                searchable: true
              },
              Object.entries((sheetData == null ? void 0 : sheetData.columnIDsMap) || {}).map(([columnID, columnHeader]) => {
                return /* @__PURE__ */ react_default.createElement(
                  DropdownItem_default,
                  {
                    key: columnID,
                    id: columnID,
                    title: getDisplayColumnHeader(columnHeader)
                  }
                );
              })
            );
          }
        } else if (paramType === "str" || paramType === "any" || paramType == "int" || paramType == "float") {
          inputElement = /* @__PURE__ */ react_default.createElement(
            Input_default,
            {
              value: paramValue,
              type: paramName.toLocaleLowerCase() == "password" ? "password" : void 0,
              onChange: (e) => {
                const newValue = e.target.value;
                const newParams = window.structuredClone(params);
                newParams[paramName] = newValue;
                props.setParams(newParams);
              },
              placeholder: paramType === "str" ? "Add string" : paramType === "int" ? "Add an int" : paramType === "float" ? "Add a float" : void 0
            }
          );
        } else if (paramType === "bool") {
          inputElement = /* @__PURE__ */ react_default.createElement(
            Toggle_default,
            {
              value: paramValue.toLowerCase().includes("true"),
              onChange: () => {
                const newValue = !paramValue.toLowerCase().includes("true");
                const newParams = window.structuredClone(params);
                newParams[paramName] = "" + newValue;
                props.setParams(newParams);
              }
            }
          );
        } else if (paramType === "List[int]") {
          const paramValues = paramValue.split(",").map((value) => value.trim());
          if (paramValues.length === 0) {
            paramValues.push("");
          }
          inputElement = /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, paramValues.map((value, index) => {
            return /* @__PURE__ */ react_default.createElement(
              Input_default,
              {
                key: index,
                value,
                onChange: (e) => {
                  const newValues = [...paramValues];
                  newValues[index] = e.target.value;
                  const newParams = window.structuredClone(params);
                  newParams[paramName] = newValues.join(",");
                  props.setParams(newParams);
                },
                style: { marginBottom: "8px" },
                placeholder: "Add int to list"
              }
            );
          }), /* @__PURE__ */ react_default.createElement(
            TextButton_default,
            {
              onClick: () => {
                const newValues = [...paramValues, ""];
                const newParams = window.structuredClone(params);
                newParams[paramName] = newValues.join(",");
                props.setParams(newParams);
              },
              variant: "dark"
            },
            "Add new int"
          ));
        } else if (paramType === "Dict[str, str]") {
          const paramValues = paramValue.split(",");
          if (paramValues.length === 0) {
            paramValues.push(":");
          }
          inputElement = /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, paramValues.map((keyAndValue, index) => {
            const [dictKey, dictValue] = keyAndValue.split(":");
            return /* @__PURE__ */ react_default.createElement(Row_default, { key: index }, /* @__PURE__ */ react_default.createElement(
              Input_default,
              {
                key: "key" + index,
                value: dictKey,
                onChange: (e) => {
                  const newValues = [...paramValues];
                  const newDictKey = e.target.value;
                  newValues[index] = `${newDictKey || ""}:${dictValue || ""}`;
                  const newParams = window.structuredClone(params);
                  newParams[paramName] = newValues.join(",");
                  props.setParams(newParams);
                },
                style: { marginBottom: "8px", marginRight: "2px" },
                placeholder: "Add key"
              }
            ), /* @__PURE__ */ react_default.createElement(
              Input_default,
              {
                key: "value" + index,
                value: dictValue,
                onChange: (e) => {
                  const newValues = [...paramValues];
                  const newDictValue = e.target.value;
                  newValues[index] = `${dictKey || ""}:${newDictValue || ""}`;
                  const newParams = window.structuredClone(params);
                  newParams[paramName] = newValues.join(",");
                  props.setParams(newParams);
                },
                style: { marginBottom: "8px" },
                placeholder: "Add value"
              }
            ));
          }), /* @__PURE__ */ react_default.createElement(
            TextButton_default,
            {
              onClick: () => {
                const newValues = [...paramValues, ":"];
                const newParams = window.structuredClone(params);
                newParams[paramName] = newValues.join(",");
                props.setParams(newParams);
              },
              variant: "dark"
            },
            "Add entry"
          ));
        }
        const paramTypeDisplay = getParamTypeDisplay(paramType) !== void 0 ? ": " + getParamTypeDisplay(paramType) : void 0;
        const tooltip = `${paramName}${paramTypeDisplay}`;
        paramRowElements.push(
          /* @__PURE__ */ react_default.createElement(Row_default, { key: paramName, justify: "space-between", title: tooltip }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 14 }, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "start", align: "center", suppressTopBottomMargin: true }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-overflow-hide" }, /* @__PURE__ */ react_default.createElement("span", { className: "text-header-3" }, paramDisplayName))), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(Tooltip_default, { title: tooltip })))), /* @__PURE__ */ react_default.createElement(Col_default, { span: 8 }, inputElement))
        );
      }
    }
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, ...paramRowElements, paramRowElements.length === 0 ? /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1" }, "This function has no parameters to configure.") : /* @__PURE__ */ react_default.createElement(react_default.Fragment, null));
  };
  var UserDefinedFunctionParamConfigSection_default = UserDefinedFunctionParamConfigSection;

  // src/mito/components/taskpanes/UserDefinedImport/UserDefinedImportConfig.tsx
  var getEmptyDefaultParamsForImporter = (sheetDataArray, userDefinedImporter) => {
    return {
      importer: userDefinedImporter.name,
      importer_params: getInitialParamNameToParamValueMap(sheetDataArray, userDefinedImporter.parameters)
    };
  };
  var UserDefinedImportImportConfig = (props) => {
    const params = props.params;
    const userDefinedImporter = params !== void 0 ? props.analysisData.userDefinedImporters.find((importer) => importer.name === params.importer) : void 0;
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, userDefinedImporter !== void 0 && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
      UserDefinedFunctionDocumentationSection_default,
      {
        userDefinedFunction: userDefinedImporter
      }
    )), params === void 0 && /* @__PURE__ */ react_default.createElement("p", null, getNoImportMessage()), params !== void 0 && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
      UserDefinedFunctionParamConfigSection_default,
      {
        paramNameToType: userDefinedImporter == null ? void 0 : userDefinedImporter.parameters,
        params: params.importer_params,
        setParams: (newImportParams) => {
          props.setParams((prevParams) => {
            if (prevParams == void 0) {
              return prevParams;
            }
            return __spreadProps(__spreadValues({}, prevParams), {
              importer_params: newImportParams
            });
          });
        },
        sheetDataArray: props.sheetDataArray
      }
    ), props.error !== void 0 && /* @__PURE__ */ react_default.createElement("p", { className: "text-color-error" }, props.error)));
  };
  var UserDefinedImportConfig_default = UserDefinedImportImportConfig;

  // src/mito/components/taskpanes/UserDefinedImport/UserDefinedImportTaskpane.tsx
  var getDefaultUserDefinedImportParams = (importer_name, sheetDataArray, analysisData) => {
    const userDefinedImporter = analysisData.userDefinedImporters.find((f) => f.name === importer_name);
    if (userDefinedImporter === void 0) {
      return void 0;
    }
    return getEmptyDefaultParamsForImporter(sheetDataArray, userDefinedImporter);
  };
  var getNoImportMessage = () => {
    let noImportMessage = "You have not defined any importers. An importer is just a function that returns a pandas dataframe.";
    if (isInStreamlit()) {
      noImportMessage += " You can define importers in the spreadsheet call with the `importers` parameter.";
    } else if (isInDash()) {
      noImportMessage += " You can define importers in the Spreadsheet call with the `importers` parameter.";
    } else {
      noImportMessage += " You can define importers in the mitosheet.sheet call with the `importers` parameter.";
    }
    return noImportMessage;
  };
  var UserDefinedImportTaskpane = (props) => {
    const [params, setParams] = useState(() => getDefaultUserDefinedImportParams(props.importer_name, props.sheetDataArray, props.analysisData));
    const [error, setError] = useState(void 0);
    useEffect(() => {
      setParams(getDefaultUserDefinedImportParams(props.importer_name, props.sheetDataArray, props.analysisData));
    }, [props.importer_name]);
    const { edit } = useSendEditOnClickNoParams_default(
      "user_defined_import" /* UserDefinedImport */,
      props.mitoAPI,
      props.analysisData
    );
    const userDefinedImporter = params !== void 0 ? props.analysisData.userDefinedImporters.find((importer) => importer.name === params.importer) : void 0;
    let header = "Custom Import";
    if (userDefinedImporter !== void 0) {
      header = getDisplayNameOfPythonVariable(userDefinedImporter.name);
    }
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header,
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneBody_default,
      {
        requiresEnterprise: {
          featureName: "user_defined_import",
          mitoAPI: props.mitoAPI
        },
        userProfile: props.userProfile
      },
      /* @__PURE__ */ react_default.createElement(
        UserDefinedImportConfig_default,
        {
          sheetDataArray: props.sheetDataArray,
          params,
          setParams,
          error,
          analysisData: props.analysisData,
          importer_name: props.importer_name
        }
      )
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => __async(void 0, null, function* () {
          if (params !== void 0) {
            const error2 = yield edit(params);
            setError(error2);
          }
        }),
        disabled: params === void 0,
        disabledTooltip: getNoImportMessage()
      },
      "Import Data"
    )));
  };
  var UserDefinedImportTaskpane_default = UserDefinedImportTaskpane;

  // src/mito/components/taskpanes/UpdateImports/UserDefinedImportScreen.tsx
  var UpdateUserDefinedImportScreen = (props) => {
    const [params, setParams] = useState(() => getDefaultUserDefinedImportParams(props.importer_name, props.sheetDataArray, props.analysisData));
    useEffect(() => {
      setParams(getDefaultUserDefinedImportParams(props.importer_name, props.sheetDataArray, props.analysisData));
    }, [props.importer_name]);
    const userDefinedImporter = params !== void 0 ? props.analysisData.userDefinedImporters.find((importer) => importer.name === params.importer) : void 0;
    let header = "Custom Import";
    if (userDefinedImporter !== void 0) {
      header = getDisplayNameOfPythonVariable(userDefinedImporter.name);
    }
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header,
        setUIState: props.setUIState,
        backCallback: props.backCallback
      }
    ), /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneBody_default,
      {
        requiresEnterprise: {
          featureName: "user_defined_import",
          mitoAPI: props.mitoAPI
        },
        userProfile: props.userProfile
      },
      /* @__PURE__ */ react_default.createElement(
        UserDefinedImportConfig_default,
        {
          sheetDataArray: props.sheetDataArray,
          params,
          setParams,
          error: void 0,
          analysisData: props.analysisData,
          importer_name: props.importer_name
        }
      )
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => props.edit(params),
        disabled: params === void 0,
        disabledTooltip: getNoImportMessage()
      },
      "Update Import"
    )));
  };
  var UserDefinedImportScreen_default = UpdateUserDefinedImportScreen;

  // src/mito/components/taskpanes/UpdateImports/UpdateImportsTaskpane.tsx
  var UpdateImportsTaskpane = (props) => {
    const failedReplayData = props.failedReplayData;
    const updatePreReplay = failedReplayData !== void 0;
    const [updatedStepImportData, setUpdatedStepImportData] = useState(void 0);
    const [updatedIndexes, setUpdatedIndexes] = useState([]);
    const [displayedImportCardDropdown, setDisplayedImportCardDropdown] = useState(void 0);
    const [replacingDataframeState, setReplacingDataframeState] = useState(void 0);
    const [postUpdateInvalidImportMessages, setPostUpdateInvalidImportMessages] = useState({});
    const [importDataAndErrors] = useStateFromAPIAsync(
      void 0,
      () => __async(void 0, null, function* () {
        let importData = void 0;
        let invalidImportIndexes = void 0;
        if (failedReplayData !== void 0) {
          const response = yield props.mitoAPI.getImportedFilesAndDataframesFromAnalysisName(failedReplayData.analysisName, failedReplayData.args);
          importData = "error" in response ? void 0 : response.result;
          const invalidImportIndexesResponse = yield props.mitoAPI.getTestImports(importData || []);
          invalidImportIndexes = "error" in invalidImportIndexesResponse ? {} : invalidImportIndexesResponse.result;
        } else {
          const response = yield props.mitoAPI.getImportedFilesAndDataframesFromCurrentSteps();
          importData = "error" in response ? void 0 : response.result;
          invalidImportIndexes = {};
        }
        if (importData !== void 0 && invalidImportIndexes !== void 0) {
          return {
            importData,
            invalidImportMessages: invalidImportIndexes
          };
        }
        return void 0;
      }),
      (loadedData) => {
        if (loadedData === void 0) {
          return;
        }
        setUpdatedStepImportData((prevUpdatedStepImportData) => {
          if (prevUpdatedStepImportData === void 0) {
            return window.structuredClone(loadedData.importData);
          }
          return prevUpdatedStepImportData;
        });
        if (failedReplayData !== void 0) {
          if (Object.keys(loadedData.invalidImportMessages).length > 0) {
            setInvalidReplayError(PRE_REPLAY_IMPORT_ERROR_TEXT);
          } else {
            setInvalidReplayError(getErrorTextFromToFix(failedReplayData.error.error));
          }
        }
      },
      []
    );
    const [invalidReplayError, setInvalidReplayError] = useState(void 0);
    useEffect(() => {
      void props.mitoAPI.log("opened_update_imports_taskpane", {
        "open_due_to_replay_error": updatePreReplay,
        "num_invalid_imports": (importDataAndErrors == null ? void 0 : importDataAndErrors.invalidImportMessages) === void 0 ? 0 : Object.keys(importDataAndErrors.invalidImportMessages).length,
        "num_total_imports": (importDataAndErrors == null ? void 0 : importDataAndErrors.importData) === void 0 ? 0 : importDataAndErrors == null ? void 0 : importDataAndErrors.importData.length
      });
    }, [importDataAndErrors]);
    if (replacingDataframeState === void 0) {
      if (props.failedReplayData !== void 0) {
        return /* @__PURE__ */ react_default.createElement(
          UpdateImportsPreReplayTaskpane_default,
          {
            mitoAPI: props.mitoAPI,
            analysisData: props.analysisData,
            userProfile: props.userProfile,
            setUIState: props.setUIState,
            updatedStepImportData,
            setUpdatedStepImportData,
            updatedIndexes,
            setUpdatedIndexes,
            displayedImportCardDropdown,
            setDisplayedImportCardDropdown,
            setReplacingDataframeState,
            postUpdateInvalidImportMessages,
            setPostUpdateInvalidImportMessages,
            failedReplayData: props.failedReplayData,
            importDataAndErrors,
            invalidReplayError,
            setInvalidReplayError,
            overwriteAnalysisToReplayToMitosheetCall: props.overwriteAnalysisToReplayToMitosheetCall
          }
        );
      } else {
        return /* @__PURE__ */ react_default.createElement(
          UpdateImportsPostReplayTaskpane_default,
          {
            mitoAPI: props.mitoAPI,
            sheetDataArray: props.sheetDataArray,
            analysisData: props.analysisData,
            userProfile: props.userProfile,
            setUIState: props.setUIState,
            updatedStepImportData,
            setUpdatedStepImportData,
            updatedIndexes,
            setUpdatedIndexes,
            displayedImportCardDropdown,
            setDisplayedImportCardDropdown,
            setReplacingDataframeState,
            invalidImportMessages: postUpdateInvalidImportMessages,
            setInvalidImportMessages: setPostUpdateInvalidImportMessages,
            importDataAndErrors,
            invalidReplayError,
            setInvalidReplayError
          }
        );
      }
    }
    const importState = replacingDataframeState.importState;
    if (importState.screen === "file_browser") {
      return /* @__PURE__ */ react_default.createElement(
        FileBrowser_default,
        {
          mitoAPI: props.mitoAPI,
          analysisData: props.analysisData,
          userProfile: props.userProfile,
          setUIState: props.setUIState,
          isUpdate: true,
          currPathParts: props.currPathParts,
          setCurrPathParts: props.setCurrPathParts,
          setImportState: (newImportState) => {
            setReplacingDataframeState({
              "importState": newImportState,
              "params": void 0,
              "dataframeCreationIndex": replacingDataframeState.dataframeCreationIndex
            });
          },
          importCSVFile: (file) => __async(void 0, null, function* () {
            const fullPath = [...props.currPathParts];
            fullPath.push(file.name);
            const pathJoinResponse = yield props.mitoAPI.getPathJoined(fullPath);
            const filePath = "error" in pathJoinResponse ? void 0 : pathJoinResponse.result;
            if (filePath === void 0) {
              return;
            }
            const dataframeCreationData = {
              "step_type": "simple_import",
              "params": {
                file_names: [filePath]
              }
            };
            const response = yield props.mitoAPI.getTestImports([{
              "step_id": "fake_id",
              "imports": [dataframeCreationData]
            }]);
            const indexToErrorMap = "error" in response ? void 0 : response.result;
            if (indexToErrorMap === void 0 || Object.keys(indexToErrorMap).length > 0) {
              setReplacingDataframeState({
                "importState": {
                  "screen": "csv_import_config",
                  "fileName": file.name,
                  "filePath": filePath,
                  "error": indexToErrorMap !== void 0 ? indexToErrorMap[0] : void 0
                },
                "params": void 0,
                "dataframeCreationIndex": replacingDataframeState.dataframeCreationIndex
              });
              return;
            }
            updateDataframeCreation(
              replacingDataframeState.dataframeCreationIndex,
              dataframeCreationData,
              setUpdatedStepImportData,
              setUpdatedIndexes,
              setPostUpdateInvalidImportMessages,
              setReplacingDataframeState
            );
          }),
          backCallback: () => {
            setReplacingDataframeState(void 0);
          },
          notCloseable: updatePreReplay
        }
      );
    } else if (importState.screen === "csv_import_config") {
      const params = isCSVImportParams(replacingDataframeState.params) ? replacingDataframeState.params : getDefaultCSVParams(importState.filePath);
      return /* @__PURE__ */ react_default.createElement(
        CSVImportConfigScreen_default,
        {
          mitoAPI: props.mitoAPI,
          analysisData: props.analysisData,
          setUIState: props.setUIState,
          isUpdate: true,
          fileName: importState.fileName,
          filePath: importState.filePath,
          params,
          setParams: (updater) => {
            setReplacingDataframeState((prevReplacingDataframeState) => {
              if (prevReplacingDataframeState === void 0) {
                return void 0;
              }
              return __spreadProps(__spreadValues({}, prevReplacingDataframeState), {
                params: updater(params)
              });
            });
          },
          edit: () => __async(void 0, null, function* () {
            var _a;
            const dataframeCreationData = {
              "step_type": "simple_import",
              "params": params
            };
            const response = yield props.mitoAPI.getTestImports([{
              "step_id": "fake_id",
              "imports": [dataframeCreationData]
            }]);
            const indexToErrorMap = "error" in response ? void 0 : response.result;
            if (indexToErrorMap === void 0 || Object.keys(indexToErrorMap).length > 0) {
              const newError = indexToErrorMap !== void 0 ? indexToErrorMap[0] : void 0;
              const finalError = newError && ((_a = importState.error) == null ? void 0 : _a.startsWith(newError)) ? `${importState.error} Still invalid.` : newError;
              setReplacingDataframeState({
                "importState": __spreadProps(__spreadValues({}, importState), {
                  error: finalError
                }),
                "params": void 0,
                "dataframeCreationIndex": replacingDataframeState.dataframeCreationIndex
              });
              return;
            }
            updateDataframeCreation(
              replacingDataframeState.dataframeCreationIndex,
              {
                "step_type": "simple_import",
                "params": params
              },
              setUpdatedStepImportData,
              setUpdatedIndexes,
              setPostUpdateInvalidImportMessages,
              setReplacingDataframeState
            );
          }),
          editApplied: false,
          loading: false,
          error: importState.error,
          backCallback: () => {
            setReplacingDataframeState(void 0);
          },
          notCloseable: updatePreReplay
        }
      );
    } else if (replacingDataframeState.importState.screen === "xlsx_import_config") {
      const params = isExcelImportParams(replacingDataframeState.params) ? replacingDataframeState.params : getDefaultXLSXParams(replacingDataframeState.importState.filePath);
      return /* @__PURE__ */ react_default.createElement(
        XLSXImportConfigScreen_default,
        {
          mitoAPI: props.mitoAPI,
          analysisData: props.analysisData,
          userProfile: props.userProfile,
          setUIState: props.setUIState,
          isUpdate: true,
          fileName: replacingDataframeState.importState.fileName,
          filePath: replacingDataframeState.importState.filePath,
          params,
          setParams: (updater) => {
            setReplacingDataframeState((prevReplacingDataframeState) => {
              if (prevReplacingDataframeState === void 0) {
                return void 0;
              }
              return __spreadProps(__spreadValues({}, prevReplacingDataframeState), {
                params: updater(params)
              });
            });
          },
          edit: () => {
            updateDataframeCreation(
              replacingDataframeState.dataframeCreationIndex,
              {
                "step_type": "excel_import",
                "params": params
              },
              setUpdatedStepImportData,
              setUpdatedIndexes,
              setPostUpdateInvalidImportMessages,
              setReplacingDataframeState
            );
          },
          editApplied: false,
          loading: false,
          backCallback: () => {
            setReplacingDataframeState(void 0);
          },
          notCloseable: updatePreReplay
        }
      );
    } else if (replacingDataframeState.importState.screen === "authenticate_to_snowflake") {
      return /* @__PURE__ */ react_default.createElement(
        UpdateSnowflakeCredentialsScreen_default,
        {
          mitoAPI: props.mitoAPI,
          setUIState: props.setUIState,
          edit: () => {
            updateAllSnowflakeImports(
              updatedStepImportData,
              setUpdatedStepImportData,
              setUpdatedIndexes,
              setPostUpdateInvalidImportMessages,
              setReplacingDataframeState
            );
          },
          backCallback: () => {
            setReplacingDataframeState(void 0);
          },
          notCloseable: updatePreReplay
        }
      );
    } else if (replacingDataframeState.importState.screen === "user_defined_import") {
      return /* @__PURE__ */ react_default.createElement(
        UserDefinedImportScreen_default,
        {
          mitoAPI: props.mitoAPI,
          setUIState: props.setUIState,
          edit: (params) => {
            updateDataframeCreation(
              replacingDataframeState.dataframeCreationIndex,
              {
                "step_type": "user_defined_import",
                "params": params
              },
              setUpdatedStepImportData,
              setUpdatedIndexes,
              setPostUpdateInvalidImportMessages,
              setReplacingDataframeState
            );
          },
          backCallback: () => {
            setReplacingDataframeState(void 0);
          },
          notCloseable: updatePreReplay,
          analysisData: props.analysisData,
          userProfile: props.userProfile,
          sheetDataArray: props.sheetDataArray,
          importer_name: replacingDataframeState.importState.importer_name
        }
      );
    } else {
      const params = isDataframeImportParams(replacingDataframeState.params) ? replacingDataframeState.params : { df_names: [] };
      return /* @__PURE__ */ react_default.createElement(
        UpdateDataframeImportTaskpane_default,
        {
          mitoAPI: props.mitoAPI,
          analysisData: props.analysisData,
          setUIState: props.setUIState,
          isUpdate: true,
          params,
          setParams: (updater) => {
            setReplacingDataframeState((prevReplacingDataframeState) => {
              if (prevReplacingDataframeState === void 0) {
                return void 0;
              }
              return __spreadProps(__spreadValues({}, prevReplacingDataframeState), {
                params: updater(params)
              });
            });
          },
          edit: () => {
            updateDataframeCreation(
              replacingDataframeState.dataframeCreationIndex,
              {
                "step_type": "dataframe_import",
                "params": params
              },
              setUpdatedStepImportData,
              setUpdatedIndexes,
              setPostUpdateInvalidImportMessages,
              setReplacingDataframeState
            );
          },
          backCallback: () => {
            setReplacingDataframeState(void 0);
          },
          notCloseable: updatePreReplay
        }
      );
    }
  };
  var UpdateImportsTaskpane_default = UpdateImportsTaskpane;

  // src/mito/pro/taskpanes/ConditionalFormatting/ConditionalFormattingTaskpane.tsx
  init_react();

  // src/mito/pro/taskpanes/ConditionalFormatting/ConditionalFormattingCard.tsx
  init_react();

  // src/mito/components/icons/ConditionalFormatIcon.tsx
  init_react();
  var ConditionalFormatIcon = (props) => {
    if (props.backgroundColor && props.color) {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "47", height: "41", viewBox: "0 0 47 41", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { width: "47", height: "41", rx: "3", fill: props.backgroundColor }), /* @__PURE__ */ react_default.createElement("path", { d: "M15.1855 16.2808L11.6553 26H10.2124L14.2773 15.3359H15.2075L15.1855 16.2808ZM18.1445 26L14.6069 16.2808L14.585 15.3359H15.5151L19.5947 26H18.1445ZM17.9614 22.0522V23.2095H11.9702V22.0522H17.9614ZM20.8105 14.75H22.1729V24.4619L22.0557 26H20.8105V14.75ZM27.5269 21.9717V22.1255C27.5269 22.7017 27.4585 23.2363 27.3218 23.7295C27.1851 24.2178 26.9849 24.6426 26.7212 25.0039C26.4575 25.3652 26.1353 25.646 25.7544 25.8462C25.3735 26.0464 24.9365 26.1465 24.4434 26.1465C23.9404 26.1465 23.4985 26.061 23.1177 25.8901C22.7417 25.7144 22.4243 25.4629 22.1655 25.1357C21.9067 24.8086 21.6992 24.4131 21.543 23.9492C21.3916 23.4854 21.2866 22.9629 21.228 22.3818V21.708C21.2866 21.1221 21.3916 20.5972 21.543 20.1333C21.6992 19.6694 21.9067 19.2739 22.1655 18.9468C22.4243 18.6147 22.7417 18.3633 23.1177 18.1924C23.4937 18.0166 23.9307 17.9287 24.4287 17.9287C24.9268 17.9287 25.3687 18.0264 25.7544 18.2217C26.1401 18.4121 26.4624 18.6855 26.7212 19.042C26.9849 19.3984 27.1851 19.8257 27.3218 20.3237C27.4585 20.8169 27.5269 21.3662 27.5269 21.9717ZM26.1646 22.1255V21.9717C26.1646 21.5762 26.1279 21.2051 26.0547 20.8584C25.9814 20.5068 25.8643 20.1992 25.7031 19.9355C25.542 19.667 25.3296 19.457 25.0659 19.3057C24.8022 19.1494 24.4775 19.0713 24.0918 19.0713C23.75 19.0713 23.4521 19.1299 23.1982 19.2471C22.9492 19.3643 22.7368 19.5229 22.561 19.7231C22.3853 19.9185 22.2412 20.1431 22.1289 20.397C22.0215 20.646 21.9409 20.9048 21.8872 21.1733V22.9385C21.9653 23.2803 22.0923 23.6099 22.2681 23.9272C22.4487 24.2397 22.688 24.4961 22.9858 24.6963C23.2886 24.8965 23.6621 24.9966 24.1064 24.9966C24.4727 24.9966 24.7852 24.9233 25.0439 24.7769C25.3076 24.6255 25.52 24.418 25.6812 24.1543C25.8472 23.8906 25.9692 23.5854 26.0474 23.2388C26.1255 22.8921 26.1646 22.521 26.1646 22.1255ZM32.4121 25.0332C32.7344 25.0332 33.0322 24.9673 33.3057 24.8354C33.5791 24.7036 33.8037 24.5229 33.9795 24.2935C34.1553 24.0591 34.2554 23.793 34.2798 23.4951H35.5688C35.5444 23.9639 35.3857 24.4009 35.0928 24.8062C34.8047 25.2065 34.4263 25.5312 33.9575 25.7803C33.4888 26.0244 32.9736 26.1465 32.4121 26.1465C31.8164 26.1465 31.2964 26.0415 30.8521 25.8315C30.4126 25.6216 30.0464 25.3335 29.7534 24.9673C29.4653 24.6011 29.248 24.1812 29.1016 23.7075C28.96 23.229 28.8892 22.7236 28.8892 22.1914V21.8838C28.8892 21.3516 28.96 20.8486 29.1016 20.375C29.248 19.8965 29.4653 19.4741 29.7534 19.1079C30.0464 18.7417 30.4126 18.4536 30.8521 18.2437C31.2964 18.0337 31.8164 17.9287 32.4121 17.9287C33.0322 17.9287 33.5742 18.0557 34.0381 18.3096C34.502 18.5586 34.8657 18.9004 35.1294 19.335C35.3979 19.7646 35.5444 20.2529 35.5688 20.7998H34.2798C34.2554 20.4727 34.1626 20.1772 34.0015 19.9136C33.8452 19.6499 33.6304 19.4399 33.3569 19.2837C33.0884 19.1226 32.7734 19.042 32.4121 19.042C31.9971 19.042 31.6479 19.125 31.3647 19.291C31.0864 19.4521 30.8643 19.6719 30.6982 19.9502C30.5371 20.2236 30.4199 20.5288 30.3467 20.8657C30.2783 21.1978 30.2441 21.5371 30.2441 21.8838V22.1914C30.2441 22.5381 30.2783 22.8799 30.3467 23.2168C30.415 23.5537 30.5298 23.8589 30.6909 24.1323C30.8569 24.4058 31.0791 24.6255 31.3574 24.7915C31.6406 24.9526 31.9922 25.0332 32.4121 25.0332Z", fill: props.color }));
    }
    return /* @__PURE__ */ react_default.createElement("svg", { width: "38", height: "30", viewBox: "0 0 38 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "4.5", y: "6.57031", width: "29", height: "16", fill: "var(--mito-background-off)", stroke: "var(--mito-text-light)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "4.5", y: "11.5703", width: "29", height: "6", stroke: "var(--mito-text-light)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "4.5", y: "6.57031", width: "29", height: "16", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "12", y: "11.5703", width: "6.5", height: "6", fill: "#9D6CFF", stroke: "#6229AB" }), /* @__PURE__ */ react_default.createElement("rect", { x: "12", y: "6.57031", width: "11.5", height: "5", fill: "#F0969A", stroke: "var(--mito-status-error)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "12", y: "17.5703", width: "14", height: "5", fill: "#F0969A", stroke: "var(--mito-status-error)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "28.25", y1: "7.07031", x2: "28.25", y2: "22.0703", stroke: "var(--mito-text-light)" }));
  };
  var ConditionalFormatIcon_default = ConditionalFormatIcon;

  // src/mito/components/icons/ConditionalFormatInvalidIcon.tsx
  init_react();
  var ConditionalFormatInvalidIcon = (props) => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "47", height: "43", viewBox: "0 0 47 43", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { y: "2", width: "47", height: "41", rx: "3", fill: props.backgroundColor }), /* @__PURE__ */ react_default.createElement("path", { d: "M15.1855 18.2808L11.6553 28H10.2124L14.2773 17.3359H15.2075L15.1855 18.2808ZM18.1445 28L14.6069 18.2808L14.585 17.3359H15.5151L19.5947 28H18.1445ZM17.9614 24.0522V25.2095H11.9702V24.0522H17.9614ZM20.8105 16.75H22.1729V26.4619L22.0557 28H20.8105V16.75ZM27.5269 23.9717V24.1255C27.5269 24.7017 27.4585 25.2363 27.3218 25.7295C27.1851 26.2178 26.9849 26.6426 26.7212 27.0039C26.4575 27.3652 26.1353 27.646 25.7544 27.8462C25.3735 28.0464 24.9365 28.1465 24.4434 28.1465C23.9404 28.1465 23.4985 28.061 23.1177 27.8901C22.7417 27.7144 22.4243 27.4629 22.1655 27.1357C21.9067 26.8086 21.6992 26.4131 21.543 25.9492C21.3916 25.4854 21.2866 24.9629 21.228 24.3818V23.708C21.2866 23.1221 21.3916 22.5972 21.543 22.1333C21.6992 21.6694 21.9067 21.2739 22.1655 20.9468C22.4243 20.6147 22.7417 20.3633 23.1177 20.1924C23.4937 20.0166 23.9307 19.9287 24.4287 19.9287C24.9268 19.9287 25.3687 20.0264 25.7544 20.2217C26.1401 20.4121 26.4624 20.6855 26.7212 21.042C26.9849 21.3984 27.1851 21.8257 27.3218 22.3237C27.4585 22.8169 27.5269 23.3662 27.5269 23.9717ZM26.1646 24.1255V23.9717C26.1646 23.5762 26.1279 23.2051 26.0547 22.8584C25.9814 22.5068 25.8643 22.1992 25.7031 21.9355C25.542 21.667 25.3296 21.457 25.0659 21.3057C24.8022 21.1494 24.4775 21.0713 24.0918 21.0713C23.75 21.0713 23.4521 21.1299 23.1982 21.2471C22.9492 21.3643 22.7368 21.5229 22.561 21.7231C22.3853 21.9185 22.2412 22.1431 22.1289 22.397C22.0215 22.646 21.9409 22.9048 21.8872 23.1733V24.9385C21.9653 25.2803 22.0923 25.6099 22.2681 25.9272C22.4487 26.2397 22.688 26.4961 22.9858 26.6963C23.2886 26.8965 23.6621 26.9966 24.1064 26.9966C24.4727 26.9966 24.7852 26.9233 25.0439 26.7769C25.3076 26.6255 25.52 26.418 25.6812 26.1543C25.8472 25.8906 25.9692 25.5854 26.0474 25.2388C26.1255 24.8921 26.1646 24.521 26.1646 24.1255ZM32.4121 27.0332C32.7344 27.0332 33.0322 26.9673 33.3057 26.8354C33.5791 26.7036 33.8037 26.5229 33.9795 26.2935C34.1553 26.0591 34.2554 25.793 34.2798 25.4951H35.5688C35.5444 25.9639 35.3857 26.4009 35.0928 26.8062C34.8047 27.2065 34.4263 27.5312 33.9575 27.7803C33.4888 28.0244 32.9736 28.1465 32.4121 28.1465C31.8164 28.1465 31.2964 28.0415 30.8521 27.8315C30.4126 27.6216 30.0464 27.3335 29.7534 26.9673C29.4653 26.6011 29.248 26.1812 29.1016 25.7075C28.96 25.229 28.8892 24.7236 28.8892 24.1914V23.8838C28.8892 23.3516 28.96 22.8486 29.1016 22.375C29.248 21.8965 29.4653 21.4741 29.7534 21.1079C30.0464 20.7417 30.4126 20.4536 30.8521 20.2437C31.2964 20.0337 31.8164 19.9287 32.4121 19.9287C33.0322 19.9287 33.5742 20.0557 34.0381 20.3096C34.502 20.5586 34.8657 20.9004 35.1294 21.335C35.3979 21.7646 35.5444 22.2529 35.5688 22.7998H34.2798C34.2554 22.4727 34.1626 22.1772 34.0015 21.9136C33.8452 21.6499 33.6304 21.4399 33.3569 21.2837C33.0884 21.1226 32.7734 21.042 32.4121 21.042C31.9971 21.042 31.6479 21.125 31.3647 21.291C31.0864 21.4521 30.8643 21.6719 30.6982 21.9502C30.5371 22.2236 30.4199 22.5288 30.3467 22.8657C30.2783 23.1978 30.2441 23.5371 30.2441 23.8838V24.1914C30.2441 24.5381 30.2783 24.8799 30.3467 25.2168C30.415 25.5537 30.5298 25.8589 30.6909 26.1323C30.8569 26.4058 31.0791 26.6255 31.3574 26.7915C31.6406 26.9526 31.9922 27.0332 32.4121 27.0332Z", fill: props.color }), /* @__PURE__ */ react_default.createElement("rect", { x: "33", y: "2", width: "14", height: "13", rx: "2", fill: "#CF0000" }), /* @__PURE__ */ react_default.createElement("path", { d: "M41.0518 3.75781L40.8994 10.2769H39.5918L39.4331 3.75781H41.0518ZM39.3887 12.2764C39.3887 12.0436 39.4648 11.849 39.6172 11.6924C39.7738 11.5316 39.9896 11.4512 40.2646 11.4512C40.5355 11.4512 40.7492 11.5316 40.9058 11.6924C41.0623 11.849 41.1406 12.0436 41.1406 12.2764C41.1406 12.5007 41.0623 12.6932 40.9058 12.854C40.7492 13.0106 40.5355 13.0889 40.2646 13.0889C39.9896 13.0889 39.7738 13.0106 39.6172 12.854C39.4648 12.6932 39.3887 12.5007 39.3887 12.2764Z", fill: "var(--mito-background-off)" }));
  };
  var ConditionalFormatInvalidIcon_default = ConditionalFormatInvalidIcon;

  // src/mito/pro/taskpanes/ConditionalFormatting/ConditionalFormattingCard.tsx
  var getColumnHeadersIncludedMessage2 = (sheetData, columnIDs) => {
    if (columnIDs.length === 0) {
      return /* @__PURE__ */ react_default.createElement("p", null, "Applied to 0 columns.");
    }
    const columnHeaders = columnIDs.map((columnID) => sheetData.columnIDsMap[columnID]).filter((columnHeader) => columnHeader !== void 0);
    const [columnHeadersString, numOtherColumnHeaders] = getFirstCharactersOfColumnHeaders(columnHeaders, 15);
    if (numOtherColumnHeaders === 0) {
      return /* @__PURE__ */ react_default.createElement("p", null, "Applied to ", /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, columnHeadersString), ".");
    } else {
      return /* @__PURE__ */ react_default.createElement("p", null, "Applied to ", /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, columnHeadersString), " and ", /* @__PURE__ */ react_default.createElement("span", { className: "text-color-medium-important" }, numOtherColumnHeaders), " others.");
    }
  };
  var getInvalidColumnHeadersMessage = (sheetData, invalidColumnIDs, filters) => {
    if (invalidColumnIDs.length === 0) {
      return null;
    }
    const allColumnIDs = Object.keys(sheetData.columnIDsMap);
    const sortedColumnIDs = invalidColumnIDs.sort((a, b) => {
      return allColumnIDs.indexOf(a) - allColumnIDs.indexOf(b);
    });
    const columnHeaders = sortedColumnIDs.map((columnID) => sheetData.columnIDsMap[columnID]).filter((columnHeader) => columnHeader !== void 0);
    const [columnHeadersString, numOtherColumnHeaders] = getFirstCharactersOfColumnHeaders(columnHeaders, 20);
    let likelyCauseOfInvalid = "This is likely due to incompatible dtypes.";
    if (filters.length === 1 && (Object.keys(NUMBER_SELECT_OPTIONS).includes(filters[0].condition) || (filters[0].condition === "most_frequent" || filters[0].condition === "least_frequent")) && filters[0].value === "") {
      likelyCauseOfInvalid = "Please enter a value to finish configuring the conditional format.";
    }
    if (numOtherColumnHeaders === 0) {
      return /* @__PURE__ */ react_default.createElement("p", null, "This condition cannot be applied to ", /* @__PURE__ */ react_default.createElement("span", { className: "text-color-error-important" }, columnHeadersString), ". ", likelyCauseOfInvalid);
    } else {
      return /* @__PURE__ */ react_default.createElement("p", null, "This condition cannot be applied to ", /* @__PURE__ */ react_default.createElement("span", { className: "text-color-error-important" }, columnHeadersString), " and ", /* @__PURE__ */ react_default.createElement("span", { className: "text-color-error-important" }, numOtherColumnHeaders), " others. ", likelyCauseOfInvalid);
    }
  };
  var ConditionalFormattingCard = (props) => {
    var _a, _b, _c;
    const conditionalFormatIndex = props.df_format.conditional_formats.findIndex((format) => {
      return format.format_uuid === props.conditionalFormat.format_uuid;
    });
    const invalidColumnIDs = ((_a = props.sheetData.conditionalFormattingResult) == null ? void 0 : _a.invalid_conditional_formats[props.conditionalFormat.format_uuid]) || [];
    const invalidColumnIDMessage = getInvalidColumnHeadersMessage(props.sheetData, invalidColumnIDs, props.conditionalFormat.filters);
    const conditionText = capitalizeFirstLetter(ALL_SELECT_OPTIONS[(_b = props.conditionalFormat.filters[0]) == null ? void 0 : _b.condition]["long_name"] || "contains");
    const color = props.conditionalFormat.color || ROW_TEXT_COLOR_DEFAULT;
    const backgroundColor = props.conditionalFormat.backgroundColor || ODD_ROW_BACKGROUND_COLOR_DEFAULT;
    return /* @__PURE__ */ react_default.createElement(
      ExpandableContentCard_default,
      {
        title: /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, conditionText, " ", (_c = props.conditionalFormat.filters[0]) == null ? void 0 : _c.value),
        subtitle: /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, getColumnHeadersIncludedMessage2(props.sheetData, props.conditionalFormat.columnIDs)),
        expandedTitle: "Columns to format",
        isExpanded: props.openFormattingCardIndex === conditionalFormatIndex,
        setExpanded: (newIsExpanded) => {
          if (newIsExpanded) {
            props.setOpenFormattingCardIndex(conditionalFormatIndex);
          } else {
            props.setOpenFormattingCardIndex(-1);
          }
        },
        icon: /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, invalidColumnIDs.length === 0 && /* @__PURE__ */ react_default.createElement(
          ConditionalFormatIcon_default,
          {
            color,
            backgroundColor
          }
        ), invalidColumnIDs.length !== 0 && /* @__PURE__ */ react_default.createElement(
          ConditionalFormatInvalidIcon_default,
          {
            color,
            backgroundColor
          }
        )),
        iconTitle: invalidColumnIDs.length !== 0 ? `This conditional format cannot be applied to ${invalidColumnIDs.length} column${invalidColumnIDs.length === 1 ? "" : "s"} that ${invalidColumnIDs.length === 1 ? "is" : "are"} selected. Please update the filters or selected columns to fix.` : "",
        onDelete: () => {
          const newConditionalFormats = [...props.df_format.conditional_formats];
          newConditionalFormats.splice(conditionalFormatIndex, 1);
          props.updateDataframeFormatParams(__spreadProps(__spreadValues({}, props.df_format), { conditional_formats: newConditionalFormats }));
        }
      },
      /* @__PURE__ */ react_default.createElement(
        MultiToggleColumns_default,
        {
          sheetData: props.sheetData,
          selectedColumnIDs: props.conditionalFormat.columnIDs,
          onChange: (newSelectedColumnIDs) => {
            const newConditionalFormats = [...props.df_format.conditional_formats];
            newConditionalFormats[conditionalFormatIndex].columnIDs = newSelectedColumnIDs;
            props.updateDataframeFormatParams(__spreadProps(__spreadValues({}, props.df_format), { conditional_formats: newConditionalFormats }));
          },
          getDisplayColumnHeaderOverride: (columnID, columnHeader) => {
            const isInvalid = invalidColumnIDs.includes(columnID);
            return getDisplayColumnHeader(columnHeader) + (isInvalid ? " (invalid)" : "");
          },
          height: "medium"
        }
      ),
      invalidColumnIDMessage,
      /* @__PURE__ */ react_default.createElement(
        Filter,
        {
          filter: props.conditionalFormat.filters[0],
          columnDtype: void 0,
          operator: "And",
          displayOperator: false,
          setFilter: (newFilter) => {
            const newConditionalFormats = [...props.df_format.conditional_formats];
            newConditionalFormats[conditionalFormatIndex].filters = [newFilter];
            props.updateDataframeFormatParams(__spreadProps(__spreadValues({}, props.df_format), { conditional_formats: newConditionalFormats }));
          },
          nameLength: "long_name"
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        LabelAndColor_default,
        {
          label: "Text Color",
          color,
          onChange: (newColor) => {
            const newConditionalFormats = [...props.df_format.conditional_formats];
            newConditionalFormats[conditionalFormatIndex].color = newColor;
            props.updateDataframeFormatParams(__spreadProps(__spreadValues({}, props.df_format), { conditional_formats: newConditionalFormats }));
          }
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        LabelAndColor_default,
        {
          label: "Background Color",
          color: backgroundColor,
          onChange: (newColor) => {
            const newConditionalFormats = [...props.df_format.conditional_formats];
            newConditionalFormats[conditionalFormatIndex].backgroundColor = newColor;
            props.updateDataframeFormatParams(__spreadProps(__spreadValues({}, props.df_format), { conditional_formats: newConditionalFormats }));
          }
        }
      )
    );
  };
  var ConditionalFormattingCard_default = ConditionalFormattingCard;

  // src/mito/pro/taskpanes/ConditionalFormatting/ConditionalFormattingTaskpane.tsx
  var getDefaultEmptyConditionalFormat = (columnIDs) => {
    return {
      format_uuid: getRandomId(),
      columnIDs: columnIDs != null ? columnIDs : [],
      filters: [{ condition: "not_empty", value: "" }],
      color: void 0,
      backgroundColor: void 0
    };
  };
  var getDefaultParams9 = (sheetDataArray, sheetIndex, startingColumnIDs) => {
    if (sheetDataArray.length === 0 || sheetDataArray[sheetIndex] === void 0) {
      return void 0;
    }
    const newFormat = sheetDataArray[sheetIndex].dfFormat || getDefaultDataframeFormat();
    if (startingColumnIDs !== void 0) {
      newFormat.conditional_formats.push(getDefaultEmptyConditionalFormat(startingColumnIDs));
    }
    return {
      sheet_index: sheetIndex,
      df_format: newFormat
    };
  };
  var ConditionalFormattingTaskpane = (props) => {
    const { params, setParams } = useLiveUpdatingParams_default(
      () => getDefaultParams9(props.sheetDataArray, props.selectedSheetIndex, props.startingColumnIDs),
      "set_dataframe_format" /* SetDataframeFormat */,
      props.mitoAPI,
      props.analysisData,
      50,
      {
        getBackendFromFrontend: (params2) => {
          const conditionalFormats2 = params2.df_format.conditional_formats.map((conditionalFormat) => {
            const newConditionalFormat = __spreadValues({}, conditionalFormat);
            const newFilters = newConditionalFormat.filters.map((filter) => {
              const newFilter = __spreadValues({}, filter);
              let newValue = newFilter.value;
              if (checkFilterShouldHaveNumberValue(newFilter)) {
                const valueAsNumber = parseFloat(newFilter.value);
                if (!isNaN(valueAsNumber)) {
                  newValue = valueAsNumber;
                }
              }
              newFilter.value = newValue;
              return newFilter;
            });
            return __spreadProps(__spreadValues({}, newConditionalFormat), {
              filters: newFilters
            });
          });
          return __spreadProps(__spreadValues({}, params2), {
            df_format: __spreadProps(__spreadValues({}, params2.df_format), {
              conditional_formats: conditionalFormats2
            })
          });
        },
        getFrontendFromBackend: (params2) => {
          return params2;
        }
      }
    );
    if (params === void 0) {
      return /* @__PURE__ */ react_default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState });
    }
    const sheetData = props.sheetDataArray[params.sheet_index];
    const conditionalFormats = params.df_format.conditional_formats;
    const [openFormattingCardIndex, setOpenFormattingCardIndex] = useState(
      props.startingColumnIDs ? conditionalFormats.length - 1 : conditionalFormats.length > 0 ? 0 : -1
    );
    const updateDataframeFormatParams = (newParams) => {
      setParams((prevParams) => {
        return updateObjectWithPartialObject(prevParams, { df_format: newParams });
      });
    };
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Conditional Formatting",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneBody_default,
      {
        userProfile: props.userProfile,
        requiresPro: {
          message: "Conditional formatting is a Mito Pro feature. Please upgrade to use this feature.",
          mitoAPI: props.mitoAPI,
          featureName: "Conditional Formatting"
        }
      },
      /* @__PURE__ */ react_default.createElement(
        DataframeSelect_default,
        {
          sheetDataArray: props.sheetDataArray,
          sheetIndex: params.sheet_index,
          onChange: (newSheetIndex) => {
            setParams((prevParams) => {
              const newParams = getDefaultParams9(props.sheetDataArray, newSheetIndex);
              if (newParams) {
                return newParams;
              }
              return __spreadProps(__spreadValues({}, prevParams), {
                sheet_index: newSheetIndex
              });
            });
            props.setUIState((prevState) => {
              return __spreadProps(__spreadValues({}, prevState), {
                selectedSheetIndex: newSheetIndex
              });
            });
          }
        }
      ),
      /* @__PURE__ */ react_default.createElement(Row_default, null, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Conditional Formats"), /* @__PURE__ */ react_default.createElement("p", { className: "text-subtext-1 mb-10px" }, "Rules applied in order. Later formatting rules overwrite earlier rules."))),
      conditionalFormats.map((conditionalFormat, index) => {
        return /* @__PURE__ */ react_default.createElement(
          ConditionalFormattingCard_default,
          {
            key: conditionalFormat.format_uuid + index,
            df_format: params.df_format,
            conditionalFormat,
            updateDataframeFormatParams,
            sheetData,
            openFormattingCardIndex,
            setOpenFormattingCardIndex
          }
        );
      }),
      /* @__PURE__ */ react_default.createElement(Row_default, null, /* @__PURE__ */ react_default.createElement(
        TextButton_default,
        {
          variant: "dark",
          onClick: () => {
            const newConditionalFormats = [...params.df_format.conditional_formats];
            newConditionalFormats.push(getDefaultEmptyConditionalFormat());
            return updateDataframeFormatParams({ conditional_formats: newConditionalFormats });
          }
        },
        "Add Conditional Formatting Rule"
      ))
    ));
  };
  var ConditionalFormattingTaskpane_default = ConditionalFormattingTaskpane;

  // src/jupyter/code.tsx
  function getCodeString(analysisName, code, telemetryEnabled, publicInterfaceVersion, skipRegisterAnalysis) {
    if (code.length == 0) {
      return "";
    }
    const finalCode = code.join("\n");
    let analysisRegisterCode = "";
    if (skipRegisterAnalysis) {
      analysisRegisterCode = "";
    } else {
      if (telemetryEnabled) {
        analysisRegisterCode = `register_analysis("${analysisName}");`;
      } else {
        analysisRegisterCode = `# Analysis Name:${analysisName};`;
      }
    }
    return finalCode.replace(`mitosheet.public.v${publicInterfaceVersion} import *`, `mitosheet.public.v${publicInterfaceVersion} import *; ${analysisRegisterCode}`);
  }

  // src/mito/components/icons/AIIcon.tsx
  init_react();
  var AIIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "22", height: "15", viewBox: "0 0 12 7", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M10.9369 3.57031C10.9369 1.91346 9.59374 0.570312 7.93689 0.570312H3.93689C2.28004 0.570312 0.93689 1.91346 0.93689 3.57031C0.93689 5.22717 2.28004 6.57031 3.93689 6.57031H7.93689C9.59374 6.57031 10.9369 5.22717 10.9369 3.57031Z", fill: "var(--mito-highlight)", strokeWidth: "0.600361", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("circle", { cx: "3.43689", cy: "3.57031", r: "1", transform: "rotate(-90 3.43689 3.57031)", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("circle", { cx: "8.43689", cy: "3.57031", r: "1", transform: "rotate(-90 8.43689 3.57031)", fill: "var(--mito-text)" }));
  };
  var AIIcon_default = AIIcon;

  // src/mito/components/icons/AddColumnIcon.tsx
  init_react();
  var AddColumnIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "22", height: "28", viewBox: "0 0 22 28", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "5.07471", y: "26.6406", width: "23", height: "16", transform: "rotate(-90 5.07471 26.6406)", fill: "var(--mito-background)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "10.0747", y: "26.6406", width: "23", height: "6", transform: "rotate(-90 10.0747 26.6406)", fill: "var(--mito-background)", stroke: "var(--mito-text-medium)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "5.07471", y: "26.6406", width: "23", height: "16", transform: "rotate(-90 5.07471 26.6406)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "10.0747", y: "26.6406", width: "23", height: "6", transform: "rotate(-90 10.0747 26.6406)", stroke: "var(--mito-text-medium)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "5.07471", y: "26.6406", width: "23", height: "16", transform: "rotate(-90 5.07471 26.6406)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "5.57471", y1: "10.6406", x2: "20.5747", y2: "10.6406", stroke: "var(--mito-text-medium)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "5.57471", y1: "18.6406", x2: "20.5747", y2: "18.6406", stroke: "var(--mito-text-medium)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M9.89575 25.9297L9.89575 0.575022L16.3958 0.635957L16.3958 13.5L16.3958 25.9297L9.89575 25.9297Z", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M9.57471 8.64062L15.8958 8.64062", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M9.57471 16.6406L16.3958 16.6406", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5.5198 16.0596L9.59908 12.52M9.59908 12.52L5.48594 9.0197M9.59908 12.52L2.09917 12.556", stroke: "var(--mito-background)", strokeWidth: "3", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5.5198 16.0596L9.59908 12.52M9.59908 12.52L5.48594 9.0197M9.59908 12.52L2.09917 12.556", stroke: "var(--mito-highlight-medium)", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var AddColumnIcon_default = AddColumnIcon;

  // src/mito/components/icons/AntiMergeIcon.tsx
  init_react();
  var AntiMergeIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "35", height: "30", viewBox: "0 0 35 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("circle", { cx: "8.5", cy: "8.5", r: "8", transform: "matrix(-1 0 0 1 21.8965 6.07031)", fill: "var(--mito-highlight)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("circle", { cx: "8.5", cy: "8.5", r: "8", transform: "matrix(-1 0 0 1 30.1033 6.07031)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("circle", { cx: "8.5", cy: "8.5", r: "8", transform: "matrix(-1 0 0 1 30.1033 6.07031)", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }));
  };
  var AntiMergeIcon_default = AntiMergeIcon;

  // src/mito/components/icons/BulkColumnHeaderTransformIcon.tsx
  init_react();
  var BulkHeaderTransformIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "20", height: "18", viewBox: "0 0 20 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M0.7402 1.31906L13.7402 1.07031V5.07031H0.740234L0.7402 1.31906Z", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M0.519531 14.8368V1.14062H14.1964V14.8368H0.519531Z", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5.55127 17.1376V3.44141H19.2282V17.1376H5.55127Z", fill: "var(--mito-background-off)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5.83057 3.75781H18.9492V7.58H5.83057V3.75781Z", fill: "#96D394" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5.55127 17.1376V3.44141H19.2282V17.1376H5.55127Z", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M10.2964 7.58203V16.819M14.7623 7.58203V16.819", stroke: "var(--mito-text-light)", strokeWidth: "0.75" }));
  };
  var BulkColumnHeaderTransformIcon_default = BulkHeaderTransformIcon;

  // src/mito/components/icons/ClearIcon.tsx
  init_react();
  var ClearIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "16", height: "16", viewBox: "0-1 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M15.3658 9.73869C15.4886 9.77711 15.6198 9.70869 15.6544 9.58468C16.0779 8.06589 16.0124 6.44999 15.4638 4.96754C14.8883 3.41211 13.8134 2.09133 12.4073 1.2118C11.0012 0.332277 9.34326 -0.0563815 7.69279 0.106626C6.04232 0.269634 4.49242 0.975113 3.28557 2.1127C2.07871 3.2503 1.28295 4.75583 1.02279 6.3938C0.762619 8.03177 1.05271 9.70977 1.84769 11.1653C2.64267 12.6209 3.89769 13.7719 5.41642 14.4383C6.8639 15.0734 8.47311 15.2342 10.0143 14.9011C10.1401 14.8739 10.2161 14.747 10.185 14.6221V14.6221C10.1539 14.4971 10.0275 14.4215 9.90161 14.4484C8.46057 14.7568 6.95681 14.605 5.60375 14.0113C4.17942 13.3864 3.00242 12.3069 2.25686 10.9419C1.5113 9.57678 1.23923 8.00308 1.48323 6.46693C1.72722 4.93078 2.47351 3.51883 3.60535 2.45196C4.73719 1.38508 6.19073 0.723457 7.73861 0.570582C9.28648 0.417707 10.8414 0.782206 12.16 1.60706C13.4787 2.43191 14.4868 3.67059 15.0266 5.12933C15.5394 6.51509 15.602 8.02518 15.2092 9.44551C15.1748 9.56959 15.2429 9.70028 15.3658 9.73869V9.73869Z", fill: "black" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5.92993 4.35547L11.6442 10.784M5.92993 10.784L11.6442 4.35547", stroke: "black", strokeLinecap: "round" }));
  };
  var ClearIcon_default = ClearIcon;

  // src/mito/components/icons/ConcatIcon.tsx
  init_react();
  var ConcatIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "18", height: "24", viewBox: "0 0 18 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("circle", { cx: "8.5", cy: "8.5", r: "8", transform: "matrix(0 1 1 0 0.103516 0.894531)", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("circle", { cx: "8.5", cy: "8.5", r: "8", transform: "matrix(0 1 1 0 0.103516 6.10156)", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("mask", { id: "mask0_7507_341", style: { maskType: "alpha" }, maskUnits: "userSpaceOnUse", x: "0", y: "7", width: "17", height: "16" }, /* @__PURE__ */ react_default.createElement("path", { d: "M8.5 22.5C12.9473 22.5 16.5 19.114 16.5 15C16.5 10.886 12.9473 7.5 8.5 7.5C4.05273 7.5 0.5 10.886 0.5 15C0.5 19.114 4.05273 22.5 8.5 22.5Z", fill: "var(--mito-highlight)", stroke: "var(--mito-text)" })), /* @__PURE__ */ react_default.createElement("g", { mask: "url(#mask0_7507_341)" }, /* @__PURE__ */ react_default.createElement("circle", { cx: "8.5", cy: "8.5", r: "8", transform: "matrix(0 1 1 0 0.103516 1.89453)", fill: "var(--mito-highlight)", stroke: "var(--mito-text)" })), /* @__PURE__ */ react_default.createElement("circle", { cx: "8.5", cy: "8.5", r: "8", transform: "matrix(0 1 1 0 0.103516 6.10156)", stroke: "var(--mito-text)" }));
  };
  var ConcatIcon_default = ConcatIcon;

  // src/mito/components/icons/CopyContextMenuItem.tsx
  init_react();
  var CopyContextMenuIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "11", height: "14", viewBox: "0 0 11 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "0.5", y: "2.96094", width: "7.47826", height: "10.2895", rx: "1.5", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "2.5", y: "0.75", width: "7.47826", height: "10.2895", rx: "1.5", fill: "var(--mito-background)", stroke: "var(--mito-text)" }));
  };
  var CopyContextMenuItem_default = CopyContextMenuIcon;

  // src/mito/components/icons/CopyIcon.tsx
  init_react();
  var CopyIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "18", height: "18", viewBox: "0 0 15 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M9.88889 2.57031L8.22222 1.07031H6.55556H1V15.0703H3.5", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5.5 3.57031H10.5556H12.0304L13.5352 4.92467L14.5 5.99264V16.5703H5.5V3.57031Z", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "10.5", y1: "4.07031", x2: "10.5", y2: "8.07031", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "10", y1: "7.57031", x2: "14", y2: "7.57031", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "8", y1: "11.5703", x2: "12", y2: "11.5703", stroke: "var(--mito-text-light" }), /* @__PURE__ */ react_default.createElement("path", { d: "M8 13.5703H12", stroke: "var(--mito-text-light" }));
  };
  var CopyIcon_default = CopyIcon;

  // src/mito/components/icons/CurrencyIcon.tsx
  init_react();
  var CurrencyIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "13", height: "20", viewBox: "0 0 13 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M4.5 12.5703C5.5 15.0703 8.5 13.1685 8.5 11.5685C8.5 8.57031 4.5 10.5703 4.5 7.56852C4.5 4.94642 7.5 5.07037 8.5 6.06852M6.5 4.07031V15.0703", stroke: "var(--mito-text)" }));
  };
  var CurrencyIcon_default = CurrencyIcon;

  // src/mito/components/icons/DataFrameImportIcon.tsx
  init_react();
  var DataFrameImportIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "5.11865", y: "7.13281", width: "20.5532", height: "4.25", fill: "var(--mito-highlight-light)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "4.82812", y: "11.8828", width: "20.3438", height: "5.375", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M18.5957 7.13281V22.0078", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M11.8394 7.13281L11.8394 22.0078", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "4.82812", y: "6.57031", width: "20.3438", height: "16", stroke: "var(--mito-text)" }));
  };
  var DataFrameImportIcon_default = DataFrameImportIcon;

  // src/mito/components/icons/DateTimeFunctionsIcon.tsx
  init_react();
  var DateTimeFunctionsIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "19", height: "23", viewBox: "0 0 14 19", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M2.39507 17.7007H2.30324C1.40512 17.7007 0.674319 17.0584 0.651047 16.2601C0.650452 16.243 0.650262 16.226 0.650475 16.2089C0.658518 15.5667 1.24002 14.9277 2.39507 14.7442H13.4594V17.7007H2.39507Z", fill: "var(--mito-background-off)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M13.1171 1.43988H2.304C1.3912 1.43988 0.650475 2.1034 0.650475 2.91982V16.2208C0.650475 17.0372 1.39044 17.7007 2.30324 17.7007H13.4594M13.4594 17.7007V1.07031M13.4594 17.7007V18.0703M13.4594 17.7007H2.39507C0.0689437 17.3312 0.0687175 15.1138 2.39507 14.7442H13.4594", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("circle", { cx: "7.26128", cy: "8.31207", r: "4.22222", stroke: "#DB4D44" }), /* @__PURE__ */ react_default.createElement("path", { d: "M6.94678 6.10547V8.9388H9.4653", stroke: "#DB4D44" }));
  };
  var DateTimeFunctionsIcon_default = DateTimeFunctionsIcon;

  // src/mito/components/icons/DeleteColumnIcon.tsx
  init_react();
  var DeleteColumnIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "18", height: "25", viewBox: "0 0 18 25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("line", { x1: "1.23479", y1: "7.73831", x2: "16.234", y2: "7.58216", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "1.31804", y1: "15.7344", x2: "16.3172", y2: "15.5783", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "5.85951", y: "19.6901", width: "14", height: "6", transform: "rotate(-90.5965 5.85951 19.6901)", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "6.28654", y1: "12.6836", x2: "12.2862", y2: "12.6212", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "11.906", y1: "24.1263", x2: "11.8644", y2: "20.1265", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "5.90628", y1: "24.1888", x2: "5.86464", y2: "20.189", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "5.70852", y1: "5.1888", x2: "5.66688", y2: "1.18902", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "11.7082", y1: "5.1263", x2: "11.6665", y2: "1.12652", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "0.896145", y1: "23.2396", x2: "0.656715", y2: "0.240826", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "16.8953", y1: "23.0755", x2: "16.6559", y2: "0.0767637", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "17.1611", y1: "0.570285", x2: "11.1614", y2: "0.632746", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "17.4005", y1: "23.5703", x2: "11.4008", y2: "23.6327", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "6.40108", y1: "23.6836", x2: "0.401404", y2: "23.746", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "6.1617", y1: "0.683567", x2: "0.162024", y2: "0.746027", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("g", { clipPath: "url(#clip0_7142_764)" }, /* @__PURE__ */ react_default.createElement("rect", { x: "2.09863", y: "6.44141", width: "3.46154", height: "15", rx: "1", transform: "rotate(-45.5965 2.09863 6.44141)", fill: "var(--mito-background-off)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "4.65625", y: "17.0195", width: "3.46154", height: "15", rx: "1", transform: "rotate(-135.596 4.65625 17.0195)", fill: "var(--mito-background-off)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "4.63818", y: "15.3867", width: "1.15385", height: "12.6923", transform: "rotate(-135.596 4.63818 15.3867)", fill: "var(--mito-status-error)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "3.72937", y: "6.41797", width: "1.15385", height: "12.6923", transform: "rotate(-45.5965 3.72937 6.41797)", fill: "var(--mito-status-error)" })), /* @__PURE__ */ react_default.createElement("defs", null, /* @__PURE__ */ react_default.createElement("clipPath", { id: "clip0_7142_764" }, /* @__PURE__ */ react_default.createElement("rect", { width: "13", height: "11", fill: "white", transform: "translate(3.13538 17.1133) rotate(-90.5965)" }))));
  };
  var DeleteColumnIcon_default = DeleteColumnIcon;

  // src/mito/components/icons/DtypeIcon.tsx
  init_react();
  var DtypeIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 6 7", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M2.83203 1.3125V7H2.08984V1.3125H2.83203ZM4.66016 1.3125V1.92969H0.265625V1.3125H4.66016ZM10.3039 7L13.5199", fill: "var(--mito-text)" }));
  };
  var DtypeIcon_default = DtypeIcon;

  // src/mito/components/icons/ExportIcon.tsx
  init_react();
  var ExportIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "19", height: "19", viewBox: "0 0 14 17", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M9.58016 3.81644L6.50004 0.734863L3.41992 3.81644", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M12 9.10571L11.9883 11.3851C11.9839 12.3571 11.1934 13.1447 10.2213 13.1447H2.76697C1.79052 13.1432 1 12.3513 1 11.3748L1.00146 9.10571", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M6.5 9.56679V1.73181", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var ExportIcon_default = ExportIcon;

  // src/mito/components/icons/FileImportIcon.tsx
  init_react();
  var FileImportIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "21", height: "30", viewBox: "0 0 21 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M4.92871 6.57031H11.1747H13.0067L14.8687 8.2461L16.0716 9.57762V22.5703H4.92871V6.57031Z", fill: "var(--mito-highlight)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "11.9287", y1: "7.07031", x2: "11.9287", y2: "11.0703", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "11.4287", y1: "10.5703", x2: "16.4287", y2: "10.5703", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "7.42871", y1: "13.5703", x2: "13.4287", y2: "13.5703", stroke: "white" }), /* @__PURE__ */ react_default.createElement("line", { x1: "7.42871", y1: "16.5703", x2: "13.4287", y2: "16.5703", stroke: "white" }), /* @__PURE__ */ react_default.createElement("line", { x1: "7.42871", y1: "19.5703", x2: "13.4287", y2: "19.5703", stroke: "white" }));
  };
  var FileImportIcon_default = FileImportIcon;

  // src/mito/components/icons/FillNanIcon.tsx
  init_react();
  var FillNanIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "17", height: "24", viewBox: "0 3 17 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "0.624023", y: "7.32031", width: "15.5", height: "11.5", fill: "var(--mito-background-off)", stroke: "var(--mito-text-medium)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("path", { d: "M8.37793 10.3828V16.0703H7.62012L4.75684 11.6836V16.0703H4.00293V10.3828H4.75684L7.63184 14.7812V10.3828H8.37793ZM12.0967 15.3477V13.1719C12.0967 13.0052 12.0628 12.8607 11.9951 12.7383C11.93 12.6133 11.8311 12.5169 11.6982 12.4492C11.5654 12.3815 11.4014 12.3477 11.2061 12.3477C11.0238 12.3477 10.8636 12.3789 10.7256 12.4414C10.5902 12.5039 10.4834 12.5859 10.4053 12.6875C10.3298 12.7891 10.292 12.8984 10.292 13.0156H9.56934C9.56934 12.8646 9.6084 12.7148 9.68652 12.5664C9.76465 12.418 9.87663 12.2839 10.0225 12.1641C10.1709 12.0417 10.348 11.9453 10.5537 11.875C10.762 11.8021 10.9938 11.7656 11.249 11.7656C11.5563 11.7656 11.8271 11.8177 12.0615 11.9219C12.2985 12.026 12.4834 12.1836 12.6162 12.3945C12.7516 12.6029 12.8193 12.8646 12.8193 13.1797V15.1484C12.8193 15.2891 12.8311 15.4388 12.8545 15.5977C12.8805 15.7565 12.9183 15.8932 12.9678 16.0078V16.0703H12.2139C12.1774 15.987 12.1488 15.8763 12.1279 15.7383C12.1071 15.5977 12.0967 15.4674 12.0967 15.3477ZM12.2217 13.5078L12.2295 14.0156H11.499C11.2933 14.0156 11.1097 14.0326 10.9482 14.0664C10.7868 14.0977 10.6514 14.1458 10.542 14.2109C10.4326 14.276 10.3493 14.3581 10.292 14.457C10.2347 14.5534 10.2061 14.6667 10.2061 14.7969C10.2061 14.9297 10.236 15.0508 10.2959 15.1602C10.3558 15.2695 10.4456 15.3568 10.5654 15.4219C10.6878 15.4844 10.8376 15.5156 11.0146 15.5156C11.236 15.5156 11.4313 15.4688 11.6006 15.375C11.7699 15.2812 11.904 15.1667 12.0029 15.0312C12.1045 14.8958 12.1592 14.7643 12.167 14.6367L12.4756 14.9844C12.4574 15.0938 12.4079 15.2148 12.3271 15.3477C12.2464 15.4805 12.1383 15.6081 12.0029 15.7305C11.8701 15.8503 11.7113 15.9505 11.5264 16.0312C11.3441 16.1094 11.1383 16.1484 10.9092 16.1484C10.6227 16.1484 10.3714 16.0924 10.1553 15.9805C9.94173 15.8685 9.77507 15.7188 9.65527 15.5312C9.53809 15.3411 9.47949 15.1289 9.47949 14.8945C9.47949 14.668 9.52376 14.4688 9.6123 14.2969C9.70085 14.1224 9.82845 13.9779 9.99512 13.8633C10.1618 13.7461 10.3623 13.6576 10.5967 13.5977C10.8311 13.5378 11.0928 13.5078 11.3818 13.5078H12.2217Z", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M8.77788 9.19141L5.5 5.69141M8.77788 9.19141L12 5.69141M8.77788 9.19141V1.42578", stroke: "var(--mito-background-off)", strokeWidth: "2", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M8.77788 9.19141L5.5 5.69141M8.77788 9.19141L12 5.69141M8.77788 9.19141V1.42578", stroke: "var(--mito-highlight)", strokeLinecap: "round" }));
  };
  var FillNanIcon_default = FillNanIcon;

  // src/mito/components/icons/FinancialFunctionsIcon.tsx
  init_react();
  var FinancialFunctionsIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "19", viewBox: "0 0 15 19", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M2.89507 17.7007H2.80324C1.90512 17.7007 1.17432 17.0584 1.15105 16.2601C1.15045 16.243 1.15026 16.226 1.15048 16.2089C1.15852 15.5667 1.74002 14.9277 2.89507 14.7442H13.9594V17.7007H2.89507Z", fill: "var(--mito-background-off)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M13.6171 1.43988H2.804C1.8912 1.43988 1.15048 2.1034 1.15048 2.91982V16.2208C1.15048 17.0372 1.89044 17.7007 2.80324 17.7007H13.9594M13.9594 17.7007V1.07031M13.9594 17.7007V18.0703M13.9594 17.7007H2.89507C0.568944 17.3312 0.568717 15.1138 2.89507 14.7442H13.9594", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M7.76154 6.73409C6.10491 6.73409 3.66895 6.02017 3.66895 5.16001C3.66895 4.37297 6.10491 3.58594 7.76154 3.58594C9.41817 3.58594 11.8541 4.071 11.8541 5.16001C11.8541 5.94705 9.41817 6.73409 7.76154 6.73409Z", fill: "#AEDCAE", stroke: "#219653" }), /* @__PURE__ */ react_default.createElement("path", { d: "M3.66895 5.16016C3.66895 5.81585 3.66895 7.02298 3.66895 7.67867M11.8541 5.16016C11.8541 5.81585 11.8541 7.67867 11.8541 7.67867M3.66895 7.67867C3.66895 8.20337 3.66895 9.56756 3.66895 9.56756M3.66895 7.67867C3.66895 7.67867 6.07683 8.62312 7.76154 8.62312C9.44625 8.62312 11.8541 7.67867 11.8541 7.67867M11.8541 7.67867V9.56756M3.66895 9.56756C3.66895 10.1165 3.66895 10.3627 3.66895 10.7117C3.66895 11.1017 3.89561 11.4561 4.2589 11.5978C5.054 11.908 6.51381 12.4009 7.76154 12.4009C9.00927 12.4009 10.4691 11.908 11.2642 11.5978C11.6275 11.4561 11.8541 11.1018 11.8541 10.7119V9.56756M3.66895 9.56756C3.66895 9.56756 6.06089 10.512 7.76154 10.512C9.46219 10.512 11.8541 9.56756 11.8541 9.56756", stroke: "#219653" }));
  };
  var FinancialFunctionsIcon_default = FinancialFunctionsIcon;

  // src/mito/components/icons/FormatContextMenuIcon.tsx
  init_react();
  var FormatContextMenuIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "16", viewBox: "0 0 15 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M11.1978 12.6899C11.5594 12.0233 12.9616 9.02325 13.0072 9.02344C13.0528 9.02363 14.4965 12.0752 14.8124 12.6899C15.3832 13.8006 14.6147 15.0898 13.007 15.0208C11.4965 14.9559 10.5731 13.8416 11.1978 12.6899Z", fill: "var(--mito-highlight-medium)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M10.9999 7.32725L1.84496 7.32326L6.77206 12.4747L10.9999 7.32725Z", fill: "var(--mito-highlight-medium)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M4.90747 0.976562L6.19709 2.21284M6.19709 2.21284L10.9561 6.77499C11.3548 7.15718 11.3718 7.79364 10.994 8.19655L7.45454 11.9721C7.07681 12.375 6.44741 12.3918 6.04872 12.0096L2.0116 8.13947C1.61291 7.75728 1.59592 7.12083 1.97365 6.71791L6.19709 2.21284Z", stroke: "var(--mito-text)" }));
  };
  var FormatContextMenuIcon_default = FormatContextMenuIcon;

  // src/mito/components/icons/FormatIcon.tsx
  init_react();
  var FormatIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "27", height: "18", viewBox: "0 0 27 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "0.857544", y: "0.570312", width: "23", height: "14.3942", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "0.857544", y: "5.09766", width: "23", height: "5.33878", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "0.857544", y: "0.570312", width: "23", height: "14.3942", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "16.8575", y1: "0.976562", x2: "16.8575", y2: "14.5597", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "8.85754", y1: "0.976562", x2: "8.85754", y2: "14.5597", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "8.85754", y: "5.09766", width: "15", height: "9.86648", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "16.8575", y1: "5.50391", x2: "16.8575", y2: "14.5593", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "9.35754", y1: "10.4375", x2: "23.3575", y2: "10.4375", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M26.3576 6.54389C25.0735 5.33723 18.3577 12.4447 17.691 13.0485L19.3577 14.8665C21.691 12.1496 27.3397 7.46681 26.3576 6.54389Z", fill: "var(--mito-background-off)", stroke: "var(--mito-text-medium)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M16.0242 17.067C14.6908 17.0669 13.1575 16.5839 12.3575 15.8593C12.9131 15.658 14.0242 15.5573 14.6908 14.9535C15.3671 14.341 15.8758 13.0862 16.6908 12.8401C17.6908 12.5382 18.6908 13.142 19.0241 13.4439C19.3574 14.0478 19.3574 14.0478 19.3574 14.9535C19.0241 16.4631 17.6908 17.0669 16.0242 17.067Z", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)" }));
  };
  var FormatIcon_default = FormatIcon;

  // src/mito/components/icons/FunctionIcon.tsx
  init_react();
  var FunctionIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "22", height: "23", viewBox: "0 0 22 23", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M11.9414 6.74609L11.7305 7.51953H10.0195L8.73047 12.6406C8.16016 14.8984 7.58594 16.6445 7.00781 17.8789C6.1875 19.6211 5.30469 20.8242 4.35938 21.4883C3.64062 21.9961 2.92188 22.25 2.20312 22.25C1.73438 22.25 1.33594 22.1094 1.00781 21.8281C0.765625 21.6328 0.644531 21.3789 0.644531 21.0664C0.644531 20.8164 0.746094 20.5977 0.949219 20.4102C1.14453 20.2305 1.38672 20.1406 1.67578 20.1406C1.88672 20.1406 2.06641 20.207 2.21484 20.3398C2.35547 20.4727 2.42578 20.625 2.42578 20.7969C2.42578 20.9688 2.34375 21.1289 2.17969 21.2773C2.05469 21.3867 1.99219 21.4688 1.99219 21.5234C1.99219 21.5938 2.01953 21.6484 2.07422 21.6875C2.14453 21.7422 2.25391 21.7695 2.40234 21.7695C2.73828 21.7695 3.09375 21.6641 3.46875 21.4531C3.83594 21.2422 4.16406 20.9258 4.45312 20.5039C4.74219 20.0898 5.01562 19.4883 5.27344 18.6992C5.38281 18.3711 5.67578 17.2891 6.15234 15.4531L8.19141 7.51953H6.15234L6.31641 6.74609C6.96484 6.74609 7.41797 6.70312 7.67578 6.61719C7.93359 6.52344 8.16797 6.35156 8.37891 6.10156C8.59766 5.84375 8.87891 5.36719 9.22266 4.67188C9.68359 3.73438 10.125 3.00781 10.5469 2.49219C11.125 1.79688 11.7305 1.27734 12.3633 0.933594C13.0039 0.582031 13.6055 0.40625 14.168 0.40625C14.7617 0.40625 15.2383 0.558594 15.5977 0.863281C15.957 1.16016 16.1367 1.48438 16.1367 1.83594C16.1367 2.10937 16.0469 2.33984 15.8672 2.52734C15.6875 2.71484 15.457 2.80859 15.1758 2.80859C14.9336 2.80859 14.7344 2.73828 14.5781 2.59766C14.4297 2.45703 14.3555 2.28906 14.3555 2.09375C14.3555 1.96875 14.4062 1.81641 14.5078 1.63672C14.6094 1.44922 14.6602 1.32422 14.6602 1.26172C14.6602 1.15234 14.625 1.07031 14.5547 1.01562C14.4531 0.9375 14.3047 0.898438 14.1094 0.898438C13.6172 0.898438 13.1758 1.05469 12.7852 1.36719C12.2617 1.78125 11.793 2.42969 11.3789 3.3125C11.168 3.77344 10.7812 4.91797 10.2188 6.74609H11.9414ZM15.668 6.46484C16.0508 6.87109 16.3398 7.27734 16.5352 7.68359C16.6758 7.96484 16.9062 8.70312 17.2266 9.89844L18.2578 8.35156C18.5312 7.97656 18.8633 7.62109 19.2539 7.28516C19.6445 6.94141 19.9883 6.70703 20.2852 6.58203C20.4727 6.50391 20.6797 6.46484 20.9062 6.46484C21.2422 6.46484 21.5078 6.55469 21.7031 6.73438C21.9062 6.91406 22.0078 7.13281 22.0078 7.39062C22.0078 7.6875 21.9492 7.89062 21.832 8C21.6133 8.19531 21.3633 8.29297 21.082 8.29297C20.918 8.29297 20.7422 8.25781 20.5547 8.1875C20.1875 8.0625 19.9414 8 19.8164 8C19.6289 8 19.4062 8.10938 19.1484 8.32812C18.6641 8.73438 18.0859 9.51953 17.4141 10.6836L18.375 14.7148C18.5234 15.332 18.6484 15.7031 18.75 15.8281C18.8516 15.9453 18.9531 16.0039 19.0547 16.0039C19.2188 16.0039 19.4102 15.9141 19.6289 15.7344C20.0586 15.375 20.4258 14.9062 20.7305 14.3281L21.1406 14.5391C20.6484 15.4609 20.0234 16.2266 19.2656 16.8359C18.8359 17.1797 18.4727 17.3516 18.1758 17.3516C17.7383 17.3516 17.3906 17.1055 17.1328 16.6133C16.9688 16.3086 16.6289 14.9961 16.1133 12.6758C14.8945 14.793 13.918 16.1562 13.1836 16.7656C12.707 17.1562 12.2461 17.3516 11.8008 17.3516C11.4883 17.3516 11.2031 17.2383 10.9453 17.0117C10.7578 16.8398 10.6641 16.6094 10.6641 16.3203C10.6641 16.0625 10.75 15.8477 10.9219 15.6758C11.0938 15.5039 11.3047 15.418 11.5547 15.418C11.8047 15.418 12.0703 15.543 12.3516 15.793C12.5547 15.9727 12.7109 16.0625 12.8203 16.0625C12.9141 16.0625 13.0352 16 13.1836 15.875C13.5508 15.5781 14.0508 14.9375 14.6836 13.9531C15.3164 12.9688 15.7305 12.2578 15.9258 11.8203C15.4414 9.92188 15.1797 8.91797 15.1406 8.80859C14.9609 8.30078 14.7266 7.94141 14.4375 7.73047C14.1484 7.51953 13.7227 7.41406 13.1602 7.41406C12.9805 7.41406 12.7734 7.42188 12.5391 7.4375V7.01562L15.668 6.46484Z", fill: "var(--mito-text)" }));
  };
  var FunctionIcon_default = FunctionIcon;

  // src/mito/components/icons/GearIcon.tsx
  init_react();
  var GearIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "26", height: "30", viewBox: "0 0 26 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M15.5408 21.3096C14.1499 19.9219 11.9584 19.9479 10.5966 21.375C10.4387 21.3199 10.2833 21.2594 10.1306 21.1939C10.1852 19.1454 8.54119 17.5397 6.48627 17.6446L6.44681 17.6466C6.38934 17.5257 6.33514 17.4029 6.28432 17.2784L6.32091 17.2454C7.87568 15.8417 7.87084 13.4959 6.32091 12.0966L6.21371 11.9998C6.25311 11.8953 6.29486 11.792 6.33892 11.6898L6.48627 11.6974C8.5782 11.8042 10.2336 10.142 10.127 8.05658L10.1195 7.90923C10.2217 7.86518 10.325 7.82342 10.4295 7.78402L10.5263 7.89122C11.9299 9.44599 14.2758 9.44116 15.6751 7.89122L15.7081 7.85463C15.8326 7.90545 15.9554 7.95965 16.0763 8.01712L16.0743 8.05658L16.1677 8.06135C16.1677 8.06135 16.1677 8.06135 16.1677 8.06135L16.0743 8.05658C15.969 10.1178 17.5813 11.7552 19.6236 11.7009C19.6891 11.8536 19.7496 12.009 19.8047 12.1669C18.3734 13.5325 18.3557 15.724 19.7393 17.1111C19.6711 17.2908 19.596 17.4672 19.5142 17.6398C17.5849 17.6452 16.0751 19.1606 16.0695 21.0845C15.8968 21.1663 15.7205 21.2414 15.5408 21.3096ZM12.9789 19.6855C15.8156 19.6855 18.1152 17.3859 18.1152 14.5492C18.1152 11.7125 15.8156 9.41284 12.9789 9.41284C10.1421 9.41284 7.84253 11.7125 7.84253 14.5492C7.84253 17.3859 10.1421 19.6855 12.9789 19.6855Z", stroke: "var(--mito-highlight)", strokeWidth: "3" }));
  };
  var GearIcon_default = GearIcon;

  // src/mito/components/icons/ImportIcon.tsx
  init_react();
  var ImportIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "20", height: "20", viewBox: "0 1 14 17", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M3.58008 6.88696L6.87312 10.1738L10.16 6.88696", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M12.7458 9.68372L12.7334 12.1209C12.7272 13.1628 11.8838 14 10.8482 14H2.88532C1.84345 14 0.993832 13.1566 1.00003 12.1085V9.68372", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M6.87305 0.741211V9.11335", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var ImportIcon_default = ImportIcon;

  // src/mito/components/icons/LessIcon.tsx
  init_react();
  var LessIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "25", height: "25", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M7.82461 10.1703L9.87158 12.3703L7.82461 14.5703M4.00492 12.3703H6.60714H9.20937", stroke: "var(--mito-highlight)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("rect", { x: "11.02", y: "10.3164", width: "2.18333", height: "4.38333", rx: "1.09167", stroke: "var(--mito-text)", strokeWidth: "0.75" }), /* @__PURE__ */ react_default.createElement("rect", { x: "11.0181", y: "4.44531", width: "2.18333", height: "4.38333", rx: "1.09167", stroke: "var(--mito-text)", strokeWidth: "0.75" }), /* @__PURE__ */ react_default.createElement("rect", { x: "7.35144", y: "4.44531", width: "2.18333", height: "4.38333", rx: "1.09167", stroke: "var(--mito-text)", strokeWidth: "0.75" }), /* @__PURE__ */ react_default.createElement("rect", { x: "9.87158", y: "14.3398", width: "0.733333", height: "0.733333", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "5.50977", y: "8.46875", width: "0.733333", height: "0.733333", fill: "var(--mito-text)" }));
  };
  var LessIcon_default = LessIcon;

  // src/mito/components/icons/LogicalFunctionsIcon.tsx
  init_react();
  var LogicalFunctionsIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "19", height: "23", viewBox: "0 0 15 19", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M2.89507 17.7007H2.80324C1.90512 17.7007 1.17432 17.0584 1.15105 16.2601C1.15045 16.243 1.15026 16.226 1.15048 16.2089C1.15852 15.5667 1.74002 14.9277 2.89507 14.7442H13.9594V17.7007H2.89507Z", fill: "var(--mito-background-off)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M13.6171 1.43988H2.804C1.8912 1.43988 1.15048 2.1034 1.15048 2.91982V16.2208C1.15048 17.0372 1.89044 17.7007 2.80324 17.7007H13.9594M13.9594 17.7007V1.07031M13.9594 17.7007V18.0703M13.9594 17.7007H2.89507C0.568944 17.3312 0.568717 15.1138 2.89507 14.7442H13.9594", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M7.76168 10.5162C7.76168 10.5162 7.76168 10.5673 7.76168 9.57178C7.76168 8.16106 10.2802 7.68244 10.2802 6.1851C10.2802 4.5356 9.65057 3.58854 7.76168 3.58984C6.04121 3.59104 5.24316 4.84911 5.24316 6.1851M7.76168 12.4051V12.7199", stroke: "#9D6CFF", strokeWidth: "1.5", strokeLinecap: "square" }));
  };
  var LogicalFunctionsIcon_default = LogicalFunctionsIcon;

  // src/mito/components/icons/MathFunctionsIcon.tsx
  init_react();
  var MathFunctionsIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "19", height: "23", viewBox: "0 0 14 19", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M2.39507 17.7007H2.30324C1.40512 17.7007 0.674319 17.0584 0.651047 16.2601C0.650452 16.243 0.650262 16.226 0.650475 16.2089C0.658518 15.5667 1.24002 14.9277 2.39507 14.7442H13.4594V17.7007H2.39507Z", fill: "var(--mito-background-off)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M13.1171 1.43988H2.304C1.3912 1.43988 0.650475 2.1034 0.650475 2.91982V16.2208C0.650475 17.0372 1.39044 17.7007 2.30324 17.7007H13.4594M13.4594 17.7007V1.07031M13.4594 17.7007V18.0703M13.4594 17.7007H2.39507C0.0689437 17.3312 0.0687175 15.1138 2.39507 14.7442H13.4594", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M9.59464 8.31207C9.59464 10.1561 9.24745 11.1989 8.78295 11.7765C8.33948 12.3279 7.72267 12.5343 6.94649 12.5343C6.20934 12.5343 5.57967 12.2745 5.11812 11.6688C4.64086 11.0424 4.29834 9.98677 4.29834 8.31207C4.29834 6.63736 4.64086 5.58174 5.11812 4.95538C5.57967 4.34963 6.20934 4.08984 6.94649 4.08984C7.72267 4.08984 8.33948 4.29628 8.78295 4.84765C9.24745 5.42519 9.59464 6.46808 9.59464 8.31207Z", stroke: "#50A85B" }), /* @__PURE__ */ react_default.createElement("path", { d: "M4.11328 8.3125H9.77995", stroke: "#50A85B" }));
  };
  var MathFunctionsIcon_default = MathFunctionsIcon;

  // src/mito/components/icons/MergeIcon.tsx
  init_react();
  var MergeIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "26", height: "17", viewBox: "0 0 26 17", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("circle", { cx: "8.5", cy: "8.5", r: "8", transform: "matrix(-1 0 0 1 25.2068 0)", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("circle", { cx: "8.5", cy: "8.5", r: "8", transform: "matrix(-1 0 0 1 17 0)", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("mask", { id: "mask0_7507_327", style: { maskType: "alpha" }, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "17", height: "17" }, /* @__PURE__ */ react_default.createElement("circle", { cx: "8.5", cy: "8.5", r: "8", transform: "matrix(-1 0 0 1 17 0)", fill: "var(--mito-highlight)", stroke: "var(--mito-text)" })), /* @__PURE__ */ react_default.createElement("g", { mask: "url(#mask0_7507_327)" }, /* @__PURE__ */ react_default.createElement("circle", { cx: "8.5", cy: "8.5", r: "8", transform: "matrix(-1 0 0 1 25.2068 0)", fill: "var(--mito-highlight)", stroke: "var(--mito-text)" })), /* @__PURE__ */ react_default.createElement("circle", { cx: "8.5", cy: "8.5", r: "8", transform: "matrix(-1 0 0 1 17 0)", stroke: "var(--mito-text)" }));
  };
  var MergeIcon_default = MergeIcon;

  // src/mito/components/icons/MoreFunctionsIcon.tsx
  init_react();
  var MoreFunctionsIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "19", height: "23", viewBox: "0 0 15 19", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M2.54546 17.7007H2.45363C1.55551 17.7007 0.82471 17.0584 0.801438 16.2601C0.800843 16.243 0.800652 16.226 0.800866 16.2089C0.808909 15.5667 1.39041 14.9277 2.54546 14.7442H13.6098V17.7007H2.54546Z", fill: "var(--mito-background-off)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M13.2675 1.43988H2.45439C1.54159 1.43988 0.800866 2.1034 0.800866 2.91982V16.2208C0.800866 17.0372 1.54083 17.7007 2.45363 17.7007H13.6098M13.6098 17.7007V1.07031M13.6098 17.7007V18.0703M13.6098 17.7007H2.54546C0.219334 17.3312 0.219108 15.1138 2.54546 14.7442H13.6098", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("circle", { cx: "4.26378", cy: "8.31163", r: "0.944444", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("circle", { cx: "7.41173", cy: "8.31163", r: "0.944444", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("circle", { cx: "10.5602", cy: "8.31163", r: "0.944444", fill: "var(--mito-highlight)" }));
  };
  var MoreFunctionsIcon_default = MoreFunctionsIcon;

  // src/mito/components/icons/MoreIcon.tsx
  init_react();
  var MoreIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "25", height: "25", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M6.78513 5.17031L4.73816 7.37031L6.78513 9.57031M10.6048 7.37027H8.0026H5.40037", stroke: "var(--mito-highlight)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("rect", { x: "12.4465", y: "4.44531", width: "2.18333", height: "4.38333", rx: "1.09167", stroke: "var(--mito-text)", strokeWidth: "0.75" }), /* @__PURE__ */ react_default.createElement("rect", { x: "12.4465", y: "10.3125", width: "2.18333", height: "4.38333", rx: "1.09167", stroke: "var(--mito-text)", strokeWidth: "0.75" }), /* @__PURE__ */ react_default.createElement("rect", { x: "8.77979", y: "10.3125", width: "2.18333", height: "4.38333", rx: "1.09167", stroke: "var(--mito-text)", strokeWidth: "0.75" }), /* @__PURE__ */ react_default.createElement("rect", { x: "10.6049", y: "8.46875", width: "0.733333", height: "0.733333", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "6.93811", y: "14.3359", width: "0.733333", height: "0.733333", fill: "var(--mito-text)" }));
  };
  var MoreIcon_default = MoreIcon;

  // src/mito/components/icons/NumberFormatIcon.tsx
  init_react();
  var NumberFormatIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "18", height: "9", viewBox: "0 0 18 9", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M3.13428 0.136719V8H2.14062V1.37744L0.137207 2.10791V1.21094L2.97852 0.136719H3.13428ZM11.1802 7.18359V8H6.06152V7.28564L8.62354 4.43359C8.93864 4.08268 9.18213 3.78548 9.354 3.54199C9.52946 3.29492 9.6512 3.07471 9.71924 2.88135C9.79085 2.68441 9.82666 2.48389 9.82666 2.27979C9.82666 2.02197 9.77295 1.78923 9.66553 1.58154C9.56169 1.37028 9.40771 1.20199 9.20361 1.07666C8.99951 0.951335 8.75244 0.888672 8.4624 0.888672C8.11507 0.888672 7.82503 0.956706 7.59229 1.09277C7.36312 1.22526 7.19124 1.41146 7.07666 1.65137C6.96208 1.89128 6.90479 2.16699 6.90479 2.47852H5.91113C5.91113 2.03809 6.00781 1.63525 6.20117 1.27002C6.39453 0.904785 6.68099 0.614746 7.06055 0.399902C7.4401 0.181478 7.90739 0.0722656 8.4624 0.0722656C8.95654 0.0722656 9.37907 0.159993 9.72998 0.335449C10.0809 0.507324 10.3494 0.750814 10.5356 1.06592C10.7254 1.37744 10.8203 1.74268 10.8203 2.16162C10.8203 2.39079 10.7809 2.62354 10.7021 2.85986C10.627 3.09261 10.5213 3.32536 10.3853 3.55811C10.2528 3.79085 10.097 4.02002 9.91797 4.24561C9.74251 4.47119 9.55452 4.6932 9.354 4.91162L7.25928 7.18359H11.1802ZM13.6938 3.60107H14.4028C14.7502 3.60107 15.0366 3.54378 15.2622 3.4292C15.4914 3.31104 15.6615 3.15169 15.7725 2.95117C15.887 2.74707 15.9443 2.5179 15.9443 2.26367C15.9443 1.96289 15.8942 1.71045 15.7939 1.50635C15.6937 1.30225 15.5433 1.14827 15.3428 1.04443C15.1423 0.940592 14.888 0.888672 14.5801 0.888672C14.3008 0.888672 14.0537 0.944173 13.8389 1.05518C13.6276 1.1626 13.4611 1.31657 13.3394 1.51709C13.2212 1.71761 13.1621 1.95394 13.1621 2.22607H12.1685C12.1685 1.82861 12.2687 1.46696 12.4692 1.14111C12.6698 0.815267 12.9508 0.555664 13.3125 0.362305C13.6777 0.168945 14.1003 0.0722656 14.5801 0.0722656C15.0527 0.0722656 15.4663 0.156413 15.8208 0.324707C16.1753 0.489421 16.451 0.736491 16.6479 1.06592C16.8449 1.39176 16.9434 1.79818 16.9434 2.28516C16.9434 2.4821 16.8968 2.69336 16.8037 2.91895C16.7142 3.14095 16.5728 3.34863 16.3794 3.54199C16.1896 3.73535 15.9425 3.89469 15.6382 4.02002C15.3338 4.14176 14.9686 4.20264 14.5425 4.20264H13.6938V3.60107ZM13.6938 4.41748V3.82129H14.5425C15.0402 3.82129 15.452 3.88037 15.7778 3.99854C16.1037 4.1167 16.3597 4.27425 16.5459 4.47119C16.7357 4.66813 16.8682 4.88477 16.9434 5.12109C17.0221 5.35384 17.0615 5.58659 17.0615 5.81934C17.0615 6.18457 16.9989 6.50863 16.8735 6.7915C16.7518 7.07438 16.5781 7.31429 16.3525 7.51123C16.1305 7.70817 15.8691 7.85677 15.5684 7.95703C15.2676 8.05729 14.9399 8.10742 14.5854 8.10742C14.2453 8.10742 13.9248 8.05908 13.624 7.9624C13.3268 7.86572 13.0636 7.72607 12.8345 7.54346C12.6053 7.35726 12.4263 7.12988 12.2974 6.86133C12.1685 6.58919 12.104 6.27946 12.104 5.93213H13.0977C13.0977 6.20426 13.1567 6.44238 13.2749 6.64648C13.3966 6.85059 13.5685 7.00993 13.7905 7.12451C14.0161 7.23551 14.2811 7.29102 14.5854 7.29102C14.8898 7.29102 15.1512 7.2391 15.3696 7.13525C15.5916 7.02783 15.7617 6.8667 15.8799 6.65186C16.0016 6.43701 16.0625 6.16667 16.0625 5.84082C16.0625 5.51497 15.9945 5.24821 15.8584 5.04053C15.7223 4.82926 15.529 4.6735 15.2783 4.57324C15.0312 4.4694 14.7394 4.41748 14.4028 4.41748H13.6938Z", fill: "var(--mito-text-medium)" }));
  };
  var NumberFormatIcon_default = NumberFormatIcon;

  // src/mito/components/icons/OneHotEncodingIcon.tsx
  init_react();
  var OneHotEncodingIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "0.874023", y: "0.570312", width: "14", height: "14", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5.39648 3.0083V6.57031H4.69336V3.81885L3.84863 4.0874V3.5332L5.3208 3.0083H5.39648Z", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M6.0752 10.4805V11.0957C6.0752 11.3626 6.04671 11.5929 5.98975 11.7866C5.93278 11.9787 5.85059 12.1366 5.74316 12.2603C5.63737 12.3823 5.51123 12.4727 5.36475 12.5312C5.21826 12.5898 5.0555 12.6191 4.87646 12.6191C4.73324 12.6191 4.59977 12.6012 4.47607 12.5654C4.35238 12.528 4.24089 12.4702 4.1416 12.3921C4.04395 12.314 3.95931 12.2155 3.8877 12.0967C3.81771 11.9762 3.764 11.833 3.72656 11.667C3.68913 11.501 3.67041 11.3105 3.67041 11.0957V10.4805C3.67041 10.2135 3.69889 9.98486 3.75586 9.79443C3.81445 9.60238 3.89665 9.44531 4.00244 9.32324C4.10986 9.20117 4.23682 9.11165 4.3833 9.05469C4.52979 8.99609 4.69255 8.9668 4.87158 8.9668C5.01481 8.9668 5.14746 8.98551 5.26953 9.02295C5.39323 9.05876 5.50472 9.11491 5.604 9.19141C5.70329 9.2679 5.78792 9.36637 5.85791 9.48682C5.9279 9.60563 5.98161 9.74805 6.01904 9.91406C6.05648 10.0785 6.0752 10.2673 6.0752 10.4805ZM5.36963 11.1885V10.3853C5.36963 10.2567 5.3623 10.1444 5.34766 10.0483C5.33464 9.95231 5.31429 9.87093 5.28662 9.8042C5.25895 9.73584 5.22477 9.6805 5.18408 9.63818C5.14339 9.59587 5.09701 9.56494 5.04492 9.54541C4.99284 9.52588 4.93506 9.51611 4.87158 9.51611C4.79183 9.51611 4.72103 9.53158 4.65918 9.5625C4.59896 9.59342 4.54769 9.64307 4.50537 9.71143C4.46305 9.77816 4.4305 9.86768 4.40771 9.97998C4.38656 10.0907 4.37598 10.2257 4.37598 10.3853V11.1885C4.37598 11.3171 4.38249 11.4302 4.39551 11.5278C4.41016 11.6255 4.43132 11.7093 4.45898 11.7793C4.48828 11.8477 4.52246 11.9038 4.56152 11.9478C4.60221 11.9901 4.6486 12.021 4.70068 12.0405C4.75439 12.0601 4.81299 12.0698 4.87646 12.0698C4.95459 12.0698 5.02376 12.0544 5.08398 12.0234C5.14583 11.9909 5.19792 11.9404 5.24023 11.8721C5.28418 11.8021 5.31673 11.7109 5.33789 11.5986C5.35905 11.4863 5.36963 11.3496 5.36963 11.1885Z", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M12.0752 4.48047V5.0957C12.0752 5.36263 12.0467 5.59294 11.9897 5.78662C11.9328 5.97868 11.8506 6.13656 11.7432 6.26025C11.6374 6.38232 11.5112 6.47266 11.3647 6.53125C11.2183 6.58984 11.0555 6.61914 10.8765 6.61914C10.7332 6.61914 10.5998 6.60124 10.4761 6.56543C10.3524 6.52799 10.2409 6.47021 10.1416 6.39209C10.0439 6.31396 9.95931 6.21549 9.8877 6.09668C9.81771 5.97624 9.764 5.83301 9.72656 5.66699C9.68913 5.50098 9.67041 5.31055 9.67041 5.0957V4.48047C9.67041 4.21354 9.69889 3.98486 9.75586 3.79443C9.81445 3.60238 9.89665 3.44531 10.0024 3.32324C10.1099 3.20117 10.2368 3.11165 10.3833 3.05469C10.5298 2.99609 10.6925 2.9668 10.8716 2.9668C11.0148 2.9668 11.1475 2.98551 11.2695 3.02295C11.3932 3.05876 11.5047 3.11491 11.604 3.19141C11.7033 3.2679 11.7879 3.36637 11.8579 3.48682C11.9279 3.60563 11.9816 3.74805 12.019 3.91406C12.0565 4.07845 12.0752 4.26725 12.0752 4.48047ZM11.3696 5.18848V4.38525C11.3696 4.25667 11.3623 4.14437 11.3477 4.04834C11.3346 3.95231 11.3143 3.87093 11.2866 3.8042C11.259 3.73584 11.2248 3.6805 11.1841 3.63818C11.1434 3.59587 11.097 3.56494 11.0449 3.54541C10.9928 3.52588 10.9351 3.51611 10.8716 3.51611C10.7918 3.51611 10.721 3.53158 10.6592 3.5625C10.599 3.59342 10.5477 3.64307 10.5054 3.71143C10.4631 3.77816 10.4305 3.86768 10.4077 3.97998C10.3866 4.09066 10.376 4.22575 10.376 4.38525V5.18848C10.376 5.31706 10.3825 5.43018 10.3955 5.52783C10.4102 5.62549 10.4313 5.70931 10.459 5.7793C10.4883 5.84766 10.5225 5.90381 10.5615 5.94775C10.6022 5.99007 10.6486 6.021 10.7007 6.04053C10.7544 6.06006 10.813 6.06982 10.8765 6.06982C10.9546 6.06982 11.0238 6.05436 11.084 6.02344C11.1458 5.99089 11.1979 5.94043 11.2402 5.87207C11.2842 5.80208 11.3167 5.71094 11.3379 5.59863C11.359 5.48633 11.3696 5.34961 11.3696 5.18848Z", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M11.3965 9.0083V12.5703H10.6934V9.81885L9.84863 10.0874V9.5332L11.3208 9.0083H11.3965Z", fill: "var(--mito-text)" }));
  };
  var OneHotEncodingIcon_default = OneHotEncodingIcon;

  // src/mito/components/icons/PercentIcon.tsx
  init_react();
  var PercentIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "21", height: "20", viewBox: "0 0 21 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M13.4048 4.59375L7.11902 14.5461", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M9.23817 6.68936C9.23817 7.85967 8.28943 8.80841 7.11908 8.80841C5.94874 8.80841 5 7.85967 5 6.68936C5 5.51905 5.94874 4.57031 7.11908 4.57031C8.28943 4.57031 9.23817 5.51905 9.23817 6.68936Z", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M15.7382 12.4511C15.7382 13.6214 14.7894 14.5701 13.6191 14.5701C12.4487 14.5701 11.5 13.6214 11.5 12.4511C11.5 11.2808 12.4487 10.332 13.6191 10.332C14.7894 10.332 15.7382 11.2808 15.7382 12.4511Z", stroke: "var(--mito-text)" }));
  };
  var PercentIcon_default = PercentIcon;

  // src/mito/components/icons/PivotIcon.tsx
  init_react();
  var PivotIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "1.43689", y: "0.570312", width: "16", height: "16", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "3.18689", y: "2.32031", width: "2.5", height: "2.5", fill: "var(--mito-text-medium)", stroke: "var(--mito-text)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("rect", { x: "7.18689", y: "2.32031", width: "8.5", height: "2.5", fill: "var(--mito-text-medium)", stroke: "var(--mito-text)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("rect", { x: "3.18689", y: "6.32031", width: "2.5", height: "8.5", fill: "var(--mito-text-medium)", stroke: "var(--mito-text)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("path", { d: "M13.5526 7.07031V12.4957H8.17548M13.5526 7.07031L11.8801 8.75347M13.5526 7.07031L15.1752 8.75347M8.17548 12.4957L9.72413 14.0703M8.17548 12.4957L9.72413 11.0586", stroke: "var(--mito-highlight)", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var PivotIcon_default = PivotIcon;

  // src/mito/components/icons/PromoteToHeaderIcon.tsx
  init_react();
  var PromoteToHeaderIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "6", height: "12", viewBox: "0 0 6 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M3 0.125L0.113249 5.125H5.88675L3 0.125ZM3.5 11.875L3.5 4.625H2.5L2.5 11.875H3.5Z", fill: "var(--mito-text)" }));
  };
  var PromoteToHeaderIcon_default = PromoteToHeaderIcon;

  // src/mito/components/icons/RedoIcon.tsx
  init_react();
  var RedoIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M12.9298 6.07072C9.42981 2.57031 5.42981 -1.92969 1.92981 2.57072C0.277991 4.69468 0.92981 7.07031 2.50766 8.57031L7.92981 13.0703M12.9298 6.07072V0.0703125M12.9298 6.07072L7.42981 6.07031", stroke: "var(--mito-text)", strokeMiterlimit: 10, strokeLinecap: "round" }));
  };
  var RedoIcon_default = RedoIcon;

  // src/mito/components/icons/ReferenceFunctionsIcons.tsx
  init_react();
  var LookupFunctionsIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "19", height: "23", viewBox: "0 0 15 19", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M2.89507 17.7007H2.80324C1.90512 17.7007 1.17432 17.0584 1.15105 16.2601C1.15045 16.243 1.15026 16.226 1.15048 16.2089C1.15852 15.5667 1.74002 14.9277 2.89507 14.7442H13.9594V17.7007H2.89507Z", fill: "var(--mito-background-off)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M13.6171 1.43988H2.804C1.8912 1.43988 1.15048 2.1034 1.15048 2.91982V16.2208C1.15048 17.0372 1.89044 17.7007 2.80324 17.7007H13.9594M13.9594 17.7007V1.07031M13.9594 17.7007V18.0703M13.9594 17.7007H2.89507C0.568944 17.3312 0.568717 15.1138 2.89507 14.7442H13.9594", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M8.06512 8.5552L11.8541 12.4039M8.78469 6.77662C8.78469 8.18929 7.63949 9.33449 6.22682 9.33449C4.81414 9.33449 3.66895 8.18929 3.66895 6.77662C3.66895 5.36395 4.81414 4.21875 6.22682 4.21875C7.63949 4.21875 8.78469 5.36395 8.78469 6.77662Z", stroke: "#4389C7" }));
  };
  var ReferenceFunctionsIcons_default = LookupFunctionsIcon;

  // src/mito/components/icons/RemoveDuplicatesIcon.tsx
  init_react();
  var RemoveDuplicatesIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "23", height: "30", viewBox: "4 3 14 23", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "4.64795", y: "6.57031", width: "10.8323", height: "4.7001", fill: "var(--mito-highlight)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "4.64795", y: "11.5586", width: "10.8323", height: "4.7001", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "4.64795", y: "16.543", width: "10.8323", height: "4.7001", fill: "var(--mito-highlight)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { width: "2.40529", height: "10.4229", rx: "1", transform: "matrix(0.707114 0.707099 -0.707114 0.707099 16.2222 13.3242)", fill: "var(--mito-background-off)" }), /* @__PURE__ */ react_default.createElement("rect", { width: "2.40529", height: "10.4229", rx: "1", transform: "matrix(0.707114 -0.707099 0.707114 0.707099 8.85254 15.0234)", fill: "var(--mito-background-off)" }), /* @__PURE__ */ react_default.createElement("rect", { width: "0.801763", height: "8.8194", transform: "matrix(0.707114 -0.707099 0.707114 0.707099 9.98633 15.0234)", fill: "var(--mito-status-error)" }), /* @__PURE__ */ react_default.createElement("rect", { width: "0.801764", height: "8.8194", transform: "matrix(0.707114 0.707099 -0.707114 0.707099 16.2236 14.457)", fill: "var(--mito-status-error)" }));
  };
  var RemoveDuplicatesIcon_default = RemoveDuplicatesIcon;

  // src/mito/components/icons/ResetAndDropIndexIcon.tsx
  init_react();
  var ResetAndDropIndexIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "14", height: "12", viewBox: "0 0 14 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M11.8399 4.62305C11.5364 3.33587 10.8161 2.18503 9.79107 1.34943C8.76603 0.513835 7.49364 0.0403044 6.17171 0.0024587C4.84977 -0.035387 3.55238 0.364572 2.48121 1.14016C1.41004 1.91574 0.625121 3.02349 0.24848 4.2912C-0.128161 5.5589 -0.0754206 6.91553 0.398501 8.15016C0.872423 9.3848 1.74097 10.4283 2.86912 11.1184C3.99727 11.8084 5.3218 12.1065 6.6368 11.9661C7.95181 11.8258 9.1836 11.2549 10.1407 10.3422L9.26881 9.42792C8.51326 10.1484 7.54083 10.5991 6.50272 10.7099C5.4646 10.8207 4.41896 10.5854 3.52836 10.0406C2.63775 9.49586 1.95209 8.6721 1.57795 7.69743C1.20382 6.72275 1.16219 5.65178 1.45952 4.651C1.75686 3.65023 2.3765 2.77572 3.22213 2.16345C4.06775 1.55117 5.09197 1.23543 6.13555 1.2653C7.17914 1.29518 8.18361 1.669 8.99282 2.32866C9.80203 2.98831 10.3706 3.89683 10.6102 4.91298L11.8399 4.62305Z", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M12.2851 8.51789L8.77386 4.87216L13.2138 3.54214L12.2851 8.51789Z", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M4 4L8 8M4 8L8 4", stroke: "var(--mito-text)", strokeLinecap: "round" }));
  };
  var ResetAndDropIndexIcon_default = ResetAndDropIndexIcon;

  // src/mito/components/icons/ResetIcon.tsx
  init_react();
  var ResetIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "23", height: "22", viewBox: "0 0 23 29", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M10.748 4.73047H16.748H22.748V28.1395H16.748H10.748V5.14062V4.73047Z", fill: "var(--mito-background)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M14.374 13.0703H22.374M14.374 21.0703H22.374", stroke: "#ACACAD", strokeOpacity: "0.76", strokeWidth: "0.5", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("rect", { x: "6.11816", y: "28.0625", width: "23", height: "16", transform: "rotate(-90 6.11816 28.0625)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5.37402 5.07031H13.374V28.0703H5.37402V5.07031Z", fill: "var(--mito-background-highlight)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "6.11816", y: "28.0625", width: "23", height: "16", transform: "rotate(-90 6.11816 28.0625)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M6.11816 28.0625L6.11816 5.0625L22.248 5.0625L22.248 16.6406L22.248 28.0625L6.11816 28.0625Z", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M10.2102 7.85352V11.0703H9.80371V8.36108L8.98413 8.65991V8.29297L10.1465 7.85352H10.2102ZM10.9705 17.7363V18.0703H8.87646V17.7781L9.92456 16.6113C10.0535 16.4678 10.1531 16.3462 10.2234 16.2466C10.2952 16.1455 10.345 16.0554 10.3728 15.9763C10.4021 15.8958 10.4167 15.8137 10.4167 15.7302C10.4167 15.6248 10.3948 15.5295 10.3508 15.4446C10.3083 15.3582 10.2454 15.2893 10.1619 15.238C10.0784 15.1868 9.97729 15.1611 9.85864 15.1611C9.71655 15.1611 9.5979 15.189 9.50269 15.2446C9.40894 15.2988 9.33862 15.375 9.29175 15.4731C9.24487 15.5713 9.22144 15.6841 9.22144 15.8115H8.81494C8.81494 15.6313 8.85449 15.4666 8.93359 15.3171C9.0127 15.1677 9.12988 15.0491 9.28516 14.9612C9.44043 14.8718 9.63159 14.8271 9.85864 14.8271C10.0608 14.8271 10.2336 14.863 10.3772 14.9348C10.5208 15.0051 10.6306 15.1047 10.7068 15.2336C10.7844 15.3611 10.8232 15.5105 10.8232 15.6819C10.8232 15.7756 10.8071 15.8708 10.7749 15.9675C10.7441 16.0627 10.7009 16.158 10.6453 16.2532C10.5911 16.3484 10.5273 16.4421 10.4541 16.5344C10.3823 16.6267 10.3054 16.7175 10.2234 16.8069L9.36646 17.7363H10.9705ZM9.46753 23.2708H9.75757C9.89966 23.2708 10.0168 23.2473 10.1091 23.2004C10.2029 23.1521 10.2725 23.0869 10.3179 23.0049C10.3647 22.9214 10.3882 22.8276 10.3882 22.7236C10.3882 22.6006 10.3677 22.4973 10.3267 22.4138C10.2856 22.3303 10.2241 22.2673 10.1421 22.2249C10.0601 22.1824 9.95605 22.1611 9.83008 22.1611C9.71582 22.1611 9.61475 22.1838 9.52686 22.2292C9.44043 22.2732 9.37231 22.3362 9.32251 22.4182C9.27417 22.5002 9.25 22.5969 9.25 22.7083H8.84351C8.84351 22.5457 8.88452 22.3977 8.96655 22.2644C9.04858 22.1311 9.16357 22.0249 9.31152 21.9458C9.46094 21.8667 9.63379 21.8271 9.83008 21.8271C10.0234 21.8271 10.1926 21.8616 10.3376 21.9304C10.4827 21.9978 10.5955 22.0989 10.676 22.2336C10.7566 22.3669 10.7969 22.5332 10.7969 22.7324C10.7969 22.813 10.7778 22.8994 10.7397 22.9917C10.7031 23.0825 10.6453 23.1675 10.5662 23.2466C10.4885 23.3257 10.3875 23.3909 10.2629 23.4421C10.1384 23.4919 9.98901 23.5168 9.8147 23.5168H9.46753V23.2708ZM9.46753 23.6047V23.3608H9.8147C10.0183 23.3608 10.1868 23.385 10.3201 23.4333C10.4534 23.4817 10.5581 23.5461 10.6343 23.6267C10.7119 23.7073 10.7661 23.7959 10.7969 23.8926C10.8291 23.9878 10.8452 24.083 10.8452 24.1782C10.8452 24.3276 10.8196 24.4602 10.7683 24.5759C10.7185 24.6917 10.6475 24.7898 10.5552 24.8704C10.4644 24.9509 10.3574 25.0117 10.2344 25.0527C10.1113 25.0938 9.97729 25.1143 9.83228 25.1143C9.69312 25.1143 9.56201 25.0945 9.43896 25.0549C9.31738 25.0154 9.20972 24.9583 9.11597 24.8835C9.02222 24.8074 8.94897 24.7144 8.89624 24.6045C8.84351 24.4932 8.81714 24.3665 8.81714 24.2244H9.22363C9.22363 24.3357 9.2478 24.4331 9.29614 24.5166C9.34595 24.6001 9.41626 24.6653 9.50708 24.7122C9.59937 24.7576 9.70776 24.7803 9.83228 24.7803C9.95679 24.7803 10.0637 24.759 10.1531 24.7166C10.2439 24.6726 10.3135 24.6067 10.3618 24.5188C10.4116 24.4309 10.4365 24.3203 10.4365 24.187C10.4365 24.0537 10.4087 23.9446 10.353 23.8596C10.2974 23.7732 10.2183 23.7095 10.1157 23.6685C10.0146 23.626 9.89526 23.6047 9.75757 23.6047H9.46753Z", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M13.874 5.14062V27.6406", stroke: "var(--mito-text)", strokeWidth: "0.75", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M10.0401 5.71109L13 7.99806L14 4.5", stroke: "var(--mito-background)", strokeWidth: "3", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("mask", { id: "path-10-outside-1_7505_367", maskUnits: "userSpaceOnUse", x: "0.374023", y: "0.0703125", width: "15", height: "15", fill: "var(--mito-text)" }, /* @__PURE__ */ react_default.createElement("rect", { fill: "var(--mito-background-off)", x: "0.374023", y: "0.0703125", width: "15", height: "15" }), /* @__PURE__ */ react_default.createElement("path", { d: "M13.7831 7.57031C13.7831 6.0665 13.2854 4.60922 12.3747 3.44676C11.4641 2.2843 10.1969 1.48859 8.78902 1.19521C7.38114 0.90183 5.91972 1.12893 4.65377 1.83782C3.38781 2.54671 2.39564 3.69353 1.84632 5.08287C1.29699 6.47221 1.2245 8.01811 1.64119 9.45716C2.05788 10.8962 2.93797 12.1394 4.13151 12.9749C5.32504 13.8103 6.75818 14.1864 8.18672 14.039C9.61526 13.8916 10.9508 13.2299 11.9658 12.1665L10.4716 10.6011C9.80228 11.3023 8.92159 11.7387 7.97959 11.8359C7.03759 11.9331 6.09256 11.6851 5.30553 11.1341C4.5185 10.5832 3.93815 9.76346 3.66338 8.81453C3.38861 7.86559 3.43641 6.84621 3.79865 5.93006C4.16088 5.01391 4.81513 4.25769 5.64992 3.79023C6.48471 3.32278 7.44838 3.17303 8.37675 3.36648C9.30512 3.55994 10.1407 4.08464 10.7412 4.85119C11.3417 5.61773 11.6699 6.57868 11.6699 7.57031H13.7831Z" })), /* @__PURE__ */ react_default.createElement("path", { d: "M13.7831 7.57031C13.7831 6.0665 13.2854 4.60922 12.3747 3.44676C11.4641 2.2843 10.1969 1.48859 8.78902 1.19521C7.38114 0.90183 5.91972 1.12893 4.65377 1.83782C3.38781 2.54671 2.39564 3.69353 1.84632 5.08287C1.29699 6.47221 1.2245 8.01811 1.64119 9.45716C2.05788 10.8962 2.93797 12.1394 4.13151 12.9749C5.32504 13.8103 6.75818 14.1864 8.18672 14.039C9.61526 13.8916 10.9508 13.2299 11.9658 12.1665L10.4716 10.6011C9.80228 11.3023 8.92159 11.7387 7.97959 11.8359C7.03759 11.9331 6.09256 11.6851 5.30553 11.1341C4.5185 10.5832 3.93815 9.76346 3.66338 8.81453C3.38861 7.86559 3.43641 6.84621 3.79865 5.93006C4.16088 5.01391 4.81513 4.25769 5.64992 3.79023C6.48471 3.32278 7.44838 3.17303 8.37675 3.36648C9.30512 3.55994 10.1407 4.08464 10.7412 4.85119C11.3417 5.61773 11.6699 6.57868 11.6699 7.57031H13.7831Z", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M13.7831 7.57031C13.7831 6.0665 13.2854 4.60922 12.3747 3.44676C11.4641 2.2843 10.1969 1.48859 8.78902 1.19521C7.38114 0.90183 5.91972 1.12893 4.65377 1.83782C3.38781 2.54671 2.39564 3.69353 1.84632 5.08287C1.29699 6.47221 1.2245 8.01811 1.64119 9.45716C2.05788 10.8962 2.93797 12.1394 4.13151 12.9749C5.32504 13.8103 6.75818 14.1864 8.18672 14.039C9.61526 13.8916 10.9508 13.2299 11.9658 12.1665L10.4716 10.6011C9.80228 11.3023 8.92159 11.7387 7.97959 11.8359C7.03759 11.9331 6.09256 11.6851 5.30553 11.1341C4.5185 10.5832 3.93815 9.76346 3.66338 8.81453C3.38861 7.86559 3.43641 6.84621 3.79865 5.93006C4.16088 5.01391 4.81513 4.25769 5.64992 3.79023C6.48471 3.32278 7.44838 3.17303 8.37675 3.36648C9.30512 3.55994 10.1407 4.08464 10.7412 4.85119C11.3417 5.61773 11.6699 6.57868 11.6699 7.57031H13.7831Z", stroke: "var(--mito-background)", strokeWidth: "2", strokeLinejoin: "round", mask: "url(#path-10-outside-1_7505_367)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M10.0401 5.71109L13 7.99806L14 4.5", stroke: "var(--mito-highlight-medium)", strokeWidth: "1.5", strokeLinecap: "round" }));
  };
  var ResetIcon_default = ResetIcon;

  // src/mito/components/icons/ResetIndexIcon.tsx
  init_react();
  var ResetIndexIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "14", height: "12", viewBox: "0 0 14 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M11.8399 4.62305C11.5364 3.33587 10.8161 2.18503 9.79107 1.34943C8.76603 0.513835 7.49364 0.0403044 6.17171 0.0024587C4.84977 -0.035387 3.55238 0.364572 2.48121 1.14016C1.41004 1.91574 0.625121 3.02349 0.24848 4.2912C-0.128161 5.5589 -0.0754206 6.91553 0.398501 8.15016C0.872423 9.3848 1.74097 10.4283 2.86912 11.1184C3.99727 11.8084 5.3218 12.1065 6.6368 11.9661C7.95181 11.8258 9.1836 11.2549 10.1407 10.3422L9.26881 9.42792C8.51326 10.1484 7.54083 10.5991 6.50272 10.7099C5.4646 10.8207 4.41896 10.5854 3.52836 10.0406C2.63775 9.49586 1.95209 8.6721 1.57795 7.69743C1.20382 6.72275 1.16219 5.65178 1.45952 4.651C1.75686 3.65023 2.3765 2.77572 3.22213 2.16345C4.06775 1.55117 5.09197 1.23543 6.13555 1.2653C7.17914 1.29518 8.18361 1.669 8.99282 2.32866C9.80203 2.98831 10.3706 3.89683 10.6102 4.91298L11.8399 4.62305Z", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M12.2851 8.51789L8.77386 4.87216L13.2138 3.54214L12.2851 8.51789Z", fill: "var(--mito-text)" }));
  };
  var ResetIndexIcon_default = ResetIndexIcon;

  // src/mito/components/icons/ScheduleIcon.tsx
  init_react();
  var ScheduleIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("circle", { cx: "8", cy: "8", r: "7.5", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "8", y1: "8.875", x2: "12", y2: "8.875", stroke: "var(--mito-highlight)", strokeWidth: "1.25" }), /* @__PURE__ */ react_default.createElement("line", { x1: "7.875", y1: "9.5", x2: "7.875", y2: "3.5", stroke: "var(--mito-highlight)", strokeWidth: "1.25" }));
  };
  var ScheduleIcon_default = ScheduleIcon;

  // src/mito/components/icons/SearchIcon.tsx
  init_react();
  var SearchIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M9.19678 5.13281C9.19678 7.37647 7.37793 9.19531 5.13428 9.19531C2.89062 9.19531 1.07178 7.37647 1.07178 5.13281C1.07178 2.88916 2.89062 1.07031 5.13428 1.07031C7.37793 1.07031 9.19678 2.88916 9.19678 5.13281Z" }), /* @__PURE__ */ react_default.createElement("path", { d: "M8.05394 7.95762L14.0718 14.0703M9.19678 5.13281C9.19678 7.37647 7.37793 9.19531 5.13428 9.19531C2.89062 9.19531 1.07178 7.37647 1.07178 5.13281C1.07178 2.88916 2.89062 1.07031 5.13428 1.07031C7.37793 1.07031 9.19678 2.88916 9.19678 5.13281Z", stroke: "var(--mito-text)" }));
  };
  var SearchIcon_default = SearchIcon;

  // src/mito/components/icons/SnowflakeIcon.tsx
  init_react();
  var SnowflakeIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "25", height: "30", viewBox: "0 0 25 30", fill: "none", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink" }, /* @__PURE__ */ react_default.createElement("rect", { x: "4", y: "6.07031", width: "17", height: "17", fill: "url(#pattern0)" }), /* @__PURE__ */ react_default.createElement("defs", null, /* @__PURE__ */ react_default.createElement("pattern", { id: "pattern0", patternContentUnits: "objectBoundingBox", width: "1", height: "1" }, /* @__PURE__ */ react_default.createElement("use", { xlinkHref: "#image0_7304_1038", transform: "translate(-0.00192431) scale(0.000641437)" })), /* @__PURE__ */ react_default.createElement("image", { id: "image0_7304_1038", width: "1565", height: "1559", xlinkHref: "data:image/png;base64, " })));
  };
  var SnowflakeIcon_default = SnowflakeIcon;

  // src/mito/components/icons/SortIcon.tsx
  init_react();
  var SortIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "26", height: "30", viewBox: "2 2 22 26", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "4.5", y: "6.57031", width: "16.6071", height: "16", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "4.5", y: "9", width: "16.6071", height: "13.5714", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "4.5", y: "6.57031", width: "16.6071", height: "2.03571", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "13", y1: "9.10547", x2: "13", y2: "22.4626", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M10.4155 14.8604V15.3203H7.52686V14.8604H10.4155ZM10.3218 11.4648L7.66162 15.3203H7.31299V14.8984L9.97021 11.0547H10.3218V11.4648ZM10.0815 11.0547V11.5176H7.35107V11.0547H10.0815Z", fill: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M8.97412 16.4326L7.56201 20.3203H6.98486L8.61084 16.0547H8.98291L8.97412 16.4326ZM10.1577 20.3203L8.74268 16.4326L8.73389 16.0547H9.10596L10.7378 20.3203H10.1577ZM10.0845 18.7412V19.2041H7.68799V18.7412H10.0845Z", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M17.4741 11.4326L16.062 15.3203H15.4849L17.1108 11.0547H17.4829L17.4741 11.4326ZM18.6577 15.3203L17.2427 11.4326L17.2339 11.0547H17.606L19.2378 15.3203H18.6577ZM18.5845 13.7412V14.2041H16.188V13.7412H18.5845Z", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M18.9155 19.8604V20.3203H16.0269V19.8604H18.9155ZM18.8218 16.4648L16.1616 20.3203H15.813V19.8984L18.4702 16.0547H18.8218V16.4648ZM18.5815 16.0547V16.5176H15.8511V16.0547H18.5815Z", fill: "var(--mito-text)" }));
  };
  var SortIcon_default = SortIcon;

  // src/mito/components/icons/StarIcon.tsx
  init_react();
  var StarIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "13", height: "11", viewBox: "0 0 13 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M5.78671 0.695289C6.01122 0.00430597 6.98878 0.00430505 7.21329 0.695288L8.01547 3.16413C8.11588 3.47315 8.40384 3.68237 8.72876 3.68237H11.3247C12.0512 3.68237 12.3533 4.61208 11.7655 5.03914L9.66537 6.56497C9.40251 6.75595 9.29251 7.09448 9.39292 7.40349L10.1951 9.87234C10.4196 10.5633 9.62875 11.1379 9.04097 10.7109L6.94084 9.18503C6.67797 8.99405 6.32203 8.99405 6.05916 9.18503L3.95903 10.7109C3.37125 11.1379 2.58039 10.5633 2.8049 9.87234L3.60708 7.40349C3.70749 7.09448 3.59749 6.75595 3.33463 6.56497L1.2345 5.03914C0.646715 4.61208 0.948796 3.68237 1.67534 3.68237H4.27124C4.59616 3.68237 4.88412 3.47315 4.98453 3.16414L5.78671 0.695289Z", fill: "var(--mito-text-medium)" }));
  };
  var StarIcon_default = StarIcon;

  // src/mito/components/icons/SummaryIcon.tsx
  init_react();
  var SummaryIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "13", height: "15", viewBox: "0 0 13 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1.5 13.4983V4.01562C1.5 3.46334 1.94772 3.01562 2.5 3.01562H11C11.5523 3.01562 12 3.46334 12 4.01562V13.4842C12 14.0358 11.5533 14.4833 11.0017 14.4842L2.50167 14.4983C1.94873 14.4993 1.5 14.0513 1.5 13.4983Z", fill: "var(--mito-background)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M3.5 1.25H3.25V1.5V4.5V4.75H3.5H10H10.25V4.5V1.5V1.25H10H3.5Z", fill: "var(--mito-text)", stroke: "var(--mito-background)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("path", { d: "M7.15833 1.49219C7.15833 1.76833 6.93447 1.99219 6.65833 1.99219C6.38218 1.99219 6.15833 1.76833 6.15833 1.49219C6.15833 1.21605 6.38218 0.992188 6.65833 0.992188C6.93447 0.992188 7.15833 1.21605 7.15833 1.49219Z", fill: "var(--mito-text)", stroke: "var(--mito-text)", strokeWidth: "2" }), /* @__PURE__ */ react_default.createElement("path", { d: "M4 6.5H9.55556M4 9H9.55556M4 12H7.5", stroke: "var(--mito-text)" }));
  };
  var SummaryIcon_default = SummaryIcon;

  // src/mito/components/icons/TextFunctionsIcon.tsx
  init_react();
  var TextFunctionsIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "19", height: "23", viewBox: "0 0 14 19", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M2.39507 17.7007H2.30324C1.40512 17.7007 0.674319 17.0584 0.651047 16.2601C0.650452 16.243 0.650262 16.226 0.650475 16.2089C0.658518 15.5667 1.24002 14.9277 2.39507 14.7442H13.4594V17.7007H2.39507Z", fill: "var(--mito-background-off)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M13.1171 1.43988H2.304C1.3912 1.43988 0.650475 2.1034 0.650475 2.91982V16.2208C0.650475 17.0372 1.39044 17.7007 2.30324 17.7007H13.4594M13.4594 17.7007V1.07031M13.4594 17.7007V18.0703M13.4594 17.7007H2.39507C0.0689437 17.3312 0.0687175 15.1138 2.39507 14.7442H13.4594", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M3.16895 12.7195L4.73216 8.9417M10.7245 12.7195L7.26154 3.58984H6.94672L4.73216 8.9417M9.29155 8.9417H4.73216", stroke: "#4388C7", strokeWidth: "1.4" }));
  };
  var TextFunctionsIcon_default = TextFunctionsIcon;

  // src/mito/components/icons/TextToColumnsIcon.tsx
  init_react();
  var TextToColumnsIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "31", height: "30", viewBox: "5 3 25 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "19.771", y: "6.57031", width: "5.95455", height: "5.18182", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "20.8169", y1: "8.66016", x2: "24.6805", y2: "8.66016", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "19.7715", y: "11.9766", width: "5.95455", height: "5.18182", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "20.8169", y1: "14.0664", x2: "24.6805", y2: "14.0664", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "19.7715", y: "17.3906", width: "5.95455", height: "5.18182", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "20.8169", y1: "19.4805", x2: "24.6805", y2: "19.4805", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "7.68018", y1: "8.66406", x2: "16.1802", y2: "8.66406", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "9.99805", y1: "13.3008", x2: "16.1799", y2: "13.3008", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "7.68018", y1: "10.9805", x2: "16.1802", y2: "10.9805", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M9.65541 18.8067L9.65542 19.3067L9.65541 18.8067ZM15.3699 19.1602C15.5652 18.9649 15.5652 18.6483 15.3699 18.4531L12.1879 15.2711C11.9927 15.0759 11.6761 15.0759 11.4808 15.2711C11.2856 15.4664 11.2856 15.783 11.4808 15.9782L14.3093 18.8066L11.4809 21.6351C11.2856 21.8303 11.2856 22.1469 11.4809 22.3422C11.6761 22.5375 11.9927 22.5375 12.188 22.3422L15.3699 19.1602ZM8.7304 13.8284C8.96001 13.675 9.02179 13.3645 8.86839 13.1349C8.71498 12.9053 8.40449 12.8435 8.17487 12.9969L8.7304 13.8284ZM8.09232 13.6534L7.81456 13.2376L7.81456 13.2376L8.09232 13.6534ZM6.98818 15.097L7.46215 15.2562L7.46215 15.2562L6.98818 15.097ZM9.65542 19.3067L15.0164 19.3066L15.0164 18.3066L9.65541 18.3067L9.65542 19.3067ZM8.17487 12.9969L7.81456 13.2376L8.37008 14.0691L8.7304 13.8284L8.17487 12.9969ZM7.81456 13.2376C7.20498 13.6449 6.74767 14.2428 6.51421 14.9377L7.46215 15.2562C7.62516 14.771 7.94446 14.3535 8.37008 14.0691L7.81456 13.2376ZM9.65541 18.3067C8.0739 18.3067 6.95853 16.7554 7.46215 15.2562L6.51421 14.9377C5.79291 17.0849 7.39036 19.3067 9.65542 19.3067L9.65541 18.3067Z", fill: "var(--mito-highlight)" }));
  };
  var TextToColumnsIcon_default = TextToColumnsIcon;

  // src/mito/components/icons/TransposeIcon.tsx
  init_react();
  var TranposeIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "16", viewBox: "0 0 15 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "0.5", y: "0.570312", width: "14", height: "14", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "2.01465", y: "2.08594", width: "2.14706", height: "2.14706", fill: "var(--mito-text-medium)", stroke: "var(--mito-text)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("rect", { x: "5.54419", y: "2.08594", width: "7.44118", height: "2.14706", fill: "var(--mito-text-medium)", stroke: "var(--mito-text)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("rect", { x: "2.01465", y: "5.61328", width: "2.14706", height: "7.44118", fill: "var(--mito-text-medium)", stroke: "var(--mito-text)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("path", { d: "M10.1471 9.33364L12.2843 5.13667M10.1471 9.33364L12.0883 8.74812M10.1471 9.33364L9.5021 7.41968", stroke: "var(--mito-highlight)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M9.3241 10.168L5.06598 12.3554M9.3241 10.168L8.67743 12.1593M9.3241 10.168L7.3489 9.57315", stroke: "var(--mito-highlight)", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var TransposeIcon_default = TranposeIcon;

  // src/mito/components/icons/UndoIcon.tsx
  init_react();
  var UndoIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M1 6.07072C4.5 2.57031 8.5 -1.92969 12 2.57072C13.6518 4.69468 13 7.07031 11.4222 8.57031L6 13.0703M1 6.07072V0.0703125M1 6.07072L6.5 6.07031", stroke: "var(--mito-text)", strokeMiterlimit: 10, strokeLinecap: "round" }));
  };
  var UndoIcon_default = UndoIcon;

  // src/mito/components/icons/UnpivotIcon.tsx
  init_react();
  var UnpivotIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "16", viewBox: "0 0 15 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "0.5", y: "0.570312", width: "8.16667", height: "4.83333", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "0.833252", y1: "2.90234", x2: "8.33325", y2: "2.90234", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "0.833252", y: "0.90625", width: "7.5", height: "1.66667", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "9.66675", y: "14.5703", width: "8.16667", height: "4.83333", transform: "rotate(-90 9.66675 14.5703)", fill: "var(--mito-background-off)", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("line", { x1: "12", y1: "14.2344", x2: "12", y2: "6.73438", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "10", y: "14.2344", width: "7.5", height: "1.66667", transform: "rotate(-90 10 14.2344)", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M3.01878 7.57031V12.0915H7.49974M3.01878 7.57031L4.41257 8.97294M3.01878 7.57031L1.66667 8.97294M7.49974 12.0915L6.2092 13.4036M7.49974 12.0915L6.2092 10.8939", stroke: "var(--mito-highlight)", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var UnpivotIcon_default = UnpivotIcon;

  // src/mito/components/icons/GraphToolbar/AddChartElementIcon.tsx
  init_react();
  var AddChartElementIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "22", height: "20", viewBox: "0 0 22 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "10.5", y: "3.42969", width: "5", height: "14.5714", fill: "#D9D9D9", stroke: "#C2C2C2" }), /* @__PURE__ */ react_default.createElement("rect", { x: "5.5", y: "1", width: "5", height: "17", fill: "var(--mito-background)", stroke: "#C2C2C2" }), /* @__PURE__ */ react_default.createElement("rect", { x: "0.5", y: "7.80078", width: "5", height: "10.2", fill: "var(--mito-highlight-medium)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M21.499 13.498H8.5M14.9995 7V19.9961", stroke: "var(--mito-background-off)", strokeWidth: "3" }), /* @__PURE__ */ react_default.createElement("path", { d: "M20.4155 13.4971H9.58301M14.9993 8.08203V18.9121", stroke: "#27AE60" }));
  };
  var AddChartElementIcon_default = AddChartElementIcon;

  // src/mito/components/icons/GraphToolbar/SelectDataIcon.tsx
  init_react();
  var SelectDataIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "28", height: "23", viewBox: "0 0 28 23", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "0.75", y: "0.863281", width: "23.731", height: "15.7777", fill: "var(--mito-background)", stroke: "var(--mito-text)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("path", { d: "M8.80776 0.914062V16.2874M16.7694 0.914062V16.2874M0.5 6.33995H24.731M0.5 11.4644H24.731", stroke: "var(--mito-text)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("path", { d: "M1 1H17V11.5H1V1Z", fill: "var(--mito-highlight-light)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M0.722656 6.24855V0.816406H16.8908V6.24855M0.722656 6.24855H8.84697M0.722656 6.24855V11.4985H8.84697M16.8908 6.24855V11.4985H8.84697M16.8908 6.24855H8.84697M8.84697 6.24855V11.4985M8.84697 6.24855V0.816406", stroke: "var(--mito-highlight)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("rect", { x: "12.5", y: "14.9922", width: "6.19258", height: "6.89496", fill: "var(--mito-background-off)", stroke: "var(--mito-background-off)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "20.8076", y: "12.0469", width: "6.19258", height: "9.84244", fill: "var(--mito-background-off)", stroke: "var(--mito-background-off)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "16.6543", y: "8.36328", width: "6.19258", height: "13.5268", fill: "var(--mito-background-off)", stroke: "var(--mito-background-off)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "13.25", y: "15.7422", width: "4.69258", height: "5.39496", fill: "#C8C6C3", stroke: "var(--mito-text-medium)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("rect", { x: "21.5576", y: "12.7969", width: "4.69258", height: "8.34244", fill: "var(--mito-highlight-light)", stroke: "var(--mito-highlight)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("rect", { x: "17.4043", y: "9.11328", width: "4.69258", height: "12.0268", fill: "var(--mito-background)", stroke: "var(--mito-text)", strokeWidth: "0.5" }));
  };
  var SelectDataIcon_default = SelectDataIcon;

  // src/mito/utils/actions.tsx
  var Actions = class {
    constructor(buildTimeActions, runtimeImportActionsList, runTimeEditActionsList) {
      this.buildTimeActions = buildTimeActions;
      this.runtimeImportActionsList = runtimeImportActionsList;
      this.runtimeEditActionsList = runTimeEditActionsList;
    }
  };
  var getDefaultActionsDisabledMessage = (uiState, sendFunctionStatus) => {
    let defaultActionDisabledMessage = void 0;
    const disabledDueToReplayAnalysis = uiState.currOpenTaskpane.type === "UpdateImports" /* UPDATEIMPORTS */ && uiState.currOpenTaskpane.failedReplayData !== void 0;
    if (disabledDueToReplayAnalysis) {
      defaultActionDisabledMessage = "Please resolve issues with the failed replay analysis before making further edits.";
    } else if (sendFunctionStatus === "loading") {
      defaultActionDisabledMessage = "Mito is still trying to connect to the backend. Please wait a moment.";
    } else if (sendFunctionStatus === "non_working_extension_error") {
      defaultActionDisabledMessage = "Mito is installed incorrectly. Please fix your installation and try again.";
    } else if (sendFunctionStatus === "non_valid_location_error") {
      defaultActionDisabledMessage = "Mito does not currently support this location. Please use Mito in JupyerLab or Jupter Notebooks.";
    } else if (sendFunctionStatus === "no_backend_comm_registered_error") {
      defaultActionDisabledMessage = "Kernel has been restarted. Please rerun the cell that created this mitosheet.";
    }
    return defaultActionDisabledMessage;
  };
  var getActions = (sheetDataArray, gridState, dfSources, closeOpenEditingPopups, setEditorState, uiState, setUIState, setGridState, mitoAPI, mitoContainerRef, analysisData, userProfile, sendFunctionStatus) => {
    const sheetIndex = gridState.sheetIndex;
    const sheetData = sheetDataArray[sheetIndex];
    const dfFormat = (sheetData == null ? void 0 : sheetData.dfFormat) || getDefaultDataframeFormat();
    const startingRowIndex = gridState.selections[gridState.selections.length - 1].startingRowIndex;
    const startingColumnIndex = gridState.selections[gridState.selections.length - 1].startingColumnIndex;
    const { columnID, cellValue, columnDtype } = getCellDataFromCellIndexes(sheetData, startingRowIndex, startingColumnIndex);
    const { startingColumnFormula, arrowKeysScrollInFormula } = getStartingFormula(sheetData, void 0, startingRowIndex, startingColumnIndex, analysisData.defaultApplyFormulaToColumn);
    const startingColumnID = columnID;
    const lastStepSummary = analysisData.stepSummaryList[analysisData.stepSummaryList.length - 1];
    const defaultActionDisabledMessage = getDefaultActionsDisabledMessage(uiState, sendFunctionStatus);
    const buildTimeActions = {
      ["add column to the right" /* Add_Column_Right */]: {
        type: "build-time",
        staticType: "add column to the right" /* Add_Column_Right */,
        iconToolbar: AddColumnIcon_default,
        iconContextMenu: PlusIcon_default,
        titleToolbar: "Insert",
        titleContextMenu: "Insert Column Right",
        longTitle: "Insert column to the Right",
        actionFunction: () => __async(void 0, null, function* () {
          if (sheetDataArray.length === 0) {
            return;
          }
          setEditorState(void 0);
          closeOpenEditingPopups();
          const newColumnHeader = "new-column-" + getNewColumnHeader();
          const selection = gridState.selections[gridState.selections.length - 1];
          const newColumnHeaderIndex = Math.max(selection.startingColumnIndex, selection.endingColumnIndex) + 1;
          yield mitoAPI.editAddColumn(
            sheetIndex,
            newColumnHeader,
            newColumnHeaderIndex
          );
          setGridState((prevGridState) => {
            return __spreadProps(__spreadValues({}, prevGridState), {
              selections: [{
                sheetIndex,
                startingRowIndex: -1,
                startingColumnIndex: newColumnHeaderIndex,
                endingRowIndex: -1,
                endingColumnIndex: newColumnHeaderIndex
              }]
            });
          });
        }),
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no dataframes to add columns to. Import data.";
        },
        searchTerms: ["add column", "add col", "new column", "new col", "insert column", "insert col"],
        tooltip: "Add a new formula column to the right of your selection."
      },
      ["add column to the left" /* Add_Column_Left */]: {
        type: "build-time",
        staticType: "add column to the left" /* Add_Column_Left */,
        iconToolbar: AddColumnIcon_default,
        iconContextMenu: PlusIcon_default,
        titleToolbar: "Insert",
        longTitle: "Insert Column to the Left",
        titleContextMenu: "Insert Column Left",
        actionFunction: () => __async(void 0, null, function* () {
          if (sheetDataArray.length === 0) {
            return;
          }
          setEditorState(void 0);
          closeOpenEditingPopups();
          const newColumnHeader = "new-column-" + getNewColumnHeader();
          const selection = gridState.selections[gridState.selections.length - 1];
          const newColumnHeaderIndex = Math.min(selection.startingColumnIndex, selection.endingColumnIndex);
          yield mitoAPI.editAddColumn(
            sheetIndex,
            newColumnHeader,
            newColumnHeaderIndex
          );
          setGridState((prevGridState) => {
            return __spreadProps(__spreadValues({}, prevGridState), {
              selections: [{
                sheetIndex,
                startingRowIndex: -1,
                startingColumnIndex: newColumnHeaderIndex,
                endingRowIndex: -1,
                endingColumnIndex: newColumnHeaderIndex
              }]
            });
          });
        }),
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no dataframes to add columns to. Import data.";
        },
        searchTerms: ["add column", "add col", "new column", "new col", "insert column", "insert col"],
        tooltip: "Add a new formula column to the left of your selection."
      },
      ["add chart element dropdown" /* AddChartElementDropdown */]: {
        type: "build-time",
        staticType: "add chart element dropdown" /* AddChartElementDropdown */,
        iconToolbar: AddChartElementIcon_default,
        titleToolbar: "Add Chart Element",
        longTitle: "Add Chart Element",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: "add-chart-element"
            });
          });
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["add chart element", "add chart", "add element", "add graph element", "add graph", "add element"],
        tooltip: "Add a new chart element to the graph."
      },
      ["change chart type dropdown" /* ChangeChartTypeDropdown */]: {
        type: "build-time",
        staticType: "change chart type dropdown" /* ChangeChartTypeDropdown */,
        iconToolbar: GraphIcon_default,
        titleToolbar: "Change Chart Type",
        longTitle: "Change Chart Type",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: "change-chart-type"
            });
          });
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["change chart type", "change chart", "change type", "change graph type", "change graph", "change type"],
        tooltip: "Change the type of the graph."
      },
      ["catch up" /* Catch_Up */]: {
        type: "build-time",
        staticType: "catch up" /* Catch_Up */,
        iconToolbar: CatchUpIcon_default,
        titleToolbar: "Catch Up",
        longTitle: "Catch up",
        actionFunction: () => {
          void mitoAPI.log("click_catch_up");
          void mitoAPI.updateCheckoutStepByIndex(-1);
        },
        isDisabled: () => {
          return analysisData.currStepIdx === lastStepSummary.step_idx ? "You are on the most recent step, so there is nothing to catch up on." : void 0;
        },
        searchTerms: ["fast forward", "catch up"],
        tooltip: "Go to the current state of the analysis."
      },
      ["change dtype" /* Change_Dtype */]: {
        type: "build-time",
        staticType: "change dtype" /* Change_Dtype */,
        iconToolbar: DtypeIcon_default,
        titleToolbar: "Dtype",
        longTitle: "Change column dtype",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: "dtype"
            });
          });
        },
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray)) {
            return "There are no columns to change the dtype of. Import data.";
          }
          return defaultActionDisabledMessage;
        },
        searchTerms: ["change dtype", "dtype", "cast", "boolean", "string", "number", "float", "int", "datetime", "date", "timedelta"],
        tooltip: "Cast the dtype of your data column to a string, int, float, boolean, datetime, or timedelta."
      },
      ["clear" /* Clear */]: {
        type: "build-time",
        staticType: "clear" /* Clear */,
        iconToolbar: ClearIcon_default,
        longTitle: "Clear all edits",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "ClearAnalysis" /* ClearAnalysis */ },
              currOpenTaskpane: { type: "none" /* NONE */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["clear", "reset", "undo", "redo"],
        tooltip: "Removes all of the transformations you've made to imported dataframes."
      },
      ["column summary" /* Column_Summary */]: {
        type: "build-time",
        staticType: "column summary" /* Column_Summary */,
        titleToolbar: "Column Summary",
        titleContextMenu: "Column Summary Stats",
        iconContextMenu: SummaryIcon_default,
        longTitle: "View column summary statistics ",
        actionFunction: () => {
          setEditorState(void 0);
          if (typeof uiState.currOpenDropdown === "object" && uiState.currOpenDropdown.type === "context-menu") {
            const rowIndex = uiState.currOpenDropdown.rowIndex;
            const columnIndex = uiState.currOpenDropdown.columnIndex;
            setGridState((prevGridState) => {
              return __spreadProps(__spreadValues({}, prevGridState), {
                selections: [{
                  sheetIndex,
                  startingRowIndex: rowIndex,
                  startingColumnIndex: columnIndex,
                  endingRowIndex: rowIndex,
                  endingColumnIndex: columnIndex
                }]
              });
            });
          }
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "control_panel" /* CONTROL_PANEL */ },
              selectedColumnControlPanelTab: "summary_stats" /* SummaryStats */,
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesColumnExist(startingColumnID, sheetIndex, sheetDataArray) ? defaultActionDisabledMessage : "There are no columns to summarize in the selected sheet. Add data to the sheet.";
        },
        searchTerms: ["column summary", "describe", "stats"],
        tooltip: "Learn about the distribution of the data in the selected column."
      },
      ["copy" /* Copy */]: {
        type: "build-time",
        staticType: "copy" /* Copy */,
        iconToolbar: CopyIcon_default,
        iconContextMenu: CopyContextMenuItem_default,
        titleToolbar: "Copy",
        longTitle: "Copy",
        actionFunction: () => {
          closeOpenEditingPopups();
          const copyStringAndSelections = getCopyStringForClipboard(
            sheetData,
            gridState.selections
          );
          if (copyStringAndSelections === void 0) {
            return;
          }
          const [stringToCopy, copiedSelections] = copyStringAndSelections;
          void writeTextToClipboard(stringToCopy);
          setGridState((prevGridState) => {
            return __spreadProps(__spreadValues({}, prevGridState), {
              copiedSelections
            });
          });
          void mitoAPI.log("copied_data", {
            "num_selections": gridState.selections.length
          });
        },
        isDisabled: () => {
          return getDataframeIsSelected(uiState, sheetDataArray) ? defaultActionDisabledMessage : "There is no selected data to copy.";
        },
        searchTerms: ["copy", "paste", "export"],
        tooltip: "Copy the current selection to the clipboard."
      },
      ["copy code" /* CopyCode */]: {
        type: "build-time",
        staticType: "copy code" /* CopyCode */,
        iconToolbar: CopyIcon_default,
        titleToolbar: "Copy Code",
        longTitle: "Copy Code to Clipboard",
        actionFunction: () => {
          closeOpenEditingPopups();
          const codeToCopy = getCodeString(
            analysisData.analysisName,
            analysisData.code,
            userProfile.telemetryEnabled,
            analysisData.publicInterfaceVersion
          );
          void writeTextToClipboard(codeToCopy);
        },
        isDisabled: () => {
          if (!analysisData.code || analysisData.code.length === 0) {
            return "There is no code to copy.";
          }
          return getDefaultActionsDisabledMessage(uiState, sendFunctionStatus);
        },
        searchTerms: ["copy", "paste", "export"],
        tooltip: "Copy the generated code to the clipboard."
      },
      ["delete" /* Delete */]: {
        type: "build-time",
        staticType: "delete" /* Delete */,
        iconToolbar: DeleteColumnIcon_default,
        iconContextMenu: TrashIcon_default,
        titleToolbar: "Delete",
        titleContextMenu: "Delete Column",
        longTitle: "Delete column / row",
        actionFunction: () => __async(void 0, null, function* () {
          setEditorState(void 0);
          closeOpenEditingPopups();
          const rowsToDelete = getSelectedRowLabelsWithEntireSelectedRow(gridState.selections, sheetData);
          if (rowsToDelete.length > 0) {
            void mitoAPI.editDeleteRow(sheetIndex, rowsToDelete);
          }
          if (isSelectionsOnlyColumnHeaders(gridState.selections)) {
            const columnIndexesSelected = getColumnIndexesInSelections(gridState.selections);
            const columnIDsToDelete = columnIndexesSelected.map((colIdx) => {
              var _a;
              return ((_a = sheetData == null ? void 0 : sheetData.data[colIdx]) == null ? void 0 : _a.columnID) || "";
            }).filter((columnID2) => columnID2 !== "");
            if (columnIDsToDelete !== void 0) {
              yield mitoAPI.editDeleteColumn(
                sheetIndex,
                columnIDsToDelete
              );
            }
          }
        }),
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray)) {
            return "There are no columns or rows to delete. Import data.";
          }
          const rowsToDelete = getSelectedRowLabelsWithEntireSelectedRow(gridState.selections, sheetData);
          if (rowsToDelete.length > 0) {
            return defaultActionDisabledMessage;
          }
          if (doesColumnExist(startingColumnID, sheetIndex, sheetDataArray)) {
            if (isSelectionsOnlyColumnHeaders(gridState.selections)) {
              return defaultActionDisabledMessage;
            } else {
              return "The selection contains individual cells. Click on column headers to select entire columns only.";
            }
          } else {
            return "There are no rows or columns in the dataframe to delete. Add data to the sheet.";
          }
        },
        searchTerms: ["delete column", "delete col", "del col", "del column", "remove column", "remove col", "delete row", "filter rows", "rows", "remove rows", "hide rows"],
        tooltip: "Delete all of the selected columns or rows from the sheet."
      },
      ["delete row" /* Delete_Row */]: {
        type: "build-time",
        staticType: "delete row" /* Delete_Row */,
        iconContextMenu: TrashIcon_default,
        titleContextMenu: "Delete Row",
        longTitle: "Delete row",
        actionFunction: () => __async(void 0, null, function* () {
          setEditorState(void 0);
          closeOpenEditingPopups();
          const rowsToDelete = getSelectedRowLabelsInSingleSelection(gridState.selections[0], sheetData);
          if (rowsToDelete.length > 0) {
            void mitoAPI.editDeleteRow(sheetIndex, rowsToDelete);
          }
        }),
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray)) {
            return "There are no rows to delete. Import data.";
          }
          const rowsToDelete = getSelectedRowLabelsInSingleSelection(gridState.selections[0], sheetData);
          if (rowsToDelete.length > 0) {
            return defaultActionDisabledMessage;
          } else {
            return "There are no rows selected.";
          }
        },
        searchTerms: ["delete row", "delete row", "del row", "remove row", "filter rows", "rows", "remove rows", "hide rows"],
        tooltip: "Delete the row of the selected cell."
      },
      ["delete column" /* Delete_Col */]: {
        type: "build-time",
        staticType: "delete column" /* Delete_Col */,
        iconContextMenu: TrashIcon_default,
        titleContextMenu: "Delete Column",
        longTitle: "Delete column",
        actionFunction: () => __async(void 0, null, function* () {
          setEditorState(void 0);
          closeOpenEditingPopups();
          const columnIndexesSelected = getColumnIndexesInSelections(gridState.selections);
          const columnIDsToDelete = columnIndexesSelected.map((colIdx) => {
            var _a;
            return ((_a = sheetData == null ? void 0 : sheetData.data[colIdx]) == null ? void 0 : _a.columnID) || "";
          }).filter((columnID2) => columnID2 !== "");
          if (columnIDsToDelete !== void 0) {
            yield mitoAPI.editDeleteColumn(
              sheetIndex,
              columnIDsToDelete
            );
          }
        }),
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray)) {
            return "There are no columns to delete. Import data.";
          }
          if (doesColumnExist(startingColumnID, sheetIndex, sheetDataArray)) {
            return defaultActionDisabledMessage;
          } else {
            return "There are no columns in the dataframe to delete. Add data to the sheet.";
          }
        },
        searchTerms: ["delete column", "delete col", "del col", "del column", "remove column", "remove col"],
        tooltip: "Delete the column of the selected cell."
      },
      ["delete dataframe" /* Delete_Dataframe */]: {
        type: "build-time",
        staticType: "delete dataframe" /* Delete_Dataframe */,
        titleToolbar: "Delete dataframe",
        longTitle: "Delete dataframe",
        actionFunction: () => __async(void 0, null, function* () {
          if (sheetIndex !== 0) {
            setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                selectedSheetIndex: sheetIndex - 1
              });
            });
          }
          closeOpenEditingPopups();
          yield mitoAPI.editDataframeDelete(sheetIndex);
        }),
        isDisabled: () => {
          return getDataframeIsSelected(uiState, sheetDataArray) ? defaultActionDisabledMessage : "There is no selected dataframe to delete.";
        },
        searchTerms: ["delete", "delete dataframe", "delete sheet", "del", "del dataframe", "del sheet", "remove", "remove dataframe", "remove sheet"],
        tooltip: "Delete the selected sheet."
      },
      ["delete graph" /* Delete_Graph */]: {
        type: "build-time",
        staticType: "delete graph" /* Delete_Graph */,
        titleToolbar: "Delete Graph",
        longTitle: "Delete graph",
        actionFunction: () => __async(void 0, null, function* () {
          const selectedGraphID = uiState.currOpenTaskpane.type === "graph" /* GRAPH */ ? uiState.currOpenTaskpane.openGraph.graphID : void 0;
          if (selectedGraphID) {
            yield deleteGraphs([selectedGraphID], mitoAPI, setUIState, analysisData.graphDataArray);
          }
        }),
        isDisabled: () => {
          return getAnyGraphIsSelected(uiState) ? defaultActionDisabledMessage : "There is no selected graph to delete.";
        },
        searchTerms: ["delete", "delete graph", "delete chart", "del", "del chart", "del chart", "remove", "remove chart", "remove graph"],
        tooltip: "Delete the selected graph."
      },
      ["docs" /* Docs */]: {
        type: "build-time",
        staticType: "docs" /* Docs */,
        titleToolbar: "Docs",
        longTitle: "Documentation",
        actionFunction: () => {
          setEditorState(void 0);
          void mitoAPI.log("clicked_documentation");
          window.open("https://docs.trymito.io/how-to/importing-data-to-mito", "_blank");
        },
        isDisabled: () => {
          return void 0;
        },
        searchTerms: ["docs", "documentation", "help", "support"],
        tooltip: "Documentation, tutorials, and how-tos on all functionality in Mito."
      },
      ["drop duplicates" /* Drop_Duplicates */]: {
        type: "build-time",
        staticType: "drop duplicates" /* Drop_Duplicates */,
        iconToolbar: RemoveDuplicatesIcon_default,
        titleToolbar: "Remove Duplicates",
        longTitle: "Deduplicate dataframe",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: { type: "drop_duplicates" /* DROP_DUPLICATES */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no dataframes to operate on. Import data.";
        },
        searchTerms: ["dedup", "deduplicate", "same", "remove", "drop duplicates", "duplicates"],
        tooltip: "Remove duplicated rows from your dataframe."
      },
      ["duplicate dataframe" /* Duplicate_Dataframe */]: {
        type: "build-time",
        staticType: "duplicate dataframe" /* Duplicate_Dataframe */,
        titleToolbar: "Duplicate Dataframe",
        longTitle: "Duplicate dataframe",
        actionFunction: () => __async(void 0, null, function* () {
          setEditorState(void 0);
          yield mitoAPI.editDataframeDuplicate(sheetIndex);
        }),
        isDisabled: () => {
          return getDataframeIsSelected(uiState, sheetDataArray) ? defaultActionDisabledMessage : "There is no selected dataframe to duplicate.";
        },
        searchTerms: ["duplicate", "copy"],
        tooltip: "Make a copy of the selected sheet."
      },
      ["export" /* Export */]: {
        type: "build-time",
        staticType: "export" /* Export */,
        iconToolbar: ExportIcon_default,
        titleToolbar: "Download",
        longTitle: "Download File Now",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: { type: "download" /* DOWNLOAD */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no dataframes to export. Import data.";
        },
        searchTerms: ["export", "download", "excel", "csv"],
        tooltip: "Download dataframes as a .csv or .xlsx file."
      },
      ["export dropdown" /* Export_Dropdown */]: {
        type: "build-time",
        staticType: "export dropdown" /* Export_Dropdown */,
        iconToolbar: ExportIcon_default,
        titleToolbar: "Export",
        longTitle: "Open Export Dropdown",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: "export"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no dataframes to export. Import data.";
        },
        searchTerms: ["export", "download", "excel", "csv"],
        tooltip: "Export dataframes as a .csv or .xlsx file. Choose whether or not to include export in the code."
      },
      ["graph select data" /* Graph_SelectData */]: {
        type: "build-time",
        staticType: "graph select data" /* Graph_SelectData */,
        iconToolbar: SelectDataIcon_default,
        titleToolbar: "Select Data",
        longTitle: "Select Data",
        actionFunction: () => {
          setEditorState(void 0);
          const currOpenTaskpane = uiState.currOpenTaskpane;
          if (currOpenTaskpane.type === "graph" /* GRAPH */) {
            setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenTaskpane: __spreadProps(__spreadValues({}, currOpenTaskpane), {
                  graphSidebarOpen: true
                })
              });
            });
          }
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["select data", "select"],
        tooltip: "Select the data to be used in the graph."
      },
      ["export graph dropdown" /* ExportGraphDropdown */]: {
        type: "build-time",
        staticType: "export graph dropdown" /* ExportGraphDropdown */,
        iconToolbar: ExportIcon_default,
        titleToolbar: "Export",
        longTitle: "Open Export Dropdown",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: "export-graph"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no dataframes to export. Import data.";
        },
        searchTerms: ["export", "download", "excel", "csv"],
        tooltip: "Export dataframes as a .csv or .xlsx file. Choose whether or not to include export in the code."
      },
      ["fill na" /* Fill_Na */]: {
        type: "build-time",
        staticType: "fill na" /* Fill_Na */,
        iconToolbar: FillNanIcon_default,
        titleToolbar: "Fill Missing Values",
        longTitle: "Fill NaN Values",
        actionFunction: () => {
          setEditorState(void 0);
          const selectedColumnIDs = getSelectedColumnIDsWithEntireSelectedColumn(gridState.selections, sheetData);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: {
                type: "fill_na" /* FILL_NA */,
                startingColumnIDs: selectedColumnIDs
              },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There is no dataframe to fill nan values within.";
        },
        searchTerms: ["fill nan", "nan", "find", "replace", "null", "undefined", "fill null", "fill undefined", "empty", "none", "blank"],
        tooltip: "Fill all NaN values within a dataframe or list of columns."
      },
      ["filter" /* Filter */]: {
        type: "build-time",
        staticType: "filter" /* Filter */,
        iconToolbar: FilterIcon,
        titleToolbar: "Filter",
        longTitle: "Filter column",
        actionFunction: () => {
          setEditorState(void 0);
          if (typeof uiState.currOpenDropdown === "object" && uiState.currOpenDropdown.type === "context-menu") {
            const rowIndex = uiState.currOpenDropdown.rowIndex;
            const columnIndex = uiState.currOpenDropdown.columnIndex;
            setGridState((prevGridState) => {
              return __spreadProps(__spreadValues({}, prevGridState), {
                selections: [{
                  sheetIndex,
                  startingRowIndex: rowIndex,
                  startingColumnIndex: columnIndex,
                  endingRowIndex: rowIndex,
                  endingColumnIndex: columnIndex
                }]
              });
            });
          }
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "control_panel" /* CONTROL_PANEL */ },
              selectedColumnControlPanelTab: "filter_sort" /* FilterSort */,
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesColumnExist(startingColumnID, sheetIndex, sheetDataArray) ? defaultActionDisabledMessage : "There are no columns to filter in the selected sheet. Add data to the sheet.";
        },
        searchTerms: ["filter", "remove", "delete"],
        tooltip: "Filter this dataframe based on the data in a column."
      },
      ["filter to cell value" /* FilterToCellValue */]: {
        type: "build-time",
        staticType: "filter to cell value" /* FilterToCellValue */,
        titleContextMenu: "Filter to Cell Value",
        iconContextMenu: FilterIcon,
        longTitle: "Filter column",
        actionFunction: () => __async(void 0, null, function* () {
          setEditorState(void 0);
          if (columnID !== void 0) {
            const condition = getEqualityFilterCondition(cellValue, columnDtype);
            yield mitoAPI.editFilter(
              sheetIndex,
              columnID,
              [
                {
                  condition,
                  value: cellValue
                }
              ],
              "And",
              "filter_sort" /* FilterSort */,
              getRandomId()
            );
          }
        }),
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray)) {
            return "There are no columns to filter in the selected sheet. Import data.";
          }
          if (gridState.selections.length === 1 && gridState.selections[0].startingRowIndex === gridState.selections[0].endingRowIndex && gridState.selections[0].startingColumnIndex === gridState.selections[0].endingColumnIndex) {
            return defaultActionDisabledMessage;
          } else {
            return "This action can only be applied to a single cell.";
          }
        },
        searchTerms: ["filter", "remove", "delete"],
        tooltip: "Filter this column to only show rows with the same value as the selected cell."
      },
      ["format number columns" /* Format_Number_Columns */]: {
        type: "build-time",
        staticType: "format number columns" /* Format_Number_Columns */,
        titleToolbar: "Number",
        longTitle: "Format number columns",
        titleContextMenu: "Format Number Column",
        iconContextMenu: NumberFormatIcon_default,
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: "format"
            });
          });
        },
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray)) {
            return "There are no columns to format. Import data.";
          }
          return getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData).length > 0 ? defaultActionDisabledMessage : FORMAT_DISABLED_MESSAGE;
        },
        searchTerms: ["format", "decimals", "percent", "%", "scientific", "Mill", "Bill", "round"],
        tooltip: "Format all of the selected columns as percents, choose the number of decimals, etc. This only changes the display of the data, and does not effect the underlying dataframe."
      },
      ["math formulas dropdown" /* Formulas_Dropdown_Math */]: {
        type: "build-time",
        staticType: "math formulas dropdown" /* Formulas_Dropdown_Math */,
        iconToolbar: MathFunctionsIcon_default,
        longTitle: "Math Formulas",
        titleToolbar: "Math",
        actionFunction: () => {
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: "formula-math"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no columns to perform math on. Import data.";
        },
        searchTerms: ["math", "functions"],
        tooltip: "Perform math on the selected columns."
      },
      ["logical formulas dropdown" /* Formulas_Dropdown_Logic */]: {
        type: "build-time",
        staticType: "logical formulas dropdown" /* Formulas_Dropdown_Logic */,
        iconToolbar: LogicalFunctionsIcon_default,
        longTitle: "Logic Formulas",
        titleToolbar: "Logical",
        actionFunction: () => {
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: "formula-logic"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no columns to perform math on. Import data.";
        },
        searchTerms: ["logic", "functions"],
        tooltip: "Perform logic on the selected columns."
      },
      ["text formulas dropdown" /* Formulas_Dropdown_Text */]: {
        type: "build-time",
        staticType: "text formulas dropdown" /* Formulas_Dropdown_Text */,
        iconToolbar: TextFunctionsIcon_default,
        longTitle: "Text Formulas",
        titleToolbar: "Text",
        actionFunction: () => {
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: "formula-text"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no columns to perform math on. Import data.";
        },
        searchTerms: ["text", "functions"],
        tooltip: "Perform text operations on the selected columns."
      },
      ["date time formulas dropdown" /* Formulas_Dropdown_DateTime */]: {
        type: "build-time",
        staticType: "date time formulas dropdown" /* Formulas_Dropdown_DateTime */,
        iconToolbar: DateTimeFunctionsIcon_default,
        longTitle: "Date and Time Formulas",
        titleToolbar: "Date & Time",
        actionFunction: () => {
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: "formula-date"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no columns to perform math on. Import data.";
        },
        searchTerms: ["date", "time", "datetime", "functions"],
        tooltip: "Perform date / time operations on the selected columns."
      },
      ["reference formulas dropdown" /* Formulas_Dropdown_Reference */]: {
        type: "build-time",
        staticType: "reference formulas dropdown" /* Formulas_Dropdown_Reference */,
        iconToolbar: ReferenceFunctionsIcons_default,
        longTitle: "Lookup & Reference Formulas",
        titleToolbar: "Lookup & Reference",
        actionFunction: () => {
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: "formula-reference"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no columns to perform math on. Import data.";
        },
        searchTerms: ["reference", "lookup", "functions"],
        tooltip: "Perform lookups on the selected columns."
      },
      ["custom formulas dropdown" /* Formulas_Dropdown_Custom */]: {
        type: "build-time",
        staticType: "custom formulas dropdown" /* Formulas_Dropdown_Custom */,
        iconToolbar: ReferenceFunctionsIcons_default,
        longTitle: "Custom Formulas",
        titleToolbar: "Custom",
        actionFunction: () => {
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: "formula-custom"
            });
          });
        },
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray)) {
            return "There are no columns to perform custom functions on. Import data.";
          } else if (analysisData.userDefinedFunctions.length === 0) {
            return "There are no custom formulas available.";
          } else {
            return defaultActionDisabledMessage;
          }
        },
        searchTerms: ["custom", "functions"],
        tooltip: "Perform custom functions on the selected columns."
      },
      ["finance formulas dropdown" /* Formulas_Dropdown_Finance */]: {
        type: "build-time",
        staticType: "finance formulas dropdown" /* Formulas_Dropdown_Finance */,
        iconToolbar: FinancialFunctionsIcon_default,
        longTitle: "Finance Formulas",
        titleToolbar: "Finance",
        actionFunction: () => {
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: "formula-finance"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no columns to perform math on. Import data.";
        },
        searchTerms: ["financial", "finance", "functions"],
        tooltip: "Perform finance operations on the selected columns."
      },
      ["more formulas dropdown" /* Formulas_Dropdown_More */]: {
        type: "build-time",
        staticType: "more formulas dropdown" /* Formulas_Dropdown_More */,
        iconToolbar: MoreFunctionsIcon_default,
        longTitle: "More Formulas",
        titleToolbar: "More",
        actionFunction: () => {
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: "formula-more"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no columns to perform math on. Import data.";
        },
        searchTerms: ["formulas", "functions"],
        tooltip: "Add formulas to the selected columns."
      },
      ["set format to default" /* Set_Format_Default */]: {
        type: "build-time",
        staticType: "set format to default" /* Set_Format_Default */,
        longTitle: "Format as default",
        actionFunction: () => {
          closeOpenEditingPopups();
          const selectedNumberSeriesColumnIDs = getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData);
          void changeFormatOfColumns(sheetIndex, sheetData, selectedNumberSeriesColumnIDs, { type: "plain text" /* PLAIN_TEXT */ }, mitoAPI);
        },
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray)) {
            return "There are no columns to format. Import data.";
          }
          return getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData).length > 0 ? defaultActionDisabledMessage : FORMAT_DISABLED_MESSAGE;
        },
        searchTerms: ["plain", "default", "number format", "format"],
        tooltip: "Format all of the selected columns as default (plain text). This only changes the display of the data, and does not effect the underlying dataframe."
      },
      ["set format to number (two decimal places)" /* Set_Format_Number */]: {
        type: "build-time",
        staticType: "set format to number (two decimal places)" /* Set_Format_Number */,
        longTitle: "Format as number (two decimal places)",
        actionFunction: () => {
          closeOpenEditingPopups();
          const selectedNumberSeriesColumnIDs = getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData);
          void changeFormatOfColumns(sheetIndex, sheetData, selectedNumberSeriesColumnIDs, { precision: 2 }, mitoAPI);
        },
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray)) {
            return "There are no columns to format. Import data.";
          }
          return getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData).length > 0 ? defaultActionDisabledMessage : FORMAT_DISABLED_MESSAGE;
        },
        searchTerms: ["accounting", "number", "number format", "format"],
        tooltip: "Format all of the selected columns as number with two decimal places. This only changes the display of the data, and does not effect the underlying dataframe."
      },
      ["set format to scientific notation" /* Set_Format_Scientific */]: {
        type: "build-time",
        staticType: "set format to scientific notation" /* Set_Format_Scientific */,
        longTitle: "Format as scientific notation",
        actionFunction: () => {
          closeOpenEditingPopups();
          const selectedNumberSeriesColumnIDs = getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData);
          void changeFormatOfColumns(sheetIndex, sheetData, selectedNumberSeriesColumnIDs, { type: "scientific notation" /* SCIENTIFIC_NOTATION */ }, mitoAPI);
        },
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray)) {
            return "There are no columns to format. Import data.";
          }
          return getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData).length > 0 ? defaultActionDisabledMessage : FORMAT_DISABLED_MESSAGE;
        },
        searchTerms: ["scientific notation", "number format", "format"],
        tooltip: "Format all of the selected columns as scientific notation. This only changes the display of the data, and does not effect the underlying dataframe."
      },
      ["set format to currency" /* Set_Format_Currency */]: {
        type: "build-time",
        staticType: "set format to currency" /* Set_Format_Currency */,
        iconToolbar: CurrencyIcon_default,
        longTitle: "Format as currency",
        actionFunction: () => {
          closeOpenEditingPopups();
          const selectedNumberSeriesColumnIDs = getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData);
          void changeFormatOfColumns(sheetIndex, sheetData, selectedNumberSeriesColumnIDs, { type: "currency" /* CURRENCY */ }, mitoAPI);
        },
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray)) {
            return "There are no columns to format. Import data.";
          }
          return getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData).length > 0 ? defaultActionDisabledMessage : FORMAT_DISABLED_MESSAGE;
        },
        searchTerms: ["currency", "number format", "format"],
        tooltip: "Format all of the selected columns as currency. This only changes the display of the data, and does not effect the underlying dataframe."
      },
      ["set format to percent" /* Set_Format_Percent */]: {
        type: "build-time",
        staticType: "set format to percent" /* Set_Format_Percent */,
        iconToolbar: PercentIcon_default,
        longTitle: "Format as percentage",
        actionFunction: () => {
          closeOpenEditingPopups();
          const selectedNumberSeriesColumnIDs = getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData);
          void changeFormatOfColumns(sheetIndex, sheetData, selectedNumberSeriesColumnIDs, { type: "percentage" /* PERCENTAGE */ }, mitoAPI);
        },
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray)) {
            return "There are no columns to format. Import data.";
          }
          return getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData).length > 0 ? defaultActionDisabledMessage : FORMAT_DISABLED_MESSAGE;
        },
        searchTerms: ["percent", "%", "number format", "format"],
        tooltip: "Format all of the selected columns as percentage. This only changes the display of the data, and does not effect the underlying dataframe."
      },
      ["set datetime type" /* Set_DateTime_Dtype */]: {
        type: "build-time",
        staticType: "set datetime type" /* Set_DateTime_Dtype */,
        longTitle: "Set datetime type",
        actionFunction: () => {
          closeOpenEditingPopups();
          const columnIndexesSelected = getColumnIndexesInSelections(gridState.selections);
          const columnIDs = columnIndexesSelected.filter((colIdx) => sheetData.data.length > colIdx).map((colIdx) => {
            var _a;
            return (_a = sheetData.data[colIdx]) == null ? void 0 : _a.columnID;
          });
          void mitoAPI.editChangeColumnDtype(sheetIndex, columnIDs, "datetime" /* DATETIME */, getRandomId());
        },
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray)) {
            return "There are no columns to format. Import data.";
          }
          return defaultActionDisabledMessage;
        },
        searchTerms: ["datetime", "dtype"],
        tooltip: "Set datatype of all of the selected columns to datetime."
      },
      ["fullscreen" /* Fullscreen */]: {
        type: "build-time",
        staticType: "fullscreen" /* Fullscreen */,
        longTitle: "Toggle fullscreen",
        actionFunction: () => {
          const isNotFullscreen = fscreen_esm_default.fullscreenElement === void 0 || fscreen_esm_default.fullscreenElement === null;
          if (isNotFullscreen && mitoContainerRef.current) {
            fscreen_esm_default.requestFullscreen(mitoContainerRef.current);
          } else {
            fscreen_esm_default.exitFullscreen();
          }
          void mitoAPI.log(
            "button_toggle_fullscreen",
            {
              fullscreen: !!fscreen_esm_default.fullscreenElement
            }
          );
        },
        isDisabled: () => {
          return void 0;
        },
        searchTerms: ["fullscreen", "zoom"],
        tooltip: "Enter fullscreen mode to see more of your data."
      },
      ["graph" /* Graph */]: {
        type: "build-time",
        staticType: "graph" /* Graph */,
        iconToolbar: GraphIcon_default,
        titleToolbar: "Graph",
        longTitle: "Create new graph",
        actionFunction: () => __async(void 0, null, function* () {
          const selectedColumnIds = getSelectedColumnIDsWithEntireSelectedColumn(gridState.selections, sheetData);
          yield openGraphSidebar(setUIState, uiState, setEditorState, sheetDataArray, mitoAPI, { type: "new_graph", graphType: "bar" /* BAR */, selectedColumnIds });
        }),
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no dataframes to graph. Import data.";
        },
        searchTerms: ["graph", "chart", "visualize", "bar chart", "box plot", "scatter plot", "histogram"],
        tooltip: "Create an interactive graph. Pick from bar charts, histograms, scatter plots, etc."
      },
      ["bar chart" /* Graph_Bar */]: {
        type: "build-time",
        staticType: "bar chart" /* Graph_Bar */,
        iconToolbar: GraphIcon_default,
        longTitle: "Create new bar chart",
        actionFunction: () => __async(void 0, null, function* () {
          const selectedColumnIds = getSelectedColumnIDsWithEntireSelectedColumn(gridState.selections, sheetData);
          yield openGraphSidebar(setUIState, uiState, setEditorState, sheetDataArray, mitoAPI, { type: "new_graph", graphType: "bar" /* BAR */, selectedColumnIds });
        }),
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no dataframes to graph. Import data.";
        },
        searchTerms: ["graph", "chart", "visualize", "bar chart", "box plot", "scatter plot", "histogram"],
        tooltip: "Create an interactive bar chart."
      },
      ["line graph" /* Graph_Line */]: {
        type: "build-time",
        staticType: "line graph" /* Graph_Line */,
        iconToolbar: LineChartIcon_default,
        longTitle: "Create new line graph",
        actionFunction: () => __async(void 0, null, function* () {
          const selectedColumnIds = getSelectedColumnIDsWithEntireSelectedColumn(gridState.selections, sheetData);
          yield openGraphSidebar(setUIState, uiState, setEditorState, sheetDataArray, mitoAPI, { type: "new_graph", graphType: "line" /* LINE */, selectedColumnIds });
        }),
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no dataframes to graph. Import data.";
        },
        searchTerms: ["graph", "chart", "visualize", "bar chart", "box plot", "scatter plot", "histogram"],
        tooltip: "Create an interactive line graph."
      },
      ["scatter plot" /* Graph_Scatter */]: {
        type: "build-time",
        staticType: "scatter plot" /* Graph_Scatter */,
        iconToolbar: ScatterPlotIcon_default,
        longTitle: "Create new scatter plot",
        actionFunction: () => __async(void 0, null, function* () {
          const selectedColumnIds = getSelectedColumnIDsWithEntireSelectedColumn(gridState.selections, sheetData);
          yield openGraphSidebar(setUIState, uiState, setEditorState, sheetDataArray, mitoAPI, { type: "new_graph", graphType: "scatter" /* SCATTER */, selectedColumnIds });
        }),
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no dataframes to graph. Import data.";
        },
        searchTerms: ["graph", "chart", "visualize", "bar chart", "box plot", "scatter plot", "histogram"],
        tooltip: "Create an interactive scatter plot."
      },
      ["help" /* Help */]: {
        type: "build-time",
        staticType: "help" /* Help */,
        titleToolbar: "Help",
        longTitle: "Help",
        actionFunction: () => {
          setEditorState(void 0);
          if (userProfile.mitoConfig.MITO_CONFIG_SUPPORT_EMAIL === DEFAULT_SUPPORT_EMAIL) {
            window.open(DISCORD_INVITE_LINK, "_blank");
          } else {
            window.open(`mailto:${userProfile.mitoConfig.MITO_CONFIG_SUPPORT_EMAIL}?subject=Mito support request`);
          }
        },
        isDisabled: () => {
          return void 0;
        },
        searchTerms: ["help", "contact", "support", "slack", "discord"],
        tooltip: "Join our Discord for more help."
      },
      ["import dropdown" /* Import_Dropdown */]: {
        type: "build-time",
        staticType: "import dropdown" /* Import_Dropdown */,
        iconToolbar: ImportIcon_default,
        titleToolbar: "Import",
        longTitle: "Open import dropdown",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: "import"
            });
          });
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["import", "upload", "new", "excel", "csv", "add"],
        tooltip: "Import a new sheet from .csv or .xlsx files, dataframe objects, or through Snowflake."
      },
      ["import files" /* Import_Files */]: {
        type: "build-time",
        staticType: "import files" /* Import_Files */,
        titleToolbar: "Import Files",
        iconToolbar: FileImportIcon_default,
        longTitle: "Import files",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: { type: "import files" /* IMPORT_FILES */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["import", "upload", "new", "excel", "csv", "add"],
        tooltip: "Import any .csv or well-formatted .xlsx file as a new sheet."
      },
      ["merge" /* Merge */]: {
        type: "build-time",
        staticType: "merge" /* Merge */,
        iconToolbar: MergeIcon_default,
        titleToolbar: "Merge",
        longTitle: "Merge dataframes",
        actionFunction: () => __async(void 0, null, function* () {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: { type: "merge" /* MERGE */ },
              selectedTabType: "data"
            });
          });
        }),
        isDisabled: () => {
          return sheetDataArray.length >= 2 ? defaultActionDisabledMessage : "You need to import at least two dataframes before you can merge them.";
        },
        searchTerms: ["merge", "join", "vlookup", "lookup", "anti", "diff", "difference", "unique"],
        tooltip: "Merge two dataframes together using a lookup, left, right, inner, or outer join. Or find the differences between two dataframes."
      },
      ["merge dropdown" /* Merge_Dropdown */]: {
        type: "build-time",
        staticType: "merge dropdown" /* Merge_Dropdown */,
        iconToolbar: MergeIcon_default,
        titleToolbar: "Merge",
        longTitle: "Merge dataframes",
        actionFunction: () => __async(void 0, null, function* () {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: "merge"
            });
          });
        }),
        isDisabled: () => {
          return sheetDataArray.length >= 2 ? defaultActionDisabledMessage : "You need to import at least two dataframes before you can merge them.";
        },
        searchTerms: ["merge", "join", "vlookup", "lookup", "anti", "diff", "difference", "unique"],
        tooltip: "Merge two dataframes together using a lookup, left, right, inner, or outer join. Or find the differences between two dataframes."
      },
      ["anti merge" /* AntiMerge */]: {
        type: "build-time",
        staticType: "anti merge" /* AntiMerge */,
        iconToolbar: AntiMergeIcon_default,
        titleToolbar: "Anti-Merge",
        longTitle: "Merge dataframes unique in left",
        actionFunction: () => __async(void 0, null, function* () {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: { type: "merge" /* MERGE */, defaultMergeType: "unique in left" /* UNIQUE_IN_LEFT */ },
              selectedTabType: "data"
            });
          });
        }),
        isDisabled: () => {
          return sheetDataArray.length >= 2 ? defaultActionDisabledMessage : "You need to import at least two dataframes before you can merge them.";
        },
        searchTerms: ["merge", "join", "vlookup", "lookup", "anti", "diff", "difference", "unique"],
        tooltip: "Merge two dataframes by including each row from the first sheet that doesn't have a match in the second sheet."
      },
      ["concat_dataframes" /* Concat_Dataframes */]: {
        type: "build-time",
        staticType: "concat_dataframes" /* Concat_Dataframes */,
        iconToolbar: ConcatIcon_default,
        titleToolbar: "Concat",
        longTitle: "Concatenate dataframes",
        actionFunction: () => __async(void 0, null, function* () {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: { type: "concat" /* CONCAT */ },
              selectedTabType: "data"
            });
          });
        }),
        isDisabled: () => {
          return sheetDataArray.length >= 2 ? defaultActionDisabledMessage : "You need to import at least two dataframes before you can concatenate them.";
        },
        searchTerms: ["stack", "merge", "join", "concat", "concatenate", "append"],
        tooltip: "Concatenate two or more dataframes by stacking them vertically on top of eachother."
      },
      ["pivot" /* Pivot */]: {
        type: "build-time",
        staticType: "pivot" /* Pivot */,
        iconToolbar: PivotIcon_default,
        titleToolbar: "Pivot",
        longTitle: "Pivot table",
        actionFunction: () => __async(void 0, null, function* () {
          setEditorState(void 0);
          if (dfSources[sheetIndex] === "pivoted" /* Pivoted */) {
            const response = yield mitoAPI.getPivotParams(sheetIndex);
            const existingPivotParams = "error" in response ? void 0 : response.result;
            if (existingPivotParams !== void 0) {
              setUIState((prevUIState) => {
                return __spreadProps(__spreadValues({}, prevUIState), {
                  currOpenModal: { type: "None" /* None */ },
                  currOpenTaskpane: {
                    type: "pivot" /* PIVOT */,
                    sourceSheetIndex: existingPivotParams.sheet_index,
                    destinationSheetIndex: sheetIndex,
                    existingPivotParams
                  },
                  selectedTabType: "data"
                });
              });
              return;
            }
          }
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: {
                type: "pivot" /* PIVOT */,
                sourceSheetIndex: sheetIndex,
                destinationSheetIndex: void 0,
                existingPivotParams: void 0
              },
              selectedTabType: "data"
            });
          });
        }),
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no sheets to pivot. Import data.";
        },
        searchTerms: ["pivot", "group", "group by", "summarize", "aggregate"],
        tooltip: "Create a Pivot Table to summarise data by breaking the data into groups and calculating statistics about each group."
      },
      ["precision decrease" /* Precision_Decrease */]: {
        type: "build-time",
        staticType: "precision decrease" /* Precision_Decrease */,
        iconToolbar: LessIcon_default,
        longTitle: "Decrease decimal places displayed",
        actionFunction: () => __async(void 0, null, function* () {
          closeOpenEditingPopups();
          const selectedNumberSeriesColumnIDs = getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData);
          const newDfFormat = window.structuredClone(dfFormat);
          selectedNumberSeriesColumnIDs.forEach((columnID2) => {
            const columnDtype2 = sheetData.columnDtypeMap[columnID2];
            const newColumnFormat = decreasePrecision(__spreadValues({}, newDfFormat.columns[columnID2]), columnDtype2);
            newDfFormat.columns[columnID2] = newColumnFormat;
          });
          void mitoAPI.editSetDataframeFormat(sheetIndex, newDfFormat);
        }),
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray)) {
            return "There are no columns to format. Import data.";
          }
          return getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData).length > 0 ? defaultActionDisabledMessage : FORMAT_DISABLED_MESSAGE;
        },
        searchTerms: ["format", "round", "decimal", "decimal places", "fraction"],
        tooltip: "Decrease the number of decimal places that are displayed in the selected number columns."
      },
      ["precision increase" /* Precision_Increase */]: {
        type: "build-time",
        staticType: "precision increase" /* Precision_Increase */,
        iconToolbar: MoreIcon_default,
        longTitle: "Increase decimal places displayed",
        actionFunction: () => __async(void 0, null, function* () {
          closeOpenEditingPopups();
          const selectedNumberSeriesColumnIDs = getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData);
          const newDfFormat = window.structuredClone(dfFormat);
          selectedNumberSeriesColumnIDs.forEach((columnID2) => {
            const columnDtype2 = sheetData.columnDtypeMap[columnID2];
            const newColumnFormat = increasePrecision(__spreadValues({}, newDfFormat.columns[columnID2]), columnDtype2);
            newDfFormat.columns[columnID2] = newColumnFormat;
          });
          void mitoAPI.editSetDataframeFormat(sheetIndex, newDfFormat);
        }),
        isDisabled: () => {
          if (!doesAnySheetExist(sheetDataArray)) {
            return "There are no columns to format. Import data.";
          }
          return getSelectedNumberSeriesColumnIDs(gridState.selections, sheetData).length > 0 ? defaultActionDisabledMessage : FORMAT_DISABLED_MESSAGE;
        },
        searchTerms: ["format", "round", "decimal", "decimal places", "fraction"],
        tooltip: "Increase the number of decimal places that are displayed in the selected number columns."
      },
      ["promote row to header" /* Promote_Row_To_Header */]: {
        type: "build-time",
        staticType: "promote row to header" /* Promote_Row_To_Header */,
        titleToolbar: "Promote to Header",
        iconContextMenu: PromoteToHeaderIcon_default,
        titleContextMenu: "Promote Row to Header",
        longTitle: "Promote Row to header",
        actionFunction: () => __async(void 0, null, function* () {
          const rowsToPromote = getSelectedRowLabelsWithEntireSelectedRow(gridState.selections, sheetData);
          if (rowsToPromote.length > 0) {
            void mitoAPI.editPromoteRowToHeader(sheetIndex, rowsToPromote[0]);
          }
        }),
        isDisabled: () => {
          const rowsToDelete = getSelectedRowLabelsWithEntireSelectedRow(gridState.selections, sheetData);
          if (rowsToDelete.length > 0) {
            return defaultActionDisabledMessage;
          }
          return "There is no selected row to promote to header.";
        },
        searchTerms: ["make header", "row to header", "rename headers", "column headers", "promote row"],
        tooltip: "Promote the selected row to be the header of the dataframe, and delete it."
      },
      ["redo" /* Redo */]: {
        type: "build-time",
        staticType: "redo" /* Redo */,
        iconToolbar: RedoIcon_default,
        longTitle: "Redo",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups(ALLOW_UNDO_REDO_EDITING_TASKPANES);
          void mitoAPI.updateRedo();
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["redo", "undo"],
        tooltip: "Reapplies the last step that you undid, as long as you haven't made any edits since the undo."
      },
      ["rename column" /* Rename_Column */]: {
        type: "build-time",
        staticType: "rename column" /* Rename_Column */,
        titleToolbar: "Rename Column",
        titleContextMenu: "Rename",
        iconContextMenu: EditIcon_default,
        longTitle: "Rename column",
        actionFunction: () => {
          let columnIndex = startingColumnIndex;
          if (typeof uiState.currOpenDropdown === "object" && uiState.currOpenDropdown.type === "context-menu") {
            columnIndex = uiState.currOpenDropdown.columnIndex;
          }
          const columnHeader = getCellDataFromCellIndexes(sheetData, -1, columnIndex).columnHeader;
          const columnHeaderSafe = columnHeader !== void 0 ? columnHeader : "";
          const finalColumnHeader = getColumnHeaderParts(columnHeaderSafe).finalColumnHeader;
          setEditorState({
            rowIndex: -1,
            columnIndex,
            formula: getDisplayColumnHeader(finalColumnHeader),
            editorLocation: "cell",
            editingMode: "specific_index_labels",
            sheetIndex
          });
        },
        isDisabled: () => {
          return doesColumnExist(startingColumnID, sheetIndex, sheetDataArray) ? defaultActionDisabledMessage : "There are no columns in the dataframe to rename. Add data to the dataframe.";
        },
        searchTerms: ["rename", "name", "header"],
        tooltip: "Rename the selected column."
      },
      ["rename dataframe" /* Rename_Dataframe */]: {
        type: "build-time",
        staticType: "rename dataframe" /* Rename_Dataframe */,
        titleToolbar: "Rename dataframe",
        longTitle: "Rename dataframe",
        actionFunction: () => {
          var _a;
          const selectedSheetTab = (_a = mitoContainerRef.current) == null ? void 0 : _a.querySelector(".tab-selected");
          if (selectedSheetTab) {
            const event = new MouseEvent("dblclick", {
              "view": window,
              "bubbles": true,
              "cancelable": true
            });
            selectedSheetTab.dispatchEvent(event);
          }
        },
        isDisabled: () => {
          return getDataframeIsSelected(uiState, sheetDataArray) ? defaultActionDisabledMessage : "There is no selected dataframe to rename.";
        },
        searchTerms: ["rename", "name"],
        tooltip: "Rename the selected sheet."
      },
      ["rename graph" /* Rename_Graph */]: {
        type: "build-time",
        staticType: "rename graph" /* Rename_Graph */,
        titleToolbar: "Rename Graph",
        longTitle: "Rename graph",
        actionFunction: () => {
          var _a;
          const selectedSheetTab = (_a = mitoContainerRef.current) == null ? void 0 : _a.querySelector(".tab-selected");
          if (selectedSheetTab) {
            const event = new MouseEvent("dblclick", {
              "view": window,
              "bubbles": true,
              "cancelable": true
            });
            selectedSheetTab.dispatchEvent(event);
          }
        },
        isDisabled: () => {
          return getAnyGraphIsSelected(uiState) ? defaultActionDisabledMessage : "There is not selected graph to rename.";
        },
        searchTerms: ["rename", "name", "graph"],
        tooltip: "Rename the selected graph."
      },
      ["schedule github" /* Schedule_Github */]: {
        type: "build-time",
        staticType: "schedule github" /* Schedule_Github */,
        titleToolbar: "Schedule Automation",
        iconToolbar: ScheduleIcon_default,
        longTitle: "Schedule Automation",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "GithubSchedule" /* GITHUB_SCHEDULE */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? void 0 : "Please import and edit data before scheduling an automation.";
        },
        searchTerms: ["github", "pull request", "automation", "schedule"],
        tooltip: "Create a GitHub pull request that schedules this analysis to run at a specific time."
      },
      ["see all functionality" /* See_All_Functionality */]: {
        type: "build-time",
        staticType: "see all functionality" /* See_All_Functionality */,
        titleToolbar: "See All Functionality",
        longTitle: "See all functionality",
        actionFunction: () => {
          setEditorState(void 0);
          void mitoAPI.log("clicked_documentation");
          window.open("https://docs.trymito.io/how-to/importing-data-to-mito", "_blank");
        },
        isDisabled: () => {
          return void 0;
        },
        searchTerms: ["docs", "documentation", "help", "support"],
        tooltip: "Documentation, tutorials, and how-tos on all functionality in Mito."
      },
      ["select columns" /* Select_Columns */]: {
        type: "build-time",
        staticType: "select columns" /* Select_Columns */,
        longTitle: "Select column",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          const minColumnIndex = Math.min(gridState.selections[0].startingColumnIndex, gridState.selections[0].endingColumnIndex);
          const maxColumnIndex = Math.max(gridState.selections[0].startingColumnIndex, gridState.selections[0].endingColumnIndex);
          const newStartingColumnIndex = Math.max(minColumnIndex, 0);
          const newEndingColumnIndex = Math.min(maxColumnIndex, sheetData.numColumns - 1);
          setGridState((prevGridState) => {
            return __spreadProps(__spreadValues({}, prevGridState), {
              selections: [{
                startingColumnIndex: newStartingColumnIndex,
                endingColumnIndex: newEndingColumnIndex,
                startingRowIndex: -1,
                endingRowIndex: -1,
                sheetIndex
              }]
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no columns to select. Import data.";
        },
        searchTerms: ["select", "columns", "select columns"],
        tooltip: "Select columns for all cells in currently selected range."
      },
      ["select rows" /* Select_Rows */]: {
        type: "build-time",
        staticType: "select rows" /* Select_Rows */,
        longTitle: "Select row",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          const minRowIndex = Math.min(gridState.selections[0].startingRowIndex, gridState.selections[0].endingRowIndex);
          const maxRowIndex = Math.max(gridState.selections[0].startingRowIndex, gridState.selections[0].endingRowIndex);
          const newStartingRowIndex = Math.max(minRowIndex, 0);
          const newEndingRowIndex = Math.min(maxRowIndex, sheetData.numRows - 1);
          setGridState((prevGridState) => {
            return __spreadProps(__spreadValues({}, prevGridState), {
              selections: [{
                startingRowIndex: newStartingRowIndex,
                endingRowIndex: newEndingRowIndex,
                startingColumnIndex: -1,
                endingColumnIndex: -1,
                sheetIndex
              }]
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no rows to select. Import data.";
        },
        searchTerms: ["select", "rows", "select rows"],
        tooltip: "Select rows for all cells in currently selected range."
      },
      ["select all" /* Select_All */]: {
        type: "build-time",
        staticType: "select all" /* Select_All */,
        longTitle: "Select all columns",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          setGridState((prevGridState) => {
            return __spreadProps(__spreadValues({}, prevGridState), {
              selections: [{
                startingRowIndex: -1,
                endingRowIndex: -1,
                startingColumnIndex: 0,
                endingColumnIndex: sheetData.numColumns - 1,
                sheetIndex
              }]
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no cells to select. Import data.";
        },
        searchTerms: ["select", "cells", "select all columns"],
        tooltip: "Select all data in current sheet."
      },
      ["set cell value" /* Set_Cell_Value */]: {
        type: "build-time",
        staticType: "set cell value" /* Set_Cell_Value */,
        titleToolbar: "Set Cell Value",
        longTitle: "Set cell value",
        actionFunction: () => __async(void 0, null, function* () {
          if (startingColumnID === void 0) {
            return;
          }
          closeOpenEditingPopups();
          setEditorState({
            rowIndex: startingRowIndex,
            columnIndex: startingColumnIndex,
            formula: startingColumnFormula,
            arrowKeysScrollInFormula: true,
            editorLocation: "cell",
            editingMode: "specific_index_labels",
            sheetIndex
          });
        }),
        isDisabled: () => {
          if (!doesColumnExist(startingColumnID, sheetIndex, sheetDataArray) || !doesSheetContainData(sheetIndex, sheetDataArray)) {
            return "There are no cells in the dataframe to set the value of. Add data to the sheet.";
          }
          if (startingRowIndex === -1) {
            return "An entire column is selected. Select a single cell to edit.";
          }
          return defaultActionDisabledMessage;
        },
        searchTerms: ["formula", "function", "edit", "set", "set formula", "set column formula"],
        tooltip: "Update the value of a specific cell in a data column."
      },
      ["set column formula" /* Set_Column_Formula */]: {
        type: "build-time",
        staticType: "set column formula" /* Set_Column_Formula */,
        iconToolbar: FunctionIcon_default,
        titleToolbar: "Insert Function",
        longTitle: "Set column formula",
        actionFunction: () => __async(void 0, null, function* () {
          closeOpenEditingPopups();
          setEditorState({
            rowIndex: startingRowIndex !== -1 ? startingRowIndex : 0,
            columnIndex: startingColumnIndex,
            formula: startingColumnFormula,
            arrowKeysScrollInFormula,
            editorLocation: "cell",
            editingMode: "entire_column",
            sheetIndex
          });
        }),
        isDisabled: () => {
          if (!doesColumnExist(startingColumnID, sheetIndex, sheetDataArray) || !doesSheetContainData(sheetIndex, sheetDataArray)) {
            return "There are no cells in the dataframe to set the formula of. Add data to the sheet.";
          }
          return defaultActionDisabledMessage;
        },
        searchTerms: ["formula", "function", "edit", "set", "set formula", "set column formula"],
        tooltip: "Use one of Mito's spreadsheet formulas or basic math operators to set the column's values."
      },
      ["sort" /* Sort */]: {
        type: "build-time",
        staticType: "sort" /* Sort */,
        iconToolbar: SortIcon_default,
        titleToolbar: "Sort",
        longTitle: "Sort column",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "control_panel" /* CONTROL_PANEL */ },
              selectedColumnControlPanelTab: "filter_sort" /* FilterSort */,
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesColumnExist(startingColumnID, sheetIndex, sheetDataArray) ? defaultActionDisabledMessage : "There are no columns to sort in the selected sheet. Add data to the sheet.";
        },
        searchTerms: ["sort", "ascending", "descending", "arrange"],
        tooltip: "Sort a column in ascending or descending order."
      },
      ["sort ascending" /* SortAscending */]: {
        type: "build-time",
        staticType: "sort ascending" /* SortAscending */,
        iconToolbar: SortAscendingIcon_default,
        titleContextMenu: "Sort A to Z",
        longTitle: "Sort column ascending",
        actionFunction: () => {
          setEditorState(void 0);
          if (startingColumnID === void 0) {
            return;
          }
          let columnIndex = startingColumnIndex;
          if (typeof uiState.currOpenDropdown === "object" && uiState.currOpenDropdown.type === "context-menu") {
            columnIndex = uiState.currOpenDropdown.columnIndex;
          }
          const columnIDForSort = getColumnIDByIndex(sheetData, columnIndex);
          void mitoAPI.editSortColumn(sheetIndex, columnIDForSort, "ascending" /* ASCENDING */);
        },
        isDisabled: () => {
          return doesColumnExist(startingColumnID, sheetIndex, sheetDataArray) ? defaultActionDisabledMessage : "There are no columns to sort in the selected sheet. Add data to the sheet.";
        },
        searchTerms: ["sort", "ascending", "arrange"],
        tooltip: "Sort a column in ascending order."
      },
      ["sort descending" /* SortDescending */]: {
        type: "build-time",
        staticType: "sort descending" /* SortDescending */,
        iconToolbar: SortDescendingIcon_default,
        titleContextMenu: "Sort Z to A",
        longTitle: "Sort column descending",
        actionFunction: () => {
          setEditorState(void 0);
          if (startingColumnID === void 0) {
            return;
          }
          let columnIndex = startingColumnIndex;
          if (typeof uiState.currOpenDropdown === "object" && uiState.currOpenDropdown.type === "context-menu") {
            columnIndex = uiState.currOpenDropdown.columnIndex;
          }
          const columnIDForSort = getColumnIDByIndex(sheetData, columnIndex);
          void mitoAPI.editSortColumn(sheetIndex, columnIDForSort, "descending" /* DESCENDING */);
        },
        isDisabled: () => {
          return doesColumnExist(startingColumnID, sheetIndex, sheetDataArray) ? defaultActionDisabledMessage : "There are no columns to sort in the selected sheet. Add data to the sheet.";
        },
        searchTerms: ["sort", "descending", "arrange"],
        tooltip: "Sort a column in descending order."
      },
      ["split text to column" /* Split_Text_To_Column */]: {
        type: "build-time",
        staticType: "split text to column" /* Split_Text_To_Column */,
        iconToolbar: TextToColumnsIcon_default,
        titleToolbar: "Text to Columns",
        longTitle: "Split text to columns",
        actionFunction: () => {
          closeOpenEditingPopups();
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: { type: "split_text_to_columns" /* SPLIT_TEXT_TO_COLUMNS */, startingColumnID }
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no dataframes to operate on. Import data.";
        },
        searchTerms: ["split", "extract", "parse", "column", "splice", "text", "delimiter", "comma", "space", "tab", "dash"],
        tooltip: "Split a column on a delimiter to break it into multiple columns."
      },
      ["steps" /* Steps */]: {
        type: "build-time",
        staticType: "steps" /* Steps */,
        longTitle: "Step history",
        actionFunction: () => {
          void mitoAPI.log("click_open_steps");
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: { type: "steps" /* STEPS */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["steps", "history"],
        tooltip: "View a list of all the edits you've made to your data."
      },
      ["open search" /* OpenFind */]: {
        type: "build-time",
        staticType: "open search" /* OpenFind */,
        iconToolbar: SearchIcon_default,
        longTitle: "Find",
        actionFunction: () => {
          var _a;
          setEditorState(void 0);
          if (uiState.currOpenSearch.isOpen) {
            const searchInput = (_a = mitoContainerRef.current) == null ? void 0 : _a.querySelector("#mito-search-bar-input");
            if (searchInput) {
              searchInput.focus();
              searchInput.select();
            }
          } else {
            setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenSearch: __spreadProps(__spreadValues({}, prevUIState.currOpenSearch), { isOpen: true })
              });
            });
          }
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no sheets to pivot. Import data.";
        },
        searchTerms: ["search", "find", "filter", "lookup"],
        tooltip: "Search for a value in your data."
      },
      ["open search and replace" /* OpenFindAndReplace */]: {
        type: "build-time",
        staticType: "open search and replace" /* OpenFindAndReplace */,
        longTitle: "Find and Replace",
        actionFunction: () => {
          var _a;
          setEditorState(void 0);
          if (uiState.currOpenSearch.isOpen) {
            const searchInput = (_a = mitoContainerRef.current) == null ? void 0 : _a.querySelector("#mito-search-bar-input");
            if (searchInput) {
              searchInput.focus();
              searchInput.select();
            }
          }
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenSearch: __spreadProps(__spreadValues({}, prevUIState.currOpenSearch), { isOpen: true, isExpanded: true })
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no sheets to pivot. Import data.";
        },
        searchTerms: ["search", "find", "filter", "lookup"],
        tooltip: "Search for a value in your data and replace with another value."
      },
      ["open next sheet" /* Open_Next_Sheet */]: {
        type: "build-time",
        staticType: "open next sheet" /* Open_Next_Sheet */,
        longTitle: "Open Next Sheet",
        actionFunction: () => {
          setEditorState(void 0);
          const selectedSheetIndex = uiState.selectedSheetIndex;
          const selectedGraphID = uiState.currOpenTaskpane.type === "graph" /* GRAPH */ ? uiState.currOpenTaskpane.openGraph.graphID : void 0;
          if (selectedGraphID !== void 0) {
            const graphIndex = analysisData.graphDataArray.findIndex((graphData) => graphData.graph_id === selectedGraphID);
            if (graphIndex === -1 || graphIndex === analysisData.graphDataArray.length - 1) {
              setUIState((prevUIState) => {
                return __spreadProps(__spreadValues({}, prevUIState), {
                  currOpenTaskpane: { type: "none" /* NONE */ },
                  selectedTabType: "data",
                  selectedSheetIndex: 0
                });
              });
            } else {
              void openGraphSidebar(setUIState, uiState, setEditorState, sheetDataArray, mitoAPI, {
                type: "existing_graph",
                graphID: analysisData.graphDataArray[graphIndex + 1].graph_id
              });
              return;
            }
          } else {
            if (selectedSheetIndex === sheetDataArray.length - 1 && analysisData.graphDataArray.length > 0) {
              void openGraphSidebar(setUIState, uiState, setEditorState, sheetDataArray, mitoAPI, {
                type: "existing_graph",
                graphID: analysisData.graphDataArray[0].graph_id
              });
              return;
            } else {
              setUIState((prevUIState) => {
                return __spreadProps(__spreadValues({}, prevUIState), {
                  selectedSheetIndex: selectedSheetIndex === sheetDataArray.length - 1 ? 0 : selectedSheetIndex + 1
                });
              });
            }
          }
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["sheet", "index", "next", "forward"],
        tooltip: "Go to the next sheet."
      },
      ["open previous sheet" /* Open_Previous_Sheet */]: {
        type: "build-time",
        staticType: "open previous sheet" /* Open_Previous_Sheet */,
        longTitle: "Open Previous Sheet",
        actionFunction: () => {
          setEditorState(void 0);
          const selectedSheetIndex = uiState.selectedSheetIndex;
          const selectedGraphID = uiState.currOpenTaskpane.type === "graph" /* GRAPH */ ? uiState.currOpenTaskpane.openGraph.graphID : void 0;
          if (selectedGraphID !== void 0) {
            const graphIndex = analysisData.graphDataArray.findIndex((graphData) => graphData.graph_id === selectedGraphID);
            if (graphIndex === -1 || graphIndex === 0) {
              setUIState((prevUIState) => {
                return __spreadProps(__spreadValues({}, prevUIState), {
                  currOpenTaskpane: { type: "none" /* NONE */ },
                  selectedTabType: "data",
                  selectedSheetIndex: sheetDataArray.length - 1
                });
              });
            } else {
              void openGraphSidebar(setUIState, uiState, setEditorState, sheetDataArray, mitoAPI, {
                type: "existing_graph",
                graphID: analysisData.graphDataArray[graphIndex - 1].graph_id
              });
              return;
            }
          } else {
            if (selectedSheetIndex === 0 && analysisData.graphDataArray.length > 0) {
              void openGraphSidebar(setUIState, uiState, setEditorState, sheetDataArray, mitoAPI, {
                type: "existing_graph",
                graphID: analysisData.graphDataArray[analysisData.graphDataArray.length - 1].graph_id
              });
              return;
            } else {
              setUIState((prevUIState) => {
                return __spreadProps(__spreadValues({}, prevUIState), {
                  selectedSheetIndex: selectedSheetIndex === 0 ? sheetDataArray.length - 1 : selectedSheetIndex - 1
                });
              });
            }
          }
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["sheet", "index", "previous", "last"],
        tooltip: "Go to the previous sheet."
      },
      ["undo" /* Undo */]: {
        type: "build-time",
        staticType: "undo" /* Undo */,
        iconToolbar: UndoIcon_default,
        longTitle: "Undo",
        actionFunction: () => __async(void 0, null, function* () {
          setEditorState(void 0);
          closeOpenEditingPopups(ALLOW_UNDO_REDO_EDITING_TASKPANES);
          yield mitoAPI.updateUndo();
          const currOpenTaskpane = uiState.currOpenTaskpane;
          if (currOpenTaskpane.type === "graph" /* GRAPH */) {
            if (!analysisData.graphDataArray.find((graphData) => graphData.graph_id === currOpenTaskpane.openGraph.graphID)) {
              setUIState((prevUIState) => {
                return __spreadProps(__spreadValues({}, prevUIState), {
                  currOpenTaskpane: { type: "none" /* NONE */ },
                  selectedTabType: "data"
                });
              });
            }
          }
        }),
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["undo", "go back", "redo"],
        tooltip: "Undo the most recent edit."
      },
      ["unique values" /* Unique_Values */]: {
        type: "build-time",
        staticType: "unique values" /* Unique_Values */,
        iconContextMenu: StarIcon_default,
        titleToolbar: "Unique Values",
        titleContextMenu: "Column Unique Values",
        longTitle: "View unique values",
        actionFunction: () => {
          setEditorState(void 0);
          if (typeof uiState.currOpenDropdown === "object" && uiState.currOpenDropdown.type === "context-menu") {
            const rowIndex = uiState.currOpenDropdown.rowIndex;
            const columnIndex = uiState.currOpenDropdown.columnIndex;
            setGridState((prevGridState) => {
              return __spreadProps(__spreadValues({}, prevGridState), {
                selections: [{
                  sheetIndex,
                  startingRowIndex: rowIndex,
                  startingColumnIndex: columnIndex,
                  endingRowIndex: rowIndex,
                  endingColumnIndex: columnIndex
                }]
              });
            });
          }
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "control_panel" /* CONTROL_PANEL */ },
              selectedColumnControlPanelTab: "unique_values" /* UniqueValues */,
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesColumnExist(startingColumnID, sheetIndex, sheetDataArray) ? defaultActionDisabledMessage : "There are no columns in the selected sheet. Add data to the sheet.";
        },
        searchTerms: ["unique values", "values", "toggle", "filter"],
        tooltip: "See a list of unique values in the column, and toggle to filter them."
      },
      ["upgrade to pro" /* Upgrade_To_Pro */]: {
        type: "build-time",
        staticType: "upgrade to pro" /* Upgrade_To_Pro */,
        titleToolbar: "Upgrade to Pro",
        longTitle: "Upgrade to Mito Pro",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "upgrade_to_pro" /* UPGRADE_TO_PRO */, proOrEnterprise: "Pro" },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["pro", "upgrade", "mito pro", "open source"],
        tooltip: "Upgrade to a Mito Pro account and get access to all of Mito Pro's functionality."
      },
      ["transpose" /* Transpose */]: {
        type: "build-time",
        staticType: "transpose" /* Transpose */,
        iconToolbar: TransposeIcon_default,
        titleToolbar: "Transpose",
        longTitle: "Transpose dataframe",
        actionFunction: () => {
          void mitoAPI.editTranspose(sheetIndex);
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "Import data before transposing it";
        },
        searchTerms: ["transpose", "diagonal", "rows and columns", "flip", "rotate"],
        tooltip: "Switches rows and columns in a dataframe"
      },
      ["melt" /* Melt */]: {
        type: "build-time",
        staticType: "melt" /* Melt */,
        iconToolbar: UnpivotIcon_default,
        titleToolbar: "Unpivot",
        longTitle: "Unpivot dataframe",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "melt" /* MELT */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "Import data before trying to unpivot it";
        },
        searchTerms: ["Melt", "Unpivot"],
        tooltip: "Unpivot a DataFrame from wide to long format."
      },
      ["one_hot_encoding" /* One_Hot_Encoding */]: {
        type: "build-time",
        staticType: "one_hot_encoding" /* One_Hot_Encoding */,
        iconToolbar: OneHotEncodingIcon_default,
        titleToolbar: "One-hot Encoding",
        longTitle: "One-hot Encoding",
        actionFunction: () => {
          if (columnID) {
            closeOpenEditingPopups();
            void mitoAPI.editOneHotEncoding(sheetIndex, columnID);
          }
        },
        isDisabled: () => {
          return doesColumnExist(startingColumnID, sheetIndex, sheetDataArray) ? defaultActionDisabledMessage : "There are no columns in the selected sheet. Add data to the sheet.";
        },
        searchTerms: ["one-hot encoding", "dummies", "get dummies", "categorical"],
        tooltip: "One Hot Encoding"
      },
      ["set_dataframe_format" /* Set_Dataframe_Format */]: {
        type: "build-time",
        staticType: "set_dataframe_format" /* Set_Dataframe_Format */,
        iconToolbar: FormatIcon_default,
        iconContextMenu: FormatContextMenuIcon_default,
        titleToolbar: "Format",
        longTitle: "Set dataframe colors",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "set_dataframe_format" /* SET_DATAFRAME_FORMAT */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There are no data to format. Import data before formatting.";
        },
        searchTerms: ["Set dataframe format", "dataframe", "format", "color", "color palette", "border", "highlight"],
        tooltip: "Change the styling of the header, rows, and border of the dataframe."
      },
      ["ConditionalFormatting" /* Conditional_Formatting */]: {
        type: "build-time",
        staticType: "ConditionalFormatting" /* Conditional_Formatting */,
        iconToolbar: ConditionalFormatIcon_default,
        titleToolbar: "Conditional Formatting",
        longTitle: "Conditional formatting",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "ConditionalFormatting" /* CONDITIONALFORMATTING */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "There is no data to format. Import data.";
        },
        searchTerms: ["formatting", "conditional", "color", "background", "highlight"],
        tooltip: "Set the background color and text color of the cell based on a condition."
      },
      ["Dataframe_Import" /* Dataframe_Import */]: {
        type: "build-time",
        staticType: "Dataframe_Import" /* Dataframe_Import */,
        iconToolbar: DataFrameImportIcon_default,
        titleToolbar: "Import Dataframes",
        longTitle: "Import dataframes",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: { type: "DataframeImport" /* DATAFRAMEIMPORT */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return defaultActionDisabledMessage;
        },
        searchTerms: ["Dataframe Import"],
        tooltip: "Dataframe Import"
      },
      ["updateImports" /* UPDATEIMPORTS */]: {
        type: "build-time",
        staticType: "updateImports" /* UPDATEIMPORTS */,
        iconToolbar: GearIcon_default,
        titleToolbar: "Change imports",
        longTitle: "Change imported data",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "UpdateImports" /* UPDATEIMPORTS */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return sendFunctionStatus !== "finished" ? defaultActionDisabledMessage : void 0;
        },
        searchTerms: ["update", "imports", "replay", "refresh", "change"],
        tooltip: "Change imported data to rerun the same edits on new data."
      },
      ["CodeSnippets" /* CODESNIPPETS */]: {
        type: "build-time",
        staticType: "CodeSnippets" /* CODESNIPPETS */,
        iconToolbar: CodeSnippetIcon_default,
        titleToolbar: "Code Snippets",
        longTitle: "Code Snippets",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "CodeSnippets" /* CODESNIPPETS */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return void 0;
        },
        searchTerms: ["CodeSnippets"],
        tooltip: "View code snippets. "
      },
      ["CodeOptions" /* CODEOPTIONS */]: {
        type: "build-time",
        staticType: "CodeOptions" /* CODEOPTIONS */,
        iconToolbar: GearIcon_default,
        titleToolbar: "Configure Code",
        longTitle: "Configure Code",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "CodeOptions" /* CODEOPTIONS */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return void 0;
        },
        searchTerms: ["Code Options", "function", "parameterize"],
        tooltip: "Configure how the code is generated."
      },
      ["Export_To_File" /* EXPORT_TO_FILE */]: {
        type: "build-time",
        staticType: "Export_To_File" /* EXPORT_TO_FILE */,
        titleToolbar: "Download File when Executing Code",
        longTitle: "Download File when Executing Code",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "Export To File" /* EXPORT_TO_FILE */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? void 0 : "Import data before exporting it";
        },
        searchTerms: ["export", "download", "file"],
        tooltip: "Generate code that exports dataframes to files."
      },
      ["reset index dropdown" /* RESET_INDEX_DROPDOWN */]: {
        type: "build-time",
        staticType: "reset index dropdown" /* RESET_INDEX_DROPDOWN */,
        iconToolbar: ResetIcon_default,
        titleToolbar: "Reset Index",
        longTitle: "Reset Index Dropdown",
        actionFunction: () => {
          setEditorState(void 0);
          closeOpenEditingPopups();
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: "reset-index"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? defaultActionDisabledMessage : "Import data before resetting an index.";
        },
        searchTerms: ["reset", "download", "excel", "csv"],
        tooltip: "Reset index"
      },
      ["reset and keep index" /* RESET_AND_KEEP_INDEX */]: {
        type: "build-time",
        staticType: "reset and keep index" /* RESET_AND_KEEP_INDEX */,
        iconContextMenu: ResetIndexIcon_default,
        titleToolbar: "Reset and Keep Index",
        longTitle: "Reset and Keep Index",
        actionFunction: () => {
          void mitoAPI.editResetIndex(sheetIndex, false);
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? void 0 : "Import data before resetting an index.";
        },
        searchTerms: ["reset", "index"],
        tooltip: "Resets a dataframe's index to 0,1,2,3... Keeps the current index as a column in the dataframe."
      },
      ["reset and drop index" /* RESET_AND_DROP_INDEX */]: {
        type: "build-time",
        staticType: "reset and drop index" /* RESET_AND_DROP_INDEX */,
        iconContextMenu: ResetAndDropIndexIcon_default,
        titleContextMenu: "Reset Index",
        titleToolbar: "Reset and Drop Index",
        longTitle: "Reset and Drop Index",
        actionFunction: () => {
          void mitoAPI.editResetIndex(sheetIndex, true);
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? void 0 : "Import data before resetting an index.";
        },
        searchTerms: ["reset", "index"],
        tooltip: "Resets a dataframe's index to 0,1,2,3... Removes current index entirely."
      },
      ["SnowflakeImport" /* SNOWFLAKEIMPORT */]: {
        type: "build-time",
        staticType: "SnowflakeImport" /* SNOWFLAKEIMPORT */,
        iconToolbar: SnowflakeIcon_default,
        titleToolbar: "Snowflake Import",
        longTitle: "Snowflake Import",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "SnowflakeImport" /* SNOWFLAKEIMPORT */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return userProfile.mitoConfig.MITO_CONFIG_FEATURE_DISPLAY_SNOWFLAKE_IMPORT ? void 0 : "Snowflake Import is deactivated for this version of Mito. Please contact your admin with any questions.";
        },
        searchTerms: ["SQL", "database", "snowflake", "import"],
        tooltip: "Import dataframe from a Snowflake data warehouse",
        requiredPlan: "enterprise"
      },
      ["AI_Transformation" /* AI_TRANSFORMATION */]: {
        type: "build-time",
        staticType: "AI_Transformation" /* AI_TRANSFORMATION */,
        iconToolbar: AIIcon_default,
        titleToolbar: "AI",
        longTitle: "AI Transformation",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "AITransformation" /* AITRANSFORMATION */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return userProfile.mitoConfig.MITO_CONFIG_FEATURE_DISPLAY_AI_TRANSFORMATION ? void 0 : "AI Transformation is deactivated for this version of Mito. Please contact your admin with any questions.";
        },
        searchTerms: ["AI Transformation"],
        tooltip: "AI Transformation"
      },
      ["Column_Headers_Transform" /* COLUMN_HEADERS_TRANSFORM */]: {
        type: "build-time",
        staticType: "Column_Headers_Transform" /* COLUMN_HEADERS_TRANSFORM */,
        iconToolbar: BulkColumnHeaderTransformIcon_default,
        titleToolbar: "Rename Columns",
        longTitle: "Bulk column headers transform",
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "Column Headers Transform" /* COLUMN_HEADERS_TRANSFORM */ },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return doesAnySheetExist(sheetDataArray) ? void 0 : "Import data before transforming column headers";
        },
        searchTerms: ["Column Headers Transform", "replace", "uppercase", "lowercase", "headers"],
        tooltip: "Allows you to capitalize, lowercase, or replace column headers in bulk."
      }
    };
    const runtimeImportActionsList = analysisData.userDefinedImporters.map((f) => {
      const displayName = getDisplayNameOfPythonVariable(f.name);
      return {
        type: "run-time",
        staticType: f.name,
        titleToolbar: displayName,
        longTitle: displayName,
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: {
                type: "UserDefinedImport" /* USERDEFINEDIMPORT */,
                importer_name: f.name
              },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return void 0;
        },
        searchTerms: displayName.split(" "),
        tooltip: f.docstring,
        domain: f.domain
      };
    });
    const runtimeEditActionsList = analysisData.userDefinedEdits.map((f) => {
      const displayName = getDisplayNameOfPythonVariable(f.name);
      return {
        type: "run-time",
        staticType: f.name,
        titleToolbar: displayName,
        longTitle: displayName,
        actionFunction: () => {
          setEditorState(void 0);
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: {
                type: "User Defined Edit" /* USER_DEFINED_EDIT */,
                edit_name: f.name
              },
              selectedTabType: "data"
            });
          });
        },
        isDisabled: () => {
          return void 0;
        },
        searchTerms: displayName.split(" "),
        tooltip: f.docstring
      };
    });
    return new Actions(buildTimeActions, runtimeImportActionsList, runtimeEditActionsList);
  };

  // src/mito/utils/plotly.tsx
  var loadPlotlyWithScriptElement = () => {
    const script = document.createElement("script");
    script.async = true;
    script.src = "https://cdn.plot.ly/plotly-latest.min.js";
    document.head.appendChild(script);
  };
  var loadPlotlyWithRequireJS = () => {
    const requirejs = window.requirejs;
    if (requirejs) {
      requirejs(
        ["https://cdn.plot.ly/plotly-latest.min.js"],
        function(p) {
          window.Plotly = p;
        }
      );
    }
  };
  var loadPlotly = () => {
    if (!("Plotly" in window)) {
      const requirejs = window.requirejs;
      if (requirejs) {
        loadPlotlyWithRequireJS();
      } else {
        loadPlotlyWithScriptElement();
      }
    }
  };
  var plotly_default = loadPlotly;

  // src/mito/components/elements/BottomLeftPopup.tsx
  init_react();

  // src/mito/components/LoadingIndicator.tsx
  init_react();

  // src/mito/components/icons/NonLoadingCircle.tsx
  init_react();
  var NonLoadingCircle = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M8 15.25C12.0041 15.25 15.25 12.0041 15.25 8C15.25 3.99594 12.0041 0.75 8 0.75C3.99593 0.75 0.75 3.99594 0.75 8C0.75 12.0041 3.99593 15.25 8 15.25Z", fill: "#E8EBF8", stroke: "#ACACAD", strokeWidth: "0.5" }));
  };
  var NonLoadingCircle_default = NonLoadingCircle;

  // src/mito/components/taskpanes/Steps/StepDataElement.tsx
  init_react();

  // src/mito/components/icons/MitoIcon.tsx
  init_react();
  var MitoIcon = (props) => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: props.width || "25", height: props.height || "25", viewBox: "0 0 36 32", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M4.27806 14.4605C4.41192 13.3117 5.01895 12.0216 5.97434 10.7002C7.05826 9.20103 8.57046 7.68957 10.2741 6.33985C11.9773 4.99054 13.8647 3.80854 15.6941 2.96488C17.5272 2.11946 19.2841 1.62217 20.731 1.62217H20.8262L20.8973 1.55886C22.3577 0.258248 24.1677 0.253529 25.9155 1.11776C27.6712 1.98588 29.3356 3.7235 30.4197 5.84055C31.0401 7.05223 31.4658 8.37926 31.6121 9.72767C31.4497 10.4602 31.1397 11.1739 30.6606 11.8437C29.3761 13.639 26.8438 15.1631 22.5518 15.856L22.4863 15.8666L22.4347 15.9082C21.4334 16.7156 20.5213 17.566 19.6548 18.3822C19.5897 18.4435 19.5249 18.5047 19.4603 18.5656C18.6629 19.3172 17.9036 20.033 17.1378 20.6632C15.4886 22.0206 13.8431 22.9522 11.813 22.9575C7.78218 22.385 5.10127 18.758 4.27806 14.4605ZM8.07142 22.403C6.88109 21.2513 5.86085 19.9151 5.17471 18.5227C6.56859 21.1106 8.80658 23.0423 11.761 23.4551L11.7783 23.4575H11.7956C14.0044 23.4575 15.7662 22.4397 17.4555 21.0493C18.235 20.4078 19.0063 19.6806 19.8006 18.9319C19.8661 18.8701 19.9318 18.8082 19.9976 18.7462C20.8491 17.9441 21.7325 17.1207 22.6972 16.339C27.0236 15.6292 29.6835 14.0688 31.0672 12.1346C31.3017 11.8069 31.4986 11.4697 31.6603 11.1258C31.6376 11.6681 31.5653 12.2087 31.4378 12.7414C30.8855 15.0491 29.2908 17.2422 26.141 18.8137C25.1942 19.2071 24.2969 19.8633 23.4233 20.6105C22.8835 21.0722 22.3406 21.5797 21.7977 22.0873C21.4643 22.399 21.131 22.7107 20.7983 23.0118C19.0215 24.6198 17.2161 25.9694 15.1112 25.9694C12.9939 25.9694 10.2755 24.5356 8.07142 22.403ZM31.7045 7.69414C31.4887 6.97391 31.204 6.27528 30.8647 5.61267C29.932 3.7912 28.5772 2.22312 27.0733 1.21431C27.108 1.23321 27.1426 1.25235 27.1771 1.27174C29.0479 2.32337 30.567 4.0771 31.291 6.01628C31.4961 6.56563 31.6371 7.12861 31.7045 7.69414ZM10.479 5.54883C12.213 4.17852 14.1208 2.97754 15.9474 2.1189C17.788 1.25371 19.5255 0.745911 20.9111 0.745911H20.9596L21.0046 0.727788C21.1373 0.67428 21.2705 0.625511 21.4039 0.58136C21.1408 0.730055 20.8844 0.909881 20.6364 1.12282C19.1081 1.14374 17.3123 1.66796 15.4847 2.51083C13.799 3.28822 12.0713 4.34354 10.479 5.54883Z", fill: "#00090F" }), /* @__PURE__ */ react_default.createElement("path", { d: "M4.27806 14.4605C4.41192 13.3117 5.01895 12.0216 5.97434 10.7002C7.05826 9.20103 8.57046 7.68957 10.2741 6.33985C11.9773 4.99054 13.8647 3.80854 15.6941 2.96488C17.5272 2.11946 19.2841 1.62217 20.731 1.62217H20.8262L20.8973 1.55886C22.3577 0.258248 24.1677 0.253529 25.9155 1.11776C27.6712 1.98588 29.3356 3.7235 30.4197 5.84055C31.0401 7.05223 31.4658 8.37926 31.6121 9.72767C31.4497 10.4602 31.1397 11.1739 30.6606 11.8437C29.3761 13.639 26.8438 15.1631 22.5518 15.856L22.4863 15.8666L22.4347 15.9082C21.4334 16.7156 20.5213 17.566 19.6548 18.3822C19.5897 18.4435 19.5249 18.5047 19.4603 18.5656C18.6629 19.3172 17.9036 20.033 17.1378 20.6632C15.4886 22.0206 13.8431 22.9522 11.813 22.9575C7.78218 22.385 5.10127 18.758 4.27806 14.4605ZM8.07142 22.403C6.88109 21.2513 5.86085 19.9151 5.17471 18.5227C6.56859 21.1106 8.80658 23.0423 11.761 23.4551L11.7783 23.4575H11.7956C14.0044 23.4575 15.7662 22.4397 17.4555 21.0493C18.235 20.4078 19.0063 19.6806 19.8006 18.9319C19.8661 18.8701 19.9318 18.8082 19.9976 18.7462C20.8491 17.9441 21.7325 17.1207 22.6972 16.339C27.0236 15.6292 29.6835 14.0688 31.0672 12.1346C31.3017 11.8069 31.4986 11.4697 31.6603 11.1258C31.6376 11.6681 31.5653 12.2087 31.4378 12.7414C30.8855 15.0491 29.2908 17.2422 26.141 18.8137C25.1942 19.2071 24.2969 19.8633 23.4233 20.6105C22.8835 21.0722 22.3406 21.5797 21.7977 22.0873C21.4643 22.399 21.131 22.7107 20.7983 23.0118C19.0215 24.6198 17.2161 25.9694 15.1112 25.9694C12.9939 25.9694 10.2755 24.5356 8.07142 22.403ZM31.7045 7.69414C31.4887 6.97391 31.204 6.27528 30.8647 5.61267C29.932 3.7912 28.5772 2.22312 27.0733 1.21431C27.108 1.23321 27.1426 1.25235 27.1771 1.27174C29.0479 2.32337 30.567 4.0771 31.291 6.01628C31.4961 6.56563 31.6371 7.12861 31.7045 7.69414ZM10.479 5.54883C12.213 4.17852 14.1208 2.97754 15.9474 2.1189C17.788 1.25371 19.5255 0.745911 20.9111 0.745911H20.9596L21.0046 0.727788C21.1373 0.67428 21.2705 0.625511 21.4039 0.58136C21.1408 0.730055 20.8844 0.909881 20.6364 1.12282C19.1081 1.14374 17.3123 1.66796 15.4847 2.51083C13.799 3.28822 12.0713 4.34354 10.479 5.54883Z", fill: "url(#paint0_linear)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M4.27806 14.4605C4.41192 13.3117 5.01895 12.0216 5.97434 10.7002C7.05826 9.20103 8.57046 7.68957 10.2741 6.33985C11.9773 4.99054 13.8647 3.80854 15.6941 2.96488C17.5272 2.11946 19.2841 1.62217 20.731 1.62217H20.8262L20.8973 1.55886C22.3577 0.258248 24.1677 0.253529 25.9155 1.11776C27.6712 1.98588 29.3356 3.7235 30.4197 5.84055C31.0401 7.05223 31.4658 8.37926 31.6121 9.72767C31.4497 10.4602 31.1397 11.1739 30.6606 11.8437C29.3761 13.639 26.8438 15.1631 22.5518 15.856L22.4863 15.8666L22.4347 15.9082C21.4334 16.7156 20.5213 17.566 19.6548 18.3822C19.5897 18.4435 19.5249 18.5047 19.4603 18.5656C18.6629 19.3172 17.9036 20.033 17.1378 20.6632C15.4886 22.0206 13.8431 22.9522 11.813 22.9575C7.78218 22.385 5.10127 18.758 4.27806 14.4605ZM8.07142 22.403C6.88109 21.2513 5.86085 19.9151 5.17471 18.5227C6.56859 21.1106 8.80658 23.0423 11.761 23.4551L11.7783 23.4575H11.7956C14.0044 23.4575 15.7662 22.4397 17.4555 21.0493C18.235 20.4078 19.0063 19.6806 19.8006 18.9319C19.8661 18.8701 19.9318 18.8082 19.9976 18.7462C20.8491 17.9441 21.7325 17.1207 22.6972 16.339C27.0236 15.6292 29.6835 14.0688 31.0672 12.1346C31.3017 11.8069 31.4986 11.4697 31.6603 11.1258C31.6376 11.6681 31.5653 12.2087 31.4378 12.7414C30.8855 15.0491 29.2908 17.2422 26.141 18.8137C25.1942 19.2071 24.2969 19.8633 23.4233 20.6105C22.8835 21.0722 22.3406 21.5797 21.7977 22.0873C21.4643 22.399 21.131 22.7107 20.7983 23.0118C19.0215 24.6198 17.2161 25.9694 15.1112 25.9694C12.9939 25.9694 10.2755 24.5356 8.07142 22.403ZM31.7045 7.69414C31.4887 6.97391 31.204 6.27528 30.8647 5.61267C29.932 3.7912 28.5772 2.22312 27.0733 1.21431C27.108 1.23321 27.1426 1.25235 27.1771 1.27174C29.0479 2.32337 30.567 4.0771 31.291 6.01628C31.4961 6.56563 31.6371 7.12861 31.7045 7.69414ZM10.479 5.54883C12.213 4.17852 14.1208 2.97754 15.9474 2.1189C17.788 1.25371 19.5255 0.745911 20.9111 0.745911H20.9596L21.0046 0.727788C21.1373 0.67428 21.2705 0.625511 21.4039 0.58136C21.1408 0.730055 20.8844 0.909881 20.6364 1.12282C19.1081 1.14374 17.3123 1.66796 15.4847 2.51083C13.799 3.28822 12.0713 4.34354 10.479 5.54883Z", stroke: "var(--mito-text)", strokeWidth: "0.5" }), /* @__PURE__ */ react_default.createElement("g", { filter: "url(#filter0_d)" }, /* @__PURE__ */ react_default.createElement("path", { d: "M22.5916 16.1028C18.6195 19.3058 16.0425 23.2075 11.7956 23.2075C7.55216 22.6146 4.79526 18.7684 4 14.3321C4 8.89088 15.1567 0.495911 20.9111 0.495911C29.6603 -3.03026 39.906 13.3076 22.5916 16.1028Z", fill: "#4FBFE8" }), /* @__PURE__ */ react_default.createElement("path", { d: "M22.5518 15.856L22.4863 15.8666L22.4347 15.9082C21.4334 16.7156 20.5213 17.566 19.6548 18.3822C19.5897 18.4435 19.5249 18.5046 19.4603 18.5655C18.663 19.3171 17.9036 20.0329 17.1378 20.6632C15.4886 22.0206 13.8431 22.9522 11.813 22.9575C7.73525 22.3784 5.03904 18.6732 4.25006 14.3102C4.25756 13.0333 4.91743 11.5494 6.03489 10.0223C7.15426 8.49265 8.71139 6.94887 10.4529 5.56953C12.1938 4.19062 14.1116 2.98186 15.9474 2.1189C17.788 1.25371 19.5255 0.745911 20.9111 0.745911H20.9596L21.0046 0.727787C23.1081 -0.119971 25.3091 0.221693 27.1771 1.27174C29.0479 2.32337 30.567 4.0771 31.291 6.01628C32.0133 7.95094 31.9406 10.0545 30.6606 11.8437C29.3761 13.639 26.8438 15.1631 22.5518 15.856Z", stroke: "#0A0A0A", strokeWidth: "0.5" })), /* @__PURE__ */ react_default.createElement("defs", null, /* @__PURE__ */ react_default.createElement("filter", { id: "filter0_d", x: "0", y: "0", width: "36", height: "31.2075", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, /* @__PURE__ */ react_default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), /* @__PURE__ */ react_default.createElement("feOffset", { dy: "4" }), /* @__PURE__ */ react_default.createElement("feGaussianBlur", { stdDeviation: "2" }), /* @__PURE__ */ react_default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow" }), /* @__PURE__ */ react_default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow", result: "shape" })), /* @__PURE__ */ react_default.createElement("linearGradient", { id: "paint0_linear", x1: "24.6767", y1: "23.0067", x2: "-1.7759", y2: "-21.8983", gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ react_default.createElement("stop", { stopColor: "#D17485" }), /* @__PURE__ */ react_default.createElement("stop", { offset: "1", stopColor: "white", stopOpacity: "0" }))));
  };
  var MitoIcon_default = MitoIcon;

  // src/mito/components/icons/DropDuplicatesIcon.tsx
  init_react();
  var DropDuplicatesIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "20", height: "14", viewBox: "0 0 20 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "0.5", y: "0.5", width: "6", height: "13", rx: "0.5", stroke: "#494650" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5 3.5L2 3.49999", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5 7L2 6.99999", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5 10.5L2 10.5", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("rect", { x: "13.5", y: "0.5", width: "6", height: "13", rx: "0.5", stroke: "#494650" }), /* @__PURE__ */ react_default.createElement("path", { d: "M18 3.5L15 3.49999", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M10.3675 5.83334L11 7.00559L10.3934 8.15366", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M10.9103 7.01642H9", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var DropDuplicatesIcon_default = DropDuplicatesIcon;

  // src/mito/components/icons/SplitTextToColumnsIcon.tsx
  init_react();
  var SplitTextToColumnsIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "12", height: "14", viewBox: "0 0 12 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "0.5", y: "0.5", width: "11", height: "13", rx: "0.5", stroke: "#494650" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5 3.5L2 3.49999", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5 7L2 6.99999", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5 10.5L2 10.5", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5 3.5L2 3.49999", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5 7L2 6.99999", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M5 10.5L2 10.5", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M10 3.5L7 3.49999", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M10 7L7 6.99999", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M10 10.5L7 10.5", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var SplitTextToColumnsIcon_default = SplitTextToColumnsIcon;

  // src/mito/components/icons/PromoteRowToHeaderIcon.tsx
  init_react();
  var PromoteRowToHeaderIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "17", height: "14", viewBox: "0 0 17 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "7.5", y: "0.499969", width: "9", height: "13", rx: "0.5", stroke: "#494650" }), /* @__PURE__ */ react_default.createElement("path", { d: "M11.1667 3.49997L8.66667 3.49996", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M11.1667 6.99997L8.66667 6.99996", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M11.1667 10.5L8.66667 10.5", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M11.1667 3.49997L8.66667 3.49996", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M11.1667 6.99997L8.66667 6.99996", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M11.1667 10.5L8.66667 10.5", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M15.3333 3.49997L12.8333 3.49996", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M15.3333 6.99997L12.8333 6.99996", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M15.3333 10.5L12.8333 10.5", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M3.82844 2.24857L5.59653 3.83479L4.01031 5.60288", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M6 10C4 10 6 10 4.09629 9.94194C2.38551 9.70294 1.19356 8.12387 1.43256 6.41309C1.67156 4.70232 3.25063 3.51036 4.96141 3.74936", stroke: "#494650", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var PromoteRowToHeaderIcon_default = PromoteRowToHeaderIcon;

  // src/mito/components/taskpanes/Steps/StepDataElement.tsx
  function getIcon(stepType, height, width) {
    switch (stepType) {
      case "initialize" /* Initialize */:
        return /* @__PURE__ */ react_default.createElement(MitoIcon_default, null);
      case "ai_transformation" /* AiTransformation */:
        return /* @__PURE__ */ react_default.createElement(AIIcon_default, null);
      case "add_column" /* AddColumn */:
        return /* @__PURE__ */ react_default.createElement(AddColumnIcon_default, null);
      case "delete_column" /* DeleteColumn */:
        return /* @__PURE__ */ react_default.createElement(DeleteColumnIcon_default, null);
      case "rename_column" /* RenameColumn */:
        return /* @__PURE__ */ react_default.createElement(EditIcon_default, { height, width });
      case "reorder_column" /* ReorderColumn */:
        return /* @__PURE__ */ react_default.createElement(EditIcon_default, { height, width });
      case "filter_column" /* FilterColumn */:
        return /* @__PURE__ */ react_default.createElement(FilterIcon, null);
      case "set_column_formula" /* SetColumnFormula */:
        return /* @__PURE__ */ react_default.createElement("div", { className: "step-taskpane-missing-icon" }, "Fx");
      case "dataframe_delete" /* DataframeDelete */:
        return /* @__PURE__ */ react_default.createElement(DeleteColumnIcon_default, null);
      case "dataframe_duplicate" /* DataframeDuplicate */:
        return /* @__PURE__ */ react_default.createElement(EditIcon_default, { height, width });
      case "dataframe_rename" /* DataframeRename */:
        return /* @__PURE__ */ react_default.createElement(EditIcon_default, { height, width });
      case "simple_import" /* SimpleImport */:
        return /* @__PURE__ */ react_default.createElement(ImportIcon_default, null);
      case "dataframe_import" /* DataframeImport */:
        return /* @__PURE__ */ react_default.createElement(ImportIcon_default, null);
      case "excel_import" /* ExcelImport */:
        return /* @__PURE__ */ react_default.createElement(ImportIcon_default, null);
      case "sort" /* Sort */:
        return /* @__PURE__ */ react_default.createElement(EditIcon_default, { height, width });
      case "pivot" /* Pivot */:
        return /* @__PURE__ */ react_default.createElement(PivotIcon_default, null);
      case "melt" /* Melt */:
        return /* @__PURE__ */ react_default.createElement(UnpivotIcon_default, null);
      case "merge" /* Merge */:
        return /* @__PURE__ */ react_default.createElement(MergeIcon_default, null);
      case "drop_duplicates" /* DropDuplicates */:
        return /* @__PURE__ */ react_default.createElement(DropDuplicatesIcon_default, null);
      case "graph" /* Graph */:
        return /* @__PURE__ */ react_default.createElement(GraphIcon_default, null);
      case "change_column_dtype" /* ChangeColumnDtype */:
        return /* @__PURE__ */ react_default.createElement(DtypeIcon_default, null);
      case "delete_row" /* DeleteRow */:
        return /* @__PURE__ */ react_default.createElement(DeleteColumnIcon_default, null);
      case "split_text_to_columns" /* SplitTextToColumns */:
        return /* @__PURE__ */ react_default.createElement(SplitTextToColumnsIcon_default, null);
      case "transpose" /* Transpose */:
        return /* @__PURE__ */ react_default.createElement(TransposeIcon_default, null);
      case "promote_row_to_header" /* PromoteRowToHeader */:
        return /* @__PURE__ */ react_default.createElement(PromoteRowToHeaderIcon_default, null);
      case "one_hot_encoding" /* OneHotEncoding */:
        return /* @__PURE__ */ react_default.createElement(OneHotEncodingIcon_default, null);
      case "undo" /* Undo */:
        return /* @__PURE__ */ react_default.createElement(UndoIcon_default, null);
      case "redo" /* Redo */:
        return /* @__PURE__ */ react_default.createElement(RedoIcon_default, null);
      case "clear" /* Clear */:
        return /* @__PURE__ */ react_default.createElement(ClearIcon_default, null);
      default:
        return /* @__PURE__ */ react_default.createElement(EditIcon_default, { height, width });
    }
  }
  function StepDataElement(props) {
    const toggleStepRollBack = () => {
      if (props.isCurrIdx) {
        void props.mitoAPI.updateCheckoutStepByIndex(props.lastIndex);
      } else {
        void props.mitoAPI.updateCheckoutStepByIndex(props.stepData.step_idx);
      }
    };
    const deleteFollowingSteps = () => {
      void props.mitoAPI.updateUndoToStepIndex(props.stepData.step_idx);
    };
    {
    }
    return /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: "step-taskpane-step-container",
        style: { opacity: props.beforeCurrIdx ? "1" : ".5" },
        onContextMenu: (e) => {
          e.preventDefault();
          e.stopPropagation();
          props.setDisplayDropdown(props.stepIdx);
        },
        onClick: toggleStepRollBack
      },
      /* @__PURE__ */ react_default.createElement("div", { className: "step-taskpane-step-icon" }, getIcon(props.stepData.step_type)),
      /* @__PURE__ */ react_default.createElement("div", { className: "element-width-block hide-scrollbar" }, /* @__PURE__ */ react_default.createElement("div", { className: "text-header-3" }, props.stepData.step_display_name), /* @__PURE__ */ react_default.createElement("div", { className: "text-body-2 text-overflow-scroll hide-scrollbar" }, props.stepData.step_description)),
      /* @__PURE__ */ react_default.createElement(
        Dropdown_default,
        {
          display: props.displayDropdown,
          closeDropdown: () => {
            props.setDisplayDropdown(void 0);
          }
        },
        /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            title: "Undo all following steps",
            onClick: () => deleteFollowingSteps(),
            disabled: !props.isPro,
            subtext: !props.isPro ? "Bulk step undo requires Mito Pro or Enterprise" : void 0
          }
        ),
        /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: "View analysis at this step", onClick: () => toggleStepRollBack() })
      )
    );
  }
  var StepDataElement_default = StepDataElement;

  // src/mito/components/LoadingIndicator.tsx
  var isEditEvent = (messageType) => {
    return messageType.endsWith("_edit");
  };
  var isUpdateEvent = (messageType) => {
    return Object.values(UpdateType).includes(messageType);
  };
  var getDisplayMessageForMessageType = (messageType) => {
    switch (messageType) {
      case "initialize" /* Initialize */: {
        return "Created a Mitosheet";
      }
      case "add_column" /* AddColumn */: {
        return "Adding a column";
      }
      case "delete_column" /* DeleteColumn */: {
        return "Deleting a column";
      }
      case "rename_column" /* RenameColumn */: {
        return "Renaming a column";
      }
      case "reorder_column" /* ReorderColumn */: {
        return "Reording a column";
      }
      case "fill_na" /* FillNa */: {
        return "Filling NaN values";
      }
      case "replace" /* Replace */: {
        return "Replacing values";
      }
      case "filter_column" /* FilterColumn */: {
        return "Filtering a column";
      }
      case "set_column_formula" /* SetColumnFormula */: {
        return "Setting a formula";
      }
      case "dataframe_delete" /* DataframeDelete */: {
        return "Deleting a dataframe";
      }
      case "dataframe_duplicate" /* DataframeDuplicate */: {
        return "Duplicating a dataframe";
      }
      case "dataframe_rename" /* DataframeRename */: {
        return "Renaming a dataframe";
      }
      case "simple_import" /* SimpleImport */: {
        return "Importing a CSV";
      }
      case "sort" /* Sort */: {
        return "Sorting a dataframe";
      }
      case "pivot" /* Pivot */: {
        return "Pivoting a dataframe";
      }
      case "merge" /* Merge */: {
        return "Merging dataframes";
      }
      case "concat" /* Concat */: {
        return "Concatenating dataframes";
      }
      case "drop_duplicates" /* DropDuplicates */: {
        return "Dropping duplicates";
      }
      case "change_column_dtype" /* ChangeColumnDtype */: {
        return "Changing a dtype";
      }
      case "set_cell_value" /* SetCellValue */: {
        return "Setting a cell value";
      }
      case "bulk_old_rename" /* BulkOldRename */: {
        return "Bulk old rename";
      }
      case "excel_import" /* ExcelImport */: {
        return "Importing Excel file";
      }
      case "graph" /* Graph */: {
        return "Creating graph";
      }
      case "graph_duplicate" /* GraphDuplicate */: {
        return "Duplicating graph";
      }
      case "graph_delete" /* GraphDelete */: {
        return "Deleting graph";
      }
      case "graph_rename" /* GraphRename */: {
        return "Renaming graph";
      }
      case "delete_row" /* DeleteRow */: {
        return "Deleting row";
      }
      case "promote_row_to_header" /* PromoteRowToHeader */: {
        return "Promoting row to header";
      }
      case "split_text_to_columns" /* SplitTextToColumns */: {
        return "Spliting column";
      }
      case "transpose" /* Transpose */: {
        return "Transposing dataframe";
      }
      case "melt" /* Melt */: {
        return "Melting dataframe";
      }
      case "set_dataframe_format" /* SetDataframeFormat */: {
        return "Changing formatting";
      }
      case "one_hot_encoding" /* OneHotEncoding */: {
        return "One hot encoding";
      }
      case "dataframe_import" /* DataframeImport */: {
        return "Dataframe Import";
      }
      case "snowflake_import" /* SnowflakeImport */: {
        return "Snowflake Import";
      }
      case "excel_range_import" /* ExcelRangeImport */: {
        return "Excel Range Import";
      }
      case "export_to_file" /* ExportToFile */: {
        return "Generating Export Code";
      }
      case "reset_index" /* ResetIndex */: {
        return "Resetting Index";
      }
      case "ai_transformation" /* AiTransformation */: {
        return "Transforming with AI";
      }
      case "column_headers_transform" /* ColumnHeadersTransform */: {
        return "Transforming Headers";
      }
      case "user_defined_import" /* UserDefinedImport */: {
        return "Importing";
      }
      case "user_defined_edit" /* UserDefinedEdit */: {
        return "Editing";
      }
      case "undo" /* Undo */: {
        return "Undoing previous edit";
      }
      case "redo" /* Redo */: {
        return "Redoing previous edit";
      }
      case "clear" /* Clear */: {
        return "Clearing all edits";
      }
      case "args_update" /* ArgsUpdate */: {
        return "Updating user profile";
      }
      case "code_options_update" /* CodeOptionsUpdate */: {
        return "Updating code options";
      }
      case "save_analysis_update" /* SaveAnalysisUpdate */: {
        return "Saving analysis";
      }
      case "replay_analysis_update" /* ReplayAnalysisUpdate */: {
        return "Replaying analysis";
      }
      case "checkout_step_by_idx_update" /* CheckoutStepByIdxUpdate */: {
        return "Checking out step";
      }
      case "append_user_field_update" /* AppendUserFieldUpdate */: {
        return "Updating user profile";
      }
      case "set_user_field_update" /* SetUserFieldUpdate */: {
        return "Updating user profile";
      }
      case "update_feedback_v2_obj_update" /* UpdateFeedbackv2ObjObject */: {
        return "Updating user profile";
      }
      case "go_pro" /* GoPro */: {
        return "Activating Mito Pro";
      }
      case "render_count_update" /* RenderCountUpdate */: {
        return "Updating user profile";
      }
      case "checklist_update" /* ChecklistUpdate */: {
        return "Updating checklist";
      }
      case "update_existing_import_update" /* UpdateExistingImportUpdate */: {
        return "Changing imports";
      }
      case "undo_to_step_index_update" /* UndoToStepIndex */: {
        return "Undoing steps";
      }
    }
  };
  var getMessageType = (messageType) => {
    if (isEditEvent(messageType)) {
      return messageType.substring(0, messageType.length - "_edit".length);
    } else if (isUpdateEvent(messageType)) {
      return messageType;
    }
    return void 0;
  };
  var getMessageTypesToDisplay = (loading) => {
    const seenStepIds = [];
    return loading.filter(([, step_id]) => {
      if (step_id !== void 0) {
        if (seenStepIds.includes(step_id)) {
          return false;
        }
        seenStepIds.push(step_id);
      }
      return true;
    }).map(([message_id, , type]) => {
      return [getMessageType(type), message_id];
    }).filter(([messageType]) => {
      return messageType !== void 0;
    });
  };
  var getSlowLoadingMessage = (currentLoadingMessage, message_id) => {
    const is10SecondsAgo = currentLoadingMessage && message_id === currentLoadingMessage[1] && currentLoadingMessage[0] <= Date.now() - 10 * 1e3;
    const is20SecondsAgo = currentLoadingMessage && message_id === currentLoadingMessage[1] && currentLoadingMessage[0] <= Date.now() - 20 * 1e3;
    const is30SecondsAgo = currentLoadingMessage && message_id === currentLoadingMessage[1] && currentLoadingMessage[0] <= Date.now() - 30 * 1e3;
    const is40SecondsAgo = currentLoadingMessage && message_id === currentLoadingMessage[1] && currentLoadingMessage[0] <= Date.now() - 40 * 1e3;
    const is50SecondsAgo = currentLoadingMessage && message_id === currentLoadingMessage[1] && currentLoadingMessage[0] <= Date.now() - 40 * 1e3;
    const is60SecondsAgo = currentLoadingMessage && message_id === currentLoadingMessage[1] && currentLoadingMessage[0] <= Date.now() - 60 * 1e3;
    if (is60SecondsAgo) {
      return "Still executing pandas code";
    } else if (is50SecondsAgo) {
      return "Doing the dataframe dance";
    } else if (is40SecondsAgo) {
      return "Working hard behind the scenes";
    } else if (is30SecondsAgo) {
      return "Still executing pandas code";
    } else if (is20SecondsAgo) {
      return "Doing the dataframe dance";
    } else if (is10SecondsAgo) {
      return "Still executing pandas code";
    }
    return void 0;
  };
  var LoadingIndicator = (props) => {
    const [currentLoadingMessage, setCurrentLoadingMessage] = useState(void 0);
    useEffect(() => {
      const interval = setInterval(() => {
        const messagesToDisplay2 = getMessageTypesToDisplay(props.loading);
        if (messagesToDisplay2.length === 0) {
          setCurrentLoadingMessage(void 0);
        } else {
          setCurrentLoadingMessage((prevLoadingMessage) => {
            const topMessageID = messagesToDisplay2[0][1];
            if (prevLoadingMessage === void 0 || topMessageID !== prevLoadingMessage[1]) {
              return [Date.now(), topMessageID];
            }
            return prevLoadingMessage;
          });
        }
        setCurrentLoadingMessage((prevCurrentLoadingMessage) => {
          if (prevCurrentLoadingMessage === void 0)
            return prevCurrentLoadingMessage;
          return [prevCurrentLoadingMessage[0], prevCurrentLoadingMessage[1]];
        });
      }, 1e3);
      return () => {
        clearInterval(interval);
      };
    }, [props.loading]);
    const messagesToDisplay = getMessageTypesToDisplay(props.loading);
    if (messagesToDisplay.length === 0) {
      return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null);
    }
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("p", { className: "loading-indicator-header text-header-3 text-color-background-important" }, "Processing ", messagesToDisplay.length, " edit", messagesToDisplay.length <= 1 ? "" : "s"), /* @__PURE__ */ react_default.createElement("div", { className: "loading-indicator-content" }, messagesToDisplay.map(([messageType, message_id], index) => {
      const slowLoadingMessage = getSlowLoadingMessage(currentLoadingMessage, message_id);
      return messageType !== void 0 && /* @__PURE__ */ react_default.createElement("div", { key: index, className: classNames("mb-5px", "mt-5px", { "text-color-medium-important": index !== 0 }) }, /* @__PURE__ */ react_default.createElement(
        "div",
        {
          key: index,
          className: classNames("loading-indicator-item")
        },
        /* @__PURE__ */ react_default.createElement("div", { className: "loading-indicator-icon", style: { opacity: index !== 0 ? "50%" : void 0 } }, getIcon(messageType, "15", "15")),
        /* @__PURE__ */ react_default.createElement("div", { className: "ml-5px" }, /* @__PURE__ */ react_default.createElement("div", { className: "text-body-1" }, getDisplayMessageForMessageType(messageType)), slowLoadingMessage !== void 0 && /* @__PURE__ */ react_default.createElement("div", { className: "text-subtext-1" }, slowLoadingMessage)),
        /* @__PURE__ */ react_default.createElement("div", { className: "loading-indicator-loader" }, index === 0 && /* @__PURE__ */ react_default.createElement(LoadingCircle_default, null), index !== 0 && /* @__PURE__ */ react_default.createElement(NonLoadingCircle_default, null))
      ));
    })));
  };
  var LoadingIndicator_default = LoadingIndicator;

  // src/mito/components/elements/BottomLeftPopup.tsx
  var BottomLeftPopup = (props) => {
    const [displayLoadingIndicator, setDisplayLoadingIndicator] = useState(false);
    useEffect(() => {
      if (props.loading.length === 0) {
        setDisplayLoadingIndicator(false);
      } else if (props.loading.length > 0) {
        const timeout = setTimeout(() => {
          setDisplayLoadingIndicator(true);
        }, 500);
        return () => {
          clearTimeout(timeout);
        };
      }
    }, [props.loading.length]);
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, displayLoadingIndicator && /* @__PURE__ */ react_default.createElement("div", { className: "bottom-left-popup-container" }, /* @__PURE__ */ react_default.createElement(LoadingIndicator_default, { loading: props.loading })));
  };
  var BottomLeftPopup_default = BottomLeftPopup;

  // src/mito/components/modals/StreamlitSignupModal.tsx
  init_react();
  var StepOne2 = (props) => {
    const [email, setEmail] = useState("");
    const onSubmit = (e) => __async(void 0, null, function* () {
      e.preventDefault();
      yield props.mitoAPI.updateSignUp(email);
      props.next();
    });
    return /* @__PURE__ */ react_default.createElement("div", { className: "signup-modal-left-column" }, /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement("h1", { className: "text-header-1", style: { margin: 0 } }, "Sign up for Mito"), /* @__PURE__ */ react_default.createElement("p", { className: "text-header-2 text-color-medium-important text-font-family-normal-important", style: { marginTop: "10px" } }, "We\u2019ll send you periodic product updates and welcome any feedback."), /* @__PURE__ */ react_default.createElement("p", { className: "text-header-2 text-color-medium-important text-font-family-normal-important", style: { marginTop: "10px" } }, "This modal appears the first time you use Mito for Streamlit on a computer.")), /* @__PURE__ */ react_default.createElement("form", { className: "signup-modal-email-form", onSubmit }, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-2", style: { marginTop: "10px", marginBottom: 0 } }, "Email"), /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        value: email,
        onChange: (event) => {
          setEmail(event.target.value);
        },
        type: "email",
        width: "large",
        placeholder: "example@gmail.com",
        required: true,
        autoFocus: true
      }
    ), /* @__PURE__ */ react_default.createElement("div", { className: "mt-10px", style: { marginTop: "10px" } }, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        type: "submit"
      },
      "Next"
    ))));
  };
  var StepTwo2 = (props) => {
    return /* @__PURE__ */ react_default.createElement("div", { className: "signup-modal-left-column" }, /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement("h1", { className: "text-header-1", style: { marginTop: 0, marginBottom: 0 } }, props.isPro && `Mito Pro is Totally Private`, !props.isPro && `Built for Privacy`), /* @__PURE__ */ react_default.createElement("p", { className: "text-header-2 text-font-family-normal-important", style: { marginTop: "10px" } }, props.isPro && `As a Mito Pro user, no data leaves your computer, ever. Check out our CCPA compliant privacy policy`, !props.isPro && `We take no private data. We collect basic information about usage. Read our CCPA compliant`, " ", " ", /* @__PURE__ */ react_default.createElement("a", { className: "text-link", href: "https://privacy.trymito.io/privacy-policy", target: "_blank", rel: "noreferrer" }, /* @__PURE__ */ react_default.createElement("u", null, "privacy policy."))), !props.isPro && /* @__PURE__ */ react_default.createElement("p", { className: "text-header-2 text-font-family-normal-important", style: { marginTop: "10px" } }, "See ", /* @__PURE__ */ react_default.createElement("a", { className: "text-link", href: "https://trymito.io/plans", target: "_blank", rel: "noreferrer" }, /* @__PURE__ */ react_default.createElement("u", null, "Mito Pro or Mito Enterprise")), " to remove all telemetry.")), /* @__PURE__ */ react_default.createElement("div", { className: "signup-modal-buttons", style: { marginTop: "10px" } }, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "light",
        width: "small",
        onClick: props.back
      },
      "Back"
    ), /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "small",
        onClick: props.next,
        autoFocus: true
      },
      "Accept"
    )));
  };
  var StreamlitSignupModal = (props) => {
    const [step, setStep] = useState(1);
    const next = () => {
      if (step + 1 > 2) {
        props.setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            currOpenModal: { type: "None" /* None */ },
            currOpenTaskpanel: { type: "import files" /* IMPORT_FILES */ }
          });
        });
      } else {
        const newStep = Math.min(step + 1, 2);
        setStep(newStep);
      }
    };
    const back = () => {
      const newStep = Math.max(step - 1, 0);
      setStep(newStep);
    };
    const backgroundColors = {
      1: "#FFEBEB",
      2: "#F0C5BB",
      3: "#FFDAAE"
    };
    return /* @__PURE__ */ react_default.createElement("div", { className: "overlay" }, /* @__PURE__ */ react_default.createElement("div", { className: classNames("signup-modal-container") }, /* @__PURE__ */ react_default.createElement("div", { className: "signup-modal-left-column-container" }, step === 1 && /* @__PURE__ */ react_default.createElement(
      StepOne2,
      {
        next,
        mitoAPI: props.mitoAPI
      }
    ), step === 2 && /* @__PURE__ */ react_default.createElement(
      StepTwo2,
      {
        next,
        back,
        mitoAPI: props.mitoAPI,
        isPro: props.isPro
      }
    )), /* @__PURE__ */ react_default.createElement("div", { className: "signup-modal-right-column-container", style: { backgroundColor: backgroundColors[step] } }, step === 1 && /* @__PURE__ */ react_default.createElement(PinkMitoFolk_default, null), step === 2 && /* @__PURE__ */ react_default.createElement(BlueMitoFolk_default, null))));
  };
  var StreamlitSignupModal_default = StreamlitSignupModal;

  // src/mito/components/modals/UserEditedCodeModal.tsx
  init_react();
  var UserEditedCodeModal = (props) => {
    useEffect(() => {
      void props.mitoAPI.log(
        "user_edited_code_cell",
        {
          length_of_code_with_user_edits: props.codeWithUserEdits.length,
          length_of_code_without_user_edits: props.codeWithoutUserEdits.length
        }
      );
    }, []);
    const handleUserEditedCode = (overwriteCode) => {
      var _a;
      (_a = props.jupyterUtils) == null ? void 0 : _a.writeGeneratedCodeToCell(
        props.analysisData.analysisName,
        props.analysisData.inputCellExecutionCount,
        props.analysisData.code,
        props.userProfile.telemetryEnabled,
        props.analysisData.publicInterfaceVersion,
        (codeWithoutUserEdits, codeWithUserEdits) => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: {
                type: "UserEditedCode" /* UserEditedCode */,
                codeWithoutUserEdits,
                codeWithUserEdits
              }
            });
          });
        },
        props.codeWithoutUserEdits,
        overwriteCode
      );
      void props.mitoAPI.log(
        overwriteCode ? "overwrite_user_edited_code" : "insert_new_cell_for_user_edited_code",
        {
          length_of_code_with_user_edits: props.codeWithUserEdits.length,
          length_of_code_without_user_edits: props.codeWithoutUserEdits.length
        }
      );
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenModal: { type: "None" /* None */ }
        });
      });
    };
    return /* @__PURE__ */ react_default.createElement(
      DefaultModal_default,
      {
        header: "Edit to Code Detected",
        modalType: "Error" /* Error */,
        wide: true,
        viewComponent: [
          /* @__PURE__ */ react_default.createElement(Fragment, { key: "user-edited-code-modal-view" }, /* @__PURE__ */ react_default.createElement("div", { className: "text-align-left text-body-1" }, "Looks like you edited the code generated by Mito in the cell below. Do you want to overwrite these edits or insert a new cell for the Mito generated code?"))
        ],
        buttons: [
          /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
            TextButton_default,
            {
              variant: "light",
              width: "hug-contents",
              onClick: () => handleUserEditedCode(true)
            },
            "Overwrite Edits"
          ), /* @__PURE__ */ react_default.createElement(
            TextButton_default,
            {
              variant: "dark",
              width: "hug-contents",
              onClick: () => handleUserEditedCode(false)
            },
            "Insert New Cell"
          ))
        ]
      }
    );
  };
  var UserEditedCodeModal_default = UserEditedCodeModal;

  // src/mito/components/popups/EphemeralMessage.tsx
  init_react();

  // src/mito/components/elements/DefaultPopup.tsx
  init_react();
  var DefaultPopup = (props) => {
    let popupLocationClass = void 0;
    switch (props.popupLocation) {
      case "top_right" /* TopRight */:
        popupLocationClass = "top-right-popup-container";
    }
    return /* @__PURE__ */ react_default.createElement("div", { className: classNames("popup-container", popupLocationClass, props.className) }, props.children);
  };
  var DefaultPopup_default = DefaultPopup;

  // src/mito/components/popups/EphemeralMessage.tsx
  var EphemeralMessage = (props) => {
    const closePopup = () => {
      props.setUIState((prevUIState) => {
        return __spreadProps(__spreadValues({}, prevUIState), {
          currOpenPopups: __spreadProps(__spreadValues({}, prevUIState.currOpenPopups), {
            [props.popupLocation]: { type: "none" /* None */ }
          })
        });
      });
    };
    useEffect(() => {
      const interval = setInterval(() => {
        closePopup();
      }, 6e3);
      return () => {
        clearInterval(interval);
      };
    }, [props.message]);
    return /* @__PURE__ */ react_default.createElement(DefaultPopup_default, { popupLocation: props.popupLocation, className: "ephemeral-message-animation" }, /* @__PURE__ */ react_default.createElement(Row_default, { className: classNames("ephemeral-message-container"), align: "center", suppressTopBottomMargin: true }, /* @__PURE__ */ react_default.createElement("p", { className: classNames("text-body-1", "text-color-background-important", "mr-10px") }, props.message), /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: "mt-5px ml-5px",
        onClick: () => closePopup()
      },
      /* @__PURE__ */ react_default.createElement(XIcon_default, null)
    )));
  };
  var EphemeralMessage_default = EphemeralMessage;

  // src/mito/components/taskpanes/Dev/DevTaskpane.tsx
  init_react();
  function DevTaskpane(props) {
    const [crashCount, setCrashCount] = react_default.useState(0);
    useEffect(() => {
      if (crashCount > 0) {
        throw new Error("Crash Mitosheet");
      }
    }, [crashCount]);
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Dev Taskpane",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        onClick: () => {
          setCrashCount((prevCrashCount) => prevCrashCount + 1);
        },
        variant: "light"
      },
      "Crash Mitosheet"
    )));
  }
  var DevTaskpane_default = DevTaskpane;

  // src/mito/components/taskpanes/GithubSchedule/GithubScheduleTaskpane.tsx
  init_react();

  // src/mito/components/elements/AutomationSchedulePicker.tsx
  init_react();
  var AutomationSchedule = (props) => {
    const schedule = props.schedule;
    return /* @__PURE__ */ react_default.createElement("div", { className: "mito-blue-container" }, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: "Select the timeframe to rerun your automation in." }, "Run on")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        width: "medium",
        value: props.schedule.type,
        onChange: (newValue) => {
          if (newValue === "Every Day") {
            props.setSchedule(__spreadProps(__spreadValues({}, props.schedule), {
              type: "Every Day"
            }));
          } else if (newValue === "Every Week") {
            props.setSchedule(__spreadProps(__spreadValues({}, props.schedule), {
              dayOfWeek: 1,
              type: "Every Week"
            }));
          } else if (newValue === "Every Month") {
            props.setSchedule(__spreadProps(__spreadValues({}, props.schedule), {
              dayOfMonth: 1,
              type: "Every Month"
            }));
          }
        }
      },
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: "Every Day" }),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: "Every Week" }),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: "Every Month" })
    ))), schedule.type === "Every Week" && /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: "Select the day of the week to rerun your automation on." }, "On day")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        width: "medium",
        value: schedule.dayOfWeek + "",
        onChange: (newValue) => {
          props.setSchedule(__spreadProps(__spreadValues({}, schedule), {
            dayOfWeek: parseInt(newValue)
          }));
        }
      },
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: "Monday", id: "1" }),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: "Tuesday", id: "2" }),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: "Wednesday", id: "3" }),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: "Thursday", id: "4" }),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: "Friday", id: "5" }),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: "Saturday", id: "6" }),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: "Sunday", id: "7" })
    ))), schedule.type === "Every Month" && /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: "Select the day of the month to rerun your automation on." }, "On day")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        width: "medium",
        value: schedule.dayOfMonth + "",
        onChange: (newValue) => {
          props.setSchedule(__spreadProps(__spreadValues({}, schedule), {
            dayOfMonth: parseInt(newValue)
          }));
        }
      },
      Array.from(Array(31).keys()).map((day) => {
        return /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: day + 1 + "", id: day + 1 + "", key: day });
      })
    ))), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { tooltip: "Select the day of the month to rerun your automation on." }, "At time")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        width: "medium",
        type: "time",
        value: schedule.time,
        onChange: (e) => {
          const newTime = e.target.value;
          props.setSchedule(__spreadProps(__spreadValues({}, schedule), {
            time: newTime
          }));
        }
      }
    ))));
  };
  var AutomationSchedulePicker_default = AutomationSchedule;

  // src/mito/components/elements/TextArea.tsx
  init_react();
  var TextArea = (props) => {
    const autoFocus = props.autoFocus === true;
    const required = props.required === true;
    const height = props.height || "block";
    const width = props.width || "block";
    const widthClass = `element-width-${width}`;
    const heightClass = `element-height-${height}`;
    return /* @__PURE__ */ react_default.createElement(
      "textarea",
      {
        ref: props.ref,
        className: classNames("text-area", "text-body-2", widthClass, heightClass, props.className, { "text-area-dark-border": props.darkBorder }),
        onChange: props.onChange,
        autoFocus,
        required,
        placeholder: props.placeholder,
        value: props.value,
        disabled: props.disabled,
        onKeyDown: props.onKeyDown,
        onKeyUp: props.onKeyUp,
        spellCheck: props.spellCheck
      }
    );
  };
  var TextArea_default = TextArea;

  // src/mito/components/taskpanes/GithubSchedule/GithubScheduleTaskpane.tsx
  var getDefaultParams10 = () => {
    return {
      automationName: "",
      automationDescription: "",
      schedule: {
        type: "Every Day",
        time: "08:00"
      }
    };
  };
  var GithubScheduleTaskpane = (props) => {
    const [params, setParams] = useState(() => getDefaultParams10());
    const [loading, setLoading] = useState(false);
    const [error, setError] = useState(void 0);
    const [automationURL, setAutomationURL] = useState(void 0);
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Schedule on Github",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneBody_default,
      {
        userProfile: props.userProfile,
        requiresEnterprise: {
          featureName: "Github Scheduling",
          mitoAPI: props.mitoAPI
        }
      },
      /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-between", align: "center" }, /* @__PURE__ */ react_default.createElement(Col_default, { span: 14 }, /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Automation Name")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
        Input_default,
        {
          value: params.automationName,
          onChange: (e) => {
            const newAutomationName = e.target.value;
            setParams((prevParams) => {
              return __spreadProps(__spreadValues({}, prevParams), {
                automationName: newAutomationName
              });
            });
            setAutomationURL(void 0);
          },
          placeholder: "Automation Name"
        }
      ))),
      /* @__PURE__ */ react_default.createElement("p", { className: "text-header-3" }, "Automation Description"),
      /* @__PURE__ */ react_default.createElement(
        TextArea_default,
        {
          value: params.automationDescription,
          onChange: (e) => {
            const newAutomationDescription = e.target.value;
            setParams((prevParams) => {
              return __spreadProps(__spreadValues({}, prevParams), {
                automationDescription: newAutomationDescription
              });
            });
            setAutomationURL(void 0);
          },
          placeholder: "Describe what this automation accomplishes",
          height: "small"
        }
      ),
      /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 10 }),
      /* @__PURE__ */ react_default.createElement(
        AutomationSchedulePicker_default,
        {
          schedule: params.schedule,
          setSchedule: (newSchedule) => {
            setParams((prevParams) => {
              return __spreadProps(__spreadValues({}, prevParams), {
                schedule: newSchedule
              });
            });
            setAutomationURL(void 0);
          }
        }
      ),
      error !== void 0 && /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement("p", { className: "text-color-error" }, error)),
      automationURL !== void 0 && /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1" }, /* @__PURE__ */ react_default.createElement("a", { href: automationURL, target: "_blank", className: "text-body-1-link", rel: "noreferrer" }, "Click here "), " to view your automation on Github."))
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneFooter_default, null, loading && /* @__PURE__ */ react_default.createElement("p", { className: "text-subtext-1" }, "Scheduling automation", /* @__PURE__ */ react_default.createElement(LoadingDots_default, null)), /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        disabled: loading,
        onClick: () => __async(void 0, null, function* () {
          if (params.automationName === "") {
            setError("Please enter an automation name");
            return;
          }
          if (params.automationDescription === "") {
            setError("Please enter an automation description");
            return;
          }
          setError(void 0);
          setLoading(true);
          const response = yield props.mitoAPI.getPRUrlOfNewPR(
            params.automationName,
            params.automationDescription,
            params.schedule
          );
          setLoading(false);
          const urlOrError = "error" in response ? void 0 : response.result;
          if (urlOrError !== void 0 && typeof urlOrError === "string") {
            setAutomationURL(urlOrError);
            window.open(urlOrError, "_blank");
          } else if (urlOrError !== void 0 && typeof urlOrError === "object") {
            setError(urlOrError.error);
          }
        })
      },
      "Schedule on Github"
    )));
  };
  var GithubScheduleTaskpane_default = GithubScheduleTaskpane;

  // src/mito/components/taskpanes/Steps/StepsTaskpane.tsx
  init_react();
  function StepTaskpane(props) {
    const [displayStepDropdown, setDisplayStepDropdown] = useState(void 0);
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: "Step History",
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement("div", { className: "step-takspane-container" }, props.stepSummaryList.map((stepSummary) => {
      return /* @__PURE__ */ react_default.createElement(
        StepDataElement_default,
        {
          key: stepSummary.step_id,
          beforeCurrIdx: stepSummary.step_idx <= props.currStepIdx,
          isCurrIdx: stepSummary.step_idx === props.currStepIdx,
          lastIndex: props.stepSummaryList[props.stepSummaryList.length - 1].step_idx,
          stepData: stepSummary,
          mitoAPI: props.mitoAPI,
          stepIdx: stepSummary.step_idx,
          isPro: props.userProfile.isPro,
          displayDropdown: displayStepDropdown === stepSummary.step_idx,
          setDisplayDropdown: () => {
            setDisplayStepDropdown((prevDisplayStepDropdown) => {
              if (prevDisplayStepDropdown === stepSummary.step_idx) {
                return void 0;
              } else {
                return stepSummary.step_idx;
              }
            });
          }
        }
      );
    }))));
  }
  var StepsTaskpane_default = StepTaskpane;

  // src/mito/components/taskpanes/UpgradeToPro/UpgradeToProTaskpane.tsx
  init_react();

  // src/mito/hooks/useInputValue.tsx
  init_react();
  var useInputValue = (value = "", placeholder = "") => {
    const [_value, _setValue] = useState(value);
    const onChange = (e) => {
      const newValue = e.target.value;
      _setValue(newValue);
    };
    return {
      "value": _value,
      "placeholder": placeholder,
      "onChange": onChange
    };
  };

  // src/mito/components/icons/HighlightCheckMark.tsx
  init_react();
  var HighlightCheckMark = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "18", height: "15", viewBox: "0 0 18 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M2 8.88525L6.15622 12.4914C6.57338 12.8534 7.20496 12.8086 7.5669 12.3914L16.3562 2.26144", stroke: "var(--mito-highlight)", strokeWidth: "4" }));
  };
  var HighlightCheckMark_default = HighlightCheckMark;

  // src/mito/components/taskpanes/UpgradeToPro/UpgradeToProTaskpane.tsx
  var ProListElement = (props) => {
    return /* @__PURE__ */ react_default.createElement(Row_default, null, /* @__PURE__ */ react_default.createElement(Col_default, { span: 2 }, /* @__PURE__ */ react_default.createElement(HighlightCheckMark_default, null)), /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1" }, props.text));
  };
  var UpgradeToProTaskpane = (props) => {
    const [isEnteringAccessCode, setIsEnteringAccessCode] = useState(false);
    const accessCodeInput = useInputValue("", "mito-pro-access-code-ASKDJQWDKQWDLL");
    const [invalidAccessCode, setInvalidAccessCode] = useState(false);
    const isPro = props.userProfile.isPro;
    useEffect(() => {
      void props.mitoAPI.log("opened_upgrade_to_pro_taskpane");
    }, []);
    if (!isPro && !isEnteringAccessCode) {
      return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
        DefaultTaskpaneHeader_default,
        {
          header: "Upgrade to Mito Pro",
          setUIState: props.setUIState
        }
      ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1 mb-10px" }, /* @__PURE__ */ react_default.createElement("a", { href: "https://trymito.io/plans", target: "_blank", rel: "noreferrer" }, /* @__PURE__ */ react_default.createElement("span", { className: "text-body-1-link" }, "Mito Pro")), " gives you extra features to super charge your analysis:"), /* @__PURE__ */ react_default.createElement(ProListElement, { text: "Turn off all telemetry" }), /* @__PURE__ */ react_default.createElement(ProListElement, { text: "Generated code optimization" }), /* @__PURE__ */ react_default.createElement(ProListElement, { text: "Import from external drives" }), /* @__PURE__ */ react_default.createElement(ProListElement, { text: "Format datframes" }), /* @__PURE__ */ react_default.createElement(ProListElement, { text: "Style graphs" }), /* @__PURE__ */ react_default.createElement(ProListElement, { text: "Priority support" }), /* @__PURE__ */ react_default.createElement(ProListElement, { text: "All future pro functionality!" }), /* @__PURE__ */ react_default.createElement("div", { className: "mt-25px" }, /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-around" }, /* @__PURE__ */ react_default.createElement("form", { className: "element-width-block", action: "https://jl76z192i0.execute-api.us-east-1.amazonaws.com/Prod/create_checkout_session/", method: "POST", target: "_blank" }, /* @__PURE__ */ react_default.createElement(
        "button",
        {
          className: classNames("text-button", "text-header-3", "text-overflow-wrap", "element-width-block", "text-button-variant-dark"),
          type: "submit",
          onClick: () => {
            void props.mitoAPI.log("clicked_purchase_mito_pro");
            setTimeout(() => setIsEnteringAccessCode(true), 100);
          }
        },
        "Purchase Mito Pro"
      ))), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-around", className: "mb-5px mt-5px" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1" }, "Or")), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-around" }, /* @__PURE__ */ react_default.createElement(TextButton_default, { variant: "dark", onClick: () => {
        setIsEnteringAccessCode(true);
      } }, "Enter Access Code")))));
    } else if (!isPro && isEnteringAccessCode) {
      return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
        DefaultTaskpaneHeader_default,
        {
          header: "Enter Access Code",
          setUIState: props.setUIState
        }
      ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement(Row_default, { align: "center", justify: "start" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-heading-2" }, "Access Code:")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(Tooltip_default, { title: "Get an access code by purchasing a Pro license on the previous page." }))), /* @__PURE__ */ react_default.createElement(Input_default, __spreadValues({}, accessCodeInput)), invalidAccessCode && /* @__PURE__ */ react_default.createElement("div", { className: "text-color-error" }, "Sorry, that access code is invalid. Purchase Mito Pro from the previous page and then enter the access code here."), /* @__PURE__ */ react_default.createElement(Spacer_default, { px: 20 }), /* @__PURE__ */ react_default.createElement(Row_default, { justify: "space-around" }, /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(TextButton_default, { variant: "light", onClick: () => {
        setIsEnteringAccessCode(false);
      } }, "Back")), /* @__PURE__ */ react_default.createElement(Col_default, null, /* @__PURE__ */ react_default.createElement(
        TextButton_default,
        {
          variant: "dark",
          onClick: () => __async(void 0, null, function* () {
            if (!checkProAccessCode(accessCodeInput.value)) {
              setInvalidAccessCode(true);
              return;
            }
            setInvalidAccessCode(false);
            yield props.mitoAPI.log("signup_completed_pro", { "location": "upgrade_to_pro_taskpane" });
            yield props.mitoAPI.updateGoPro();
            setIsEnteringAccessCode(false);
          })
        },
        "Submit Access Code"
      )))));
    } else {
      return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
        DefaultTaskpaneHeader_default,
        {
          header: `Welcome to Mito ${props.proOrEnterprise}!`,
          setUIState: props.setUIState
        }
      ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement("p", { className: "text-heading-4 mb-10px" }, props.proOrEnterprise === "Pro" ? "You've successfully upgraded to Mito Pro. You can cancel any time by sending us an email." : "Mito Enterprise is the fastest way to automate any Python analysis."), /* @__PURE__ */ react_default.createElement(ProListElement, { text: "All telemetry is off" }), /* @__PURE__ */ react_default.createElement(ProListElement, { text: "Generated code is being optimized" }), /* @__PURE__ */ react_default.createElement(ProListElement, { text: "Style graphs" }), /* @__PURE__ */ react_default.createElement(ProListElement, { text: "Format dataframes" }), /* @__PURE__ */ react_default.createElement(ProListElement, { text: "Export formatting" }), /* @__PURE__ */ react_default.createElement(ProListElement, { text: "Get priority support" }), /* @__PURE__ */ react_default.createElement(ProListElement, { text: `All future ${props.proOrEnterprise} functionality!` })));
    }
  };
  var UpgradeToProTaskpane_default = UpgradeToProTaskpane;

  // src/mito/components/taskpanes/UserDefinedEdit/UserDefinedEditTaskpane.tsx
  init_react();
  var getDefaultParams11 = (edit_name, sheetDataArray, analyisData) => {
    const editor = analyisData.userDefinedEdits.find((f) => f.name === edit_name);
    if (editor === void 0) {
      return void 0;
    }
    return {
      "edit_name": editor.name,
      "edit_params": getInitialParamNameToParamValueMap(sheetDataArray, editor.parameters)
    };
  };
  var getNoEditorMessage = () => {
    let noEditorMessage = "You have not defined any editors. An editors is just a function that takes a pandas dataframe as the first argument, and returns a pandas dataframe.";
    if (isInStreamlit()) {
      noEditorMessage += " You can define editors in the spreadsheet call with the `editors` parameter.";
    } else if (isInDash()) {
      noEditorMessage += " You can define editors in the Spreadsheet call with the `editors` parameter.";
    } else {
      noEditorMessage += " You can define editors in the mitosheet.sheet call with the `editors` parameter.";
    }
    return noEditorMessage;
  };
  var UserDefinedEditTaskpane = (props) => {
    const [params, setParams] = useState(() => getDefaultParams11(props.edit_name, props.sheetDataArray, props.analysisData));
    const { edit } = useSendEditOnClickNoParams_default(
      "user_defined_edit" /* UserDefinedEdit */,
      props.mitoAPI,
      props.analysisData
    );
    const [error, setError] = useState(void 0);
    useEffect(() => {
      setParams(getDefaultParams11(props.edit_name, props.sheetDataArray, props.analysisData));
    }, [props.edit_name]);
    const editor = props.analysisData.userDefinedEdits.find((f) => f.name === (params == null ? void 0 : params.edit_name));
    if (params === void 0 || editor === void 0) {
      return /* @__PURE__ */ react_default.createElement(DefaultEmptyTaskpane_default, { setUIState: props.setUIState, message: getNoEditorMessage() });
    }
    const editorName = editor.name;
    const editorNameForDisplay = getDisplayNameOfPythonVariable(editorName);
    return /* @__PURE__ */ react_default.createElement(DefaultTaskpane_default, { setUIState: props.setUIState, mitoAPI: props.mitoAPI }, /* @__PURE__ */ react_default.createElement(
      DefaultTaskpaneHeader_default,
      {
        header: editorNameForDisplay,
        setUIState: props.setUIState
      }
    ), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneBody_default, null, /* @__PURE__ */ react_default.createElement(
      UserDefinedFunctionParamConfigSection_default,
      {
        sheetDataArray: props.sheetDataArray,
        paramNameToType: editor.parameters,
        params: params.edit_params,
        setParams: (newEditParams) => {
          setParams((prevParams) => {
            if (prevParams === void 0) {
              return prevParams;
            }
            return __spreadProps(__spreadValues({}, prevParams), {
              edit_params: newEditParams
            });
          });
        }
      }
    ), error !== void 0 && /* @__PURE__ */ react_default.createElement("p", { className: "text-color-error" }, error)), /* @__PURE__ */ react_default.createElement(DefaultTaskpaneFooter_default, null, /* @__PURE__ */ react_default.createElement(
      TextButton_default,
      {
        variant: "dark",
        width: "block",
        onClick: () => __async(void 0, null, function* () {
          if (params !== void 0) {
            const error2 = yield edit(params);
            setError(error2);
          }
        }),
        disabled: params === void 0,
        disabledTooltip: getNoEditorMessage()
      },
      editorNameForDisplay
    )));
  };
  var UserDefinedEditTaskpane_default = UserDefinedEditTaskpane;

  // src/mito/components/toolbar/Toolbar.tsx
  init_react();

  // src/mito/components/icons/FullscreenIcons.tsx
  init_react();
  var OpenFullscreenIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M6.09898 9.01562L1.07178 14.0713", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M13.9999 1.07031L8.97266 6.126", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M1.07178 9.01562V14.0713H6.09898", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M13.9999 6.126V1.07031H8.97266", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };
  var CloseFullscreenIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("path", { d: "M6.05555 8.94434L1 13.9999", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M8.94445 6.05566L14 1.00011", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M6.05469 13.9998V8.9442H0.999135", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("path", { d: "M8.94445 1.00011V6.05566H14", stroke: "var(--mito-text)", strokeMiterlimit: "10", strokeLinecap: "round" }));
  };

  // src/mito/components/toolbar/CodeTabContents.tsx
  init_react();

  // src/mito/components/icons/CopyCodeIcon.tsx
  init_react();
  var CopyIcon2 = (props) => {
    if (props.success) {
      return /* @__PURE__ */ react_default.createElement("svg", { width: "18", height: "22", viewBox: "0 0 18 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "0.5", y: "2.56641", width: "14", height: "18", rx: "1.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M1.49219 2.96094C1.49219 1.85637 2.38762 0.960938 3.49219 0.960938H14.4922C15.5968 0.960938 16.4922 1.85637 16.4922 2.96094V17.9609C16.4922 19.0655 15.5968 19.9609 14.4922 19.9609H3.49219C2.38762 19.9609 1.49219 19.0655 1.49219 17.9609V2.96094Z", fill: "var(--mito-background-off)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "2.48438", y: "0.5", width: "14", height: "18", rx: "1.5", stroke: "var(--mito-text)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M6 11L9.2371 14.2371C9.36264 14.3626 9.57538 14.321 9.64428 14.1573L13.5 5", stroke: "var(--mito-status-success)", strokeWidth: "1.5", strokeLinecap: "square" }));
    }
    return /* @__PURE__ */ react_default.createElement("svg", { width: "18", height: "22", viewBox: "0 1 18 21", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "1.00781", y: "3.03516", width: "14", height: "18", rx: "1.5", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M2 3.42969C2 2.32512 2.89543 1.42969 4 1.42969H15C16.1046 1.42969 17 2.32512 17 3.42969V18.4297C17 19.5343 16.1046 20.4297 15 20.4297H4C2.89543 20.4297 2 19.5343 2 18.4297V3.42969Z", fill: "var(--mito-background-off)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "2.99219", y: "0.96875", width: "14", height: "18", rx: "1.5", stroke: "var(--mito-text)" }));
  };
  var CopyCodeIcon_default = CopyIcon2;

  // src/mito/components/toolbar/CodeTabContents.tsx
  var CodeTabContents = (props) => {
    const [clickedCopy, setClickedCopy] = react_default.useState(false);
    return /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-bottom" }, /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        onClick: () => {
          setClickedCopy(true);
          setTimeout(() => setClickedCopy(false), 5e3);
        },
        iconOverride: /* @__PURE__ */ react_default.createElement(CopyCodeIcon_default, { success: clickedCopy }),
        action: props.actions.buildTimeActions["copy code" /* CopyCode */]
      }
    ), props.userProfile.mitoConfig["MITO_CONFIG_FEATURE_DISPLAY_CODE_OPTIONS" /* DISPLAY_CODE_OPTIONS */] && /* @__PURE__ */ react_default.createElement(ToolbarButton_default, { action: props.actions.buildTimeActions["CodeOptions" /* CODEOPTIONS */] }), /* @__PURE__ */ react_default.createElement(ToolbarButton_default, { action: props.actions.buildTimeActions["CodeSnippets" /* CODESNIPPETS */] }), props.userProfile.mitoConfig["MITO_CONFIG_FEATURE_DISPLAY_SCHEDULING" /* DISPLAY_SCHEDULING */] && /* @__PURE__ */ react_default.createElement(ToolbarButton_default, { action: props.actions.buildTimeActions["schedule github" /* Schedule_Github */] }));
  };

  // src/mito/components/toolbar/DataTabContents.tsx
  init_react();
  var getToolbarButtonsForUserDefinedImports = (actions, uiState, setUIState) => {
    const noDomainActions = actions.runtimeImportActionsList.filter((action) => action.domain === void 0 || action.domain === null);
    const domainToAction = /* @__PURE__ */ new Map();
    actions.runtimeImportActionsList.forEach((action) => {
      if (action.domain === void 0 || action.domain === null) {
        return;
      }
      const domainActions = domainToAction.get(action.domain);
      if (domainActions === void 0) {
        domainToAction.set(action.domain, [action]);
      } else {
        domainActions.push(action);
      }
    });
    const soloButtons = [];
    const dropdownButtons = [];
    noDomainActions.forEach((action) => {
      soloButtons.push(/* @__PURE__ */ react_default.createElement(
        ToolbarButton_default,
        {
          action,
          iconOverride: /* @__PURE__ */ react_default.createElement(ImportIcon_default, null),
          key: action.staticType
        }
      ));
    });
    domainToAction.forEach((domainActions, domain) => {
      if (domainActions.length === 1) {
        soloButtons.push(/* @__PURE__ */ react_default.createElement(
          ToolbarButton_default,
          {
            action: domainActions[0],
            iconOverride: /* @__PURE__ */ react_default.createElement(ImportIcon_default, null),
            key: domainActions[0].staticType
          }
        ));
        return;
      }
      const key2 = `open-domain-dropdown-${domainActions[0].domain}`;
      const openDomainAction = {
        staticType: key2,
        titleToolbar: toTitleCase(domain),
        domain,
        actionFunction: () => {
          setUIState((prevUIState) => {
            if (prevUIState.currOpenDropdown === void 0) {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenDropdown: {
                  type: "import-domain-dropdown",
                  domain
                }
              });
            }
            return prevUIState;
          });
        },
        type: "run-time",
        longTitle: key2,
        searchTerms: [],
        isDisabled: () => void 0,
        tooltip: ""
      };
      dropdownButtons.push(/* @__PURE__ */ react_default.createElement(
        ToolbarButton_default,
        {
          action: openDomainAction,
          iconOverride: /* @__PURE__ */ react_default.createElement(ImportIcon_default, null),
          key: domainActions[0].staticType
        },
        /* @__PURE__ */ react_default.createElement(
          Dropdown_default,
          {
            display: typeof uiState.currOpenDropdown === "object" && uiState.currOpenDropdown.type === "import-domain-dropdown" && uiState.currOpenDropdown.domain === domain,
            closeDropdown: () => setUIState((prevUIState) => {
              if (typeof prevUIState.currOpenDropdown !== "object" || prevUIState.currOpenDropdown.type !== "import-domain-dropdown" || prevUIState.currOpenDropdown.domain !== domain) {
                return prevUIState;
              }
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenDropdown: void 0
              });
            }),
            searchable: true
          },
          domainActions.map((action) => {
            console.log(action);
            return /* @__PURE__ */ react_default.createElement(
              DropdownItem_default,
              {
                title: action.titleToolbar || action.longTitle,
                subtext: action.tooltip,
                key: action.staticType,
                onClick: action.actionFunction
              }
            );
          })
        )
      ));
    });
    const buttons = [...soloButtons, ...dropdownButtons];
    return buttons;
  };
  var DataTabContents = (props) => {
    return /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-bottom" }, /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["import files" /* Import_Files */]
      }
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["Dataframe_Import" /* Dataframe_Import */]
      }
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["SnowflakeImport" /* SNOWFLAKEIMPORT */]
      }
    ), getToolbarButtonsForUserDefinedImports(props.actions, props.uiState, props.setUIState), /* @__PURE__ */ react_default.createElement("div", { className: "toolbar-vertical-line" }), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["updateImports" /* UPDATEIMPORTS */]
      }
    ), /* @__PURE__ */ react_default.createElement("div", { className: "toolbar-vertical-line" }), /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-icon-buttons" }, /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["sort ascending" /* SortAscending */]
      }
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["sort descending" /* SortDescending */]
      }
    )), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["sort" /* Sort */]
      }
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["filter" /* Filter */]
      }
    ), /* @__PURE__ */ react_default.createElement("div", { className: "toolbar-vertical-line" }), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["split text to column" /* Split_Text_To_Column */]
      }
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["Column_Headers_Transform" /* COLUMN_HEADERS_TRANSFORM */]
      }
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["drop duplicates" /* Drop_Duplicates */]
      }
    ), /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["fill na" /* Fill_Na */],
        orientation: "horizontal"
      }
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["one_hot_encoding" /* One_Hot_Encoding */],
        orientation: "horizontal"
      }
    )), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["reset index dropdown" /* RESET_INDEX_DROPDOWN */]
      },
      /* @__PURE__ */ react_default.createElement(
        Dropdown_default,
        {
          display: props.uiState.currOpenDropdown === "reset-index",
          closeDropdown: () => props.setUIState((prevUIState) => {
            if (prevUIState.currOpenDropdown !== "reset-index") {
              return prevUIState;
            }
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: void 0
            });
          }),
          width: "medium"
        },
        /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            title: "Reset and Keep Index",
            key: "reset-and-keep-index",
            onClick: props.actions.buildTimeActions["reset and keep index" /* RESET_AND_KEEP_INDEX */].actionFunction
          }
        ),
        /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            title: "Reset and Drop Index",
            key: "reset-and-drop-index",
            onClick: props.actions.buildTimeActions["reset and drop index" /* RESET_AND_DROP_INDEX */].actionFunction
          }
        )
      )
    ));
  };

  // src/mito/components/toolbar/FormulaTabContents.tsx
  init_react();
  var FormulaTabContents = (props) => {
    const formulaCategories = {
      "FINANCE": "finance formulas dropdown" /* Formulas_Dropdown_Finance */,
      "LOGIC": "logical formulas dropdown" /* Formulas_Dropdown_Logic */,
      "TEXT": "text formulas dropdown" /* Formulas_Dropdown_Text */,
      "DATE": "date time formulas dropdown" /* Formulas_Dropdown_DateTime */,
      "REFERENCE": "reference formulas dropdown" /* Formulas_Dropdown_Reference */,
      "MATH": "math formulas dropdown" /* Formulas_Dropdown_Math */
    };
    const getFormulaDropdownItems = (category) => {
      let functionsInCategory = [];
      if (category === "custom") {
        functionsInCategory = props.analysisData.userDefinedFunctions;
      } else {
        functionsInCategory = functionDocumentationObjects.filter(
          (functionObject) => functionObject.category === category
        );
      }
      return functionsInCategory.map((functionObject) => {
        return /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            title: functionObject.function,
            tooltip: functionObject.description,
            key: functionObject.function,
            supressFocusSettingOnClose: true,
            onClick: (e) => {
              var _a;
              e == null ? void 0 : e.stopPropagation();
              if (props.editorState !== void 0) {
                const currentFormula = props.editorState.formula;
                props.setEditorState(__spreadProps(__spreadValues({}, props.editorState), {
                  formula: `=${functionObject.function}(${currentFormula.startsWith("=") ? currentFormula.substring(1) : currentFormula}`
                }));
                void ((_a = props.mitoContainerRef.current) == null ? void 0 : _a.querySelector("#cell-editor-input")).focus();
              } else {
                const rowIndex = props.gridState.selections[0].startingRowIndex;
                const columnIndex = props.gridState.selections[0].startingColumnIndex;
                const { startingColumnFormula, arrowKeysScrollInFormula, editingMode } = getStartingFormula(props.sheetData, props.editorState, rowIndex, columnIndex, false);
                const newFormula = `=${functionObject.function}(${startingColumnFormula.startsWith("=") ? startingColumnFormula.substring(1) : startingColumnFormula}`;
                props.setEditorState({
                  rowIndex: Math.max(rowIndex, 0),
                  columnIndex: Math.max(columnIndex, 0),
                  formula: newFormula,
                  arrowKeysScrollInFormula,
                  editorLocation: "cell",
                  editingMode,
                  sheetIndex: props.gridState.selections[0].sheetIndex
                });
              }
            }
          }
        );
      });
    };
    const getFormulaDropdown = (action, category) => {
      const toolbarDropdown = `formula-${(category != null ? category : "more").toLocaleLowerCase()}`;
      return /* @__PURE__ */ react_default.createElement(ToolbarButton_default, { action: props.actions.buildTimeActions[action] }, /* @__PURE__ */ react_default.createElement(
        Dropdown_default,
        {
          display: props.uiState.currOpenDropdown === toolbarDropdown,
          closeDropdown: () => props.setUIState((prevUIState) => {
            if (prevUIState.currOpenDropdown !== toolbarDropdown) {
              return prevUIState;
            }
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: void 0
            });
          }),
          width: category === "DATE" ? "large" : "medium"
        },
        getFormulaDropdownItems(category)
      ));
    };
    return /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-bottom" }, /* @__PURE__ */ react_default.createElement(ToolbarButton_default, { action: props.actions.buildTimeActions["set column formula" /* Set_Column_Formula */] }), /* @__PURE__ */ react_default.createElement(ToolbarButton_default, { action: props.actions.buildTimeActions["add column to the right" /* Add_Column_Right */] }), /* @__PURE__ */ react_default.createElement("div", { className: "toolbar-vertical-line" }), Object.keys(formulaCategories).map((category) => {
      if (category === "FINANCE") {
        return null;
      }
      return getFormulaDropdown(formulaCategories[category], category);
    }), getFormulaDropdown("custom formulas dropdown" /* Formulas_Dropdown_Custom */, "custom"), getFormulaDropdown("more formulas dropdown" /* Formulas_Dropdown_More */));
  };

  // src/mito/components/toolbar/HomeTabContents.tsx
  init_react();
  var HomeTabContents = (props) => {
    var _a;
    const importDropdownItems = [
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: "Import Files", key: "Import Files", onClick: () => {
        props.setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            currOpenTaskpane: { type: "import files" /* IMPORT_FILES */ }
          });
        });
      } }),
      /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: "Import Dataframes", key: "Import Dataframes", onClick: () => {
        props.setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            currOpenTaskpane: { type: "DataframeImport" /* DATAFRAMEIMPORT */ }
          });
        });
      } })
    ];
    if (props.userProfile.mitoConfig.MITO_CONFIG_FEATURE_DISPLAY_SNOWFLAKE_IMPORT) {
      importDropdownItems.push(
        /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: "Import from Snowflake", key: "Import from Snowflake", onClick: () => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "SnowflakeImport" /* SNOWFLAKEIMPORT */ }
            });
          });
        } })
      );
    }
    props.actions.runtimeImportActionsList.map((action) => {
      const longTitle = action.longTitle;
      importDropdownItems.push(
        /* @__PURE__ */ react_default.createElement(DropdownItem_default, { title: longTitle, key: longTitle, onClick: () => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: {
                type: "UserDefinedImport" /* USERDEFINEDIMPORT */,
                importer_name: action.staticType
              }
            });
          });
        } })
      );
    });
    return /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-bottom" }, /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["import dropdown" /* Import_Dropdown */]
      },
      /* @__PURE__ */ react_default.createElement(
        Dropdown_default,
        {
          display: props.uiState.currOpenDropdown === "import",
          closeDropdown: () => props.setUIState((prevUIState) => {
            if (prevUIState.currOpenDropdown !== "import") {
              return prevUIState;
            }
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: void 0
            });
          }),
          width: props.actions.runtimeImportActionsList.length > 0 ? "large" : "medium"
        },
        importDropdownItems
      )
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["export dropdown" /* Export_Dropdown */]
      },
      /* @__PURE__ */ react_default.createElement(
        Dropdown_default,
        {
          display: props.uiState.currOpenDropdown === "export",
          closeDropdown: () => props.setUIState((prevUIState) => {
            if (prevUIState.currOpenDropdown !== "export") {
              return prevUIState;
            }
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: void 0
            });
          }),
          width: "large"
        },
        /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            title: "Download File Now",
            subtext: "Download the file to your downloads folder.",
            onClick: () => {
              props.setUIState((prevUIState) => {
                return __spreadProps(__spreadValues({}, prevUIState), {
                  currOpenTaskpane: { type: "download" /* DOWNLOAD */ }
                });
              });
            }
          }
        ),
        /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            title: "Download File when Executing Code",
            subtext: "Download the file to the same folder as this notebook when you run the generated code.",
            onClick: () => {
              props.setUIState((prevUIState) => {
                return __spreadProps(__spreadValues({}, prevUIState), {
                  currOpenTaskpane: { type: "Export To File" /* EXPORT_TO_FILE */ }
                });
              });
            }
          }
        )
      )
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["copy" /* Copy */]
      }
    ), /* @__PURE__ */ react_default.createElement("div", { className: "toolbar-vertical-line" }), /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-number-format" }, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        iconStyle: { width: "18px" },
        disabled: !!props.actions.buildTimeActions["precision decrease" /* Precision_Decrease */].isDisabled(),
        value: getColumnAppliedFormat(props.sheetData, getSelectedNumberSeriesColumnIDs(props.gridState.selections, props.sheetData)),
        display: props.uiState.currOpenDropdown === "format",
        onChangeDisplay: (display) => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: display ? "format" : void 0
            });
          });
        }
      },
      getColumnFormatDropdownItems(props.gridState.sheetIndex, props.sheetData, getSelectedNumberSeriesColumnIDs(props.gridState.selections, props.sheetData), props.mitoAPI, props.closeOpenEditingPopups)
    ), /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-number-precision" }, /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["set format to currency" /* Set_Format_Currency */]
      }
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["set format to percent" /* Set_Format_Percent */]
      }
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["precision increase" /* Precision_Increase */]
      }
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["precision decrease" /* Precision_Decrease */]
      }
    ))), /* @__PURE__ */ react_default.createElement("div", { className: "toolbar-vertical-line", style: { marginLeft: "5px" } }), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["ConditionalFormatting" /* Conditional_Formatting */]
      }
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["set_dataframe_format" /* Set_Dataframe_Format */]
      }
    ), /* @__PURE__ */ react_default.createElement("div", { className: "toolbar-vertical-line" }), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["add column to the right" /* Add_Column_Right */],
        highlightToolbarButton: props.highlightAddColButton
      }
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["delete" /* Delete */]
      }
    ), /* @__PURE__ */ react_default.createElement("div", { className: "toolbar-vertical-line" }), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["filter" /* Filter */],
        iconOverride: /* @__PURE__ */ react_default.createElement(FilterIcon, { sortIncluded: true })
      }
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["open search" /* OpenFind */],
        titleToolbar: "Find & Replace"
      }
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["change dtype" /* Change_Dtype */]
      },
      /* @__PURE__ */ react_default.createElement(
        Dropdown_default,
        {
          display: props.uiState.currOpenDropdown === "dtype",
          closeDropdown: () => props.setUIState((prevUIState) => {
            if (prevUIState.currOpenDropdown !== "dtype") {
              return prevUIState;
            }
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: void 0
            });
          }),
          width: "medium"
        },
        getDtypeSelectOptions((newDtype) => {
          const selectedColumnIDs = getSelectedColumnIDsWithEntireSelectedColumn(props.gridState.selections, props.sheetData);
          void props.mitoAPI.editChangeColumnDtype(
            props.sheetIndex,
            selectedColumnIDs,
            newDtype,
            getRandomId()
          );
        })
      )
    ), /* @__PURE__ */ react_default.createElement("div", { className: "toolbar-vertical-line" }), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["pivot" /* Pivot */],
        highlightToolbarButton: props.highlightPivotTableButton
      }
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["merge dropdown" /* Merge_Dropdown */]
      },
      /* @__PURE__ */ react_default.createElement(
        Dropdown_default,
        {
          display: props.uiState.currOpenDropdown === "merge",
          closeDropdown: () => props.setUIState((prevUIState) => {
            if (prevUIState.currOpenDropdown !== "merge") {
              return prevUIState;
            }
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: void 0
            });
          }),
          width: "medium"
        },
        /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            title: "Merge (horizontal)",
            onClick: () => {
              props.actions.buildTimeActions["merge" /* Merge */].actionFunction();
            }
          }
        ),
        /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            title: "Concat (vertical)",
            onClick: () => {
              props.actions.buildTimeActions["concat_dataframes" /* Concat_Dataframes */].actionFunction();
            }
          }
        ),
        /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            title: "Anti Merge (unique)",
            onClick: () => {
              props.actions.buildTimeActions["anti merge" /* AntiMerge */].actionFunction();
            }
          }
        )
      )
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["graph" /* Graph */]
      }
    ), props.userProfile.mitoConfig.MITO_CONFIG_FEATURE_DISPLAY_AI_TRANSFORMATION && /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["AI_Transformation" /* AI_TRANSFORMATION */]
      }
    ), ((_a = props.userProfile.mitoConfig.MITO_CONFIG_CODE_SNIPPETS) == null ? void 0 : _a.MITO_CONFIG_CODE_SNIPPETS_URL) !== void 0 && /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["CodeSnippets" /* CODESNIPPETS */]
      }
    ));
  };

  // src/mito/components/toolbar/InsertTabContents.tsx
  init_react();
  var InsertTabContents = (props) => {
    return /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-bottom" }, /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["pivot" /* Pivot */]
      }
    ), /* @__PURE__ */ react_default.createElement("div", null, /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["melt" /* Melt */],
        orientation: "horizontal"
      }
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["transpose" /* Transpose */],
        orientation: "horizontal"
      }
    )), /* @__PURE__ */ react_default.createElement("div", { className: "toolbar-vertical-line" }), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["merge" /* Merge */]
      }
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["concat_dataframes" /* Concat_Dataframes */]
      }
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["anti merge" /* AntiMerge */]
      }
    ), /* @__PURE__ */ react_default.createElement("div", { className: "toolbar-vertical-line" }), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["graph" /* Graph */]
      }
    ), /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-icon-buttons" }, /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["scatter plot" /* Graph_Scatter */]
      }
    ), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["line graph" /* Graph_Line */]
      }
    )));
  };

  // src/mito/components/toolbar/PlanButton.tsx
  init_react();
  var PlanButton = (props) => {
    const disabledDueToReplayAnalysis = props.uiState.currOpenTaskpane.type === "UpdateImports" /* UPDATEIMPORTS */ && props.uiState.currOpenTaskpane.failedReplayData !== void 0;
    let displayMessage = "Upgrade to Mito Pro";
    let proOrEnterprise = "Pro";
    if (props.userProfile.isPro) {
      displayMessage = "Mito Pro";
    }
    if (props.userProfile.isEnterprise) {
      displayMessage = "Mito Enterprise";
      proOrEnterprise = "Enterprise";
    }
    return /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: classNames("text-button", "text-button-variant-default", "mito-plan-button", "cursor-pointer"),
        onClick: () => {
          if (disabledDueToReplayAnalysis) {
            return;
          }
          if (!props.userProfile.isPro) {
            void props.mitoAPI.log("clicked_plan_button");
          }
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenTaskpane: { type: "upgrade_to_pro" /* UPGRADE_TO_PRO */, proOrEnterprise },
              selectedTabType: "data"
            });
          });
        }
      },
      displayMessage
    );
  };
  var PlanButton_default = PlanButton;

  // src/mito/components/toolbar/GraphTabs/ChartDesignTabContents.tsx
  init_react();

  // src/mito/hooks/useCopyToClipboard.tsx
  init_react();
  var useCopyToClipboard = (text, resetTimeout = 2500) => {
    const [copyStatus, setCopyStatus] = useState(false);
    const copy = useCallback(() => {
      if (text == void 0) {
        return;
      }
      writeTextToClipboard(text).then(
        () => {
          setCopyStatus(true);
        },
        () => {
          setCopyStatus(false);
        }
      );
    }, [text]);
    useEffect(() => {
      if (!copyStatus) {
        return;
      }
      const timer = setTimeout(() => {
        setCopyStatus(false);
      }, resetTimeout);
      return () => clearTimeout(timer);
    }, [copyStatus]);
    return [copy, copyStatus];
  };

  // src/mito/components/toolbar/GraphTabs/AddChartElementButton.tsx
  init_react();

  // src/mito/components/icons/GraphToolbar/AxisTitlesIcon.tsx
  init_react();
  var AxisTitlesIcon = (props) => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "15", height: "20", viewBox: "0 0 15 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "9.5", y: "5.5", width: "5", height: "10", fill: "var(--mito-background-off)", stroke: "#C2C2C2" }), /* @__PURE__ */ react_default.createElement("rect", { x: "4.5", y: "0.5", width: "5", height: "15", fill: "var(--mito-background)", stroke: "var(--mito-text-medium)" }), (props.axis === void 0 || props.axis === "horizontal") && /* @__PURE__ */ react_default.createElement("rect", { x: "4.5", y: "17.5", width: "10", height: "2", fill: "var(--mito-background)", stroke: "var(--mito-highlight)" }), (props.axis === void 0 || props.axis === "vertical") && /* @__PURE__ */ react_default.createElement("rect", { x: "0.5", y: "0.5", width: "2", height: "14", fill: "var(--mito-background)", stroke: "var(--mito-highlight)" }));
  };
  var AxisTitlesIcon_default = AxisTitlesIcon;

  // src/mito/components/icons/GraphToolbar/ChartTitleIcon.tsx
  init_react();
  var ChartTitleIcon = () => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "11", height: "22", viewBox: "0 0 11 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "5.5", y: "11.5", width: "5", height: "10", fill: "var(--mito-background-off)", stroke: "#C2C2C2" }), /* @__PURE__ */ react_default.createElement("rect", { x: "0.5", y: "6.5", width: "5", height: "15", fill: "var(--mito-background)", stroke: "var(--mito-text-medium)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "0.5", y: "0.5", width: "10", height: "4", fill: "var(--mito-background)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M2 2.5H9", stroke: "var(--mito-highlight)" }));
  };
  var ChartTitleIcon_default = ChartTitleIcon;

  // src/mito/components/icons/GraphToolbar/LegendIcon.tsx
  init_react();
  var LegendIcon = (props) => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "16", height: "20", viewBox: "0 0 16 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ react_default.createElement("rect", { x: "5.5", y: "9.5", width: "5", height: "10", fill: "var(--mito-background-off)", stroke: "#C2C2C2" }), /* @__PURE__ */ react_default.createElement("rect", { x: "0.5", y: "4.5", width: "5", height: "15", fill: "var(--mito-background)", stroke: "var(--mito-text-medium)" }), (props.orientation === void 0 || props.orientation === "vertical" || props.orientation === "none") && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("path", { d: "M7.5 0.5H13.5V7H7.5V0.5Z", fill: "var(--mito-background)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M8.5 1.5H10.5V3.5H8.5V1.5Z", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "8.5", y: "4", width: "2", height: "2", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M11 2.5H12.5V3.5H11V2.5Z", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M11 5H12.5V6H11V5Z", fill: "var(--mito-highlight)" })), props.orientation === "horizontal" && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("path", { d: "M0.5 0.5H11.5V4.5H0.5V0.5Z", fill: "var(--mito-background)", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M6.5 1.5H8.5V3.5H6.5V1.5Z", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M9 2.5H10.5V3.5H9V2.5Z", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M1.5 1.5H3.5V3.5H1.5V1.5Z", fill: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("path", { d: "M4 2.5H5.5V3.5H4V2.5Z", fill: "var(--mito-highlight)" })), props.orientation === "none" && /* @__PURE__ */ react_default.createElement("path", { d: "M11 5L15 9.5M11 9.5L15 5", stroke: "#CF0000", strokeLinecap: "round" }));
  };
  var LegendIcon_default = LegendIcon;

  // src/mito/components/icons/GraphToolbar/GridlinesIcon.tsx
  init_react();
  var GridlinesIcon = (props) => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "19", height: "17", viewBox: "0 0 25 21", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props.orientation !== void 0 && /* @__PURE__ */ react_default.createElement("path", { d: "M0.5 0V21H27", stroke: "var(--mito-text)" }), (props.orientation === void 0 || props.orientation === "horizontal") && /* @__PURE__ */ react_default.createElement("path", { d: "M0 21H5.60784H12.2353H19.1176H26M0 14.9884H26M0 8.01163H26M0 1.5H5.60784H12.2353H19.1176H26", stroke: "var(--mito-highlight)" }), (props.orientation === void 0 || props.orientation === "vertical") && /* @__PURE__ */ react_default.createElement("path", { d: "M5.60742 0.5L5.60742 20M12.2349 0.5L12.2349 20M19.1172 0.5L19.1172 20", stroke: "var(--mito-highlight)" }), /* @__PURE__ */ react_default.createElement("rect", { x: "12.5", y: "10", width: "5", height: "10", fill: "var(--mito-background-off)", stroke: "#C2C2C2" }), /* @__PURE__ */ react_default.createElement("rect", { x: "7.5", y: "5", width: "5", height: "15", fill: "var(--mito-background)", stroke: "var(--mito-text-medium)" }));
  };
  var GridlinesIcon_default = GridlinesIcon;

  // src/mito/components/icons/GraphToolbar/RangeSliderIcon.tsx
  init_react();
  var RangeSliderIcon = (props) => {
    return /* @__PURE__ */ react_default.createElement("svg", { width: "11", height: "25", viewBox: "0 0 11 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, (props.hasRangeSlider === void 0 || props.hasRangeSlider) && /* @__PURE__ */ react_default.createElement("path", { d: "M1 17V15M1 17V19M1 17H9M9 17V15M9 17V19", stroke: "var(--mito-highlight)", transform: "translate(0 3)", strokeWidth: "0.75", strokeLinecap: "round" }), /* @__PURE__ */ react_default.createElement("rect", { x: "5.5", y: "5.5", width: "5", height: "10", fill: "var(--mito-background-off)", stroke: "#C2C2C2" }), /* @__PURE__ */ react_default.createElement("rect", { x: "0.5", y: "0.5", width: "5", height: "15", fill: "var(--mito-background)", stroke: "var(--mito-text-medium)" }));
  };
  var RangeSliderIcon_default = RangeSliderIcon;

  // src/mito/components/toolbar/GraphTabs/AddChartElementButton.tsx
  var AddChartElementButton = (props) => {
    var _a;
    const [currOpenSubmenu, setCurrOpenSubmenu] = react_default.useState(void 0);
    const graphStylingParams = (_a = props.params) == null ? void 0 : _a.graph_styling;
    return /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        action: props.actions.buildTimeActions["add chart element dropdown" /* AddChartElementDropdown */]
      },
      /* @__PURE__ */ react_default.createElement(
        Dropdown_default,
        {
          display: props.uiState.currOpenDropdown === "add-chart-element",
          closeDropdown: () => {
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenDropdown: prevUIState.currOpenDropdown === "add-chart-element" ? void 0 : prevUIState.currOpenDropdown
              });
            });
          }
        },
        /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            title: "Axis Titles",
            icon: /* @__PURE__ */ react_default.createElement(AxisTitlesIcon_default, null),
            canHaveCheckMark: true,
            onMouseEnter: () => setCurrOpenSubmenu("axis-titles"),
            subMenu: /* @__PURE__ */ react_default.createElement(
              Dropdown_default,
              {
                display: currOpenSubmenu === "axis-titles",
                position: "horizontal",
                closeDropdown: () => setCurrOpenSubmenu(void 0)
              },
              /* @__PURE__ */ react_default.createElement(
                DropdownItem_default,
                {
                  title: "Horizontal",
                  icon: /* @__PURE__ */ react_default.createElement(AxisTitlesIcon_default, { axis: "horizontal" }),
                  canHaveCheckMark: true,
                  hasCheckMark: graphStylingParams == null ? void 0 : graphStylingParams.xaxis.visible,
                  onClick: () => {
                    return props.updateGraphParam({ graph_styling: { xaxis: { visible: !(graphStylingParams == null ? void 0 : graphStylingParams.xaxis.visible) } } });
                  }
                }
              ),
              /* @__PURE__ */ react_default.createElement(
                DropdownItem_default,
                {
                  title: "Vertical",
                  icon: /* @__PURE__ */ react_default.createElement(AxisTitlesIcon_default, { axis: "vertical" }),
                  canHaveCheckMark: true,
                  hasCheckMark: graphStylingParams == null ? void 0 : graphStylingParams.yaxis.visible,
                  onClick: () => {
                    return props.updateGraphParam({ graph_styling: { yaxis: { visible: !(graphStylingParams == null ? void 0 : graphStylingParams.yaxis.visible) } } });
                  }
                }
              ),
              /* @__PURE__ */ react_default.createElement(
                DropdownItem_default,
                {
                  title: "Edit X Axis Title",
                  icon: /* @__PURE__ */ react_default.createElement(AxisTitlesIcon_default, { axis: "horizontal" }),
                  canHaveCheckMark: true,
                  supressFocusSettingOnClose: true,
                  onClick: () => {
                    const graphElementObjects = getGraphElementObjects(props.graphOutput);
                    if (graphElementObjects === void 0) {
                      return;
                    }
                    props.setUIState((prevUIState) => {
                      var _a2;
                      return __spreadProps(__spreadValues({}, prevUIState), {
                        currOpenDropdown: void 0,
                        currOpenTaskpane: __spreadProps(__spreadValues({}, prevUIState.currOpenTaskpane), {
                          currentGraphElement: getGraphElementInfoFromHTMLElement(graphElementObjects.xtitle, "xtitle", props.graphOutput, (_a2 = props.mitoContainerRef) == null ? void 0 : _a2.current, "popup-title-editor")
                        })
                      });
                    });
                  }
                }
              ),
              /* @__PURE__ */ react_default.createElement(
                DropdownItem_default,
                {
                  title: "Edit Y Axis Title",
                  icon: /* @__PURE__ */ react_default.createElement(AxisTitlesIcon_default, { axis: "vertical" }),
                  canHaveCheckMark: true,
                  supressFocusSettingOnClose: true,
                  onClick: () => {
                    const graphElementObjects = getGraphElementObjects(props.graphOutput);
                    if (graphElementObjects === void 0) {
                      return;
                    }
                    props.setUIState((prevUIState) => {
                      var _a2;
                      return __spreadProps(__spreadValues({}, prevUIState), {
                        currOpenDropdown: void 0,
                        currOpenTaskpane: __spreadProps(__spreadValues({}, prevUIState.currOpenTaskpane), {
                          currentGraphElement: getGraphElementInfoFromHTMLElement(graphElementObjects.ytitle, "ytitle", props.graphOutput, (_a2 = props.mitoContainerRef) == null ? void 0 : _a2.current, "popup-title-editor")
                        })
                      });
                    });
                  }
                }
              )
            )
          }
        ),
        /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            title: "Chart Title",
            icon: /* @__PURE__ */ react_default.createElement(ChartTitleIcon_default, null),
            canHaveCheckMark: true,
            onMouseEnter: () => setCurrOpenSubmenu("chart-title"),
            subMenu: /* @__PURE__ */ react_default.createElement(
              Dropdown_default,
              {
                display: currOpenSubmenu === "chart-title",
                position: "horizontal",
                closeDropdown: () => setCurrOpenSubmenu(void 0)
              },
              /* @__PURE__ */ react_default.createElement(
                DropdownItem_default,
                {
                  title: "Display Title",
                  icon: /* @__PURE__ */ react_default.createElement(ChartTitleIcon_default, null),
                  canHaveCheckMark: true,
                  hasCheckMark: graphStylingParams == null ? void 0 : graphStylingParams.title.visible,
                  onClick: () => {
                    return props.updateGraphParam({ graph_styling: { title: { visible: !(graphStylingParams == null ? void 0 : graphStylingParams.title.visible) } } });
                  }
                }
              ),
              /* @__PURE__ */ react_default.createElement(
                DropdownItem_default,
                {
                  title: "Edit Title",
                  icon: /* @__PURE__ */ react_default.createElement(EditIcon_default, null),
                  supressFocusSettingOnClose: true,
                  canHaveCheckMark: true,
                  onClick: () => {
                    const graphElementObjects = getGraphElementObjects(props.graphOutput);
                    if (graphElementObjects === void 0) {
                      return;
                    }
                    props.setUIState((prevUIState) => {
                      var _a2;
                      return __spreadProps(__spreadValues({}, prevUIState), {
                        currOpenDropdown: void 0,
                        currOpenTaskpane: __spreadProps(__spreadValues({}, prevUIState.currOpenTaskpane), {
                          currentGraphElement: getGraphElementInfoFromHTMLElement(graphElementObjects.gtitle, "gtitle", props.graphOutput, (_a2 = props.mitoContainerRef) == null ? void 0 : _a2.current, "popup-title-editor")
                        })
                      });
                    });
                  }
                }
              )
            )
          }
        ),
        /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            title: "Legend",
            icon: /* @__PURE__ */ react_default.createElement(LegendIcon_default, null),
            canHaveCheckMark: true,
            onMouseEnter: () => setCurrOpenSubmenu("legend"),
            subMenu: /* @__PURE__ */ react_default.createElement(
              Dropdown_default,
              {
                display: currOpenSubmenu === "legend",
                position: "horizontal",
                closeDropdown: () => setCurrOpenSubmenu(void 0)
              },
              /* @__PURE__ */ react_default.createElement(
                DropdownItem_default,
                {
                  title: "None",
                  icon: /* @__PURE__ */ react_default.createElement(LegendIcon_default, { orientation: "none" }),
                  canHaveCheckMark: true,
                  hasCheckMark: !(graphStylingParams == null ? void 0 : graphStylingParams.showlegend),
                  onClick: () => {
                    return props.updateGraphParam({ graph_styling: { showlegend: !(graphStylingParams == null ? void 0 : graphStylingParams.showlegend) } });
                  }
                }
              ),
              /* @__PURE__ */ react_default.createElement(
                DropdownItem_default,
                {
                  title: "Vertical",
                  icon: /* @__PURE__ */ react_default.createElement(LegendIcon_default, { orientation: "vertical" }),
                  canHaveCheckMark: true,
                  hasCheckMark: (graphStylingParams == null ? void 0 : graphStylingParams.showlegend) && (graphStylingParams == null ? void 0 : graphStylingParams.legend.orientation) === "v",
                  onClick: () => {
                    return props.updateGraphParam({ graph_styling: { showlegend: true, legend: { orientation: "v" } } });
                  }
                }
              ),
              /* @__PURE__ */ react_default.createElement(
                DropdownItem_default,
                {
                  title: "Horizontal",
                  icon: /* @__PURE__ */ react_default.createElement(LegendIcon_default, { orientation: "horizontal" }),
                  canHaveCheckMark: true,
                  hasCheckMark: (graphStylingParams == null ? void 0 : graphStylingParams.showlegend) && (graphStylingParams == null ? void 0 : graphStylingParams.legend.orientation) === "h",
                  onClick: () => {
                    return props.updateGraphParam({ graph_styling: { showlegend: true, legend: { orientation: "h" } } });
                  }
                }
              )
            )
          }
        ),
        /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            title: "Grid Lines",
            icon: /* @__PURE__ */ react_default.createElement(GridlinesIcon_default, null),
            canHaveCheckMark: true,
            onMouseEnter: () => setCurrOpenSubmenu("grid-lines"),
            subMenu: /* @__PURE__ */ react_default.createElement(
              Dropdown_default,
              {
                display: currOpenSubmenu === "grid-lines",
                position: "horizontal",
                closeDropdown: () => setCurrOpenSubmenu(void 0)
              },
              /* @__PURE__ */ react_default.createElement(
                DropdownItem_default,
                {
                  title: "None",
                  icon: /* @__PURE__ */ react_default.createElement(GridlinesIcon_default, { orientation: "none" }),
                  canHaveCheckMark: true,
                  hasCheckMark: !(graphStylingParams == null ? void 0 : graphStylingParams.xaxis.showgrid) && !(graphStylingParams == null ? void 0 : graphStylingParams.yaxis.showgrid),
                  onClick: () => {
                    return props.updateGraphParam({ graph_styling: { xaxis: { showgrid: false }, yaxis: { showgrid: false } } });
                  }
                }
              ),
              /* @__PURE__ */ react_default.createElement(
                DropdownItem_default,
                {
                  title: "Vertical",
                  icon: /* @__PURE__ */ react_default.createElement(GridlinesIcon_default, { orientation: "vertical" }),
                  canHaveCheckMark: true,
                  hasCheckMark: graphStylingParams == null ? void 0 : graphStylingParams.xaxis.showgrid,
                  onClick: () => {
                    return props.updateGraphParam({ graph_styling: { xaxis: { showgrid: !(graphStylingParams == null ? void 0 : graphStylingParams.xaxis.showgrid) } } });
                  }
                }
              ),
              /* @__PURE__ */ react_default.createElement(
                DropdownItem_default,
                {
                  title: "Horizontal",
                  icon: /* @__PURE__ */ react_default.createElement(GridlinesIcon_default, { orientation: "horizontal" }),
                  canHaveCheckMark: true,
                  hasCheckMark: graphStylingParams == null ? void 0 : graphStylingParams.yaxis.showgrid,
                  onClick: () => {
                    return props.updateGraphParam({ graph_styling: { yaxis: { showgrid: !(graphStylingParams == null ? void 0 : graphStylingParams.yaxis.showgrid) } } });
                  }
                }
              )
            )
          }
        ),
        /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            title: "Show Range Slider",
            icon: /* @__PURE__ */ react_default.createElement(RangeSliderIcon_default, null),
            canHaveCheckMark: true,
            onMouseEnter: () => setCurrOpenSubmenu("range-slider"),
            subMenu: /* @__PURE__ */ react_default.createElement(
              Dropdown_default,
              {
                display: currOpenSubmenu === "range-slider",
                position: "horizontal",
                closeDropdown: () => setCurrOpenSubmenu(void 0)
              },
              /* @__PURE__ */ react_default.createElement(
                DropdownItem_default,
                {
                  title: "None",
                  icon: /* @__PURE__ */ react_default.createElement(RangeSliderIcon_default, { hasRangeSlider: false }),
                  canHaveCheckMark: true,
                  hasCheckMark: !(graphStylingParams == null ? void 0 : graphStylingParams.xaxis.rangeslider.visible),
                  onClick: () => {
                    return props.updateGraphParam({ graph_styling: { xaxis: { rangeslider: { visible: false } } } });
                  }
                }
              ),
              /* @__PURE__ */ react_default.createElement(
                DropdownItem_default,
                {
                  title: "Horizontal",
                  icon: /* @__PURE__ */ react_default.createElement(RangeSliderIcon_default, null),
                  canHaveCheckMark: true,
                  hasCheckMark: graphStylingParams == null ? void 0 : graphStylingParams.xaxis.rangeslider.visible,
                  onClick: () => {
                    return props.updateGraphParam({ graph_styling: { xaxis: { rangeslider: { visible: true } } } });
                  }
                }
              )
            )
          }
        )
      )
    );
  };

  // src/mito/components/toolbar/GraphTabs/GraphTypeConfigurations.tsx
  init_react();
  var GraphTypeConfigurations = (props) => {
    var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
    const configurationInputs = [];
    if (GRAPHS_WITH_UNIQUE_CONFIG_OPTIONS.includes((_a = props.graphParams.graph_creation) == null ? void 0 : _a.graph_type)) {
      if (GRAPHS_THAT_HAVE_NBINS.includes((_b = props.graphParams.graph_creation) == null ? void 0 : _b.graph_type)) {
        configurationInputs.push(/* @__PURE__ */ react_default.createElement("div", { className: "mito-graph-configuration-option" }, /* @__PURE__ */ react_default.createElement("p", { className: "text-body-1", style: { fontWeight: "bold" } }, "Number of bins (int)"), /* @__PURE__ */ react_default.createElement(
          Input_default,
          {
            value: ((_d = (_c = props.graphParams.graph_creation) == null ? void 0 : _c.nbins) == null ? void 0 : _d.toString()) || "",
            type: "number",
            placeholder: "5",
            onChange: (e) => {
              const newNumberBins = e.target.value === "" ? void 0 : e.target.value;
              if (newNumberBins === void 0 || +newNumberBins < 0)
                return;
              props.updateGraphParam({ graph_creation: { nbins: +(newNumberBins != null ? newNumberBins : "") } });
            },
            style: { width: "70px" }
          }
        )));
      }
      if (GRAPHS_THAT_HAVE_HISTFUNC.includes((_e = props.graphParams.graph_creation) == null ? void 0 : _e.graph_type)) {
        configurationInputs.push(/* @__PURE__ */ react_default.createElement("div", { className: "mito-graph-configuration-option" }, /* @__PURE__ */ react_default.createElement(LabelAndTooltip_default, { style: { fontWeight: "bold" }, tooltip: "The metric displayed for each bin of data", textBody: true }, "Aggregation Type"), /* @__PURE__ */ react_default.createElement(
          Select_default,
          {
            value: ((_f = props.graphParams.graph_creation) == null ? void 0 : _f.histfunc) || "count",
            onChange: (newHistfunc) => {
              props.updateGraphParam({ graph_creation: { histfunc: newHistfunc } });
            },
            style: { width: "70px" },
            dropdownWidth: "medium"
          },
          /* @__PURE__ */ react_default.createElement(
            DropdownItem_default,
            {
              title: "count",
              subtext: "number of values in each bin"
            }
          ),
          /* @__PURE__ */ react_default.createElement(
            DropdownItem_default,
            {
              title: "sum",
              subtext: "sum of values in each bin"
            }
          ),
          /* @__PURE__ */ react_default.createElement(
            DropdownItem_default,
            {
              title: "avg",
              subtext: "average value in each bin"
            }
          ),
          /* @__PURE__ */ react_default.createElement(
            DropdownItem_default,
            {
              title: "min",
              subtext: "min value in each bin"
            }
          ),
          /* @__PURE__ */ react_default.createElement(
            DropdownItem_default,
            {
              title: "max",
              subtext: "max value in each bin"
            }
          )
        )));
      }
      if (GRAPHS_THAT_HAVE_POINTS.includes((_g = props.graphParams.graph_creation) == null ? void 0 : _g.graph_type)) {
        configurationInputs.push(/* @__PURE__ */ react_default.createElement("div", { className: "mito-graph-configuration-option" }, /* @__PURE__ */ react_default.createElement("p", { style: { fontWeight: "bold" } }, "Points"), /* @__PURE__ */ react_default.createElement(
          Select_default,
          {
            value: ((_h = props.graphParams.graph_creation) == null ? void 0 : _h.points) === false ? "none" : ((_i = props.graphParams.graph_creation) == null ? void 0 : _i.points) !== void 0 ? (_j = props.graphParams.graph_creation) == null ? void 0 : _j.points : "",
            onChange: (newPointsString) => {
              const newPointsParams = newPointsString === "false" ? false : newPointsString;
              props.updateGraphParam({ graph_creation: { points: newPointsParams } });
            },
            width: "small",
            dropdownWidth: "medium"
          },
          /* @__PURE__ */ react_default.createElement(
            DropdownItem_default,
            {
              title: "outliers",
              subtext: "only display sample points outside the whiskers"
            }
          ),
          /* @__PURE__ */ react_default.createElement(
            DropdownItem_default,
            {
              title: "suspected outliers",
              id: "suspectedoutliers",
              subtext: "display outlier and suspected outlier points"
            }
          ),
          /* @__PURE__ */ react_default.createElement(
            DropdownItem_default,
            {
              title: "all",
              subtext: "display all sample points"
            }
          ),
          /* @__PURE__ */ react_default.createElement(
            DropdownItem_default,
            {
              title: "none",
              id: "false",
              subtext: "display no individual sample points"
            }
          )
        )));
      }
    }
    return configurationInputs.length === 0 ? /* @__PURE__ */ react_default.createElement(react_default.Fragment, null) : /* @__PURE__ */ react_default.createElement("div", { className: "mito-graph-configuration-container" }, configurationInputs);
  };

  // src/mito/components/toolbar/GraphTabs/ChartDesignTabContents.tsx
  var ChartDesignTabContents = (props) => {
    var _a, _b;
    const currOpenTaskpane = props.uiState.currOpenTaskpane;
    if (currOpenTaskpane.type !== "graph" /* GRAPH */) {
      throw new Error("ChartDesignTabContents should only be used when the graph taskpane is open.");
    }
    const openGraph = currOpenTaskpane.openGraph;
    const stepSummaryList = props.analysisData.stepSummaryList;
    const currGraphStep = stepSummaryList[stepSummaryList.length - 1];
    const params = currGraphStep.params;
    const updateGraphParam = (update) => {
      var _a2, _b2, _c, _d;
      if (params === void 0) {
        return;
      }
      void props.mitoAPI.editGraph(
        openGraph.graphID,
        convertBackendtoFrontendGraphParams(updateObjectWithPartialObject(params, update)),
        (_b2 = (_a2 = params.graph_rendering) == null ? void 0 : _a2.height) != null ? _b2 : "100%",
        (_d = (_c = params.graph_rendering) == null ? void 0 : _c.width) != null ? _d : "100%",
        currGraphStep.step_id,
        true
      );
    };
    const graphDataArray = props.analysisData.graphDataArray;
    const graphData = graphDataArray.find((graphData2) => graphData2.graph_id === openGraph.graphID);
    const [_copyShowGraphCode] = useCopyToClipboard(
      (((_a = graphData == null ? void 0 : graphData.graph_output) == null ? void 0 : _a.graphGeneratedCode) || "") + `
fig.show(renderer="iframe")`
    );
    const [_copyExportHTMLGraphCode] = useCopyToClipboard(
      (((_b = graphData == null ? void 0 : graphData.graph_output) == null ? void 0 : _b.graphGeneratedCode) || "") + `
fig.write_html("${graphData == null ? void 0 : graphData.graph_tab_name}.html")`
    );
    const copyShowGraphCode = () => {
      var _a2;
      _copyShowGraphCode();
      void props.mitoAPI.log("copy_graph_code", {
        "graph_type": (_a2 = params == null ? void 0 : params.graph_creation) == null ? void 0 : _a2.graph_type
      });
    };
    const copyExportHTMLGraphCode = () => {
      var _a2;
      _copyExportHTMLGraphCode();
      void props.mitoAPI.log("copy_export_html_graph_code", {
        "graph_type": (_a2 = params == null ? void 0 : params.graph_creation) == null ? void 0 : _a2.graph_type
      });
    };
    return /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-bottom" }, /* @__PURE__ */ react_default.createElement(ToolbarButton_default, { action: props.actions.buildTimeActions["graph select data" /* Graph_SelectData */] }), /* @__PURE__ */ react_default.createElement(
      ChangeChartTypeButton,
      __spreadProps(__spreadValues({}, props), {
        params,
        updateGraphParam
      })
    ), /* @__PURE__ */ react_default.createElement(
      AddChartElementButton,
      __spreadProps(__spreadValues({}, props), {
        params,
        updateGraphParam,
        graphOutput: graphData == null ? void 0 : graphData.graph_output
      })
    ), params === void 0 ? /* @__PURE__ */ react_default.createElement("p", null, " Loading... ") : /* @__PURE__ */ react_default.createElement(
      GraphTypeConfigurations,
      __spreadProps(__spreadValues({}, props), {
        graphParams: params,
        updateGraphParam
      })
    ), /* @__PURE__ */ react_default.createElement(ToolbarButton_default, { action: props.actions.buildTimeActions["export graph dropdown" /* ExportGraphDropdown */] }, /* @__PURE__ */ react_default.createElement(
      Dropdown_default,
      {
        display: props.uiState.currOpenDropdown === "export-graph",
        closeDropdown: () => {
          props.setUIState((prevUIState) => {
            if (prevUIState.currOpenDropdown !== "export-graph") {
              return prevUIState;
            }
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: void 0
            });
          });
        }
      },
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "Copy code that displays graph",
          onClick: copyShowGraphCode
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "Copy code to create graph HTML file",
          onClick: copyExportHTMLGraphCode
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "Download as PNG",
          onClick: () => {
            var _a2, _b2;
            const downloadLink = (_a2 = props.mitoContainerRef.current) == null ? void 0 : _a2.querySelector('[data-title="Download plot as a png"]');
            downloadLink == null ? void 0 : downloadLink.click();
            void props.mitoAPI.log("export_graph_as_png", {
              "graph_type": (_b2 = params == null ? void 0 : params.graph_creation) == null ? void 0 : _b2.graph_type
            });
          }
        }
      )
    )));
  };

  // src/mito/components/toolbar/GraphTabs/ChartFormatTabContents.tsx
  init_react();

  // src/mito/components/toolbar/GraphTabs/AxesFormatOptions.tsx
  init_react();
  var AxesFormatOptions = (props) => {
    var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("div", { className: "graph-element-style-options" }, /* @__PURE__ */ react_default.createElement("div", { className: "horizontal-input-with-label" }, /* @__PURE__ */ react_default.createElement("p", null, "X Axis Transform"), /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        value: (_c = (_b = (_a = props.params) == null ? void 0 : _a.graph_styling) == null ? void 0 : _b.xaxis.type) != null ? _c : "-" /* DEFAULT */,
        width: "small",
        onChange: (value) => {
          props.updateGraphParam({
            graph_styling: {
              xaxis: {
                type: value
              }
            }
          });
        }
      },
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "-" /* DEFAULT */
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "linear" /* LINEAR */
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "log" /* LOG */
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "date" /* DATE */
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "category" /* CATEGORY */
        }
      )
    )), /* @__PURE__ */ react_default.createElement("div", { className: "horizontal-input-with-label" }, /* @__PURE__ */ react_default.createElement("p", null, "Y Axis Transform"), /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        value: (_e = (_d = props.params) == null ? void 0 : _d.graph_styling.yaxis.type) != null ? _e : "-" /* DEFAULT */,
        width: "small",
        onChange: (value) => {
          props.updateGraphParam({
            graph_styling: {
              yaxis: {
                type: value
              }
            }
          });
        }
      },
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "-" /* DEFAULT */
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "linear" /* LINEAR */
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "log" /* LOG */
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "date" /* DATE */
        }
      ),
      /* @__PURE__ */ react_default.createElement(
        DropdownItem_default,
        {
          title: "category" /* CATEGORY */
        }
      )
    ))), /* @__PURE__ */ react_default.createElement("div", { className: "graph-element-style-options" }, /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: "mito-toolbar-button-container mito-toolbar-button-container-enabled vertical-align-content",
        style: { width: "60px", marginLeft: "10px" }
      },
      /* @__PURE__ */ react_default.createElement(
        ColorInput_default,
        {
          value: (_i = (_h = (_g = (_f = props.params) == null ? void 0 : _f.graph_styling) == null ? void 0 : _g.xaxis) == null ? void 0 : _h.title_font_color) != null ? _i : "",
          onChange: (value) => {
            props.updateGraphParam({
              graph_styling: {
                xaxis: {
                  title_font_color: value
                }
              }
            });
          },
          id: "x-axis-title-color",
          type: "font-color"
        }
      ),
      /* @__PURE__ */ react_default.createElement("p", null, "X Axis Title Color")
    )), /* @__PURE__ */ react_default.createElement("div", { className: "graph-element-style-options" }, /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: "mito-toolbar-button-container mito-toolbar-button-container-enabled vertical-align-content",
        style: { width: "60px", marginLeft: "5px" }
      },
      /* @__PURE__ */ react_default.createElement(
        ColorInput_default,
        {
          value: (_l = (_k = (_j = props.params) == null ? void 0 : _j.graph_styling) == null ? void 0 : _k.yaxis.title_font_color) != null ? _l : "",
          onChange: (value) => {
            props.updateGraphParam({
              graph_styling: {
                yaxis: {
                  title_font_color: value
                }
              }
            });
          },
          type: "font-color",
          id: "y-axis-title-color"
        }
      ),
      /* @__PURE__ */ react_default.createElement("p", null, "Y Axis Title Color")
    )));
  };

  // src/mito/components/toolbar/GraphTabs/ChartTitleFormatOptions.tsx
  init_react();
  var ChartTitleFormatOptions = (props) => {
    var _a, _b, _c, _d;
    return /* @__PURE__ */ react_default.createElement("div", { className: "graph-element-style-options mito-toolbar-button-container-enabled vertical-align-content" }, /* @__PURE__ */ react_default.createElement(
      ColorInput_default,
      {
        value: (_d = (_c = (_b = (_a = props.params) == null ? void 0 : _a.graph_styling) == null ? void 0 : _b.title) == null ? void 0 : _c.title_font_color) != null ? _d : "",
        onChange: (value) => {
          props.updateGraphParam({
            graph_styling: {
              title: {
                title_font_color: value
              }
            }
          });
        },
        type: "font-color"
      }
    ), /* @__PURE__ */ react_default.createElement("p", null, "Text Fill"));
  };

  // src/mito/components/toolbar/GraphTabs/FacetFormatOptions.tsx
  init_react();
  var FacetFormatOptions = (props) => {
    var _a, _b, _c, _d, _e, _f, _g, _h, _i;
    return /* @__PURE__ */ react_default.createElement("div", { className: "graph-element-style-options" }, /* @__PURE__ */ react_default.createElement("div", { className: "horizontal-input-with-label" }, /* @__PURE__ */ react_default.createElement("p", null, "Number of Columns"), /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        type: "number",
        value: `${(_c = (_b = (_a = props.params) == null ? void 0 : _a.graph_creation) == null ? void 0 : _b.facet_col_wrap) != null ? _c : ""}`,
        onChange: (e) => {
          if (+e.target.value > 0) {
            props.updateGraphParam({
              graph_creation: {
                facet_col_wrap: +e.target.value
              }
            });
          }
        }
      }
    )), /* @__PURE__ */ react_default.createElement("div", { className: "horizontal-input-with-label" }, /* @__PURE__ */ react_default.createElement("p", null, "Column Spacing"), /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        type: "number",
        value: `${(_f = (_e = (_d = props.params) == null ? void 0 : _d.graph_creation) == null ? void 0 : _e.facet_col_spacing) != null ? _f : ""}`,
        onChange: (e) => {
          if (+e.target.value > 0) {
            props.updateGraphParam({
              graph_creation: {
                facet_col_spacing: +e.target.value
              }
            });
          }
        }
      }
    )), /* @__PURE__ */ react_default.createElement("div", { className: "horizontal-input-with-label" }, /* @__PURE__ */ react_default.createElement("p", null, "Row Spacing"), /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        type: "number",
        value: `${(_i = (_h = (_g = props.params) == null ? void 0 : _g.graph_creation) == null ? void 0 : _h.facet_row_spacing) != null ? _i : ""}`,
        onChange: (e) => {
          if (+e.target.value > 0) {
            props.updateGraphParam({
              graph_creation: {
                facet_row_spacing: +e.target.value
              }
            });
          }
        }
      }
    )));
  };

  // src/mito/components/toolbar/GraphTabs/GridlinesFormatOptions.tsx
  init_react();
  var GridlinesFormatOptions = (props) => {
    var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
    return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement("div", { className: "graph-element-style-options" }, /* @__PURE__ */ react_default.createElement("div", { className: "horizontal-input-with-label" }, /* @__PURE__ */ react_default.createElement("p", null, "Vertical Grid Width"), /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        type: "number",
        value: `${(_c = (_b = (_a = props.params) == null ? void 0 : _a.graph_styling) == null ? void 0 : _b.xaxis.gridwidth) != null ? _c : ""}`,
        onChange: (e) => {
          if (+e.target.value > 0) {
            props.updateGraphParam({
              graph_styling: {
                xaxis: {
                  gridwidth: +e.target.value
                }
              }
            });
          }
        }
      }
    )), /* @__PURE__ */ react_default.createElement("div", { className: "horizontal-input-with-label" }, /* @__PURE__ */ react_default.createElement("p", null, "Horizontal Grid Width"), /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        type: "number",
        value: `${(_f = (_e = (_d = props.params) == null ? void 0 : _d.graph_styling) == null ? void 0 : _e.yaxis.gridwidth) != null ? _f : ""}`,
        onChange: (e) => {
          if (+e.target.value > 0) {
            props.updateGraphParam({
              graph_styling: {
                yaxis: {
                  gridwidth: +e.target.value
                }
              }
            });
          }
        }
      }
    ))), /* @__PURE__ */ react_default.createElement("div", { className: "graph-element-style-options" }, /* @__PURE__ */ react_default.createElement("div", { className: "horizontal-input-with-label" }, /* @__PURE__ */ react_default.createElement("p", null, "Display Horizontal Gridlines"), /* @__PURE__ */ react_default.createElement(
      Toggle_default,
      {
        value: !!((_h = (_g = props.params) == null ? void 0 : _g.graph_styling) == null ? void 0 : _h.yaxis.showgrid),
        onChange: () => {
          var _a2, _b2;
          props.updateGraphParam({
            graph_styling: {
              yaxis: {
                showgrid: !((_b2 = (_a2 = props.params) == null ? void 0 : _a2.graph_styling) == null ? void 0 : _b2.yaxis.showgrid)
              }
            }
          });
        }
      }
    )), /* @__PURE__ */ react_default.createElement("div", { className: "horizontal-input-with-label" }, /* @__PURE__ */ react_default.createElement("p", null, "Display Vertical Gridlines"), /* @__PURE__ */ react_default.createElement(
      Toggle_default,
      {
        value: !!((_j = (_i = props.params) == null ? void 0 : _i.graph_styling) == null ? void 0 : _j.xaxis.showgrid),
        onChange: () => {
          var _a2, _b2;
          props.updateGraphParam({
            graph_styling: {
              xaxis: {
                showgrid: !((_b2 = (_a2 = props.params) == null ? void 0 : _a2.graph_styling) == null ? void 0 : _b2.xaxis.showgrid)
              }
            }
          });
        }
      }
    ))));
  };

  // src/mito/components/toolbar/GraphTabs/LegendFormatOptions.tsx
  init_react();
  var LegendFormatOptions = (props) => {
    var _a, _b, _c, _d, _e, _f;
    const [xPos, setXPos] = react_default.useState(`${(_c = (_b = (_a = props.params) == null ? void 0 : _a.graph_styling) == null ? void 0 : _b.legend.x) != null ? _c : ""}`);
    const [yPos, setYPos] = react_default.useState(`${(_f = (_e = (_d = props.params) == null ? void 0 : _d.graph_styling) == null ? void 0 : _e.legend.y) != null ? _f : ""}`);
    return /* @__PURE__ */ react_default.createElement("div", { className: "graph-element-style-options" }, /* @__PURE__ */ react_default.createElement("div", { className: "horizontal-input-with-label" }, /* @__PURE__ */ react_default.createElement("p", null, "X Position (-2 to 3)"), /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        type: "number",
        value: xPos,
        width: "small",
        onChange: (e) => {
          if (+e.target.value > 3 || +e.target.value < -2)
            return;
          setXPos(e.target.value);
          props.updateGraphParam({
            graph_styling: {
              legend: {
                x: +e.target.value
              }
            }
          });
        }
      }
    )), /* @__PURE__ */ react_default.createElement("div", { className: "horizontal-input-with-label" }, /* @__PURE__ */ react_default.createElement("p", null, "Y Position (-2 to 3)"), /* @__PURE__ */ react_default.createElement(
      Input_default,
      {
        type: "number",
        value: `${yPos != null ? yPos : ""}`,
        width: "small",
        onChange: (e) => {
          if (+e.target.value > 3 || +e.target.value < -2)
            return;
          setYPos(e.target.value);
          props.updateGraphParam({
            graph_styling: {
              legend: {
                y: +e.target.value
              }
            }
          });
        }
      }
    )));
  };

  // src/mito/components/toolbar/GraphTabs/PlotFormatOptions.tsx
  init_react();
  var PlotFormatOptions = (props) => {
    var _a, _b, _c, _d, _e, _f;
    return /* @__PURE__ */ react_default.createElement("div", { className: "graph-element-style-options" }, /* @__PURE__ */ react_default.createElement("div", { style: { marginRight: "5px" }, className: "mito-toolbar-button-container mito-toolbar-button-container-enabled vertical-align-content" }, /* @__PURE__ */ react_default.createElement(
      ColorInput_default,
      {
        value: (_c = (_b = (_a = props.params) == null ? void 0 : _a.graph_styling) == null ? void 0 : _b.plot_bgcolor) != null ? _c : "",
        onChange: (value) => {
          props.updateGraphParam({
            graph_styling: {
              plot_bgcolor: value
            }
          });
        },
        id: "plot-bgcolor",
        type: "background-color"
      }
    ), /* @__PURE__ */ react_default.createElement("p", null, "Chart Interior")), /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-button-container mito-toolbar-button-container-enabled vertical-align-content" }, /* @__PURE__ */ react_default.createElement(
      ColorInput_default,
      {
        value: (_f = (_e = (_d = props.params) == null ? void 0 : _d.graph_styling) == null ? void 0 : _e.paper_bgcolor) != null ? _f : "",
        onChange: (value) => {
          props.updateGraphParam({
            graph_styling: {
              paper_bgcolor: value
            }
          });
        },
        id: "paper-bgcolor",
        type: "background-color"
      }
    ), /* @__PURE__ */ react_default.createElement("p", null, "Chart Exterior")));
  };

  // src/mito/components/toolbar/GraphTabs/ChartFormatTabContents.tsx
  var ChartFormatTabContents = (props) => {
    var _a, _b, _c, _d;
    const currOpenTaskpane = props.uiState.currOpenTaskpane;
    if (currOpenTaskpane.type !== "graph" /* GRAPH */) {
      throw new Error("ChartDesignTabContents should only be used when the graph taskpane is open.");
    }
    const openGraph = currOpenTaskpane.openGraph;
    const stepSummaryList = props.analysisData.stepSummaryList;
    const currGraphStep = stepSummaryList[stepSummaryList.length - 1];
    const params = currGraphStep.params;
    const updateGraphParam = (update) => {
      var _a2, _b2, _c2, _d2;
      if (params === void 0) {
        return;
      }
      void props.mitoAPI.editGraph(
        openGraph.graphID,
        convertBackendtoFrontendGraphParams(updateObjectWithPartialObject(params, update)),
        (_b2 = (_a2 = params.graph_rendering) == null ? void 0 : _a2.height) != null ? _b2 : "100%",
        (_d2 = (_c2 = params.graph_rendering) == null ? void 0 : _c2.width) != null ? _d2 : "100%",
        currGraphStep.step_id,
        true
      );
    };
    const elementOptions = ["Chart Title", "Chart Area", "Legend", "Gridlines", "Axes", "Facet"];
    if (((_a = params == null ? void 0 : params.graph_styling) == null ? void 0 : _a.showlegend) === false) {
      elementOptions.splice(elementOptions.indexOf("Legend"), 1);
    }
    if (((_b = params == null ? void 0 : params.graph_styling) == null ? void 0 : _b.title.visible) === false) {
      elementOptions.splice(elementOptions.indexOf("Chart Title"), 1);
    }
    if (((_c = params == null ? void 0 : params.graph_creation) == null ? void 0 : _c.facet_col_column_id) === void 0 && ((_d = params == null ? void 0 : params.graph_creation) == null ? void 0 : _d.facet_row_column_id) === void 0) {
      elementOptions.splice(elementOptions.indexOf("Facet"), 1);
    }
    const [currElement, setCurrElement] = react_default.useState(elementOptions.includes(props.defaultCurrElement) ? props.defaultCurrElement : elementOptions[0]);
    const renderFormatOptions = () => {
      switch (currElement) {
        case "Chart Title":
          return /* @__PURE__ */ react_default.createElement(ChartTitleFormatOptions, { params, updateGraphParam });
        case "Chart Area":
          return /* @__PURE__ */ react_default.createElement(PlotFormatOptions, { params, updateGraphParam });
        case "Legend":
          return /* @__PURE__ */ react_default.createElement(LegendFormatOptions, { params, updateGraphParam });
        case "Gridlines":
          return /* @__PURE__ */ react_default.createElement(GridlinesFormatOptions, { params, updateGraphParam });
        case "Axes":
          return /* @__PURE__ */ react_default.createElement(AxesFormatOptions, { params, updateGraphParam });
        case "Facet":
          return /* @__PURE__ */ react_default.createElement(FacetFormatOptions, { params, updateGraphParam });
      }
    };
    return /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-bottom" }, /* @__PURE__ */ react_default.createElement(
      Select_default,
      {
        display: props.uiState.currOpenDropdown === "chart-format",
        width: "small",
        style: {
          alignSelf: "center"
        },
        onChangeDisplay: (display) => {
          props.setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenDropdown: display ? "chart-format" : void 0
            });
          });
        },
        onChange: (value) => {
          setCurrElement(value);
          props.setDefaultCurrElement(value);
        },
        value: currElement
      },
      elementOptions.map(
        (element, index) => /* @__PURE__ */ react_default.createElement(
          DropdownItem_default,
          {
            key: index,
            onClick: () => {
              setCurrElement(element);
            },
            title: element
          }
        )
      )
    ), /* @__PURE__ */ react_default.createElement("div", { className: "toolbar-vertical-line" }), renderFormatOptions());
  };

  // src/mito/components/toolbar/Toolbar.tsx
  var MITO_TOOLBAR_OPEN_SEARCH_ID = "mito-open-search";
  var MITO_TOOLBAR_UNDO_ID = "mito-undo-button";
  var MITO_TOOLBAR_REDO_ID = "mito-redo-button";
  var Toolbar = (props) => {
    var _a;
    const currentTab = props.uiState.currentToolbarTab;
    const originalTabs = ["Home", "Insert", "Data", "Formulas", "Code"];
    const tabs = {
      "Home": /* @__PURE__ */ react_default.createElement(HomeTabContents, __spreadValues({}, props)),
      "Insert": /* @__PURE__ */ react_default.createElement(InsertTabContents, __spreadValues({}, props)),
      "Data": /* @__PURE__ */ react_default.createElement(DataTabContents, __spreadValues({}, props)),
      "Formulas": /* @__PURE__ */ react_default.createElement(FormulaTabContents, __spreadValues({}, props)),
      "Code": /* @__PURE__ */ react_default.createElement(CodeTabContents, __spreadValues({}, props))
    };
    if (props.actions.runtimeEditActionsList.length > 0) {
      tabs["Custom Edits"] = /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-bottom", id: "mito-editor-tab" }, props.actions.runtimeEditActionsList.map((action) => {
        return /* @__PURE__ */ react_default.createElement(
          ToolbarButton_default,
          {
            action,
            key: action.staticType,
            iconOverride: action.iconToolbar === void 0 ? /* @__PURE__ */ react_default.createElement(EditIcon_default, null) : void 0
          }
        );
      }));
    }
    const [currElement, setCurrElement] = react_default.useState("Chart Title");
    if (props.uiState.currOpenTaskpane.type === "graph" /* GRAPH */) {
      tabs["Chart Design"] = /* @__PURE__ */ react_default.createElement(ChartDesignTabContents, __spreadValues({}, props));
      tabs["Format"] = /* @__PURE__ */ react_default.createElement(ChartFormatTabContents, __spreadProps(__spreadValues({}, props), { defaultCurrElement: currElement, setDefaultCurrElement: setCurrElement }));
    }
    const isLoading = () => {
      if (props.uiState.loading.length > 0) {
        for (const loadingInfo of props.uiState.loading) {
          if (loadingInfo[1] !== void 0) {
            return true;
          }
        }
      }
      return false;
    };
    return /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-container" }, /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-top" }, /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-top-left" }, /* @__PURE__ */ react_default.createElement(ToolbarButton_default, { id: MITO_TOOLBAR_UNDO_ID, action: props.actions.buildTimeActions["undo" /* Undo */] }), /* @__PURE__ */ react_default.createElement(ToolbarButton_default, { id: MITO_TOOLBAR_REDO_ID, action: props.actions.buildTimeActions["redo" /* Redo */] }), /* @__PURE__ */ react_default.createElement(ToolbarButton_default, { action: props.actions.buildTimeActions["clear" /* Clear */] })), /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-top-right" }, isLoading() ? /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-save-indicator", style: { justifyContent: "center" } }, /* @__PURE__ */ react_default.createElement("p", null, "Saving"), /* @__PURE__ */ react_default.createElement("div", { style: { width: "10px" } }, /* @__PURE__ */ react_default.createElement(LoadingDots_default, null))) : /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-save-indicator", title: "All changes are saved automatically." }, /* @__PURE__ */ react_default.createElement("p", null, "Saved"), /* @__PURE__ */ react_default.createElement(CheckmarkIcon_default, null)), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        id: MITO_TOOLBAR_OPEN_SEARCH_ID,
        action: props.actions.buildTimeActions["open search" /* OpenFind */]
      }
    ), /* @__PURE__ */ react_default.createElement(ToolbarButton_default, { action: props.actions.buildTimeActions["steps" /* Steps */] }), /* @__PURE__ */ react_default.createElement(
      ToolbarButton_default,
      {
        iconOverride: fscreen_esm_default.fullscreenElement ? /* @__PURE__ */ react_default.createElement(CloseFullscreenIcon, null) : /* @__PURE__ */ react_default.createElement(OpenFullscreenIcon, null),
        action: props.actions.buildTimeActions["fullscreen" /* Fullscreen */]
      }
    ))), /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-tabbar" }, /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-tabbar-left" }, Object.keys(tabs).map((tab) => {
      return /* @__PURE__ */ react_default.createElement(
        "button",
        {
          key: tab,
          style: { width: `${tab.length + 2}ch` },
          onClick: () => {
            if (currentTab === tab) {
              props.setUIState((prevUIState) => {
                return __spreadProps(__spreadValues({}, prevUIState), {
                  currentToolbarTab: void 0
                });
              });
              return;
            }
            props.setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currentToolbarTab: tab
              });
            });
          },
          className: classNames("mito-toolbar-tabbar-tabname", currentTab === tab ? "mito-toolbar-tabbar-tabname-selected" : "", originalTabs.includes(tab) ? "" : "mito-toolbar-tabbar-tabname-extra")
        },
        /* @__PURE__ */ react_default.createElement("span", null, tab),
        currentTab === tab && /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-tabbar-selected-underline" })
      );
    })), /* @__PURE__ */ react_default.createElement("div", { className: "mito-toolbar-tabbar-right" }, /* @__PURE__ */ react_default.createElement(
      GetSupportButton_default,
      {
        userProfile: props.userProfile,
        setUIState: props.setUIState,
        mitoAPI: props.mitoAPI,
        width: "hug-contents",
        className: "mito-plan-button"
      }
    ), /* @__PURE__ */ react_default.createElement(
      PlanButton_default,
      {
        uiState: props.uiState,
        userProfile: props.userProfile,
        setUIState: props.setUIState,
        mitoAPI: props.mitoAPI
      }
    ))), currentTab !== void 0 ? (_a = tabs[currentTab]) != null ? _a : tabs["Home"] : void 0);
  };

  // src/mito/hooks/useMitoAPI.tsx
  init_react();
  var useMitoAPI = (getSendFunction, setSheetDataArray, setAnalysisData, setUserProfile, setUIState) => {
    const [sendFunctionStatus, setCommCreationStatus] = useState("loading");
    const [mitoAPI] = useState(
      () => {
        return new MitoAPI2(
          () => __async(void 0, null, function* () {
            const fetchFunction = yield getSendFunction();
            if (typeof fetchFunction === "string") {
              setCommCreationStatus(fetchFunction);
              return void 0;
            } else {
              setCommCreationStatus("finished");
              return fetchFunction;
            }
          }),
          setSheetDataArray,
          setAnalysisData,
          setUserProfile,
          setUIState
        );
      }
    );
    return {
      mitoAPI,
      sendFunctionStatus
    };
  };

  // src/mito/Mito.tsx
  var Mito = (props) => {
    const mitoContainerRef = useRef(null);
    const [sheetDataArray, setSheetDataArray] = useState(props.sheetDataArray);
    const [analysisData, setAnalysisData] = useState(props.analysisData);
    const [userProfile, setUserProfile] = useState(props.userProfile);
    const [gridState, setGridState] = useState(() => getDefaultGridState(sheetDataArray, 0));
    const isDataframeRenderMitosheet = props.analysisData.inputCellExecutionCount !== null;
    const [uiState, setUIState] = useState({
      loading: [],
      currOpenModal: !isDataframeRenderMitosheet && userProfile.userEmail == "" && userProfile.telemetryEnabled && !isInDashboard() ? { type: "SignUp" /* SignUp */ } : { type: "None" /* None */ },
      currOpenTaskpane: { type: "none" /* NONE */ },
      selectedColumnControlPanelTab: "filter_sort" /* FilterSort */,
      selectedSheetIndex: 0,
      selectedTabType: "data",
      currOpenDropdown: void 0,
      exportConfiguration: { exportType: "csv" },
      currentToolbarTab: isDataframeRenderMitosheet ? void 0 : "Home",
      currOpenPopups: {
        ["top_right" /* TopRight */]: { type: "none" /* None */ }
      },
      currOpenSearch: {
        isOpen: false,
        currentMatchIndex: -1,
        matches: []
      },
      dataRecon: void 0,
      taskpaneWidth: getDefaultTaskpaneWidth()
    });
    const [editorState, setEditorState] = useState(void 0);
    const [currPathParts, setCurrPathParts] = useState(props.analysisData.importFolderData ? props.analysisData.importFolderData.pathParts : ["."]);
    const [previousAITransformParams, setPreviousAITransformParams] = useState([]);
    const { mitoAPI, sendFunctionStatus } = useMitoAPI(props.getSendFunction, setSheetDataArray, setAnalysisData, setUserProfile, setUIState);
    useEffect(() => {
      if (sendFunctionStatus === "no_backend_comm_registered_error" || sendFunctionStatus === "non_valid_location_error" || sendFunctionStatus === "non_working_extension_error") {
        setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            currOpenTaskpane: {
              type: "CannotCreateComm" /* CANNOTCREATECOMM */,
              commCreationErrorStatus: sendFunctionStatus
            }
          });
        });
      }
    }, [sendFunctionStatus]);
    useEffect(() => {
      void mitoAPI.log("mitosheet_rendered");
    }, [mitoAPI]);
    useEffect(() => {
      const updateMitosheetCallCellOnFirstRender = () => __async(void 0, null, function* () {
        var _a, _b, _c, _d, _e;
        const args = (_c = yield (_b = props.jupyterUtils) == null ? void 0 : _b.getArgs((_a = analysisData.analysisToReplay) == null ? void 0 : _a.analysisName, analysisData.inputCellExecutionCount)) != null ? _c : [];
        if (analysisData.analysisToReplay) {
          const analysisToReplayName = (_d = analysisData.analysisToReplay) == null ? void 0 : _d.analysisName;
          if (!analysisData.analysisToReplay.existsOnDisk) {
            void mitoAPI.log("replayed_nonexistant_analysis_failed");
            setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenModal: {
                  type: "ErrorReplayAnalysis" /* ErrorReplayedAnalysis */,
                  header: "analysis_to_replay does not exist",
                  message: `We're unable to replay ${analysisToReplayName} because you don't have access to it. This is probably because the analysis was created on a different computer.`,
                  error: void 0,
                  oldAnalysisName: analysisToReplayName,
                  newAnalysisName: analysisData.analysisName
                }
              });
            });
            return;
          }
          const error = yield mitoAPI.updateReplayAnalysis(analysisToReplayName, args);
          if ("error" in error) {
            setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenTaskpane: {
                  type: "UpdateImports" /* UPDATEIMPORTS */,
                  failedReplayData: {
                    analysisName: analysisToReplayName,
                    error,
                    args
                  }
                }
              });
            });
          }
        } else {
          (_e = props.jupyterUtils) == null ? void 0 : _e.writeAnalysisToReplayToMitosheetCall(analysisData.analysisName, mitoAPI);
          yield mitoAPI.updateArgs(args);
        }
      });
      const handleRenderInNotebook = () => __async(void 0, null, function* () {
        const response = yield mitoAPI.getRenderCount();
        const currentRenderCount = "error" in response ? void 0 : response.result;
        if (currentRenderCount === 0 && sendFunctionStatus === "finished") {
          yield updateMitosheetCallCellOnFirstRender();
        }
        yield mitoAPI.updateRenderCount();
      });
      if (isInJupyterLabOrNotebook()) {
        void handleRenderInNotebook();
      }
    }, [mitoAPI, sendFunctionStatus]);
    const oldCodeRef = useRef();
    useEffect(() => {
      var _a;
      if (oldCodeRef.current === void 0) {
        void mitoAPI.getSavedAnalysisCode().then((response) => {
          if ("error" in response) {
            console.error(response.error);
            return;
          }
          oldCodeRef.current = response.result;
        });
        return;
      }
      (_a = props.jupyterUtils) == null ? void 0 : _a.writeGeneratedCodeToCell(
        analysisData.analysisName,
        analysisData.inputCellExecutionCount,
        analysisData.code,
        userProfile.telemetryEnabled,
        analysisData.publicInterfaceVersion,
        (codeWithoutUserEdits, codeWithUserEdits) => {
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: {
                type: "UserEditedCode" /* UserEditedCode */,
                codeWithoutUserEdits,
                codeWithUserEdits
              }
            });
          });
        },
        oldCodeRef.current,
        oldCodeRef.current === null ? true : void 0
      );
      oldCodeRef.current = analysisData.code;
    }, [analysisData]);
    useEffect(() => {
      plotly_default();
    }, []);
    useEffect(() => {
      if (uiState.currOpenTaskpane.type === "graph" /* GRAPH */ && analysisData.graphDataArray.length === 0) {
        setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            currOpenTaskpane: { type: "none" /* NONE */ },
            selectedTabType: "data",
            selectedSheetIndex: 0
          });
        });
      }
    }, [analysisData.graphDataArray.length]);
    const previousNumSheetsRef = useRef(sheetDataArray.length);
    useEffect(() => {
      const previousNumSheets = previousNumSheetsRef.current;
      setUIState((prevUIState) => {
        const prevSelectedSheetIndex = prevUIState.selectedSheetIndex;
        let newSheetIndex = prevSelectedSheetIndex;
        if (previousNumSheets < sheetDataArray.length) {
          newSheetIndex = sheetDataArray.length - 1 >= 0 ? sheetDataArray.length - 1 : 0;
        } else if (prevSelectedSheetIndex >= sheetDataArray.length) {
          newSheetIndex = sheetDataArray.length - 1 >= 0 ? sheetDataArray.length - 1 : 0;
        }
        return __spreadProps(__spreadValues({}, prevUIState), {
          selectedSheetIndex: newSheetIndex
        });
      });
      previousNumSheetsRef.current = sheetDataArray.length;
    }, [sheetDataArray]);
    useEffect(() => {
      const openEditedPivot = () => __async(void 0, null, function* () {
        const response = yield mitoAPI.getPivotParams(uiState.selectedSheetIndex);
        const existingPivotParams = "error" in response ? void 0 : response.result;
        if (existingPivotParams !== void 0) {
          setUIState((prevUIState) => {
            return __spreadProps(__spreadValues({}, prevUIState), {
              currOpenModal: { type: "None" /* None */ },
              currOpenTaskpane: {
                type: "pivot" /* PIVOT */,
                sourceSheetIndex: existingPivotParams.sheet_index,
                destinationSheetIndex: uiState.selectedSheetIndex,
                existingPivotParams
              },
              selectedTabType: "data"
            });
          });
        }
      });
      const source = dfSources[uiState.selectedSheetIndex];
      if (source !== void 0 && source === "pivoted" /* Pivoted */ && uiState.currOpenTaskpane.type === "none" /* NONE */) {
        void openEditedPivot();
      }
    }, [uiState.selectedSheetIndex]);
    const prevOpenTaskpaneRef = useRef(uiState.currOpenTaskpane.type);
    useEffect(() => {
      var _a;
      if (prevOpenTaskpaneRef.current !== "none" /* NONE */ && uiState.currOpenTaskpane.type === "none" /* NONE */) {
        const endoGridContainer = (_a = mitoContainerRef.current) == null ? void 0 : _a.querySelector(".endo-grid-container");
        focusGrid(endoGridContainer);
      }
      prevOpenTaskpaneRef.current = uiState.currOpenTaskpane.type;
    }, [uiState]);
    useEffect(() => {
      const cssVariables = getCSSStyleVariables(props.height, props.theme);
      Object.keys(cssVariables).forEach((key2) => {
        const value = cssVariables[key2];
        document.documentElement.style.setProperty(key2, value);
      });
    }, [props.theme, props.height]);
    const previousSelections = useRef(gridState.selections);
    useEffect(() => {
      if (props.onSelectionChange) {
        if (!shallowEqualToDepth(previousSelections.current, gridState.selections, 2)) {
          props.onSelectionChange(
            gridState.sheetIndex,
            gridState.selections
          );
          previousSelections.current = gridState.selections;
        }
      }
    }, [props.onSelectionChange, gridState.selections, gridState.sheetIndex]);
    const dfNames = sheetDataArray.map((sheetData) => sheetData.dfName);
    const dfSources = sheetDataArray.map((sheetData) => sheetData.dfSource);
    const lastStepSummary = analysisData.stepSummaryList[analysisData.stepSummaryList.length - 1];
    const { columnID } = getCellDataFromCellIndexes(
      sheetDataArray[uiState.selectedSheetIndex],
      gridState.selections[gridState.selections.length - 1].startingRowIndex,
      gridState.selections[gridState.selections.length - 1].startingColumnIndex
    );
    const closeOpenEditingPopups = useCallback((taskpanesToKeepIfOpen) => {
      if (EDITING_TASKPANES.includes(uiState.currOpenTaskpane.type) && (taskpanesToKeepIfOpen === void 0 || !taskpanesToKeepIfOpen.includes(uiState.currOpenTaskpane.type))) {
        setUIState((prevUIState) => {
          return __spreadProps(__spreadValues({}, prevUIState), {
            currOpenTaskpane: {
              type: "none" /* NONE */
            },
            currOpenModal: {
              type: "None" /* None */
            },
            selectedTabType: "data"
          });
        });
      }
    }, [uiState]);
    const getCurrentModalComponent = () => {
      var _a;
      switch (uiState.currOpenModal.type) {
        case "None" /* None */:
          return /* @__PURE__ */ react_default.createElement("div", null);
        case "Error" /* Error */:
          return /* @__PURE__ */ react_default.createElement(
            ErrorModal_default,
            {
              error: uiState.currOpenModal.error,
              setUIState,
              mitoAPI,
              userProfile
            }
          );
        case "ClearAnalysis" /* ClearAnalysis */:
          return /* @__PURE__ */ react_default.createElement(
            ClearAnalysisModal_default,
            {
              setUIState,
              mitoAPI
            }
          );
        case "SignUp" /* SignUp */:
          return /* @__PURE__ */ react_default.createElement(
            SignupModal_default,
            {
              setUIState,
              numUsages: userProfile.numUsages,
              mitoAPI,
              isPro: userProfile.isPro,
              sheetDataArray,
              analysisData
            }
          );
        case "DashboardSignup" /* DashboardSignup */:
          return /* @__PURE__ */ react_default.createElement(
            StreamlitSignupModal_default,
            {
              setUIState,
              numUsages: userProfile.numUsages,
              mitoAPI,
              isPro: userProfile.isPro,
              sheetDataArray,
              analysisData
            }
          );
        case "ErrorReplayAnalysis" /* ErrorReplayedAnalysis */:
          return /* @__PURE__ */ react_default.createElement(
            ReplayAnalysisModals_default,
            {
              setUIState,
              mitoAPI,
              header: uiState.currOpenModal.header,
              message: uiState.currOpenModal.message,
              error: uiState.currOpenModal.error,
              newAnalysisName: uiState.currOpenModal.newAnalysisName,
              oldAnalysisName: uiState.currOpenModal.oldAnalysisName,
              userProfile,
              overwriteAnalysisToReplayToMitosheetCall: (_a = props.jupyterUtils) == null ? void 0 : _a.overwriteAnalysisToReplayToMitosheetCall
            }
          );
        case "DeleteGraphs" /* DeleteGraphs */:
          return /* @__PURE__ */ react_default.createElement(
            DeleteGraphsModal_default,
            {
              setUIState,
              mitoAPI,
              graphDataArray: analysisData.graphDataArray,
              sheetIndex: uiState.currOpenModal.sheetIndex,
              dependantGraphTabNamesAndIDs: uiState.currOpenModal.dependantGraphTabNamesAndIDs,
              dfName: sheetDataArray[uiState.currOpenModal.sheetIndex] ? sheetDataArray[uiState.currOpenModal.sheetIndex].dfName : "this dataframe"
            }
          );
        case "UserEditedCode" /* UserEditedCode */:
          return /* @__PURE__ */ react_default.createElement(
            UserEditedCodeModal_default,
            {
              setUIState,
              mitoAPI,
              userProfile,
              jupyterUtils: props.jupyterUtils,
              analysisData,
              codeWithoutUserEdits: uiState.currOpenModal.codeWithoutUserEdits,
              codeWithUserEdits: uiState.currOpenModal.codeWithUserEdits
            }
          );
      }
    };
    const getCurrOpenTaskpane = () => {
      var _a, _b;
      switch (uiState.currOpenTaskpane.type) {
        case "control_panel" /* CONTROL_PANEL */:
          return /* @__PURE__ */ react_default.createElement(
            ControlPanelTaskpane_default,
            {
              key: "" + columnID + uiState.selectedSheetIndex + uiState.selectedColumnControlPanelTab,
              selectedSheetIndex: uiState.selectedSheetIndex,
              sheetData: sheetDataArray[uiState.selectedSheetIndex],
              selection: gridState.selections[gridState.selections.length - 1],
              gridState,
              mitoContainerRef,
              setUIState,
              setEditorState,
              mitoAPI,
              tab: uiState.selectedColumnControlPanelTab,
              lastStepIndex: lastStepSummary.step_idx,
              lastStepType: lastStepSummary.step_type,
              analysisData,
              closeOpenEditingPopups
            }
          );
        case "upgrade_to_pro" /* UPGRADE_TO_PRO */:
          return /* @__PURE__ */ react_default.createElement(
            UpgradeToProTaskpane_default,
            {
              mitoAPI,
              userProfile,
              setUIState,
              proOrEnterprise: uiState.currOpenTaskpane.proOrEnterprise
            }
          );
        case "download" /* DOWNLOAD */:
          return /* @__PURE__ */ react_default.createElement(
            DownloadTaskpane_default,
            {
              dfNames,
              userProfile,
              selectedSheetIndex: uiState.selectedSheetIndex,
              uiState,
              setUIState,
              mitoAPI,
              sheetDataArray
            }
          );
        case "drop_duplicates" /* DROP_DUPLICATES */:
          return /* @__PURE__ */ react_default.createElement(
            DropDuplicates_default,
            {
              dfNames,
              selectedSheetIndex: uiState.selectedSheetIndex,
              setUIState,
              mitoAPI,
              sheetDataArray,
              analysisData
            }
          );
        case "graph" /* GRAPH */:
          return /* @__PURE__ */ react_default.createElement(
            GraphSidebar_default,
            {
              setUIState,
              uiState,
              sheetDataArray,
              mitoAPI,
              graphDataArray: analysisData.graphDataArray,
              analysisData,
              mitoContainerRef,
              openGraph: uiState.currOpenTaskpane.openGraph
            }
          );
        case "import files" /* IMPORT_FILES */:
          return /* @__PURE__ */ react_default.createElement(
            FileImportTaskpane_default,
            {
              mitoAPI,
              analysisData,
              userProfile,
              setUIState,
              currPathParts,
              setCurrPathParts
            }
          );
        case "merge" /* MERGE */:
          return /* @__PURE__ */ react_default.createElement(
            MergeTaskpane_default,
            {
              selectedSheetIndex: uiState.selectedSheetIndex,
              sheetDataArray,
              existingParams: uiState.currOpenTaskpane.existingParams,
              setUIState,
              mitoAPI,
              analysisData,
              defaultMergeType: uiState.currOpenTaskpane.defaultMergeType
            }
          );
        case "concat" /* CONCAT */:
          return /* @__PURE__ */ react_default.createElement(
            ConcatTaskpane_default,
            {
              analysisData,
              sheetDataArray,
              setUIState,
              mitoAPI
            }
          );
        case "none" /* NONE */:
          return /* @__PURE__ */ react_default.createElement(Fragment, null);
        case "pivot" /* PIVOT */:
          return /* @__PURE__ */ react_default.createElement(
            PivotTaskpane_default,
            {
              dfNames,
              sheetDataArray,
              mitoAPI,
              sourceSheetIndex: uiState.currOpenTaskpane.sourceSheetIndex,
              analysisData,
              setUIState,
              destinationSheetIndex: uiState.currOpenTaskpane.destinationSheetIndex,
              existingPivotParams: uiState.currOpenTaskpane.existingPivotParams
            }
          );
        case "split_text_to_columns" /* SPLIT_TEXT_TO_COLUMNS */:
          return /* @__PURE__ */ react_default.createElement(
            SplitTextToColumnsTaskpane_default,
            {
              mitoAPI,
              analysisData,
              sheetDataArray,
              selectedSheetIndex: uiState.selectedSheetIndex,
              setUIState,
              dfNames,
              startingColumnID: uiState.currOpenTaskpane.startingColumnID
            }
          );
        case "steps" /* STEPS */:
          return /* @__PURE__ */ react_default.createElement(
            StepsTaskpane_default,
            {
              stepSummaryList: analysisData.stepSummaryList,
              setUIState,
              mitoAPI,
              currStepIdx: analysisData.currStepIdx,
              userProfile
            }
          );
        case "import_first" /* IMPORT_FIRST */:
          return /* @__PURE__ */ react_default.createElement(
            DefaultEmptyTaskpane_default,
            {
              setUIState,
              message: uiState.currOpenTaskpane.message
            }
          );
        case "fill_na" /* FILL_NA */:
          return /* @__PURE__ */ react_default.createElement(
            FillNaTaskpane_default,
            {
              setUIState,
              uiState,
              mitoAPI,
              selectedSheetIndex: uiState.selectedSheetIndex,
              sheetDataArray,
              analysisData,
              startingColumnIDs: uiState.currOpenTaskpane.startingColumnIDs
            }
          );
        case "melt" /* MELT */:
          return /* @__PURE__ */ react_default.createElement(
            MeltTaskpane_default,
            {
              userProfile,
              analysisData,
              sheetDataArray,
              setUIState,
              mitoAPI,
              selectedSheetIndex: uiState.selectedSheetIndex
            }
          );
        case "set_dataframe_format" /* SET_DATAFRAME_FORMAT */:
          return /* @__PURE__ */ react_default.createElement(
            SetDataframeFormatTaskpane_default,
            {
              userProfile,
              analysisData,
              sheetDataArray,
              setUIState,
              mitoAPI,
              selectedSheetIndex: uiState.selectedSheetIndex
            }
          );
        case "ConditionalFormatting" /* CONDITIONALFORMATTING */:
          return /* @__PURE__ */ react_default.createElement(
            ConditionalFormattingTaskpane_default,
            {
              userProfile,
              analysisData,
              sheetDataArray,
              setUIState,
              mitoAPI,
              selectedSheetIndex: uiState.selectedSheetIndex,
              startingColumnIDs: uiState.currOpenTaskpane.startingColumnIDs
            }
          );
        case "DataframeImport" /* DATAFRAMEIMPORT */:
          return /* @__PURE__ */ react_default.createElement(
            DataframeImportTaskpane_default,
            {
              userProfile,
              analysisData,
              sheetDataArray,
              setUIState,
              mitoAPI,
              selectedSheetIndex: uiState.selectedSheetIndex
            }
          );
        case "UpdateImports" /* UPDATEIMPORTS */:
          return /* @__PURE__ */ react_default.createElement(
            UpdateImportsTaskpane_default,
            {
              mitoAPI,
              sheetDataArray,
              setUIState,
              userProfile,
              analysisData,
              currPathParts,
              setCurrPathParts,
              failedReplayData: uiState.currOpenTaskpane.failedReplayData,
              overwriteAnalysisToReplayToMitosheetCall: (_a = props.jupyterUtils) == null ? void 0 : _a.overwriteAnalysisToReplayToMitosheetCall
            }
          );
        case "CannotCreateComm" /* CANNOTCREATECOMM */:
          return /* @__PURE__ */ react_default.createElement(
            CannotCreateCommTaskpane_default,
            {
              userProfile,
              setUIState,
              commCreationErrorStatus: uiState.currOpenTaskpane.commCreationErrorStatus
            }
          );
        case "CodeSnippets" /* CODESNIPPETS */:
          return /* @__PURE__ */ react_default.createElement(
            CodeSnippetsTaskpane_default,
            {
              userProfile,
              analysisData,
              sheetDataArray,
              setUIState,
              mitoAPI,
              selectedSheetIndex: uiState.selectedSheetIndex,
              writeCodeSnippetCell: (_b = props.jupyterUtils) == null ? void 0 : _b.writeCodeSnippetCell
            }
          );
        case "SnowflakeImport" /* SNOWFLAKEIMPORT */:
          return /* @__PURE__ */ react_default.createElement(
            SnowflakeImportTaskpane_default,
            {
              userProfile,
              analysisData,
              sheetDataArray,
              setUIState,
              mitoAPI,
              selectedSheetIndex: uiState.selectedSheetIndex
            }
          );
        case "Excel Range Import" /* EXCEL_RANGE_IMPORT */:
          return /* @__PURE__ */ react_default.createElement(
            ExcelRangeImportTaskpane_default,
            {
              userProfile,
              analysisData,
              sheetDataArray,
              setUIState,
              mitoAPI,
              file_path: uiState.currOpenTaskpane.file_path,
              sheet_name: uiState.currOpenTaskpane.sheet_name,
              sheet_names: uiState.currOpenTaskpane.sheet_names
            }
          );
        case "Export To File" /* EXPORT_TO_FILE */:
          return /* @__PURE__ */ react_default.createElement(
            ExportToFileTaskpane_default,
            {
              userProfile,
              analysisData,
              sheetDataArray,
              setUIState,
              mitoAPI,
              selectedSheetIndex: uiState.selectedSheetIndex
            }
          );
        case "AITransformation" /* AITRANSFORMATION */:
          return /* @__PURE__ */ react_default.createElement(
            AITransformationTaskpane_default,
            {
              userProfile,
              analysisData,
              gridState,
              uiState,
              setUIState,
              mitoAPI,
              sheetDataArray,
              previousAITransformParams,
              setPreviousAITransformParams
            }
          );
        case "CodeOptions" /* CODEOPTIONS */:
          return /* @__PURE__ */ react_default.createElement(
            CodeOptionsTaskpane_default,
            {
              userProfile,
              analysisData,
              setUIState,
              mitoAPI
            }
          );
        case "Column Headers Transform" /* COLUMN_HEADERS_TRANSFORM */:
          return /* @__PURE__ */ react_default.createElement(
            ColumnHeadersTransformTaskpane_default,
            {
              userProfile,
              analysisData,
              sheetDataArray,
              setUIState,
              mitoAPI,
              selectedSheetIndex: uiState.selectedSheetIndex
            }
          );
        case "UserDefinedImport" /* USERDEFINEDIMPORT */:
          return /* @__PURE__ */ react_default.createElement(
            UserDefinedImportTaskpane_default,
            {
              userProfile,
              analysisData,
              sheetDataArray,
              setUIState,
              mitoAPI,
              selectedSheetIndex: uiState.selectedSheetIndex,
              importer_name: uiState.currOpenTaskpane.importer_name
            }
          );
        case "User Defined Edit" /* USER_DEFINED_EDIT */:
          return /* @__PURE__ */ react_default.createElement(
            UserDefinedEditTaskpane_default,
            {
              userProfile,
              analysisData,
              sheetDataArray,
              setUIState,
              mitoAPI,
              selectedSheetIndex: uiState.selectedSheetIndex,
              edit_name: uiState.currOpenTaskpane.edit_name
            }
          );
        case "GithubSchedule" /* GITHUB_SCHEDULE */:
          return /* @__PURE__ */ react_default.createElement(
            GithubScheduleTaskpane_default,
            {
              userProfile,
              analysisData,
              setUIState,
              mitoAPI
            }
          );
        case "DevTaskpane" /* DEV_TASKPANE */:
          return /* @__PURE__ */ react_default.createElement(
            DevTaskpane_default,
            {
              userProfile,
              setUIState,
              mitoAPI
            }
          );
      }
    };
    const getCurrOpenPopup = (popupLocation) => {
      const popupLocationInfo = uiState.currOpenPopups[popupLocation];
      switch (popupLocationInfo.type) {
        case "ephemeral_message" /* EphemeralMessage */:
          return /* @__PURE__ */ react_default.createElement(
            EphemeralMessage_default,
            {
              message: popupLocationInfo.message,
              setUIState,
              popupLocation
            }
          );
        case "none" /* None */:
          return /* @__PURE__ */ react_default.createElement(Fragment, null);
      }
    };
    const actions = getActions(
      sheetDataArray,
      gridState,
      dfSources,
      closeOpenEditingPopups,
      setEditorState,
      uiState,
      setUIState,
      setGridState,
      mitoAPI,
      mitoContainerRef,
      analysisData,
      userProfile,
      sendFunctionStatus
    );
    const taskpaneOpen = uiState.currOpenTaskpane.type !== "none" /* NONE */;
    const wideTaskpaneOpen = uiState.currOpenTaskpane.type === "graph" /* GRAPH */ && uiState.selectedTabType === "graph";
    const narrowTaskpaneOpen = taskpaneOpen && !wideTaskpaneOpen;
    const formulaBarAndSheetClassNames = classNames("mito-sheet-and-formula-bar-container", {
      "mito-sheet-and-formula-bar-container-wide-taskpane-open": wideTaskpaneOpen
    });
    const taskpaneClassNames = classNames({
      "mito-taskpane-container": !taskpaneOpen,
      "mito-taskpane-container-wide": wideTaskpaneOpen,
      "mito-taskpane-container-narrow": narrowTaskpaneOpen
    });
    const [resizingTaskpane, setResizingTaskpane] = useState(false);
    return /* @__PURE__ */ react_default.createElement(
      "div",
      {
        className: "mito-container",
        "data-jp-suppress-context-menu": true,
        ref: mitoContainerRef,
        tabIndex: 0,
        onMouseMove: (event) => {
          if (resizingTaskpane) {
            event.preventDefault();
            event.stopPropagation();
            if (mitoContainerRef.current !== null) {
              const { clientX } = event;
              const rawTaskpaneWidth = mitoContainerRef.current.getBoundingClientRect().right - clientX;
              const taskpaneWidth = Math.max(
                Math.min(TASKPANE_WIDTH_MAX, rawTaskpaneWidth),
                TASKPANE_WIDTH_MIN
              );
              setUIState(__spreadProps(__spreadValues({}, uiState), {
                taskpaneWidth
              }));
            }
          }
        },
        onMouseUp: (event) => {
          event.preventDefault();
          event.stopPropagation();
          setResizingTaskpane(false);
        },
        onKeyDown: (e) => {
          var _a, _b;
          if (e.key === "Escape") {
            if (editorState !== void 0) {
              setEditorState(void 0);
            } else if (uiState.currOpenTaskpane.type !== "none" /* NONE */ && uiState.currOpenTaskpane.type !== "graph" /* GRAPH */) {
              setUIState((prevUIState) => {
                return __spreadProps(__spreadValues({}, prevUIState), {
                  currOpenTaskpane: {
                    type: "none" /* NONE */
                  }
                });
              });
            } else if (uiState.currOpenSearch.isOpen) {
              setUIState((prevUIState) => {
                return __spreadProps(__spreadValues({}, prevUIState), {
                  currOpenSearch: {
                    isOpen: false,
                    currentMatchIndex: -1,
                    matches: []
                  }
                });
              });
              const endoGridContainer = (_a = mitoContainerRef.current) == null ? void 0 : _a.querySelector(".endo-grid-container");
              focusGrid(endoGridContainer);
            } else if (uiState.currOpenDropdown !== void 0) {
              setUIState((prevUIState) => {
                return __spreadProps(__spreadValues({}, prevUIState), {
                  currOpenDropdown: void 0
                });
              });
              const endoGridContainer = (_b = mitoContainerRef.current) == null ? void 0 : _b.querySelector(".endo-grid-container");
              focusGrid(endoGridContainer);
            }
          }
          handleKeyboardShortcuts(e, actions);
        },
        onClick: (e) => {
          var _a, _b;
          const eventTarget = e.target;
          if (uiState.currOpenTaskpane.type === "graph" /* GRAPH */ && ["context-menu", "popup-title-editor"].includes((_b = (_a = uiState.currOpenTaskpane.currentGraphElement) == null ? void 0 : _a.display) != null ? _b : "") && !(eventTarget instanceof HTMLInputElement && eventTarget.className.includes("popup-input"))) {
            e.stopPropagation();
            setUIState((prevUIState) => {
              return __spreadProps(__spreadValues({}, prevUIState), {
                currOpenTaskpane: __spreadProps(__spreadValues({}, prevUIState.currOpenTaskpane), {
                  currentGraphElement: void 0
                })
              });
            });
          }
        }
      },
      /* @__PURE__ */ react_default.createElement(ErrorBoundary_default, { mitoAPI, analyisData: analysisData, userProfile, sheetDataArray }, /* @__PURE__ */ react_default.createElement(
        Toolbar,
        {
          mitoAPI,
          currStepIdx: analysisData.currStepIdx,
          lastStepIndex: lastStepSummary.step_idx,
          actions,
          mitoContainerRef,
          gridState,
          setGridState,
          uiState,
          setUIState,
          sheetData: sheetDataArray[uiState.selectedSheetIndex],
          sheetDataArray,
          userProfile,
          editorState,
          setEditorState,
          analysisData,
          sheetIndex: uiState.selectedSheetIndex,
          closeOpenEditingPopups
        }
      ), /* @__PURE__ */ react_default.createElement("div", { className: "mito-center-content-container", id: "mito-center-content-container" }, /* @__PURE__ */ react_default.createElement(
        "div",
        {
          className: formulaBarAndSheetClassNames,
          style: narrowTaskpaneOpen ? { width: `calc(100% - ${uiState.taskpaneWidth}px)` } : void 0
        },
        /* @__PURE__ */ react_default.createElement(
          EndoGrid_default,
          {
            sheetDataArray,
            mitoAPI,
            uiState,
            setUIState,
            sheetIndex: uiState.selectedSheetIndex,
            gridState,
            setGridState,
            editorState,
            setEditorState,
            mitoContainerRef,
            closeOpenEditingPopups,
            sendFunctionStatus,
            analysisData,
            actions
          }
        )
      ), uiState.currOpenTaskpane.type !== "none" /* NONE */ && /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, uiState.currOpenTaskpane.type !== "graph" /* GRAPH */ && /* @__PURE__ */ react_default.createElement(
        "div",
        {
          className: "taskpane-resizer-container",
          onMouseDown: (event) => {
            event.preventDefault();
            event.stopPropagation();
            setResizingTaskpane(true);
          }
        },
        /* @__PURE__ */ react_default.createElement("div", { className: "taskpane-resizer" })
      ), /* @__PURE__ */ react_default.createElement(
        "div",
        {
          className: taskpaneClassNames,
          style: narrowTaskpaneOpen ? { width: `${uiState.taskpaneWidth}px` } : void 0
        },
        getCurrOpenTaskpane()
      ))), /* @__PURE__ */ react_default.createElement(
        Footer_default,
        {
          sheetDataArray,
          graphDataArray: analysisData.graphDataArray,
          gridState,
          setGridState,
          mitoAPI,
          closeOpenEditingPopups,
          uiState,
          setUIState,
          mitoContainerRef,
          setEditorState,
          actions
        }
      ), getCurrentModalComponent(), /* @__PURE__ */ react_default.createElement(
        BottomLeftPopup_default,
        {
          loading: uiState.loading,
          sheetDataArray,
          userProfile,
          analysisData,
          mitoAPI,
          currOpenModal: uiState.currOpenModal,
          actions,
          setUIState
        }
      ), getCurrOpenPopup("top_right" /* TopRight */), analysisData.currStepIdx !== lastStepSummary.step_idx && /* @__PURE__ */ react_default.createElement(
        CatchUpPopup_default,
        {
          fastForward: () => {
            void mitoAPI.updateCheckoutStepByIndex(lastStepSummary.step_idx);
          },
          deleteStepsAfterIdx: () => {
            void mitoAPI.updateUndoToStepIndex(analysisData.currStepIdx);
          },
          isPro: userProfile.isPro
        }
      ))
    );
  };
  var Mito_default = Mito;

  // src/dash/MitoDashWrapper.tsx
  init_react();

  // src/jupyter/jupyterUtils.tsx
  var getSheetDataArrayFromString = (sheet_data_json) => {
    if (sheet_data_json.length === 0) {
      return [];
    }
    return JSON.parse(sheet_data_json);
  };
  var getUserProfileFromString = (user_profile_json) => {
    const userProfile = JSON.parse(user_profile_json);
    if (userProfile["usageTriggeredFeedbackID"] == "") {
      userProfile["usageTriggeredFeedbackID"] = void 0;
    }
    return userProfile;
  };
  var getAnalysisDataFromString = (analysis_data_json) => {
    return JSON.parse(analysis_data_json);
  };

  // src/dash/MitoDashWrapper.tsx
  var DELAY_BETWEEN_SET_DASH_PROPS = 25;
  var MAX_DELAY = 5 * 6e4;
  var RETRY_DELAY = 25;
  var MAX_RETRIES = MAX_DELAY / RETRY_DELAY;
  var MitoDashWrapper = class extends Component {
    constructor(props) {
      super(props);
      this.processQueue = () => {
        if (this.state.messageQueue.length > 0) {
          const [messageType, message] = this.state.messageQueue[0];
          this.props.setProps({
            [messageType]: message
          });
          this.setState((prevState) => {
            const messageQueue = [...prevState.messageQueue];
            const index = messageQueue.findIndex((m) => m[1] === message);
            messageQueue.splice(index, 1);
            return {
              messageQueue,
              isSendingMessages: messageQueue.length > 0
            };
          });
          this.processMessageQueueTimer = setTimeout(this.processQueue, DELAY_BETWEEN_SET_DASH_PROPS);
        } else {
          this.setState({ isSendingMessages: false });
        }
      };
      this.handleMitoEvent = (propName, message) => {
        if (message.event === "log_event") {
          return;
        }
        this.setState((prevState) => ({
          messageQueue: [...prevState.messageQueue, [propName, message]]
        }));
        let processQueue = false;
        this.setState((prevState) => {
          if (!prevState.isSendingMessages) {
            processQueue = true;
          }
          return { isSendingMessages: true };
        }, () => {
          if (processQueue) {
            this.processQueue();
          }
        });
      };
      this.processResponses = () => {
        const { all_json } = this.props;
        const { responses_json } = JSON.parse(all_json);
        const responses = JSON.parse(responses_json);
        if (responses.length > this.state.responses.length) {
          const newResponses = responses.slice(this.state.responses.length);
          this.setState((prevState) => ({
            responses: [...prevState.responses, ...newResponses]
          }));
        }
        if (responses.length < this.state.responses.length) {
          this.setState({ responses });
        }
      };
      this.render = () => {
        var _a;
        const { all_json } = this.props;
        const { sheet_data_json, analysis_data_json, user_profile_json, key: key2, track_selection } = JSON.parse(all_json);
        const sheetDataArray = getSheetDataArrayFromString(sheet_data_json);
        const analysisData = getAnalysisDataFromString(analysis_data_json);
        const userProfile = getUserProfileFromString(user_profile_json);
        return /* @__PURE__ */ react_default.createElement(
          Mito_default,
          {
            key: key2,
            getSendFunction: () => __async(this, null, function* () {
              return this.send.bind(this);
            }),
            sheetDataArray,
            analysisData,
            userProfile,
            theme: (_a = analysisData.theme) != null ? _a : void 0,
            onSelectionChange: track_selection ? (selectedDataframeIndex, selections) => {
              this.handleMitoEvent("index_and_selections", {
                selectedDataframeIndex,
                selections
              });
            } : void 0
          }
        );
      };
      this.state = { responses: [], analysisName: "", messageQueue: [], isSendingMessages: false, session_key: getRandomId() };
      this.processMessageQueueTimer = null;
      this.props.setProps({
        "session_key": this.state.session_key
      });
    }
    getResponseData(messageID, maxRetries = MAX_RETRIES) {
      return new Promise((resolve) => {
        let tries = 0;
        const interval = setInterval(() => {
          const unconsumedResponses = [...this.state.responses];
          tries++;
          if (tries > maxRetries) {
            console.error(`No response on message: {id: ${messageID}}`);
            clearInterval(interval);
            return resolve({
              error: `No response on message: {id: ${messageID}}`,
              errorShort: `No response received`,
              showErrorModal: false
            });
          }
          const index = unconsumedResponses.findIndex((response) => response["id"] === messageID);
          if (index !== -1) {
            clearInterval(interval);
            const response = unconsumedResponses[index];
            if (response["event"] == "error") {
              return resolve({
                error: response.error,
                errorShort: response.errorShort,
                showErrorModal: response.showErrorModal,
                traceback: response.traceback
              });
            }
            const sharedVariables = response.shared_variables;
            return resolve({
              sheetDataArray: sharedVariables ? getSheetDataArrayFromString(sharedVariables.sheet_data_json) : void 0,
              analysisData: sharedVariables ? getAnalysisDataFromString(sharedVariables.analysis_data_json) : void 0,
              userProfile: sharedVariables ? getUserProfileFromString(sharedVariables.user_profile_json) : void 0,
              result: response["data"]
            });
          }
        }, RETRY_DELAY);
      });
    }
    send(msg) {
      return __async(this, null, function* () {
        this.handleMitoEvent("message", msg);
        const response = yield this.getResponseData(msg["id"]);
        return response;
      });
    }
    componentDidUpdate(prevProps) {
      if (this.props.all_json !== prevProps.all_json) {
        this.processResponses();
      }
    }
  };
  return __toCommonJS(dash_exports);
})();
/**
 * @license React
 * react-dom.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/**
 * @license React
 * scheduler.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/**
 * Checks if an event is supported in the current execution environment.
 *
 * NOTE: This will not work correctly for non-generic events such as `change`,
 * `reset`, `load`, `error`, and `select`.
 *
 * Borrows from Modernizr.
 *
 * @param {string} eventNameSuffix Event name, e.g. "click".
 * @return {boolean} True if the event is supported.
 * @internal
 * @license Modernizr 3.0.0pre (Custom Build) | MIT
 */
