/*! shiny 1.10.0 | (c) 2012-2024 RStudio, PBC. | License: GPL-3 | file LICENSE */
"use strict";
(function() {
  var __create = Object.create;
  var __defProp = Object.defineProperty;
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  var __getOwnPropNames = Object.getOwnPropertyNames;
  var __getProtoOf = Object.getPrototypeOf;
  var __hasOwnProp = Object.prototype.hasOwnProperty;
  var __commonJS = function(cb, mod) {
    return function __require() {
      return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
    };
  };
  var __copyProps = function(to, from2, except, desc) {
    if (from2 && typeof from2 === "object" || typeof from2 === "function")
      for (var keys2 = __getOwnPropNames(from2), i5 = 0, n4 = keys2.length, key; i5 < n4; i5++) {
        key = keys2[i5];
        if (!__hasOwnProp.call(to, key) && key !== except)
          __defProp(to, key, { get: function(k2) {
            return from2[k2];
          }.bind(null, key), enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
      }
    return to;
  };
  var __toESM = function(mod, isNodeMode, target) {
    return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
      isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
      mod
    );
  };

  // node_modules/core-js/internals/global.js
  var require_global = __commonJS({
    "node_modules/core-js/internals/global.js": function(exports, module) {
      var check = function(it) {
        return it && it.Math == Math && it;
      };
      module.exports = check(typeof globalThis == "object" && globalThis) || check(typeof window == "object" && window) || check(typeof self == "object" && self) || check(typeof global == "object" && global) || function() {
        return this;
      }() || Function("return this")();
    }
  });

  // node_modules/core-js/internals/fails.js
  var require_fails = __commonJS({
    "node_modules/core-js/internals/fails.js": function(exports, module) {
      module.exports = function(exec3) {
        try {
          return !!exec3();
        } catch (error) {
          return true;
        }
      };
    }
  });

  // node_modules/core-js/internals/descriptors.js
  var require_descriptors = __commonJS({
    "node_modules/core-js/internals/descriptors.js": function(exports, module) {
      var fails17 = require_fails();
      module.exports = !fails17(function() {
        return Object.defineProperty({}, 1, { get: function() {
          return 7;
        } })[1] != 7;
      });
    }
  });

  // node_modules/core-js/internals/function-bind-native.js
  var require_function_bind_native = __commonJS({
    "node_modules/core-js/internals/function-bind-native.js": function(exports, module) {
      var fails17 = require_fails();
      module.exports = !fails17(function() {
        var test2 = function() {
        }.bind();
        return typeof test2 != "function" || test2.hasOwnProperty("prototype");
      });
    }
  });

  // node_modules/core-js/internals/function-call.js
  var require_function_call = __commonJS({
    "node_modules/core-js/internals/function-call.js": function(exports, module) {
      var NATIVE_BIND = require_function_bind_native();
      var call8 = Function.prototype.call;
      module.exports = NATIVE_BIND ? call8.bind(call8) : function() {
        return call8.apply(call8, arguments);
      };
    }
  });

  // node_modules/core-js/internals/object-property-is-enumerable.js
  var require_object_property_is_enumerable = __commonJS({
    "node_modules/core-js/internals/object-property-is-enumerable.js": function(exports) {
      "use strict";
      var $propertyIsEnumerable = {}.propertyIsEnumerable;
      var getOwnPropertyDescriptor5 = Object.getOwnPropertyDescriptor;
      var NASHORN_BUG = getOwnPropertyDescriptor5 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
      exports.f = NASHORN_BUG ? function propertyIsEnumerable(V2) {
        var descriptor = getOwnPropertyDescriptor5(this, V2);
        return !!descriptor && descriptor.enumerable;
      } : $propertyIsEnumerable;
    }
  });

  // node_modules/core-js/internals/create-property-descriptor.js
  var require_create_property_descriptor = __commonJS({
    "node_modules/core-js/internals/create-property-descriptor.js": function(exports, module) {
      module.exports = function(bitmap, value) {
        return {
          enumerable: !(bitmap & 1),
          configurable: !(bitmap & 2),
          writable: !(bitmap & 4),
          value: value
        };
      };
    }
  });

  // node_modules/core-js/internals/function-uncurry-this.js
  var require_function_uncurry_this = __commonJS({
    "node_modules/core-js/internals/function-uncurry-this.js": function(exports, module) {
      var NATIVE_BIND = require_function_bind_native();
      var FunctionPrototype2 = Function.prototype;
      var call8 = FunctionPrototype2.call;
      var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype2.bind.bind(call8, call8);
      module.exports = NATIVE_BIND ? uncurryThisWithBind : function(fn) {
        return function() {
          return call8.apply(fn, arguments);
        };
      };
    }
  });

  // node_modules/core-js/internals/classof-raw.js
  var require_classof_raw = __commonJS({
    "node_modules/core-js/internals/classof-raw.js": function(exports, module) {
      var uncurryThis15 = require_function_uncurry_this();
      var toString13 = uncurryThis15({}.toString);
      var stringSlice6 = uncurryThis15("".slice);
      module.exports = function(it) {
        return stringSlice6(toString13(it), 8, -1);
      };
    }
  });

  // node_modules/core-js/internals/indexed-object.js
  var require_indexed_object = __commonJS({
    "node_modules/core-js/internals/indexed-object.js": function(exports, module) {
      var uncurryThis15 = require_function_uncurry_this();
      var fails17 = require_fails();
      var classof2 = require_classof_raw();
      var $Object = Object;
      var split = uncurryThis15("".split);
      module.exports = fails17(function() {
        return !$Object("z").propertyIsEnumerable(0);
      }) ? function(it) {
        return classof2(it) == "String" ? split(it, "") : $Object(it);
      } : $Object;
    }
  });

  // node_modules/core-js/internals/is-null-or-undefined.js
  var require_is_null_or_undefined = __commonJS({
    "node_modules/core-js/internals/is-null-or-undefined.js": function(exports, module) {
      module.exports = function(it) {
        return it === null || it === void 0;
      };
    }
  });

  // node_modules/core-js/internals/require-object-coercible.js
  var require_require_object_coercible = __commonJS({
    "node_modules/core-js/internals/require-object-coercible.js": function(exports, module) {
      var isNullOrUndefined5 = require_is_null_or_undefined();
      var $TypeError2 = TypeError;
      module.exports = function(it) {
        if (isNullOrUndefined5(it))
          throw $TypeError2("Can't call method on " + it);
        return it;
      };
    }
  });

  // node_modules/core-js/internals/to-indexed-object.js
  var require_to_indexed_object = __commonJS({
    "node_modules/core-js/internals/to-indexed-object.js": function(exports, module) {
      var IndexedObject2 = require_indexed_object();
      var requireObjectCoercible8 = require_require_object_coercible();
      module.exports = function(it) {
        return IndexedObject2(requireObjectCoercible8(it));
      };
    }
  });

  // node_modules/core-js/internals/document-all.js
  var require_document_all = __commonJS({
    "node_modules/core-js/internals/document-all.js": function(exports, module) {
      var documentAll = typeof document == "object" && document.all;
      var IS_HTMLDDA = typeof documentAll == "undefined" && documentAll !== void 0;
      module.exports = {
        all: documentAll,
        IS_HTMLDDA: IS_HTMLDDA
      };
    }
  });

  // node_modules/core-js/internals/is-callable.js
  var require_is_callable = __commonJS({
    "node_modules/core-js/internals/is-callable.js": function(exports, module) {
      var $documentAll = require_document_all();
      var documentAll = $documentAll.all;
      module.exports = $documentAll.IS_HTMLDDA ? function(argument) {
        return typeof argument == "function" || argument === documentAll;
      } : function(argument) {
        return typeof argument == "function";
      };
    }
  });

  // node_modules/core-js/internals/is-object.js
  var require_is_object = __commonJS({
    "node_modules/core-js/internals/is-object.js": function(exports, module) {
      var isCallable5 = require_is_callable();
      var $documentAll = require_document_all();
      var documentAll = $documentAll.all;
      module.exports = $documentAll.IS_HTMLDDA ? function(it) {
        return typeof it == "object" ? it !== null : isCallable5(it) || it === documentAll;
      } : function(it) {
        return typeof it == "object" ? it !== null : isCallable5(it);
      };
    }
  });

  // node_modules/core-js/internals/get-built-in.js
  var require_get_built_in = __commonJS({
    "node_modules/core-js/internals/get-built-in.js": function(exports, module) {
      var global11 = require_global();
      var isCallable5 = require_is_callable();
      var aFunction = function(argument) {
        return isCallable5(argument) ? argument : void 0;
      };
      module.exports = function(namespace, method) {
        return arguments.length < 2 ? aFunction(global11[namespace]) : global11[namespace] && global11[namespace][method];
      };
    }
  });

  // node_modules/core-js/internals/object-is-prototype-of.js
  var require_object_is_prototype_of = __commonJS({
    "node_modules/core-js/internals/object-is-prototype-of.js": function(exports, module) {
      var uncurryThis15 = require_function_uncurry_this();
      module.exports = uncurryThis15({}.isPrototypeOf);
    }
  });

  // node_modules/core-js/internals/engine-user-agent.js
  var require_engine_user_agent = __commonJS({
    "node_modules/core-js/internals/engine-user-agent.js": function(exports, module) {
      module.exports = typeof navigator != "undefined" && String(navigator.userAgent) || "";
    }
  });

  // node_modules/core-js/internals/engine-v8-version.js
  var require_engine_v8_version = __commonJS({
    "node_modules/core-js/internals/engine-v8-version.js": function(exports, module) {
      var global11 = require_global();
      var userAgent2 = require_engine_user_agent();
      var process2 = global11.process;
      var Deno2 = global11.Deno;
      var versions = process2 && process2.versions || Deno2 && Deno2.version;
      var v8 = versions && versions.v8;
      var match;
      var version;
      if (v8) {
        match = v8.split(".");
        version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
      }
      if (!version && userAgent2) {
        match = userAgent2.match(/Edge\/(\d+)/);
        if (!match || match[1] >= 74) {
          match = userAgent2.match(/Chrome\/(\d+)/);
          if (match)
            version = +match[1];
        }
      }
      module.exports = version;
    }
  });

  // node_modules/core-js/internals/symbol-constructor-detection.js
  var require_symbol_constructor_detection = __commonJS({
    "node_modules/core-js/internals/symbol-constructor-detection.js": function(exports, module) {
      var V8_VERSION2 = require_engine_v8_version();
      var fails17 = require_fails();
      module.exports = !!Object.getOwnPropertySymbols && !fails17(function() {
        var symbol = Symbol();
        return !String(symbol) || !(Object(symbol) instanceof Symbol) || !Symbol.sham && V8_VERSION2 && V8_VERSION2 < 41;
      });
    }
  });

  // node_modules/core-js/internals/use-symbol-as-uid.js
  var require_use_symbol_as_uid = __commonJS({
    "node_modules/core-js/internals/use-symbol-as-uid.js": function(exports, module) {
      var NATIVE_SYMBOL = require_symbol_constructor_detection();
      module.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == "symbol";
    }
  });

  // node_modules/core-js/internals/is-symbol.js
  var require_is_symbol = __commonJS({
    "node_modules/core-js/internals/is-symbol.js": function(exports, module) {
      var getBuiltIn4 = require_get_built_in();
      var isCallable5 = require_is_callable();
      var isPrototypeOf4 = require_object_is_prototype_of();
      var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
      var $Object = Object;
      module.exports = USE_SYMBOL_AS_UID ? function(it) {
        return typeof it == "symbol";
      } : function(it) {
        var $Symbol = getBuiltIn4("Symbol");
        return isCallable5($Symbol) && isPrototypeOf4($Symbol.prototype, $Object(it));
      };
    }
  });

  // node_modules/core-js/internals/try-to-string.js
  var require_try_to_string = __commonJS({
    "node_modules/core-js/internals/try-to-string.js": function(exports, module) {
      var $String = String;
      module.exports = function(argument) {
        try {
          return $String(argument);
        } catch (error) {
          return "Object";
        }
      };
    }
  });

  // node_modules/core-js/internals/a-callable.js
  var require_a_callable = __commonJS({
    "node_modules/core-js/internals/a-callable.js": function(exports, module) {
      var isCallable5 = require_is_callable();
      var tryToString = require_try_to_string();
      var $TypeError2 = TypeError;
      module.exports = function(argument) {
        if (isCallable5(argument))
          return argument;
        throw $TypeError2(tryToString(argument) + " is not a function");
      };
    }
  });

  // node_modules/core-js/internals/get-method.js
  var require_get_method = __commonJS({
    "node_modules/core-js/internals/get-method.js": function(exports, module) {
      var aCallable2 = require_a_callable();
      var isNullOrUndefined5 = require_is_null_or_undefined();
      module.exports = function(V2, P3) {
        var func = V2[P3];
        return isNullOrUndefined5(func) ? void 0 : aCallable2(func);
      };
    }
  });

  // node_modules/core-js/internals/ordinary-to-primitive.js
  var require_ordinary_to_primitive = __commonJS({
    "node_modules/core-js/internals/ordinary-to-primitive.js": function(exports, module) {
      var call8 = require_function_call();
      var isCallable5 = require_is_callable();
      var isObject6 = require_is_object();
      var $TypeError2 = TypeError;
      module.exports = function(input, pref) {
        var fn, val;
        if (pref === "string" && isCallable5(fn = input.toString) && !isObject6(val = call8(fn, input)))
          return val;
        if (isCallable5(fn = input.valueOf) && !isObject6(val = call8(fn, input)))
          return val;
        if (pref !== "string" && isCallable5(fn = input.toString) && !isObject6(val = call8(fn, input)))
          return val;
        throw $TypeError2("Can't convert object to primitive value");
      };
    }
  });

  // node_modules/core-js/internals/is-pure.js
  var require_is_pure = __commonJS({
    "node_modules/core-js/internals/is-pure.js": function(exports, module) {
      module.exports = false;
    }
  });

  // node_modules/core-js/internals/define-global-property.js
  var require_define_global_property = __commonJS({
    "node_modules/core-js/internals/define-global-property.js": function(exports, module) {
      var global11 = require_global();
      var defineProperty3 = Object.defineProperty;
      module.exports = function(key, value) {
        try {
          defineProperty3(global11, key, { value: value, configurable: true, writable: true });
        } catch (error) {
          global11[key] = value;
        }
        return value;
      };
    }
  });

  // node_modules/core-js/internals/shared-store.js
  var require_shared_store = __commonJS({
    "node_modules/core-js/internals/shared-store.js": function(exports, module) {
      var global11 = require_global();
      var defineGlobalProperty = require_define_global_property();
      var SHARED = "__core-js_shared__";
      var store = global11[SHARED] || defineGlobalProperty(SHARED, {});
      module.exports = store;
    }
  });

  // node_modules/core-js/internals/shared.js
  var require_shared = __commonJS({
    "node_modules/core-js/internals/shared.js": function(exports, module) {
      var IS_PURE5 = require_is_pure();
      var store = require_shared_store();
      (module.exports = function(key, value) {
        return store[key] || (store[key] = value !== void 0 ? value : {});
      })("versions", []).push({
        version: "3.29.0",
        mode: IS_PURE5 ? "pure" : "global",
        copyright: "\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",
        license: "https://github.com/zloirock/core-js/blob/v3.29.0/LICENSE",
        source: "https://github.com/zloirock/core-js"
      });
    }
  });

  // node_modules/core-js/internals/to-object.js
  var require_to_object = __commonJS({
    "node_modules/core-js/internals/to-object.js": function(exports, module) {
      var requireObjectCoercible8 = require_require_object_coercible();
      var $Object = Object;
      module.exports = function(argument) {
        return $Object(requireObjectCoercible8(argument));
      };
    }
  });

  // node_modules/core-js/internals/has-own-property.js
  var require_has_own_property = __commonJS({
    "node_modules/core-js/internals/has-own-property.js": function(exports, module) {
      var uncurryThis15 = require_function_uncurry_this();
      var toObject6 = require_to_object();
      var hasOwnProperty2 = uncurryThis15({}.hasOwnProperty);
      module.exports = Object.hasOwn || function hasOwn5(it, key) {
        return hasOwnProperty2(toObject6(it), key);
      };
    }
  });

  // node_modules/core-js/internals/uid.js
  var require_uid = __commonJS({
    "node_modules/core-js/internals/uid.js": function(exports, module) {
      var uncurryThis15 = require_function_uncurry_this();
      var id = 0;
      var postfix = Math.random();
      var toString13 = uncurryThis15(1 .toString);
      module.exports = function(key) {
        return "Symbol(" + (key === void 0 ? "" : key) + ")_" + toString13(++id + postfix, 36);
      };
    }
  });

  // node_modules/core-js/internals/well-known-symbol.js
  var require_well_known_symbol = __commonJS({
    "node_modules/core-js/internals/well-known-symbol.js": function(exports, module) {
      var global11 = require_global();
      var shared = require_shared();
      var hasOwn5 = require_has_own_property();
      var uid = require_uid();
      var NATIVE_SYMBOL = require_symbol_constructor_detection();
      var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
      var Symbol2 = global11.Symbol;
      var WellKnownSymbolsStore = shared("wks");
      var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol2["for"] || Symbol2 : Symbol2 && Symbol2.withoutSetter || uid;
      module.exports = function(name) {
        if (!hasOwn5(WellKnownSymbolsStore, name)) {
          WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn5(Symbol2, name) ? Symbol2[name] : createWellKnownSymbol("Symbol." + name);
        }
        return WellKnownSymbolsStore[name];
      };
    }
  });

  // node_modules/core-js/internals/to-primitive.js
  var require_to_primitive = __commonJS({
    "node_modules/core-js/internals/to-primitive.js": function(exports, module) {
      var call8 = require_function_call();
      var isObject6 = require_is_object();
      var isSymbol2 = require_is_symbol();
      var getMethod5 = require_get_method();
      var ordinaryToPrimitive = require_ordinary_to_primitive();
      var wellKnownSymbol7 = require_well_known_symbol();
      var $TypeError2 = TypeError;
      var TO_PRIMITIVE2 = wellKnownSymbol7("toPrimitive");
      module.exports = function(input, pref) {
        if (!isObject6(input) || isSymbol2(input))
          return input;
        var exoticToPrim = getMethod5(input, TO_PRIMITIVE2);
        var result;
        if (exoticToPrim) {
          if (pref === void 0)
            pref = "default";
          result = call8(exoticToPrim, input, pref);
          if (!isObject6(result) || isSymbol2(result))
            return result;
          throw $TypeError2("Can't convert object to primitive value");
        }
        if (pref === void 0)
          pref = "number";
        return ordinaryToPrimitive(input, pref);
      };
    }
  });

  // node_modules/core-js/internals/to-property-key.js
  var require_to_property_key = __commonJS({
    "node_modules/core-js/internals/to-property-key.js": function(exports, module) {
      var toPrimitive2 = require_to_primitive();
      var isSymbol2 = require_is_symbol();
      module.exports = function(argument) {
        var key = toPrimitive2(argument, "string");
        return isSymbol2(key) ? key : key + "";
      };
    }
  });

  // node_modules/core-js/internals/document-create-element.js
  var require_document_create_element = __commonJS({
    "node_modules/core-js/internals/document-create-element.js": function(exports, module) {
      var global11 = require_global();
      var isObject6 = require_is_object();
      var document2 = global11.document;
      var EXISTS = isObject6(document2) && isObject6(document2.createElement);
      module.exports = function(it) {
        return EXISTS ? document2.createElement(it) : {};
      };
    }
  });

  // node_modules/core-js/internals/ie8-dom-define.js
  var require_ie8_dom_define = __commonJS({
    "node_modules/core-js/internals/ie8-dom-define.js": function(exports, module) {
      var DESCRIPTORS10 = require_descriptors();
      var fails17 = require_fails();
      var createElement = require_document_create_element();
      module.exports = !DESCRIPTORS10 && !fails17(function() {
        return Object.defineProperty(createElement("div"), "a", {
          get: function() {
            return 7;
          }
        }).a != 7;
      });
    }
  });

  // node_modules/core-js/internals/object-get-own-property-descriptor.js
  var require_object_get_own_property_descriptor = __commonJS({
    "node_modules/core-js/internals/object-get-own-property-descriptor.js": function(exports) {
      var DESCRIPTORS10 = require_descriptors();
      var call8 = require_function_call();
      var propertyIsEnumerableModule = require_object_property_is_enumerable();
      var createPropertyDescriptor = require_create_property_descriptor();
      var toIndexedObject5 = require_to_indexed_object();
      var toPropertyKey = require_to_property_key();
      var hasOwn5 = require_has_own_property();
      var IE8_DOM_DEFINE = require_ie8_dom_define();
      var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
      exports.f = DESCRIPTORS10 ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor5(O, P3) {
        O = toIndexedObject5(O);
        P3 = toPropertyKey(P3);
        if (IE8_DOM_DEFINE)
          try {
            return $getOwnPropertyDescriptor(O, P3);
          } catch (error) {
          }
        if (hasOwn5(O, P3))
          return createPropertyDescriptor(!call8(propertyIsEnumerableModule.f, O, P3), O[P3]);
      };
    }
  });

  // node_modules/core-js/internals/v8-prototype-define-bug.js
  var require_v8_prototype_define_bug = __commonJS({
    "node_modules/core-js/internals/v8-prototype-define-bug.js": function(exports, module) {
      var DESCRIPTORS10 = require_descriptors();
      var fails17 = require_fails();
      module.exports = DESCRIPTORS10 && fails17(function() {
        return Object.defineProperty(function() {
        }, "prototype", {
          value: 42,
          writable: false
        }).prototype != 42;
      });
    }
  });

  // node_modules/core-js/internals/an-object.js
  var require_an_object = __commonJS({
    "node_modules/core-js/internals/an-object.js": function(exports, module) {
      var isObject6 = require_is_object();
      var $String = String;
      var $TypeError2 = TypeError;
      module.exports = function(argument) {
        if (isObject6(argument))
          return argument;
        throw $TypeError2($String(argument) + " is not an object");
      };
    }
  });

  // node_modules/core-js/internals/object-define-property.js
  var require_object_define_property = __commonJS({
    "node_modules/core-js/internals/object-define-property.js": function(exports) {
      var DESCRIPTORS10 = require_descriptors();
      var IE8_DOM_DEFINE = require_ie8_dom_define();
      var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug();
      var anObject10 = require_an_object();
      var toPropertyKey = require_to_property_key();
      var $TypeError2 = TypeError;
      var $defineProperty = Object.defineProperty;
      var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
      var ENUMERABLE = "enumerable";
      var CONFIGURABLE = "configurable";
      var WRITABLE = "writable";
      exports.f = DESCRIPTORS10 ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty3(O, P3, Attributes) {
        anObject10(O);
        P3 = toPropertyKey(P3);
        anObject10(Attributes);
        if (typeof O === "function" && P3 === "prototype" && "value" in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
          var current = $getOwnPropertyDescriptor(O, P3);
          if (current && current[WRITABLE]) {
            O[P3] = Attributes.value;
            Attributes = {
              configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
              enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
              writable: false
            };
          }
        }
        return $defineProperty(O, P3, Attributes);
      } : $defineProperty : function defineProperty3(O, P3, Attributes) {
        anObject10(O);
        P3 = toPropertyKey(P3);
        anObject10(Attributes);
        if (IE8_DOM_DEFINE)
          try {
            return $defineProperty(O, P3, Attributes);
          } catch (error) {
          }
        if ("get" in Attributes || "set" in Attributes)
          throw $TypeError2("Accessors not supported");
        if ("value" in Attributes)
          O[P3] = Attributes.value;
        return O;
      };
    }
  });

  // node_modules/core-js/internals/create-non-enumerable-property.js
  var require_create_non_enumerable_property = __commonJS({
    "node_modules/core-js/internals/create-non-enumerable-property.js": function(exports, module) {
      var DESCRIPTORS10 = require_descriptors();
      var definePropertyModule = require_object_define_property();
      var createPropertyDescriptor = require_create_property_descriptor();
      module.exports = DESCRIPTORS10 ? function(object, key, value) {
        return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
      } : function(object, key, value) {
        object[key] = value;
        return object;
      };
    }
  });

  // node_modules/core-js/internals/function-name.js
  var require_function_name = __commonJS({
    "node_modules/core-js/internals/function-name.js": function(exports, module) {
      var DESCRIPTORS10 = require_descriptors();
      var hasOwn5 = require_has_own_property();
      var FunctionPrototype2 = Function.prototype;
      var getDescriptor = DESCRIPTORS10 && Object.getOwnPropertyDescriptor;
      var EXISTS = hasOwn5(FunctionPrototype2, "name");
      var PROPER = EXISTS && function something() {
      }.name === "something";
      var CONFIGURABLE = EXISTS && (!DESCRIPTORS10 || DESCRIPTORS10 && getDescriptor(FunctionPrototype2, "name").configurable);
      module.exports = {
        EXISTS: EXISTS,
        PROPER: PROPER,
        CONFIGURABLE: CONFIGURABLE
      };
    }
  });

  // node_modules/core-js/internals/inspect-source.js
  var require_inspect_source = __commonJS({
    "node_modules/core-js/internals/inspect-source.js": function(exports, module) {
      var uncurryThis15 = require_function_uncurry_this();
      var isCallable5 = require_is_callable();
      var store = require_shared_store();
      var functionToString2 = uncurryThis15(Function.toString);
      if (!isCallable5(store.inspectSource)) {
        store.inspectSource = function(it) {
          return functionToString2(it);
        };
      }
      module.exports = store.inspectSource;
    }
  });

  // node_modules/core-js/internals/weak-map-basic-detection.js
  var require_weak_map_basic_detection = __commonJS({
    "node_modules/core-js/internals/weak-map-basic-detection.js": function(exports, module) {
      var global11 = require_global();
      var isCallable5 = require_is_callable();
      var WeakMap2 = global11.WeakMap;
      module.exports = isCallable5(WeakMap2) && /native code/.test(String(WeakMap2));
    }
  });

  // node_modules/core-js/internals/shared-key.js
  var require_shared_key = __commonJS({
    "node_modules/core-js/internals/shared-key.js": function(exports, module) {
      var shared = require_shared();
      var uid = require_uid();
      var keys2 = shared("keys");
      module.exports = function(key) {
        return keys2[key] || (keys2[key] = uid(key));
      };
    }
  });

  // node_modules/core-js/internals/hidden-keys.js
  var require_hidden_keys = __commonJS({
    "node_modules/core-js/internals/hidden-keys.js": function(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/core-js/internals/internal-state.js
  var require_internal_state = __commonJS({
    "node_modules/core-js/internals/internal-state.js": function(exports, module) {
      var NATIVE_WEAK_MAP = require_weak_map_basic_detection();
      var global11 = require_global();
      var isObject6 = require_is_object();
      var createNonEnumerableProperty4 = require_create_non_enumerable_property();
      var hasOwn5 = require_has_own_property();
      var shared = require_shared_store();
      var sharedKey = require_shared_key();
      var hiddenKeys = require_hidden_keys();
      var OBJECT_ALREADY_INITIALIZED = "Object already initialized";
      var TypeError3 = global11.TypeError;
      var WeakMap2 = global11.WeakMap;
      var set;
      var get3;
      var has;
      var enforce = function(it) {
        return has(it) ? get3(it) : set(it, {});
      };
      var getterFor = function(TYPE) {
        return function(it) {
          var state;
          if (!isObject6(it) || (state = get3(it)).type !== TYPE) {
            throw TypeError3("Incompatible receiver, " + TYPE + " required");
          }
          return state;
        };
      };
      if (NATIVE_WEAK_MAP || shared.state) {
        store = shared.state || (shared.state = new WeakMap2());
        store.get = store.get;
        store.has = store.has;
        store.set = store.set;
        set = function(it, metadata) {
          if (store.has(it))
            throw TypeError3(OBJECT_ALREADY_INITIALIZED);
          metadata.facade = it;
          store.set(it, metadata);
          return metadata;
        };
        get3 = function(it) {
          return store.get(it) || {};
        };
        has = function(it) {
          return store.has(it);
        };
      } else {
        STATE = sharedKey("state");
        hiddenKeys[STATE] = true;
        set = function(it, metadata) {
          if (hasOwn5(it, STATE))
            throw TypeError3(OBJECT_ALREADY_INITIALIZED);
          metadata.facade = it;
          createNonEnumerableProperty4(it, STATE, metadata);
          return metadata;
        };
        get3 = function(it) {
          return hasOwn5(it, STATE) ? it[STATE] : {};
        };
        has = function(it) {
          return hasOwn5(it, STATE);
        };
      }
      var store;
      var STATE;
      module.exports = {
        set: set,
        get: get3,
        has: has,
        enforce: enforce,
        getterFor: getterFor
      };
    }
  });

  // node_modules/core-js/internals/make-built-in.js
  var require_make_built_in = __commonJS({
    "node_modules/core-js/internals/make-built-in.js": function(exports, module) {
      var uncurryThis15 = require_function_uncurry_this();
      var fails17 = require_fails();
      var isCallable5 = require_is_callable();
      var hasOwn5 = require_has_own_property();
      var DESCRIPTORS10 = require_descriptors();
      var CONFIGURABLE_FUNCTION_NAME = require_function_name().CONFIGURABLE;
      var inspectSource = require_inspect_source();
      var InternalStateModule2 = require_internal_state();
      var enforceInternalState2 = InternalStateModule2.enforce;
      var getInternalState3 = InternalStateModule2.get;
      var $String = String;
      var defineProperty3 = Object.defineProperty;
      var stringSlice6 = uncurryThis15("".slice);
      var replace2 = uncurryThis15("".replace);
      var join2 = uncurryThis15([].join);
      var CONFIGURABLE_LENGTH = DESCRIPTORS10 && !fails17(function() {
        return defineProperty3(function() {
        }, "length", { value: 8 }).length !== 8;
      });
      var TEMPLATE = String(String).split("String");
      var makeBuiltIn = module.exports = function(value, name, options) {
        if (stringSlice6($String(name), 0, 7) === "Symbol(") {
          name = "[" + replace2($String(name), /^Symbol\(([^)]*)\)/, "$1") + "]";
        }
        if (options && options.getter)
          name = "get " + name;
        if (options && options.setter)
          name = "set " + name;
        if (!hasOwn5(value, "name") || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
          if (DESCRIPTORS10)
            defineProperty3(value, "name", { value: name, configurable: true });
          else
            value.name = name;
        }
        if (CONFIGURABLE_LENGTH && options && hasOwn5(options, "arity") && value.length !== options.arity) {
          defineProperty3(value, "length", { value: options.arity });
        }
        try {
          if (options && hasOwn5(options, "constructor") && options.constructor) {
            if (DESCRIPTORS10)
              defineProperty3(value, "prototype", { writable: false });
          } else if (value.prototype)
            value.prototype = void 0;
        } catch (error) {
        }
        var state = enforceInternalState2(value);
        if (!hasOwn5(state, "source")) {
          state.source = join2(TEMPLATE, typeof name == "string" ? name : "");
        }
        return value;
      };
      Function.prototype.toString = makeBuiltIn(function toString13() {
        return isCallable5(this) && getInternalState3(this).source || inspectSource(this);
      }, "toString");
    }
  });

  // node_modules/core-js/internals/define-built-in.js
  var require_define_built_in = __commonJS({
    "node_modules/core-js/internals/define-built-in.js": function(exports, module) {
      var isCallable5 = require_is_callable();
      var definePropertyModule = require_object_define_property();
      var makeBuiltIn = require_make_built_in();
      var defineGlobalProperty = require_define_global_property();
      module.exports = function(O, key, value, options) {
        if (!options)
          options = {};
        var simple = options.enumerable;
        var name = options.name !== void 0 ? options.name : key;
        if (isCallable5(value))
          makeBuiltIn(value, name, options);
        if (options.global) {
          if (simple)
            O[key] = value;
          else
            defineGlobalProperty(key, value);
        } else {
          try {
            if (!options.unsafe)
              delete O[key];
            else if (O[key])
              simple = true;
          } catch (error) {
          }
          if (simple)
            O[key] = value;
          else
            definePropertyModule.f(O, key, {
              value: value,
              enumerable: false,
              configurable: !options.nonConfigurable,
              writable: !options.nonWritable
            });
        }
        return O;
      };
    }
  });

  // node_modules/core-js/internals/math-trunc.js
  var require_math_trunc = __commonJS({
    "node_modules/core-js/internals/math-trunc.js": function(exports, module) {
      var ceil = Math.ceil;
      var floor = Math.floor;
      module.exports = Math.trunc || function trunc(x2) {
        var n4 = +x2;
        return (n4 > 0 ? floor : ceil)(n4);
      };
    }
  });

  // node_modules/core-js/internals/to-integer-or-infinity.js
  var require_to_integer_or_infinity = __commonJS({
    "node_modules/core-js/internals/to-integer-or-infinity.js": function(exports, module) {
      var trunc = require_math_trunc();
      module.exports = function(argument) {
        var number = +argument;
        return number !== number || number === 0 ? 0 : trunc(number);
      };
    }
  });

  // node_modules/core-js/internals/to-absolute-index.js
  var require_to_absolute_index = __commonJS({
    "node_modules/core-js/internals/to-absolute-index.js": function(exports, module) {
      var toIntegerOrInfinity4 = require_to_integer_or_infinity();
      var max4 = Math.max;
      var min6 = Math.min;
      module.exports = function(index, length) {
        var integer = toIntegerOrInfinity4(index);
        return integer < 0 ? max4(integer + length, 0) : min6(integer, length);
      };
    }
  });

  // node_modules/core-js/internals/to-length.js
  var require_to_length = __commonJS({
    "node_modules/core-js/internals/to-length.js": function(exports, module) {
      var toIntegerOrInfinity4 = require_to_integer_or_infinity();
      var min6 = Math.min;
      module.exports = function(argument) {
        return argument > 0 ? min6(toIntegerOrInfinity4(argument), 9007199254740991) : 0;
      };
    }
  });

  // node_modules/core-js/internals/length-of-array-like.js
  var require_length_of_array_like = __commonJS({
    "node_modules/core-js/internals/length-of-array-like.js": function(exports, module) {
      var toLength7 = require_to_length();
      module.exports = function(obj) {
        return toLength7(obj.length);
      };
    }
  });

  // node_modules/core-js/internals/array-includes.js
  var require_array_includes = __commonJS({
    "node_modules/core-js/internals/array-includes.js": function(exports, module) {
      var toIndexedObject5 = require_to_indexed_object();
      var toAbsoluteIndex4 = require_to_absolute_index();
      var lengthOfArrayLike5 = require_length_of_array_like();
      var createMethod = function(IS_INCLUDES) {
        return function($this, el, fromIndex) {
          var O = toIndexedObject5($this);
          var length = lengthOfArrayLike5(O);
          var index = toAbsoluteIndex4(fromIndex, length);
          var value;
          if (IS_INCLUDES && el != el)
            while (length > index) {
              value = O[index++];
              if (value != value)
                return true;
            }
          else
            for (; length > index; index++) {
              if ((IS_INCLUDES || index in O) && O[index] === el)
                return IS_INCLUDES || index || 0;
            }
          return !IS_INCLUDES && -1;
        };
      };
      module.exports = {
        includes: createMethod(true),
        indexOf: createMethod(false)
      };
    }
  });

  // node_modules/core-js/internals/object-keys-internal.js
  var require_object_keys_internal = __commonJS({
    "node_modules/core-js/internals/object-keys-internal.js": function(exports, module) {
      var uncurryThis15 = require_function_uncurry_this();
      var hasOwn5 = require_has_own_property();
      var toIndexedObject5 = require_to_indexed_object();
      var indexOf2 = require_array_includes().indexOf;
      var hiddenKeys = require_hidden_keys();
      var push4 = uncurryThis15([].push);
      module.exports = function(object, names) {
        var O = toIndexedObject5(object);
        var i5 = 0;
        var result = [];
        var key;
        for (key in O)
          !hasOwn5(hiddenKeys, key) && hasOwn5(O, key) && push4(result, key);
        while (names.length > i5)
          if (hasOwn5(O, key = names[i5++])) {
            ~indexOf2(result, key) || push4(result, key);
          }
        return result;
      };
    }
  });

  // node_modules/core-js/internals/enum-bug-keys.js
  var require_enum_bug_keys = __commonJS({
    "node_modules/core-js/internals/enum-bug-keys.js": function(exports, module) {
      module.exports = [
        "constructor",
        "hasOwnProperty",
        "isPrototypeOf",
        "propertyIsEnumerable",
        "toLocaleString",
        "toString",
        "valueOf"
      ];
    }
  });

  // node_modules/core-js/internals/object-get-own-property-names.js
  var require_object_get_own_property_names = __commonJS({
    "node_modules/core-js/internals/object-get-own-property-names.js": function(exports) {
      var internalObjectKeys = require_object_keys_internal();
      var enumBugKeys = require_enum_bug_keys();
      var hiddenKeys = enumBugKeys.concat("length", "prototype");
      exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames4(O) {
        return internalObjectKeys(O, hiddenKeys);
      };
    }
  });

  // node_modules/core-js/internals/object-get-own-property-symbols.js
  var require_object_get_own_property_symbols = __commonJS({
    "node_modules/core-js/internals/object-get-own-property-symbols.js": function(exports) {
      exports.f = Object.getOwnPropertySymbols;
    }
  });

  // node_modules/core-js/internals/own-keys.js
  var require_own_keys = __commonJS({
    "node_modules/core-js/internals/own-keys.js": function(exports, module) {
      var getBuiltIn4 = require_get_built_in();
      var uncurryThis15 = require_function_uncurry_this();
      var getOwnPropertyNamesModule = require_object_get_own_property_names();
      var getOwnPropertySymbolsModule = require_object_get_own_property_symbols();
      var anObject10 = require_an_object();
      var concat3 = uncurryThis15([].concat);
      module.exports = getBuiltIn4("Reflect", "ownKeys") || function ownKeys4(it) {
        var keys2 = getOwnPropertyNamesModule.f(anObject10(it));
        var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
        return getOwnPropertySymbols ? concat3(keys2, getOwnPropertySymbols(it)) : keys2;
      };
    }
  });

  // node_modules/core-js/internals/copy-constructor-properties.js
  var require_copy_constructor_properties = __commonJS({
    "node_modules/core-js/internals/copy-constructor-properties.js": function(exports, module) {
      var hasOwn5 = require_has_own_property();
      var ownKeys4 = require_own_keys();
      var getOwnPropertyDescriptorModule3 = require_object_get_own_property_descriptor();
      var definePropertyModule = require_object_define_property();
      module.exports = function(target, source, exceptions) {
        var keys2 = ownKeys4(source);
        var defineProperty3 = definePropertyModule.f;
        var getOwnPropertyDescriptor5 = getOwnPropertyDescriptorModule3.f;
        for (var i5 = 0; i5 < keys2.length; i5++) {
          var key = keys2[i5];
          if (!hasOwn5(target, key) && !(exceptions && hasOwn5(exceptions, key))) {
            defineProperty3(target, key, getOwnPropertyDescriptor5(source, key));
          }
        }
      };
    }
  });

  // node_modules/core-js/internals/is-forced.js
  var require_is_forced = __commonJS({
    "node_modules/core-js/internals/is-forced.js": function(exports, module) {
      var fails17 = require_fails();
      var isCallable5 = require_is_callable();
      var replacement = /#|\.prototype\./;
      var isForced3 = function(feature, detection) {
        var value = data[normalize(feature)];
        return value == POLYFILL ? true : value == NATIVE ? false : isCallable5(detection) ? fails17(detection) : !!detection;
      };
      var normalize = isForced3.normalize = function(string) {
        return String(string).replace(replacement, ".").toLowerCase();
      };
      var data = isForced3.data = {};
      var NATIVE = isForced3.NATIVE = "N";
      var POLYFILL = isForced3.POLYFILL = "P";
      module.exports = isForced3;
    }
  });

  // node_modules/core-js/internals/export.js
  var require_export = __commonJS({
    "node_modules/core-js/internals/export.js": function(exports, module) {
      var global11 = require_global();
      var getOwnPropertyDescriptor5 = require_object_get_own_property_descriptor().f;
      var createNonEnumerableProperty4 = require_create_non_enumerable_property();
      var defineBuiltIn6 = require_define_built_in();
      var defineGlobalProperty = require_define_global_property();
      var copyConstructorProperties3 = require_copy_constructor_properties();
      var isForced3 = require_is_forced();
      module.exports = function(options, source) {
        var TARGET = options.target;
        var GLOBAL = options.global;
        var STATIC = options.stat;
        var FORCED9, target, key, targetProperty, sourceProperty, descriptor;
        if (GLOBAL) {
          target = global11;
        } else if (STATIC) {
          target = global11[TARGET] || defineGlobalProperty(TARGET, {});
        } else {
          target = (global11[TARGET] || {}).prototype;
        }
        if (target)
          for (key in source) {
            sourceProperty = source[key];
            if (options.dontCallGetSet) {
              descriptor = getOwnPropertyDescriptor5(target, key);
              targetProperty = descriptor && descriptor.value;
            } else
              targetProperty = target[key];
            FORCED9 = isForced3(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced);
            if (!FORCED9 && targetProperty !== void 0) {
              if (typeof sourceProperty == typeof targetProperty)
                continue;
              copyConstructorProperties3(sourceProperty, targetProperty);
            }
            if (options.sham || targetProperty && targetProperty.sham) {
              createNonEnumerableProperty4(sourceProperty, "sham", true);
            }
            defineBuiltIn6(target, key, sourceProperty, options);
          }
      };
    }
  });

  // node_modules/core-js/internals/function-uncurry-this-clause.js
  var require_function_uncurry_this_clause = __commonJS({
    "node_modules/core-js/internals/function-uncurry-this-clause.js": function(exports, module) {
      var classofRaw = require_classof_raw();
      var uncurryThis15 = require_function_uncurry_this();
      module.exports = function(fn) {
        if (classofRaw(fn) === "Function")
          return uncurryThis15(fn);
      };
    }
  });

  // node_modules/core-js/internals/array-method-is-strict.js
  var require_array_method_is_strict = __commonJS({
    "node_modules/core-js/internals/array-method-is-strict.js": function(exports, module) {
      "use strict";
      var fails17 = require_fails();
      module.exports = function(METHOD_NAME, argument) {
        var method = [][METHOD_NAME];
        return !!method && fails17(function() {
          method.call(null, argument || function() {
            return 1;
          }, 1);
        });
      };
    }
  });

  // node_modules/core-js/internals/to-string-tag-support.js
  var require_to_string_tag_support = __commonJS({
    "node_modules/core-js/internals/to-string-tag-support.js": function(exports, module) {
      var wellKnownSymbol7 = require_well_known_symbol();
      var TO_STRING_TAG2 = wellKnownSymbol7("toStringTag");
      var test2 = {};
      test2[TO_STRING_TAG2] = "z";
      module.exports = String(test2) === "[object z]";
    }
  });

  // node_modules/core-js/internals/classof.js
  var require_classof = __commonJS({
    "node_modules/core-js/internals/classof.js": function(exports, module) {
      var TO_STRING_TAG_SUPPORT2 = require_to_string_tag_support();
      var isCallable5 = require_is_callable();
      var classofRaw = require_classof_raw();
      var wellKnownSymbol7 = require_well_known_symbol();
      var TO_STRING_TAG2 = wellKnownSymbol7("toStringTag");
      var $Object = Object;
      var CORRECT_ARGUMENTS = classofRaw(function() {
        return arguments;
      }()) == "Arguments";
      var tryGet = function(it, key) {
        try {
          return it[key];
        } catch (error) {
        }
      };
      module.exports = TO_STRING_TAG_SUPPORT2 ? classofRaw : function(it) {
        var O, tag, result;
        return it === void 0 ? "Undefined" : it === null ? "Null" : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG2)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) == "Object" && isCallable5(O.callee) ? "Arguments" : result;
      };
    }
  });

  // node_modules/core-js/internals/to-string.js
  var require_to_string = __commonJS({
    "node_modules/core-js/internals/to-string.js": function(exports, module) {
      var classof2 = require_classof();
      var $String = String;
      module.exports = function(argument) {
        if (classof2(argument) === "Symbol")
          throw TypeError("Cannot convert a Symbol value to a string");
        return $String(argument);
      };
    }
  });

  // node_modules/core-js/internals/whitespaces.js
  var require_whitespaces = __commonJS({
    "node_modules/core-js/internals/whitespaces.js": function(exports, module) {
      module.exports = "	\n\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF";
    }
  });

  // node_modules/core-js/internals/string-trim.js
  var require_string_trim = __commonJS({
    "node_modules/core-js/internals/string-trim.js": function(exports, module) {
      var uncurryThis15 = require_function_uncurry_this();
      var requireObjectCoercible8 = require_require_object_coercible();
      var toString13 = require_to_string();
      var whitespaces = require_whitespaces();
      var replace2 = uncurryThis15("".replace);
      var ltrim = RegExp("^[" + whitespaces + "]+");
      var rtrim = RegExp("(^|[^" + whitespaces + "])[" + whitespaces + "]+$");
      var createMethod = function(TYPE) {
        return function($this) {
          var string = toString13(requireObjectCoercible8($this));
          if (TYPE & 1)
            string = replace2(string, ltrim, "");
          if (TYPE & 2)
            string = replace2(string, rtrim, "$1");
          return string;
        };
      };
      module.exports = {
        start: createMethod(1),
        end: createMethod(2),
        trim: createMethod(3)
      };
    }
  });

  // node_modules/core-js/internals/number-parse-int.js
  var require_number_parse_int = __commonJS({
    "node_modules/core-js/internals/number-parse-int.js": function(exports, module) {
      var global11 = require_global();
      var fails17 = require_fails();
      var uncurryThis15 = require_function_uncurry_this();
      var toString13 = require_to_string();
      var trim3 = require_string_trim().trim;
      var whitespaces = require_whitespaces();
      var $parseInt2 = global11.parseInt;
      var Symbol2 = global11.Symbol;
      var ITERATOR2 = Symbol2 && Symbol2.iterator;
      var hex = /^[+-]?0x/i;
      var exec3 = uncurryThis15(hex.exec);
      var FORCED9 = $parseInt2(whitespaces + "08") !== 8 || $parseInt2(whitespaces + "0x16") !== 22 || ITERATOR2 && !fails17(function() {
        $parseInt2(Object(ITERATOR2));
      });
      module.exports = FORCED9 ? function parseInt2(string, radix) {
        var S4 = trim3(toString13(string));
        return $parseInt2(S4, radix >>> 0 || (exec3(hex, S4) ? 16 : 10));
      } : $parseInt2;
    }
  });

  // node_modules/core-js/internals/regexp-flags.js
  var require_regexp_flags = __commonJS({
    "node_modules/core-js/internals/regexp-flags.js": function(exports, module) {
      "use strict";
      var anObject10 = require_an_object();
      module.exports = function() {
        var that = anObject10(this);
        var result = "";
        if (that.hasIndices)
          result += "d";
        if (that.global)
          result += "g";
        if (that.ignoreCase)
          result += "i";
        if (that.multiline)
          result += "m";
        if (that.dotAll)
          result += "s";
        if (that.unicode)
          result += "u";
        if (that.unicodeSets)
          result += "v";
        if (that.sticky)
          result += "y";
        return result;
      };
    }
  });

  // node_modules/core-js/internals/regexp-sticky-helpers.js
  var require_regexp_sticky_helpers = __commonJS({
    "node_modules/core-js/internals/regexp-sticky-helpers.js": function(exports, module) {
      var fails17 = require_fails();
      var global11 = require_global();
      var $RegExp = global11.RegExp;
      var UNSUPPORTED_Y3 = fails17(function() {
        var re = $RegExp("a", "y");
        re.lastIndex = 2;
        return re.exec("abcd") != null;
      });
      var MISSED_STICKY3 = UNSUPPORTED_Y3 || fails17(function() {
        return !$RegExp("a", "y").sticky;
      });
      var BROKEN_CARET = UNSUPPORTED_Y3 || fails17(function() {
        var re = $RegExp("^r", "gy");
        re.lastIndex = 2;
        return re.exec("str") != null;
      });
      module.exports = {
        BROKEN_CARET: BROKEN_CARET,
        MISSED_STICKY: MISSED_STICKY3,
        UNSUPPORTED_Y: UNSUPPORTED_Y3
      };
    }
  });

  // node_modules/core-js/internals/object-keys.js
  var require_object_keys = __commonJS({
    "node_modules/core-js/internals/object-keys.js": function(exports, module) {
      var internalObjectKeys = require_object_keys_internal();
      var enumBugKeys = require_enum_bug_keys();
      module.exports = Object.keys || function keys2(O) {
        return internalObjectKeys(O, enumBugKeys);
      };
    }
  });

  // node_modules/core-js/internals/object-define-properties.js
  var require_object_define_properties = __commonJS({
    "node_modules/core-js/internals/object-define-properties.js": function(exports) {
      var DESCRIPTORS10 = require_descriptors();
      var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug();
      var definePropertyModule = require_object_define_property();
      var anObject10 = require_an_object();
      var toIndexedObject5 = require_to_indexed_object();
      var objectKeys = require_object_keys();
      exports.f = DESCRIPTORS10 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties2(O, Properties) {
        anObject10(O);
        var props = toIndexedObject5(Properties);
        var keys2 = objectKeys(Properties);
        var length = keys2.length;
        var index = 0;
        var key;
        while (length > index)
          definePropertyModule.f(O, key = keys2[index++], props[key]);
        return O;
      };
    }
  });

  // node_modules/core-js/internals/html.js
  var require_html = __commonJS({
    "node_modules/core-js/internals/html.js": function(exports, module) {
      var getBuiltIn4 = require_get_built_in();
      module.exports = getBuiltIn4("document", "documentElement");
    }
  });

  // node_modules/core-js/internals/object-create.js
  var require_object_create = __commonJS({
    "node_modules/core-js/internals/object-create.js": function(exports, module) {
      var anObject10 = require_an_object();
      var definePropertiesModule = require_object_define_properties();
      var enumBugKeys = require_enum_bug_keys();
      var hiddenKeys = require_hidden_keys();
      var html = require_html();
      var documentCreateElement = require_document_create_element();
      var sharedKey = require_shared_key();
      var GT = ">";
      var LT = "<";
      var PROTOTYPE = "prototype";
      var SCRIPT = "script";
      var IE_PROTO = sharedKey("IE_PROTO");
      var EmptyConstructor = function() {
      };
      var scriptTag = function(content) {
        return LT + SCRIPT + GT + content + LT + "/" + SCRIPT + GT;
      };
      var NullProtoObjectViaActiveX = function(activeXDocument2) {
        activeXDocument2.write(scriptTag(""));
        activeXDocument2.close();
        var temp = activeXDocument2.parentWindow.Object;
        activeXDocument2 = null;
        return temp;
      };
      var NullProtoObjectViaIFrame = function() {
        var iframe = documentCreateElement("iframe");
        var JS = "java" + SCRIPT + ":";
        var iframeDocument;
        iframe.style.display = "none";
        html.appendChild(iframe);
        iframe.src = String(JS);
        iframeDocument = iframe.contentWindow.document;
        iframeDocument.open();
        iframeDocument.write(scriptTag("document.F=Object"));
        iframeDocument.close();
        return iframeDocument.F;
      };
      var activeXDocument;
      var NullProtoObject = function() {
        try {
          activeXDocument = new ActiveXObject("htmlfile");
        } catch (error) {
        }
        NullProtoObject = typeof document != "undefined" ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument);
        var length = enumBugKeys.length;
        while (length--)
          delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
        return NullProtoObject();
      };
      hiddenKeys[IE_PROTO] = true;
      module.exports = Object.create || function create3(O, Properties) {
        var result;
        if (O !== null) {
          EmptyConstructor[PROTOTYPE] = anObject10(O);
          result = new EmptyConstructor();
          EmptyConstructor[PROTOTYPE] = null;
          result[IE_PROTO] = O;
        } else
          result = NullProtoObject();
        return Properties === void 0 ? result : definePropertiesModule.f(result, Properties);
      };
    }
  });

  // node_modules/core-js/internals/regexp-unsupported-dot-all.js
  var require_regexp_unsupported_dot_all = __commonJS({
    "node_modules/core-js/internals/regexp-unsupported-dot-all.js": function(exports, module) {
      var fails17 = require_fails();
      var global11 = require_global();
      var $RegExp = global11.RegExp;
      module.exports = fails17(function() {
        var re = $RegExp(".", "s");
        return !(re.dotAll && re.exec("\n") && re.flags === "s");
      });
    }
  });

  // node_modules/core-js/internals/regexp-unsupported-ncg.js
  var require_regexp_unsupported_ncg = __commonJS({
    "node_modules/core-js/internals/regexp-unsupported-ncg.js": function(exports, module) {
      var fails17 = require_fails();
      var global11 = require_global();
      var $RegExp = global11.RegExp;
      module.exports = fails17(function() {
        var re = $RegExp("(?<a>b)", "g");
        return re.exec("b").groups.a !== "b" || "b".replace(re, "$<a>c") !== "bc";
      });
    }
  });

  // node_modules/core-js/internals/regexp-exec.js
  var require_regexp_exec = __commonJS({
    "node_modules/core-js/internals/regexp-exec.js": function(exports, module) {
      "use strict";
      var call8 = require_function_call();
      var uncurryThis15 = require_function_uncurry_this();
      var toString13 = require_to_string();
      var regexpFlags = require_regexp_flags();
      var stickyHelpers3 = require_regexp_sticky_helpers();
      var shared = require_shared();
      var create3 = require_object_create();
      var getInternalState3 = require_internal_state().get;
      var UNSUPPORTED_DOT_ALL2 = require_regexp_unsupported_dot_all();
      var UNSUPPORTED_NCG2 = require_regexp_unsupported_ncg();
      var nativeReplace = shared("native-string-replace", String.prototype.replace);
      var nativeExec = RegExp.prototype.exec;
      var patchedExec = nativeExec;
      var charAt3 = uncurryThis15("".charAt);
      var indexOf2 = uncurryThis15("".indexOf);
      var replace2 = uncurryThis15("".replace);
      var stringSlice6 = uncurryThis15("".slice);
      var UPDATES_LAST_INDEX_WRONG = function() {
        var re12 = /a/;
        var re22 = /b*/g;
        call8(nativeExec, re12, "a");
        call8(nativeExec, re22, "a");
        return re12.lastIndex !== 0 || re22.lastIndex !== 0;
      }();
      var UNSUPPORTED_Y3 = stickyHelpers3.BROKEN_CARET;
      var NPCG_INCLUDED = /()??/.exec("")[1] !== void 0;
      var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y3 || UNSUPPORTED_DOT_ALL2 || UNSUPPORTED_NCG2;
      if (PATCH) {
        patchedExec = function exec3(string) {
          var re = this;
          var state = getInternalState3(re);
          var str = toString13(string);
          var raw = state.raw;
          var result, reCopy, lastIndex, match, i5, object, group;
          if (raw) {
            raw.lastIndex = re.lastIndex;
            result = call8(patchedExec, raw, str);
            re.lastIndex = raw.lastIndex;
            return result;
          }
          var groups = state.groups;
          var sticky = UNSUPPORTED_Y3 && re.sticky;
          var flags = call8(regexpFlags, re);
          var source = re.source;
          var charsAdded = 0;
          var strCopy = str;
          if (sticky) {
            flags = replace2(flags, "y", "");
            if (indexOf2(flags, "g") === -1) {
              flags += "g";
            }
            strCopy = stringSlice6(str, re.lastIndex);
            if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt3(str, re.lastIndex - 1) !== "\n")) {
              source = "(?: " + source + ")";
              strCopy = " " + strCopy;
              charsAdded++;
            }
            reCopy = new RegExp("^(?:" + source + ")", flags);
          }
          if (NPCG_INCLUDED) {
            reCopy = new RegExp("^" + source + "$(?!\\s)", flags);
          }
          if (UPDATES_LAST_INDEX_WRONG)
            lastIndex = re.lastIndex;
          match = call8(nativeExec, sticky ? reCopy : re, strCopy);
          if (sticky) {
            if (match) {
              match.input = stringSlice6(match.input, charsAdded);
              match[0] = stringSlice6(match[0], charsAdded);
              match.index = re.lastIndex;
              re.lastIndex += match[0].length;
            } else
              re.lastIndex = 0;
          } else if (UPDATES_LAST_INDEX_WRONG && match) {
            re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
          }
          if (NPCG_INCLUDED && match && match.length > 1) {
            call8(nativeReplace, match[0], reCopy, function() {
              for (i5 = 1; i5 < arguments.length - 2; i5++) {
                if (arguments[i5] === void 0)
                  match[i5] = void 0;
              }
            });
          }
          if (match && groups) {
            match.groups = object = create3(null);
            for (i5 = 0; i5 < groups.length; i5++) {
              group = groups[i5];
              object[group[0]] = match[group[1]];
            }
          }
          return match;
        };
      }
      module.exports = patchedExec;
    }
  });

  // node_modules/core-js/modules/es.regexp.exec.js
  var require_es_regexp_exec = __commonJS({
    "node_modules/core-js/modules/es.regexp.exec.js": function() {
      "use strict";
      var $88 = require_export();
      var exec3 = require_regexp_exec();
      $88({ target: "RegExp", proto: true, forced: /./.exec !== exec3 }, {
        exec: exec3
      });
    }
  });

  // globals:jquery
  var require_jquery = __commonJS({
    "globals:jquery": function(exports, module) {
      module.exports = window.jQuery;
    }
  });

  // node_modules/core-js/internals/function-bind-context.js
  var require_function_bind_context = __commonJS({
    "node_modules/core-js/internals/function-bind-context.js": function(exports, module) {
      var uncurryThis15 = require_function_uncurry_this_clause();
      var aCallable2 = require_a_callable();
      var NATIVE_BIND = require_function_bind_native();
      var bind2 = uncurryThis15(uncurryThis15.bind);
      module.exports = function(fn, that) {
        aCallable2(fn);
        return that === void 0 ? fn : NATIVE_BIND ? bind2(fn, that) : function() {
          return fn.apply(that, arguments);
        };
      };
    }
  });

  // node_modules/core-js/internals/is-array.js
  var require_is_array = __commonJS({
    "node_modules/core-js/internals/is-array.js": function(exports, module) {
      var classof2 = require_classof_raw();
      module.exports = Array.isArray || function isArray4(argument) {
        return classof2(argument) == "Array";
      };
    }
  });

  // node_modules/core-js/internals/is-constructor.js
  var require_is_constructor = __commonJS({
    "node_modules/core-js/internals/is-constructor.js": function(exports, module) {
      var uncurryThis15 = require_function_uncurry_this();
      var fails17 = require_fails();
      var isCallable5 = require_is_callable();
      var classof2 = require_classof();
      var getBuiltIn4 = require_get_built_in();
      var inspectSource = require_inspect_source();
      var noop = function() {
      };
      var empty = [];
      var construct2 = getBuiltIn4("Reflect", "construct");
      var constructorRegExp = /^\s*(?:class|function)\b/;
      var exec3 = uncurryThis15(constructorRegExp.exec);
      var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
      var isConstructorModern = function isConstructor2(argument) {
        if (!isCallable5(argument))
          return false;
        try {
          construct2(noop, empty, argument);
          return true;
        } catch (error) {
          return false;
        }
      };
      var isConstructorLegacy = function isConstructor2(argument) {
        if (!isCallable5(argument))
          return false;
        switch (classof2(argument)) {
          case "AsyncFunction":
          case "GeneratorFunction":
          case "AsyncGeneratorFunction":
            return false;
        }
        try {
          return INCORRECT_TO_STRING || !!exec3(constructorRegExp, inspectSource(argument));
        } catch (error) {
          return true;
        }
      };
      isConstructorLegacy.sham = true;
      module.exports = !construct2 || fails17(function() {
        var called;
        return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function() {
          called = true;
        }) || called;
      }) ? isConstructorLegacy : isConstructorModern;
    }
  });

  // node_modules/core-js/internals/array-species-constructor.js
  var require_array_species_constructor = __commonJS({
    "node_modules/core-js/internals/array-species-constructor.js": function(exports, module) {
      var isArray4 = require_is_array();
      var isConstructor2 = require_is_constructor();
      var isObject6 = require_is_object();
      var wellKnownSymbol7 = require_well_known_symbol();
      var SPECIES2 = wellKnownSymbol7("species");
      var $Array2 = Array;
      module.exports = function(originalArray) {
        var C2;
        if (isArray4(originalArray)) {
          C2 = originalArray.constructor;
          if (isConstructor2(C2) && (C2 === $Array2 || isArray4(C2.prototype)))
            C2 = void 0;
          else if (isObject6(C2)) {
            C2 = C2[SPECIES2];
            if (C2 === null)
              C2 = void 0;
          }
        }
        return C2 === void 0 ? $Array2 : C2;
      };
    }
  });

  // node_modules/core-js/internals/array-species-create.js
  var require_array_species_create = __commonJS({
    "node_modules/core-js/internals/array-species-create.js": function(exports, module) {
      var arraySpeciesConstructor = require_array_species_constructor();
      module.exports = function(originalArray, length) {
        return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
      };
    }
  });

  // node_modules/core-js/internals/array-iteration.js
  var require_array_iteration = __commonJS({
    "node_modules/core-js/internals/array-iteration.js": function(exports, module) {
      var bind2 = require_function_bind_context();
      var uncurryThis15 = require_function_uncurry_this();
      var IndexedObject2 = require_indexed_object();
      var toObject6 = require_to_object();
      var lengthOfArrayLike5 = require_length_of_array_like();
      var arraySpeciesCreate4 = require_array_species_create();
      var push4 = uncurryThis15([].push);
      var createMethod = function(TYPE) {
        var IS_MAP = TYPE == 1;
        var IS_FILTER = TYPE == 2;
        var IS_SOME = TYPE == 3;
        var IS_EVERY = TYPE == 4;
        var IS_FIND_INDEX = TYPE == 6;
        var IS_FILTER_REJECT = TYPE == 7;
        var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
        return function($this, callbackfn, that, specificCreate) {
          var O = toObject6($this);
          var self2 = IndexedObject2(O);
          var boundFunction = bind2(callbackfn, that);
          var length = lengthOfArrayLike5(self2);
          var index = 0;
          var create3 = specificCreate || arraySpeciesCreate4;
          var target = IS_MAP ? create3($this, length) : IS_FILTER || IS_FILTER_REJECT ? create3($this, 0) : void 0;
          var value, result;
          for (; length > index; index++)
            if (NO_HOLES || index in self2) {
              value = self2[index];
              result = boundFunction(value, index, O);
              if (TYPE) {
                if (IS_MAP)
                  target[index] = result;
                else if (result)
                  switch (TYPE) {
                    case 3:
                      return true;
                    case 5:
                      return value;
                    case 6:
                      return index;
                    case 2:
                      push4(target, value);
                  }
                else
                  switch (TYPE) {
                    case 4:
                      return false;
                    case 7:
                      push4(target, value);
                  }
              }
            }
          return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
        };
      };
      module.exports = {
        forEach: createMethod(0),
        map: createMethod(1),
        filter: createMethod(2),
        some: createMethod(3),
        every: createMethod(4),
        find: createMethod(5),
        findIndex: createMethod(6),
        filterReject: createMethod(7)
      };
    }
  });

  // node_modules/core-js/internals/add-to-unscopables.js
  var require_add_to_unscopables = __commonJS({
    "node_modules/core-js/internals/add-to-unscopables.js": function(exports, module) {
      var wellKnownSymbol7 = require_well_known_symbol();
      var create3 = require_object_create();
      var defineProperty3 = require_object_define_property().f;
      var UNSCOPABLES = wellKnownSymbol7("unscopables");
      var ArrayPrototype = Array.prototype;
      if (ArrayPrototype[UNSCOPABLES] == void 0) {
        defineProperty3(ArrayPrototype, UNSCOPABLES, {
          configurable: true,
          value: create3(null)
        });
      }
      module.exports = function(key) {
        ArrayPrototype[UNSCOPABLES][key] = true;
      };
    }
  });

  // node_modules/core-js/internals/object-to-string.js
  var require_object_to_string = __commonJS({
    "node_modules/core-js/internals/object-to-string.js": function(exports, module) {
      "use strict";
      var TO_STRING_TAG_SUPPORT2 = require_to_string_tag_support();
      var classof2 = require_classof();
      module.exports = TO_STRING_TAG_SUPPORT2 ? {}.toString : function toString13() {
        return "[object " + classof2(this) + "]";
      };
    }
  });

  // node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js
  var require_fix_regexp_well_known_symbol_logic = __commonJS({
    "node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js": function(exports, module) {
      "use strict";
      require_es_regexp_exec();
      var uncurryThis15 = require_function_uncurry_this_clause();
      var defineBuiltIn6 = require_define_built_in();
      var regexpExec2 = require_regexp_exec();
      var fails17 = require_fails();
      var wellKnownSymbol7 = require_well_known_symbol();
      var createNonEnumerableProperty4 = require_create_non_enumerable_property();
      var SPECIES2 = wellKnownSymbol7("species");
      var RegExpPrototype4 = RegExp.prototype;
      module.exports = function(KEY, exec3, FORCED9, SHAM) {
        var SYMBOL = wellKnownSymbol7(KEY);
        var DELEGATES_TO_SYMBOL = !fails17(function() {
          var O = {};
          O[SYMBOL] = function() {
            return 7;
          };
          return ""[KEY](O) != 7;
        });
        var DELEGATES_TO_EXEC2 = DELEGATES_TO_SYMBOL && !fails17(function() {
          var execCalled = false;
          var re = /a/;
          if (KEY === "split") {
            re = {};
            re.constructor = {};
            re.constructor[SPECIES2] = function() {
              return re;
            };
            re.flags = "";
            re[SYMBOL] = /./[SYMBOL];
          }
          re.exec = function() {
            execCalled = true;
            return null;
          };
          re[SYMBOL]("");
          return !execCalled;
        });
        if (!DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC2 || FORCED9) {
          var uncurriedNativeRegExpMethod = uncurryThis15(/./[SYMBOL]);
          var methods = exec3(SYMBOL, ""[KEY], function(nativeMethod, regexp, str, arg2, forceStringMethod) {
            var uncurriedNativeMethod = uncurryThis15(nativeMethod);
            var $exec = regexp.exec;
            if ($exec === regexpExec2 || $exec === RegExpPrototype4.exec) {
              if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
                return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
              }
              return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
            }
            return { done: false };
          });
          defineBuiltIn6(String.prototype, KEY, methods[0]);
          defineBuiltIn6(RegExpPrototype4, SYMBOL, methods[1]);
        }
        if (SHAM)
          createNonEnumerableProperty4(RegExpPrototype4[SYMBOL], "sham", true);
      };
    }
  });

  // node_modules/core-js/internals/string-multibyte.js
  var require_string_multibyte = __commonJS({
    "node_modules/core-js/internals/string-multibyte.js": function(exports, module) {
      var uncurryThis15 = require_function_uncurry_this();
      var toIntegerOrInfinity4 = require_to_integer_or_infinity();
      var toString13 = require_to_string();
      var requireObjectCoercible8 = require_require_object_coercible();
      var charAt3 = uncurryThis15("".charAt);
      var charCodeAt2 = uncurryThis15("".charCodeAt);
      var stringSlice6 = uncurryThis15("".slice);
      var createMethod = function(CONVERT_TO_STRING) {
        return function($this, pos) {
          var S4 = toString13(requireObjectCoercible8($this));
          var position = toIntegerOrInfinity4(pos);
          var size = S4.length;
          var first, second;
          if (position < 0 || position >= size)
            return CONVERT_TO_STRING ? "" : void 0;
          first = charCodeAt2(S4, position);
          return first < 55296 || first > 56319 || position + 1 === size || (second = charCodeAt2(S4, position + 1)) < 56320 || second > 57343 ? CONVERT_TO_STRING ? charAt3(S4, position) : first : CONVERT_TO_STRING ? stringSlice6(S4, position, position + 2) : (first - 55296 << 10) + (second - 56320) + 65536;
        };
      };
      module.exports = {
        codeAt: createMethod(false),
        charAt: createMethod(true)
      };
    }
  });

  // node_modules/core-js/internals/advance-string-index.js
  var require_advance_string_index = __commonJS({
    "node_modules/core-js/internals/advance-string-index.js": function(exports, module) {
      "use strict";
      var charAt3 = require_string_multibyte().charAt;
      module.exports = function(S4, index, unicode) {
        return index + (unicode ? charAt3(S4, index).length : 1);
      };
    }
  });

  // node_modules/core-js/internals/regexp-exec-abstract.js
  var require_regexp_exec_abstract = __commonJS({
    "node_modules/core-js/internals/regexp-exec-abstract.js": function(exports, module) {
      var call8 = require_function_call();
      var anObject10 = require_an_object();
      var isCallable5 = require_is_callable();
      var classof2 = require_classof_raw();
      var regexpExec2 = require_regexp_exec();
      var $TypeError2 = TypeError;
      module.exports = function(R2, S4) {
        var exec3 = R2.exec;
        if (isCallable5(exec3)) {
          var result = call8(exec3, R2, S4);
          if (result !== null)
            anObject10(result);
          return result;
        }
        if (classof2(R2) === "RegExp")
          return call8(regexpExec2, R2, S4);
        throw $TypeError2("RegExp#exec called on incompatible receiver");
      };
    }
  });

  // node_modules/core-js/internals/number-parse-float.js
  var require_number_parse_float = __commonJS({
    "node_modules/core-js/internals/number-parse-float.js": function(exports, module) {
      var global11 = require_global();
      var fails17 = require_fails();
      var uncurryThis15 = require_function_uncurry_this();
      var toString13 = require_to_string();
      var trim3 = require_string_trim().trim;
      var whitespaces = require_whitespaces();
      var charAt3 = uncurryThis15("".charAt);
      var $parseFloat2 = global11.parseFloat;
      var Symbol2 = global11.Symbol;
      var ITERATOR2 = Symbol2 && Symbol2.iterator;
      var FORCED9 = 1 / $parseFloat2(whitespaces + "-0") !== -Infinity || ITERATOR2 && !fails17(function() {
        $parseFloat2(Object(ITERATOR2));
      });
      module.exports = FORCED9 ? function parseFloat2(string) {
        var trimmedString = trim3(toString13(string));
        var result = $parseFloat2(trimmedString);
        return result === 0 && charAt3(trimmedString, 0) == "-" ? -0 : result;
      } : $parseFloat2;
    }
  });

  // node_modules/core-js/internals/function-apply.js
  var require_function_apply = __commonJS({
    "node_modules/core-js/internals/function-apply.js": function(exports, module) {
      var NATIVE_BIND = require_function_bind_native();
      var FunctionPrototype2 = Function.prototype;
      var apply4 = FunctionPrototype2.apply;
      var call8 = FunctionPrototype2.call;
      module.exports = typeof Reflect == "object" && Reflect.apply || (NATIVE_BIND ? call8.bind(apply4) : function() {
        return call8.apply(apply4, arguments);
      });
    }
  });

  // node_modules/core-js/internals/get-substitution.js
  var require_get_substitution = __commonJS({
    "node_modules/core-js/internals/get-substitution.js": function(exports, module) {
      var uncurryThis15 = require_function_uncurry_this();
      var toObject6 = require_to_object();
      var floor = Math.floor;
      var charAt3 = uncurryThis15("".charAt);
      var replace2 = uncurryThis15("".replace);
      var stringSlice6 = uncurryThis15("".slice);
      var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
      var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
      module.exports = function(matched, str, position, captures, namedCaptures, replacement) {
        var tailPos = position + matched.length;
        var m2 = captures.length;
        var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
        if (namedCaptures !== void 0) {
          namedCaptures = toObject6(namedCaptures);
          symbols = SUBSTITUTION_SYMBOLS;
        }
        return replace2(replacement, symbols, function(match, ch) {
          var capture;
          switch (charAt3(ch, 0)) {
            case "$":
              return "$";
            case "&":
              return matched;
            case "`":
              return stringSlice6(str, 0, position);
            case "'":
              return stringSlice6(str, tailPos);
            case "<":
              capture = namedCaptures[stringSlice6(ch, 1, -1)];
              break;
            default:
              var n4 = +ch;
              if (n4 === 0)
                return match;
              if (n4 > m2) {
                var f4 = floor(n4 / 10);
                if (f4 === 0)
                  return match;
                if (f4 <= m2)
                  return captures[f4 - 1] === void 0 ? charAt3(ch, 1) : captures[f4 - 1] + charAt3(ch, 1);
                return match;
              }
              capture = captures[n4 - 1];
          }
          return capture === void 0 ? "" : capture;
        });
      };
    }
  });

  // node_modules/core-js/internals/does-not-exceed-safe-integer.js
  var require_does_not_exceed_safe_integer = __commonJS({
    "node_modules/core-js/internals/does-not-exceed-safe-integer.js": function(exports, module) {
      var $TypeError2 = TypeError;
      var MAX_SAFE_INTEGER = 9007199254740991;
      module.exports = function(it) {
        if (it > MAX_SAFE_INTEGER)
          throw $TypeError2("Maximum allowed index exceeded");
        return it;
      };
    }
  });

  // node_modules/core-js/internals/create-property.js
  var require_create_property = __commonJS({
    "node_modules/core-js/internals/create-property.js": function(exports, module) {
      "use strict";
      var toPropertyKey = require_to_property_key();
      var definePropertyModule = require_object_define_property();
      var createPropertyDescriptor = require_create_property_descriptor();
      module.exports = function(object, key, value) {
        var propertyKey = toPropertyKey(key);
        if (propertyKey in object)
          definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
        else
          object[propertyKey] = value;
      };
    }
  });

  // node_modules/core-js/internals/array-method-has-species-support.js
  var require_array_method_has_species_support = __commonJS({
    "node_modules/core-js/internals/array-method-has-species-support.js": function(exports, module) {
      var fails17 = require_fails();
      var wellKnownSymbol7 = require_well_known_symbol();
      var V8_VERSION2 = require_engine_v8_version();
      var SPECIES2 = wellKnownSymbol7("species");
      module.exports = function(METHOD_NAME) {
        return V8_VERSION2 >= 51 || !fails17(function() {
          var array = [];
          var constructor = array.constructor = {};
          constructor[SPECIES2] = function() {
            return { foo: 1 };
          };
          return array[METHOD_NAME](Boolean).foo !== 1;
        });
      };
    }
  });

  // node_modules/core-js/internals/same-value.js
  var require_same_value = __commonJS({
    "node_modules/core-js/internals/same-value.js": function(exports, module) {
      module.exports = Object.is || function is2(x2, y4) {
        return x2 === y4 ? x2 !== 0 || 1 / x2 === 1 / y4 : x2 != x2 && y4 != y4;
      };
    }
  });

  // node_modules/core-js/internals/is-regexp.js
  var require_is_regexp = __commonJS({
    "node_modules/core-js/internals/is-regexp.js": function(exports, module) {
      var isObject6 = require_is_object();
      var classof2 = require_classof_raw();
      var wellKnownSymbol7 = require_well_known_symbol();
      var MATCH2 = wellKnownSymbol7("match");
      module.exports = function(it) {
        var isRegExp3;
        return isObject6(it) && ((isRegExp3 = it[MATCH2]) !== void 0 ? !!isRegExp3 : classof2(it) == "RegExp");
      };
    }
  });

  // node_modules/core-js/internals/a-constructor.js
  var require_a_constructor = __commonJS({
    "node_modules/core-js/internals/a-constructor.js": function(exports, module) {
      var isConstructor2 = require_is_constructor();
      var tryToString = require_try_to_string();
      var $TypeError2 = TypeError;
      module.exports = function(argument) {
        if (isConstructor2(argument))
          return argument;
        throw $TypeError2(tryToString(argument) + " is not a constructor");
      };
    }
  });

  // node_modules/core-js/internals/species-constructor.js
  var require_species_constructor = __commonJS({
    "node_modules/core-js/internals/species-constructor.js": function(exports, module) {
      var anObject10 = require_an_object();
      var aConstructor2 = require_a_constructor();
      var isNullOrUndefined5 = require_is_null_or_undefined();
      var wellKnownSymbol7 = require_well_known_symbol();
      var SPECIES2 = wellKnownSymbol7("species");
      module.exports = function(O, defaultConstructor) {
        var C2 = anObject10(O).constructor;
        var S4;
        return C2 === void 0 || isNullOrUndefined5(S4 = anObject10(C2)[SPECIES2]) ? defaultConstructor : aConstructor2(S4);
      };
    }
  });

  // node_modules/core-js/internals/array-slice-simple.js
  var require_array_slice_simple = __commonJS({
    "node_modules/core-js/internals/array-slice-simple.js": function(exports, module) {
      var toAbsoluteIndex4 = require_to_absolute_index();
      var lengthOfArrayLike5 = require_length_of_array_like();
      var createProperty5 = require_create_property();
      var $Array2 = Array;
      var max4 = Math.max;
      module.exports = function(O, start, end) {
        var length = lengthOfArrayLike5(O);
        var k2 = toAbsoluteIndex4(start, length);
        var fin = toAbsoluteIndex4(end === void 0 ? length : end, length);
        var result = $Array2(max4(fin - k2, 0));
        for (var n4 = 0; k2 < fin; k2++, n4++)
          createProperty5(result, n4, O[k2]);
        result.length = n4;
        return result;
      };
    }
  });

  // node_modules/core-js/internals/path.js
  var require_path = __commonJS({
    "node_modules/core-js/internals/path.js": function(exports, module) {
      var global11 = require_global();
      module.exports = global11;
    }
  });

  // node_modules/core-js/internals/well-known-symbol-wrapped.js
  var require_well_known_symbol_wrapped = __commonJS({
    "node_modules/core-js/internals/well-known-symbol-wrapped.js": function(exports) {
      var wellKnownSymbol7 = require_well_known_symbol();
      exports.f = wellKnownSymbol7;
    }
  });

  // node_modules/core-js/internals/well-known-symbol-define.js
  var require_well_known_symbol_define = __commonJS({
    "node_modules/core-js/internals/well-known-symbol-define.js": function(exports, module) {
      var path2 = require_path();
      var hasOwn5 = require_has_own_property();
      var wrappedWellKnownSymbolModule = require_well_known_symbol_wrapped();
      var defineProperty3 = require_object_define_property().f;
      module.exports = function(NAME2) {
        var Symbol2 = path2.Symbol || (path2.Symbol = {});
        if (!hasOwn5(Symbol2, NAME2))
          defineProperty3(Symbol2, NAME2, {
            value: wrappedWellKnownSymbolModule.f(NAME2)
          });
      };
    }
  });

  // node_modules/core-js/internals/symbol-define-to-primitive.js
  var require_symbol_define_to_primitive = __commonJS({
    "node_modules/core-js/internals/symbol-define-to-primitive.js": function(exports, module) {
      var call8 = require_function_call();
      var getBuiltIn4 = require_get_built_in();
      var wellKnownSymbol7 = require_well_known_symbol();
      var defineBuiltIn6 = require_define_built_in();
      module.exports = function() {
        var Symbol2 = getBuiltIn4("Symbol");
        var SymbolPrototype2 = Symbol2 && Symbol2.prototype;
        var valueOf = SymbolPrototype2 && SymbolPrototype2.valueOf;
        var TO_PRIMITIVE2 = wellKnownSymbol7("toPrimitive");
        if (SymbolPrototype2 && !SymbolPrototype2[TO_PRIMITIVE2]) {
          defineBuiltIn6(SymbolPrototype2, TO_PRIMITIVE2, function(hint) {
            return call8(valueOf, this);
          }, { arity: 1 });
        }
      };
    }
  });

  // node_modules/core-js/internals/date-to-primitive.js
  var require_date_to_primitive = __commonJS({
    "node_modules/core-js/internals/date-to-primitive.js": function(exports, module) {
      "use strict";
      var anObject10 = require_an_object();
      var ordinaryToPrimitive = require_ordinary_to_primitive();
      var $TypeError2 = TypeError;
      module.exports = function(hint) {
        anObject10(this);
        if (hint === "string" || hint === "default")
          hint = "string";
        else if (hint !== "number")
          throw $TypeError2("Incorrect hint");
        return ordinaryToPrimitive(this, hint);
      };
    }
  });

  // node_modules/core-js/internals/object-get-own-property-names-external.js
  var require_object_get_own_property_names_external = __commonJS({
    "node_modules/core-js/internals/object-get-own-property-names-external.js": function(exports, module) {
      var classof2 = require_classof_raw();
      var toIndexedObject5 = require_to_indexed_object();
      var $getOwnPropertyNames = require_object_get_own_property_names().f;
      var arraySlice2 = require_array_slice_simple();
      var windowNames = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
      var getWindowNames = function(it) {
        try {
          return $getOwnPropertyNames(it);
        } catch (error) {
          return arraySlice2(windowNames);
        }
      };
      module.exports.f = function getOwnPropertyNames4(it) {
        return windowNames && classof2(it) == "Window" ? getWindowNames(it) : $getOwnPropertyNames(toIndexedObject5(it));
      };
    }
  });

  // node_modules/core-js/internals/define-built-in-accessor.js
  var require_define_built_in_accessor = __commonJS({
    "node_modules/core-js/internals/define-built-in-accessor.js": function(exports, module) {
      var makeBuiltIn = require_make_built_in();
      var defineProperty3 = require_object_define_property();
      module.exports = function(target, name, descriptor) {
        if (descriptor.get)
          makeBuiltIn(descriptor.get, name, { getter: true });
        if (descriptor.set)
          makeBuiltIn(descriptor.set, name, { setter: true });
        return defineProperty3.f(target, name, descriptor);
      };
    }
  });

  // node_modules/core-js/internals/set-to-string-tag.js
  var require_set_to_string_tag = __commonJS({
    "node_modules/core-js/internals/set-to-string-tag.js": function(exports, module) {
      var defineProperty3 = require_object_define_property().f;
      var hasOwn5 = require_has_own_property();
      var wellKnownSymbol7 = require_well_known_symbol();
      var TO_STRING_TAG2 = wellKnownSymbol7("toStringTag");
      module.exports = function(target, TAG, STATIC) {
        if (target && !STATIC)
          target = target.prototype;
        if (target && !hasOwn5(target, TO_STRING_TAG2)) {
          defineProperty3(target, TO_STRING_TAG2, { configurable: true, value: TAG });
        }
      };
    }
  });

  // node_modules/core-js/modules/es.symbol.constructor.js
  var require_es_symbol_constructor = __commonJS({
    "node_modules/core-js/modules/es.symbol.constructor.js": function() {
      "use strict";
      var $88 = require_export();
      var global11 = require_global();
      var call8 = require_function_call();
      var uncurryThis15 = require_function_uncurry_this();
      var IS_PURE5 = require_is_pure();
      var DESCRIPTORS10 = require_descriptors();
      var NATIVE_SYMBOL = require_symbol_constructor_detection();
      var fails17 = require_fails();
      var hasOwn5 = require_has_own_property();
      var isPrototypeOf4 = require_object_is_prototype_of();
      var anObject10 = require_an_object();
      var toIndexedObject5 = require_to_indexed_object();
      var toPropertyKey = require_to_property_key();
      var $toString2 = require_to_string();
      var createPropertyDescriptor = require_create_property_descriptor();
      var nativeObjectCreate = require_object_create();
      var objectKeys = require_object_keys();
      var getOwnPropertyNamesModule = require_object_get_own_property_names();
      var getOwnPropertyNamesExternal = require_object_get_own_property_names_external();
      var getOwnPropertySymbolsModule = require_object_get_own_property_symbols();
      var getOwnPropertyDescriptorModule3 = require_object_get_own_property_descriptor();
      var definePropertyModule = require_object_define_property();
      var definePropertiesModule = require_object_define_properties();
      var propertyIsEnumerableModule = require_object_property_is_enumerable();
      var defineBuiltIn6 = require_define_built_in();
      var defineBuiltInAccessor4 = require_define_built_in_accessor();
      var shared = require_shared();
      var sharedKey = require_shared_key();
      var hiddenKeys = require_hidden_keys();
      var uid = require_uid();
      var wellKnownSymbol7 = require_well_known_symbol();
      var wrappedWellKnownSymbolModule = require_well_known_symbol_wrapped();
      var defineWellKnownSymbol5 = require_well_known_symbol_define();
      var defineSymbolToPrimitive2 = require_symbol_define_to_primitive();
      var setToStringTag5 = require_set_to_string_tag();
      var InternalStateModule2 = require_internal_state();
      var $forEach = require_array_iteration().forEach;
      var HIDDEN = sharedKey("hidden");
      var SYMBOL = "Symbol";
      var PROTOTYPE = "prototype";
      var setInternalState2 = InternalStateModule2.set;
      var getInternalState3 = InternalStateModule2.getterFor(SYMBOL);
      var ObjectPrototype2 = Object[PROTOTYPE];
      var $Symbol = global11.Symbol;
      var SymbolPrototype2 = $Symbol && $Symbol[PROTOTYPE];
      var TypeError3 = global11.TypeError;
      var QObject = global11.QObject;
      var nativeGetOwnPropertyDescriptor2 = getOwnPropertyDescriptorModule3.f;
      var nativeDefineProperty = definePropertyModule.f;
      var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
      var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
      var push4 = uncurryThis15([].push);
      var AllSymbols = shared("symbols");
      var ObjectPrototypeSymbols = shared("op-symbols");
      var WellKnownSymbolsStore = shared("wks");
      var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
      var setSymbolDescriptor = DESCRIPTORS10 && fails17(function() {
        return nativeObjectCreate(nativeDefineProperty({}, "a", {
          get: function() {
            return nativeDefineProperty(this, "a", { value: 7 }).a;
          }
        })).a != 7;
      }) ? function(O, P3, Attributes) {
        var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor2(ObjectPrototype2, P3);
        if (ObjectPrototypeDescriptor)
          delete ObjectPrototype2[P3];
        nativeDefineProperty(O, P3, Attributes);
        if (ObjectPrototypeDescriptor && O !== ObjectPrototype2) {
          nativeDefineProperty(ObjectPrototype2, P3, ObjectPrototypeDescriptor);
        }
      } : nativeDefineProperty;
      var wrap = function(tag, description) {
        var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype2);
        setInternalState2(symbol, {
          type: SYMBOL,
          tag: tag,
          description: description
        });
        if (!DESCRIPTORS10)
          symbol.description = description;
        return symbol;
      };
      var $defineProperty = function defineProperty3(O, P3, Attributes) {
        if (O === ObjectPrototype2)
          $defineProperty(ObjectPrototypeSymbols, P3, Attributes);
        anObject10(O);
        var key = toPropertyKey(P3);
        anObject10(Attributes);
        if (hasOwn5(AllSymbols, key)) {
          if (!Attributes.enumerable) {
            if (!hasOwn5(O, HIDDEN))
              nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
            O[HIDDEN][key] = true;
          } else {
            if (hasOwn5(O, HIDDEN) && O[HIDDEN][key])
              O[HIDDEN][key] = false;
            Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
          }
          return setSymbolDescriptor(O, key, Attributes);
        }
        return nativeDefineProperty(O, key, Attributes);
      };
      var $defineProperties = function defineProperties2(O, Properties) {
        anObject10(O);
        var properties = toIndexedObject5(Properties);
        var keys2 = objectKeys(properties).concat($getOwnPropertySymbols(properties));
        $forEach(keys2, function(key) {
          if (!DESCRIPTORS10 || call8($propertyIsEnumerable, properties, key))
            $defineProperty(O, key, properties[key]);
        });
        return O;
      };
      var $create = function create3(O, Properties) {
        return Properties === void 0 ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
      };
      var $propertyIsEnumerable = function propertyIsEnumerable(V2) {
        var P3 = toPropertyKey(V2);
        var enumerable = call8(nativePropertyIsEnumerable, this, P3);
        if (this === ObjectPrototype2 && hasOwn5(AllSymbols, P3) && !hasOwn5(ObjectPrototypeSymbols, P3))
          return false;
        return enumerable || !hasOwn5(this, P3) || !hasOwn5(AllSymbols, P3) || hasOwn5(this, HIDDEN) && this[HIDDEN][P3] ? enumerable : true;
      };
      var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor5(O, P3) {
        var it = toIndexedObject5(O);
        var key = toPropertyKey(P3);
        if (it === ObjectPrototype2 && hasOwn5(AllSymbols, key) && !hasOwn5(ObjectPrototypeSymbols, key))
          return;
        var descriptor = nativeGetOwnPropertyDescriptor2(it, key);
        if (descriptor && hasOwn5(AllSymbols, key) && !(hasOwn5(it, HIDDEN) && it[HIDDEN][key])) {
          descriptor.enumerable = true;
        }
        return descriptor;
      };
      var $getOwnPropertyNames = function getOwnPropertyNames4(O) {
        var names = nativeGetOwnPropertyNames(toIndexedObject5(O));
        var result = [];
        $forEach(names, function(key) {
          if (!hasOwn5(AllSymbols, key) && !hasOwn5(hiddenKeys, key))
            push4(result, key);
        });
        return result;
      };
      var $getOwnPropertySymbols = function(O) {
        var IS_OBJECT_PROTOTYPE = O === ObjectPrototype2;
        var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject5(O));
        var result = [];
        $forEach(names, function(key) {
          if (hasOwn5(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn5(ObjectPrototype2, key))) {
            push4(result, AllSymbols[key]);
          }
        });
        return result;
      };
      if (!NATIVE_SYMBOL) {
        $Symbol = function Symbol2() {
          if (isPrototypeOf4(SymbolPrototype2, this))
            throw TypeError3("Symbol is not a constructor");
          var description = !arguments.length || arguments[0] === void 0 ? void 0 : $toString2(arguments[0]);
          var tag = uid(description);
          var setter = function(value) {
            if (this === ObjectPrototype2)
              call8(setter, ObjectPrototypeSymbols, value);
            if (hasOwn5(this, HIDDEN) && hasOwn5(this[HIDDEN], tag))
              this[HIDDEN][tag] = false;
            setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
          };
          if (DESCRIPTORS10 && USE_SETTER)
            setSymbolDescriptor(ObjectPrototype2, tag, { configurable: true, set: setter });
          return wrap(tag, description);
        };
        SymbolPrototype2 = $Symbol[PROTOTYPE];
        defineBuiltIn6(SymbolPrototype2, "toString", function toString13() {
          return getInternalState3(this).tag;
        });
        defineBuiltIn6($Symbol, "withoutSetter", function(description) {
          return wrap(uid(description), description);
        });
        propertyIsEnumerableModule.f = $propertyIsEnumerable;
        definePropertyModule.f = $defineProperty;
        definePropertiesModule.f = $defineProperties;
        getOwnPropertyDescriptorModule3.f = $getOwnPropertyDescriptor;
        getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
        getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
        wrappedWellKnownSymbolModule.f = function(name) {
          return wrap(wellKnownSymbol7(name), name);
        };
        if (DESCRIPTORS10) {
          defineBuiltInAccessor4(SymbolPrototype2, "description", {
            configurable: true,
            get: function description() {
              return getInternalState3(this).description;
            }
          });
          if (!IS_PURE5) {
            defineBuiltIn6(ObjectPrototype2, "propertyIsEnumerable", $propertyIsEnumerable, { unsafe: true });
          }
        }
      }
      $88({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
        Symbol: $Symbol
      });
      $forEach(objectKeys(WellKnownSymbolsStore), function(name) {
        defineWellKnownSymbol5(name);
      });
      $88({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
        useSetter: function() {
          USE_SETTER = true;
        },
        useSimple: function() {
          USE_SETTER = false;
        }
      });
      $88({ target: "Object", stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS10 }, {
        create: $create,
        defineProperty: $defineProperty,
        defineProperties: $defineProperties,
        getOwnPropertyDescriptor: $getOwnPropertyDescriptor
      });
      $88({ target: "Object", stat: true, forced: !NATIVE_SYMBOL }, {
        getOwnPropertyNames: $getOwnPropertyNames
      });
      defineSymbolToPrimitive2();
      setToStringTag5($Symbol, SYMBOL);
      hiddenKeys[HIDDEN] = true;
    }
  });

  // node_modules/core-js/internals/symbol-registry-detection.js
  var require_symbol_registry_detection = __commonJS({
    "node_modules/core-js/internals/symbol-registry-detection.js": function(exports, module) {
      var NATIVE_SYMBOL = require_symbol_constructor_detection();
      module.exports = NATIVE_SYMBOL && !!Symbol["for"] && !!Symbol.keyFor;
    }
  });

  // node_modules/core-js/modules/es.symbol.for.js
  var require_es_symbol_for = __commonJS({
    "node_modules/core-js/modules/es.symbol.for.js": function() {
      var $88 = require_export();
      var getBuiltIn4 = require_get_built_in();
      var hasOwn5 = require_has_own_property();
      var toString13 = require_to_string();
      var shared = require_shared();
      var NATIVE_SYMBOL_REGISTRY = require_symbol_registry_detection();
      var StringToSymbolRegistry = shared("string-to-symbol-registry");
      var SymbolToStringRegistry = shared("symbol-to-string-registry");
      $88({ target: "Symbol", stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
        "for": function(key) {
          var string = toString13(key);
          if (hasOwn5(StringToSymbolRegistry, string))
            return StringToSymbolRegistry[string];
          var symbol = getBuiltIn4("Symbol")(string);
          StringToSymbolRegistry[string] = symbol;
          SymbolToStringRegistry[symbol] = string;
          return symbol;
        }
      });
    }
  });

  // node_modules/core-js/modules/es.symbol.key-for.js
  var require_es_symbol_key_for = __commonJS({
    "node_modules/core-js/modules/es.symbol.key-for.js": function() {
      var $88 = require_export();
      var hasOwn5 = require_has_own_property();
      var isSymbol2 = require_is_symbol();
      var tryToString = require_try_to_string();
      var shared = require_shared();
      var NATIVE_SYMBOL_REGISTRY = require_symbol_registry_detection();
      var SymbolToStringRegistry = shared("symbol-to-string-registry");
      $88({ target: "Symbol", stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
        keyFor: function keyFor(sym) {
          if (!isSymbol2(sym))
            throw TypeError(tryToString(sym) + " is not a symbol");
          if (hasOwn5(SymbolToStringRegistry, sym))
            return SymbolToStringRegistry[sym];
        }
      });
    }
  });

  // node_modules/core-js/internals/array-slice.js
  var require_array_slice = __commonJS({
    "node_modules/core-js/internals/array-slice.js": function(exports, module) {
      var uncurryThis15 = require_function_uncurry_this();
      module.exports = uncurryThis15([].slice);
    }
  });

  // node_modules/core-js/internals/get-json-replacer-function.js
  var require_get_json_replacer_function = __commonJS({
    "node_modules/core-js/internals/get-json-replacer-function.js": function(exports, module) {
      var uncurryThis15 = require_function_uncurry_this();
      var isArray4 = require_is_array();
      var isCallable5 = require_is_callable();
      var classof2 = require_classof_raw();
      var toString13 = require_to_string();
      var push4 = uncurryThis15([].push);
      module.exports = function(replacer) {
        if (isCallable5(replacer))
          return replacer;
        if (!isArray4(replacer))
          return;
        var rawLength = replacer.length;
        var keys2 = [];
        for (var i5 = 0; i5 < rawLength; i5++) {
          var element = replacer[i5];
          if (typeof element == "string")
            push4(keys2, element);
          else if (typeof element == "number" || classof2(element) == "Number" || classof2(element) == "String")
            push4(keys2, toString13(element));
        }
        var keysLength = keys2.length;
        var root = true;
        return function(key, value) {
          if (root) {
            root = false;
            return value;
          }
          if (isArray4(this))
            return value;
          for (var j3 = 0; j3 < keysLength; j3++)
            if (keys2[j3] === key)
              return value;
        };
      };
    }
  });

  // node_modules/core-js/modules/es.json.stringify.js
  var require_es_json_stringify = __commonJS({
    "node_modules/core-js/modules/es.json.stringify.js": function() {
      var $88 = require_export();
      var getBuiltIn4 = require_get_built_in();
      var apply4 = require_function_apply();
      var call8 = require_function_call();
      var uncurryThis15 = require_function_uncurry_this();
      var fails17 = require_fails();
      var isCallable5 = require_is_callable();
      var isSymbol2 = require_is_symbol();
      var arraySlice2 = require_array_slice();
      var getReplacerFunction = require_get_json_replacer_function();
      var NATIVE_SYMBOL = require_symbol_constructor_detection();
      var $String = String;
      var $stringify = getBuiltIn4("JSON", "stringify");
      var exec3 = uncurryThis15(/./.exec);
      var charAt3 = uncurryThis15("".charAt);
      var charCodeAt2 = uncurryThis15("".charCodeAt);
      var replace2 = uncurryThis15("".replace);
      var numberToString = uncurryThis15(1 .toString);
      var tester = /[\uD800-\uDFFF]/g;
      var low = /^[\uD800-\uDBFF]$/;
      var hi = /^[\uDC00-\uDFFF]$/;
      var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails17(function() {
        var symbol = getBuiltIn4("Symbol")();
        return $stringify([symbol]) != "[null]" || $stringify({ a: symbol }) != "{}" || $stringify(Object(symbol)) != "{}";
      });
      var ILL_FORMED_UNICODE = fails17(function() {
        return $stringify("\uDF06\uD834") !== '"\\udf06\\ud834"' || $stringify("\uDEAD") !== '"\\udead"';
      });
      var stringifyWithSymbolsFix = function(it, replacer) {
        var args = arraySlice2(arguments);
        var $replacer = getReplacerFunction(replacer);
        if (!isCallable5($replacer) && (it === void 0 || isSymbol2(it)))
          return;
        args[1] = function(key, value) {
          if (isCallable5($replacer))
            value = call8($replacer, this, $String(key), value);
          if (!isSymbol2(value))
            return value;
        };
        return apply4($stringify, null, args);
      };
      var fixIllFormed = function(match, offset, string) {
        var prev = charAt3(string, offset - 1);
        var next2 = charAt3(string, offset + 1);
        if (exec3(low, match) && !exec3(hi, next2) || exec3(hi, match) && !exec3(low, prev)) {
          return "\\u" + numberToString(charCodeAt2(match, 0), 16);
        }
        return match;
      };
      if ($stringify) {
        $88({ target: "JSON", stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
          stringify: function stringify(it, replacer, space) {
            var args = arraySlice2(arguments);
            var result = apply4(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
            return ILL_FORMED_UNICODE && typeof result == "string" ? replace2(result, tester, fixIllFormed) : result;
          }
        });
      }
    }
  });

  // node_modules/core-js/modules/es.object.get-own-property-symbols.js
  var require_es_object_get_own_property_symbols = __commonJS({
    "node_modules/core-js/modules/es.object.get-own-property-symbols.js": function() {
      var $88 = require_export();
      var NATIVE_SYMBOL = require_symbol_constructor_detection();
      var fails17 = require_fails();
      var getOwnPropertySymbolsModule = require_object_get_own_property_symbols();
      var toObject6 = require_to_object();
      var FORCED9 = !NATIVE_SYMBOL || fails17(function() {
        getOwnPropertySymbolsModule.f(1);
      });
      $88({ target: "Object", stat: true, forced: FORCED9 }, {
        getOwnPropertySymbols: function getOwnPropertySymbols(it) {
          var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
          return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject6(it)) : [];
        }
      });
    }
  });

  // node_modules/core-js/internals/function-uncurry-this-accessor.js
  var require_function_uncurry_this_accessor = __commonJS({
    "node_modules/core-js/internals/function-uncurry-this-accessor.js": function(exports, module) {
      var uncurryThis15 = require_function_uncurry_this();
      var aCallable2 = require_a_callable();
      module.exports = function(object, key, method) {
        try {
          return uncurryThis15(aCallable2(Object.getOwnPropertyDescriptor(object, key)[method]));
        } catch (error) {
        }
      };
    }
  });

  // node_modules/core-js/internals/a-possible-prototype.js
  var require_a_possible_prototype = __commonJS({
    "node_modules/core-js/internals/a-possible-prototype.js": function(exports, module) {
      var isCallable5 = require_is_callable();
      var $String = String;
      var $TypeError2 = TypeError;
      module.exports = function(argument) {
        if (typeof argument == "object" || isCallable5(argument))
          return argument;
        throw $TypeError2("Can't set " + $String(argument) + " as a prototype");
      };
    }
  });

  // node_modules/core-js/internals/object-set-prototype-of.js
  var require_object_set_prototype_of = __commonJS({
    "node_modules/core-js/internals/object-set-prototype-of.js": function(exports, module) {
      var uncurryThisAccessor = require_function_uncurry_this_accessor();
      var anObject10 = require_an_object();
      var aPossiblePrototype = require_a_possible_prototype();
      module.exports = Object.setPrototypeOf || ("__proto__" in {} ? function() {
        var CORRECT_SETTER = false;
        var test2 = {};
        var setter;
        try {
          setter = uncurryThisAccessor(Object.prototype, "__proto__", "set");
          setter(test2, []);
          CORRECT_SETTER = test2 instanceof Array;
        } catch (error) {
        }
        return function setPrototypeOf2(O, proto) {
          anObject10(O);
          aPossiblePrototype(proto);
          if (CORRECT_SETTER)
            setter(O, proto);
          else
            O.__proto__ = proto;
          return O;
        };
      }() : void 0);
    }
  });

  // node_modules/core-js/internals/inherit-if-required.js
  var require_inherit_if_required = __commonJS({
    "node_modules/core-js/internals/inherit-if-required.js": function(exports, module) {
      var isCallable5 = require_is_callable();
      var isObject6 = require_is_object();
      var setPrototypeOf2 = require_object_set_prototype_of();
      module.exports = function($this, dummy, Wrapper) {
        var NewTarget, NewTargetPrototype;
        if (setPrototypeOf2 && isCallable5(NewTarget = dummy.constructor) && NewTarget !== Wrapper && isObject6(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype)
          setPrototypeOf2($this, NewTargetPrototype);
        return $this;
      };
    }
  });

  // node_modules/core-js/internals/this-number-value.js
  var require_this_number_value = __commonJS({
    "node_modules/core-js/internals/this-number-value.js": function(exports, module) {
      var uncurryThis15 = require_function_uncurry_this();
      module.exports = uncurryThis15(1 .valueOf);
    }
  });

  // node_modules/core-js/internals/engine-is-node.js
  var require_engine_is_node = __commonJS({
    "node_modules/core-js/internals/engine-is-node.js": function(exports, module) {
      var classof2 = require_classof_raw();
      module.exports = typeof process != "undefined" && classof2(process) == "process";
    }
  });

  // node_modules/core-js/internals/set-species.js
  var require_set_species = __commonJS({
    "node_modules/core-js/internals/set-species.js": function(exports, module) {
      "use strict";
      var getBuiltIn4 = require_get_built_in();
      var defineBuiltInAccessor4 = require_define_built_in_accessor();
      var wellKnownSymbol7 = require_well_known_symbol();
      var DESCRIPTORS10 = require_descriptors();
      var SPECIES2 = wellKnownSymbol7("species");
      module.exports = function(CONSTRUCTOR_NAME) {
        var Constructor = getBuiltIn4(CONSTRUCTOR_NAME);
        if (DESCRIPTORS10 && Constructor && !Constructor[SPECIES2]) {
          defineBuiltInAccessor4(Constructor, SPECIES2, {
            configurable: true,
            get: function() {
              return this;
            }
          });
        }
      };
    }
  });

  // node_modules/core-js/internals/an-instance.js
  var require_an_instance = __commonJS({
    "node_modules/core-js/internals/an-instance.js": function(exports, module) {
      var isPrototypeOf4 = require_object_is_prototype_of();
      var $TypeError2 = TypeError;
      module.exports = function(it, Prototype) {
        if (isPrototypeOf4(Prototype, it))
          return it;
        throw $TypeError2("Incorrect invocation");
      };
    }
  });

  // node_modules/core-js/internals/validate-arguments-length.js
  var require_validate_arguments_length = __commonJS({
    "node_modules/core-js/internals/validate-arguments-length.js": function(exports, module) {
      var $TypeError2 = TypeError;
      module.exports = function(passed, required) {
        if (passed < required)
          throw $TypeError2("Not enough arguments");
        return passed;
      };
    }
  });

  // node_modules/core-js/internals/engine-is-ios.js
  var require_engine_is_ios = __commonJS({
    "node_modules/core-js/internals/engine-is-ios.js": function(exports, module) {
      var userAgent2 = require_engine_user_agent();
      module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent2);
    }
  });

  // node_modules/core-js/internals/task.js
  var require_task = __commonJS({
    "node_modules/core-js/internals/task.js": function(exports, module) {
      var global11 = require_global();
      var apply4 = require_function_apply();
      var bind2 = require_function_bind_context();
      var isCallable5 = require_is_callable();
      var hasOwn5 = require_has_own_property();
      var fails17 = require_fails();
      var html = require_html();
      var arraySlice2 = require_array_slice();
      var createElement = require_document_create_element();
      var validateArgumentsLength = require_validate_arguments_length();
      var IS_IOS = require_engine_is_ios();
      var IS_NODE2 = require_engine_is_node();
      var set = global11.setImmediate;
      var clear = global11.clearImmediate;
      var process2 = global11.process;
      var Dispatch = global11.Dispatch;
      var Function2 = global11.Function;
      var MessageChannel = global11.MessageChannel;
      var String2 = global11.String;
      var counter = 0;
      var queue = {};
      var ONREADYSTATECHANGE = "onreadystatechange";
      var $location;
      var defer;
      var channel;
      var port;
      fails17(function() {
        $location = global11.location;
      });
      var run = function(id) {
        if (hasOwn5(queue, id)) {
          var fn = queue[id];
          delete queue[id];
          fn();
        }
      };
      var runner = function(id) {
        return function() {
          run(id);
        };
      };
      var eventListener = function(event) {
        run(event.data);
      };
      var globalPostMessageDefer = function(id) {
        global11.postMessage(String2(id), $location.protocol + "//" + $location.host);
      };
      if (!set || !clear) {
        set = function setImmediate(handler) {
          validateArgumentsLength(arguments.length, 1);
          var fn = isCallable5(handler) ? handler : Function2(handler);
          var args = arraySlice2(arguments, 1);
          queue[++counter] = function() {
            apply4(fn, void 0, args);
          };
          defer(counter);
          return counter;
        };
        clear = function clearImmediate(id) {
          delete queue[id];
        };
        if (IS_NODE2) {
          defer = function(id) {
            process2.nextTick(runner(id));
          };
        } else if (Dispatch && Dispatch.now) {
          defer = function(id) {
            Dispatch.now(runner(id));
          };
        } else if (MessageChannel && !IS_IOS) {
          channel = new MessageChannel();
          port = channel.port2;
          channel.port1.onmessage = eventListener;
          defer = bind2(port.postMessage, port);
        } else if (global11.addEventListener && isCallable5(global11.postMessage) && !global11.importScripts && $location && $location.protocol !== "file:" && !fails17(globalPostMessageDefer)) {
          defer = globalPostMessageDefer;
          global11.addEventListener("message", eventListener, false);
        } else if (ONREADYSTATECHANGE in createElement("script")) {
          defer = function(id) {
            html.appendChild(createElement("script"))[ONREADYSTATECHANGE] = function() {
              html.removeChild(this);
              run(id);
            };
          };
        } else {
          defer = function(id) {
            setTimeout(runner(id), 0);
          };
        }
      }
      module.exports = {
        set: set,
        clear: clear
      };
    }
  });

  // node_modules/core-js/internals/queue.js
  var require_queue = __commonJS({
    "node_modules/core-js/internals/queue.js": function(exports, module) {
      var Queue = function() {
        this.head = null;
        this.tail = null;
      };
      Queue.prototype = {
        add: function(item) {
          var entry = { item: item, next: null };
          var tail = this.tail;
          if (tail)
            tail.next = entry;
          else
            this.head = entry;
          this.tail = entry;
        },
        get: function() {
          var entry = this.head;
          if (entry) {
            var next2 = this.head = entry.next;
            if (next2 === null)
              this.tail = null;
            return entry.item;
          }
        }
      };
      module.exports = Queue;
    }
  });

  // node_modules/core-js/internals/engine-is-ios-pebble.js
  var require_engine_is_ios_pebble = __commonJS({
    "node_modules/core-js/internals/engine-is-ios-pebble.js": function(exports, module) {
      var userAgent2 = require_engine_user_agent();
      module.exports = /ipad|iphone|ipod/i.test(userAgent2) && typeof Pebble != "undefined";
    }
  });

  // node_modules/core-js/internals/engine-is-webos-webkit.js
  var require_engine_is_webos_webkit = __commonJS({
    "node_modules/core-js/internals/engine-is-webos-webkit.js": function(exports, module) {
      var userAgent2 = require_engine_user_agent();
      module.exports = /web0s(?!.*chrome)/i.test(userAgent2);
    }
  });

  // node_modules/core-js/internals/microtask.js
  var require_microtask = __commonJS({
    "node_modules/core-js/internals/microtask.js": function(exports, module) {
      var global11 = require_global();
      var bind2 = require_function_bind_context();
      var getOwnPropertyDescriptor5 = require_object_get_own_property_descriptor().f;
      var macrotask = require_task().set;
      var Queue = require_queue();
      var IS_IOS = require_engine_is_ios();
      var IS_IOS_PEBBLE = require_engine_is_ios_pebble();
      var IS_WEBOS_WEBKIT = require_engine_is_webos_webkit();
      var IS_NODE2 = require_engine_is_node();
      var MutationObserver2 = global11.MutationObserver || global11.WebKitMutationObserver;
      var document2 = global11.document;
      var process2 = global11.process;
      var Promise2 = global11.Promise;
      var queueMicrotaskDescriptor = getOwnPropertyDescriptor5(global11, "queueMicrotask");
      var microtask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
      var notify;
      var toggle;
      var node;
      var promise;
      var then;
      if (!microtask) {
        queue = new Queue();
        flush = function() {
          var parent, fn;
          if (IS_NODE2 && (parent = process2.domain))
            parent.exit();
          while (fn = queue.get())
            try {
              fn();
            } catch (error) {
              if (queue.head)
                notify();
              throw error;
            }
          if (parent)
            parent.enter();
        };
        if (!IS_IOS && !IS_NODE2 && !IS_WEBOS_WEBKIT && MutationObserver2 && document2) {
          toggle = true;
          node = document2.createTextNode("");
          new MutationObserver2(flush).observe(node, { characterData: true });
          notify = function() {
            node.data = toggle = !toggle;
          };
        } else if (!IS_IOS_PEBBLE && Promise2 && Promise2.resolve) {
          promise = Promise2.resolve(void 0);
          promise.constructor = Promise2;
          then = bind2(promise.then, promise);
          notify = function() {
            then(flush);
          };
        } else if (IS_NODE2) {
          notify = function() {
            process2.nextTick(flush);
          };
        } else {
          macrotask = bind2(macrotask, global11);
          notify = function() {
            macrotask(flush);
          };
        }
        microtask = function(fn) {
          if (!queue.head)
            notify();
          queue.add(fn);
        };
      }
      var queue;
      var flush;
      module.exports = microtask;
    }
  });

  // node_modules/core-js/internals/host-report-errors.js
  var require_host_report_errors = __commonJS({
    "node_modules/core-js/internals/host-report-errors.js": function(exports, module) {
      module.exports = function(a3, b3) {
        try {
          arguments.length == 1 ? console.error(a3) : console.error(a3, b3);
        } catch (error) {
        }
      };
    }
  });

  // node_modules/core-js/internals/perform.js
  var require_perform = __commonJS({
    "node_modules/core-js/internals/perform.js": function(exports, module) {
      module.exports = function(exec3) {
        try {
          return { error: false, value: exec3() };
        } catch (error) {
          return { error: true, value: error };
        }
      };
    }
  });

  // node_modules/core-js/internals/promise-native-constructor.js
  var require_promise_native_constructor = __commonJS({
    "node_modules/core-js/internals/promise-native-constructor.js": function(exports, module) {
      var global11 = require_global();
      module.exports = global11.Promise;
    }
  });

  // node_modules/core-js/internals/engine-is-deno.js
  var require_engine_is_deno = __commonJS({
    "node_modules/core-js/internals/engine-is-deno.js": function(exports, module) {
      module.exports = typeof Deno == "object" && Deno && typeof Deno.version == "object";
    }
  });

  // node_modules/core-js/internals/engine-is-browser.js
  var require_engine_is_browser = __commonJS({
    "node_modules/core-js/internals/engine-is-browser.js": function(exports, module) {
      var IS_DENO = require_engine_is_deno();
      var IS_NODE2 = require_engine_is_node();
      module.exports = !IS_DENO && !IS_NODE2 && typeof window == "object" && typeof document == "object";
    }
  });

  // node_modules/core-js/internals/promise-constructor-detection.js
  var require_promise_constructor_detection = __commonJS({
    "node_modules/core-js/internals/promise-constructor-detection.js": function(exports, module) {
      var global11 = require_global();
      var NativePromiseConstructor2 = require_promise_native_constructor();
      var isCallable5 = require_is_callable();
      var isForced3 = require_is_forced();
      var inspectSource = require_inspect_source();
      var wellKnownSymbol7 = require_well_known_symbol();
      var IS_BROWSER = require_engine_is_browser();
      var IS_DENO = require_engine_is_deno();
      var IS_PURE5 = require_is_pure();
      var V8_VERSION2 = require_engine_v8_version();
      var NativePromisePrototype2 = NativePromiseConstructor2 && NativePromiseConstructor2.prototype;
      var SPECIES2 = wellKnownSymbol7("species");
      var SUBCLASSING = false;
      var NATIVE_PROMISE_REJECTION_EVENT = isCallable5(global11.PromiseRejectionEvent);
      var FORCED_PROMISE_CONSTRUCTOR = isForced3("Promise", function() {
        var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor2);
        var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor2);
        if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION2 === 66)
          return true;
        if (IS_PURE5 && !(NativePromisePrototype2["catch"] && NativePromisePrototype2["finally"]))
          return true;
        if (!V8_VERSION2 || V8_VERSION2 < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
          var promise = new NativePromiseConstructor2(function(resolve) {
            resolve(1);
          });
          var FakePromise = function(exec3) {
            exec3(function() {
            }, function() {
            });
          };
          var constructor = promise.constructor = {};
          constructor[SPECIES2] = FakePromise;
          SUBCLASSING = promise.then(function() {
          }) instanceof FakePromise;
          if (!SUBCLASSING)
            return true;
        }
        return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT;
      });
      module.exports = {
        CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,
        REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,
        SUBCLASSING: SUBCLASSING
      };
    }
  });

  // node_modules/core-js/internals/new-promise-capability.js
  var require_new_promise_capability = __commonJS({
    "node_modules/core-js/internals/new-promise-capability.js": function(exports, module) {
      "use strict";
      var aCallable2 = require_a_callable();
      var $TypeError2 = TypeError;
      var PromiseCapability = function(C2) {
        var resolve, reject;
        this.promise = new C2(function($$resolve, $$reject) {
          if (resolve !== void 0 || reject !== void 0)
            throw $TypeError2("Bad Promise constructor");
          resolve = $$resolve;
          reject = $$reject;
        });
        this.resolve = aCallable2(resolve);
        this.reject = aCallable2(reject);
      };
      module.exports.f = function(C2) {
        return new PromiseCapability(C2);
      };
    }
  });

  // node_modules/core-js/modules/es.promise.constructor.js
  var require_es_promise_constructor = __commonJS({
    "node_modules/core-js/modules/es.promise.constructor.js": function() {
      "use strict";
      var $88 = require_export();
      var IS_PURE5 = require_is_pure();
      var IS_NODE2 = require_engine_is_node();
      var global11 = require_global();
      var call8 = require_function_call();
      var defineBuiltIn6 = require_define_built_in();
      var setPrototypeOf2 = require_object_set_prototype_of();
      var setToStringTag5 = require_set_to_string_tag();
      var setSpecies3 = require_set_species();
      var aCallable2 = require_a_callable();
      var isCallable5 = require_is_callable();
      var isObject6 = require_is_object();
      var anInstance = require_an_instance();
      var speciesConstructor4 = require_species_constructor();
      var task = require_task().set;
      var microtask = require_microtask();
      var hostReportErrors = require_host_report_errors();
      var perform2 = require_perform();
      var Queue = require_queue();
      var InternalStateModule2 = require_internal_state();
      var NativePromiseConstructor2 = require_promise_native_constructor();
      var PromiseConstructorDetection = require_promise_constructor_detection();
      var newPromiseCapabilityModule2 = require_new_promise_capability();
      var PROMISE = "Promise";
      var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;
      var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
      var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
      var getInternalPromiseState = InternalStateModule2.getterFor(PROMISE);
      var setInternalState2 = InternalStateModule2.set;
      var NativePromisePrototype2 = NativePromiseConstructor2 && NativePromiseConstructor2.prototype;
      var PromiseConstructor = NativePromiseConstructor2;
      var PromisePrototype = NativePromisePrototype2;
      var TypeError3 = global11.TypeError;
      var document2 = global11.document;
      var process2 = global11.process;
      var newPromiseCapability = newPromiseCapabilityModule2.f;
      var newGenericPromiseCapability = newPromiseCapability;
      var DISPATCH_EVENT = !!(document2 && document2.createEvent && global11.dispatchEvent);
      var UNHANDLED_REJECTION = "unhandledrejection";
      var REJECTION_HANDLED = "rejectionhandled";
      var PENDING = 0;
      var FULFILLED = 1;
      var REJECTED = 2;
      var HANDLED = 1;
      var UNHANDLED = 2;
      var Internal;
      var OwnPromiseCapability;
      var PromiseWrapper;
      var nativeThen;
      var isThenable = function(it) {
        var then;
        return isObject6(it) && isCallable5(then = it.then) ? then : false;
      };
      var callReaction = function(reaction, state) {
        var value = state.value;
        var ok = state.state == FULFILLED;
        var handler = ok ? reaction.ok : reaction.fail;
        var resolve = reaction.resolve;
        var reject = reaction.reject;
        var domain = reaction.domain;
        var result, then, exited;
        try {
          if (handler) {
            if (!ok) {
              if (state.rejection === UNHANDLED)
                onHandleUnhandled(state);
              state.rejection = HANDLED;
            }
            if (handler === true)
              result = value;
            else {
              if (domain)
                domain.enter();
              result = handler(value);
              if (domain) {
                domain.exit();
                exited = true;
              }
            }
            if (result === reaction.promise) {
              reject(TypeError3("Promise-chain cycle"));
            } else if (then = isThenable(result)) {
              call8(then, result, resolve, reject);
            } else
              resolve(result);
          } else
            reject(value);
        } catch (error) {
          if (domain && !exited)
            domain.exit();
          reject(error);
        }
      };
      var notify = function(state, isReject) {
        if (state.notified)
          return;
        state.notified = true;
        microtask(function() {
          var reactions = state.reactions;
          var reaction;
          while (reaction = reactions.get()) {
            callReaction(reaction, state);
          }
          state.notified = false;
          if (isReject && !state.rejection)
            onUnhandled(state);
        });
      };
      var dispatchEvent = function(name, promise, reason) {
        var event, handler;
        if (DISPATCH_EVENT) {
          event = document2.createEvent("Event");
          event.promise = promise;
          event.reason = reason;
          event.initEvent(name, false, true);
          global11.dispatchEvent(event);
        } else
          event = { promise: promise, reason: reason };
        if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global11["on" + name]))
          handler(event);
        else if (name === UNHANDLED_REJECTION)
          hostReportErrors("Unhandled promise rejection", reason);
      };
      var onUnhandled = function(state) {
        call8(task, global11, function() {
          var promise = state.facade;
          var value = state.value;
          var IS_UNHANDLED = isUnhandled(state);
          var result;
          if (IS_UNHANDLED) {
            result = perform2(function() {
              if (IS_NODE2) {
                process2.emit("unhandledRejection", value, promise);
              } else
                dispatchEvent(UNHANDLED_REJECTION, promise, value);
            });
            state.rejection = IS_NODE2 || isUnhandled(state) ? UNHANDLED : HANDLED;
            if (result.error)
              throw result.value;
          }
        });
      };
      var isUnhandled = function(state) {
        return state.rejection !== HANDLED && !state.parent;
      };
      var onHandleUnhandled = function(state) {
        call8(task, global11, function() {
          var promise = state.facade;
          if (IS_NODE2) {
            process2.emit("rejectionHandled", promise);
          } else
            dispatchEvent(REJECTION_HANDLED, promise, state.value);
        });
      };
      var bind2 = function(fn, state, unwrap) {
        return function(value) {
          fn(state, value, unwrap);
        };
      };
      var internalReject = function(state, value, unwrap) {
        if (state.done)
          return;
        state.done = true;
        if (unwrap)
          state = unwrap;
        state.value = value;
        state.state = REJECTED;
        notify(state, true);
      };
      var internalResolve = function(state, value, unwrap) {
        if (state.done)
          return;
        state.done = true;
        if (unwrap)
          state = unwrap;
        try {
          if (state.facade === value)
            throw TypeError3("Promise can't be resolved itself");
          var then = isThenable(value);
          if (then) {
            microtask(function() {
              var wrapper = { done: false };
              try {
                call8(
                  then,
                  value,
                  bind2(internalResolve, wrapper, state),
                  bind2(internalReject, wrapper, state)
                );
              } catch (error) {
                internalReject(wrapper, error, state);
              }
            });
          } else {
            state.value = value;
            state.state = FULFILLED;
            notify(state, false);
          }
        } catch (error) {
          internalReject({ done: false }, error, state);
        }
      };
      if (FORCED_PROMISE_CONSTRUCTOR) {
        PromiseConstructor = function Promise2(executor) {
          anInstance(this, PromisePrototype);
          aCallable2(executor);
          call8(Internal, this);
          var state = getInternalPromiseState(this);
          try {
            executor(bind2(internalResolve, state), bind2(internalReject, state));
          } catch (error) {
            internalReject(state, error);
          }
        };
        PromisePrototype = PromiseConstructor.prototype;
        Internal = function Promise2(executor) {
          setInternalState2(this, {
            type: PROMISE,
            done: false,
            notified: false,
            parent: false,
            reactions: new Queue(),
            rejection: false,
            state: PENDING,
            value: void 0
          });
        };
        Internal.prototype = defineBuiltIn6(PromisePrototype, "then", function then(onFulfilled, onRejected) {
          var state = getInternalPromiseState(this);
          var reaction = newPromiseCapability(speciesConstructor4(this, PromiseConstructor));
          state.parent = true;
          reaction.ok = isCallable5(onFulfilled) ? onFulfilled : true;
          reaction.fail = isCallable5(onRejected) && onRejected;
          reaction.domain = IS_NODE2 ? process2.domain : void 0;
          if (state.state == PENDING)
            state.reactions.add(reaction);
          else
            microtask(function() {
              callReaction(reaction, state);
            });
          return reaction.promise;
        });
        OwnPromiseCapability = function() {
          var promise = new Internal();
          var state = getInternalPromiseState(promise);
          this.promise = promise;
          this.resolve = bind2(internalResolve, state);
          this.reject = bind2(internalReject, state);
        };
        newPromiseCapabilityModule2.f = newPromiseCapability = function(C2) {
          return C2 === PromiseConstructor || C2 === PromiseWrapper ? new OwnPromiseCapability(C2) : newGenericPromiseCapability(C2);
        };
        if (!IS_PURE5 && isCallable5(NativePromiseConstructor2) && NativePromisePrototype2 !== Object.prototype) {
          nativeThen = NativePromisePrototype2.then;
          if (!NATIVE_PROMISE_SUBCLASSING) {
            defineBuiltIn6(NativePromisePrototype2, "then", function then(onFulfilled, onRejected) {
              var that = this;
              return new PromiseConstructor(function(resolve, reject) {
                call8(nativeThen, that, resolve, reject);
              }).then(onFulfilled, onRejected);
            }, { unsafe: true });
          }
          try {
            delete NativePromisePrototype2.constructor;
          } catch (error) {
          }
          if (setPrototypeOf2) {
            setPrototypeOf2(NativePromisePrototype2, PromisePrototype);
          }
        }
      }
      $88({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
        Promise: PromiseConstructor
      });
      setToStringTag5(PromiseConstructor, PROMISE, false, true);
      setSpecies3(PROMISE);
    }
  });

  // node_modules/core-js/internals/iterators.js
  var require_iterators = __commonJS({
    "node_modules/core-js/internals/iterators.js": function(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/core-js/internals/is-array-iterator-method.js
  var require_is_array_iterator_method = __commonJS({
    "node_modules/core-js/internals/is-array-iterator-method.js": function(exports, module) {
      var wellKnownSymbol7 = require_well_known_symbol();
      var Iterators = require_iterators();
      var ITERATOR2 = wellKnownSymbol7("iterator");
      var ArrayPrototype = Array.prototype;
      module.exports = function(it) {
        return it !== void 0 && (Iterators.Array === it || ArrayPrototype[ITERATOR2] === it);
      };
    }
  });

  // node_modules/core-js/internals/get-iterator-method.js
  var require_get_iterator_method = __commonJS({
    "node_modules/core-js/internals/get-iterator-method.js": function(exports, module) {
      var classof2 = require_classof();
      var getMethod5 = require_get_method();
      var isNullOrUndefined5 = require_is_null_or_undefined();
      var Iterators = require_iterators();
      var wellKnownSymbol7 = require_well_known_symbol();
      var ITERATOR2 = wellKnownSymbol7("iterator");
      module.exports = function(it) {
        if (!isNullOrUndefined5(it))
          return getMethod5(it, ITERATOR2) || getMethod5(it, "@@iterator") || Iterators[classof2(it)];
      };
    }
  });

  // node_modules/core-js/internals/get-iterator.js
  var require_get_iterator = __commonJS({
    "node_modules/core-js/internals/get-iterator.js": function(exports, module) {
      var call8 = require_function_call();
      var aCallable2 = require_a_callable();
      var anObject10 = require_an_object();
      var tryToString = require_try_to_string();
      var getIteratorMethod = require_get_iterator_method();
      var $TypeError2 = TypeError;
      module.exports = function(argument, usingIterator) {
        var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
        if (aCallable2(iteratorMethod))
          return anObject10(call8(iteratorMethod, argument));
        throw $TypeError2(tryToString(argument) + " is not iterable");
      };
    }
  });

  // node_modules/core-js/internals/iterator-close.js
  var require_iterator_close = __commonJS({
    "node_modules/core-js/internals/iterator-close.js": function(exports, module) {
      var call8 = require_function_call();
      var anObject10 = require_an_object();
      var getMethod5 = require_get_method();
      module.exports = function(iterator, kind, value) {
        var innerResult, innerError;
        anObject10(iterator);
        try {
          innerResult = getMethod5(iterator, "return");
          if (!innerResult) {
            if (kind === "throw")
              throw value;
            return value;
          }
          innerResult = call8(innerResult, iterator);
        } catch (error) {
          innerError = true;
          innerResult = error;
        }
        if (kind === "throw")
          throw value;
        if (innerError)
          throw innerResult;
        anObject10(innerResult);
        return value;
      };
    }
  });

  // node_modules/core-js/internals/iterate.js
  var require_iterate = __commonJS({
    "node_modules/core-js/internals/iterate.js": function(exports, module) {
      var bind2 = require_function_bind_context();
      var call8 = require_function_call();
      var anObject10 = require_an_object();
      var tryToString = require_try_to_string();
      var isArrayIteratorMethod = require_is_array_iterator_method();
      var lengthOfArrayLike5 = require_length_of_array_like();
      var isPrototypeOf4 = require_object_is_prototype_of();
      var getIterator = require_get_iterator();
      var getIteratorMethod = require_get_iterator_method();
      var iteratorClose = require_iterator_close();
      var $TypeError2 = TypeError;
      var Result = function(stopped, result) {
        this.stopped = stopped;
        this.result = result;
      };
      var ResultPrototype = Result.prototype;
      module.exports = function(iterable, unboundFunction, options) {
        var that = options && options.that;
        var AS_ENTRIES = !!(options && options.AS_ENTRIES);
        var IS_RECORD = !!(options && options.IS_RECORD);
        var IS_ITERATOR = !!(options && options.IS_ITERATOR);
        var INTERRUPTED = !!(options && options.INTERRUPTED);
        var fn = bind2(unboundFunction, that);
        var iterator, iterFn, index, length, result, next2, step;
        var stop = function(condition) {
          if (iterator)
            iteratorClose(iterator, "normal", condition);
          return new Result(true, condition);
        };
        var callFn = function(value) {
          if (AS_ENTRIES) {
            anObject10(value);
            return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
          }
          return INTERRUPTED ? fn(value, stop) : fn(value);
        };
        if (IS_RECORD) {
          iterator = iterable.iterator;
        } else if (IS_ITERATOR) {
          iterator = iterable;
        } else {
          iterFn = getIteratorMethod(iterable);
          if (!iterFn)
            throw $TypeError2(tryToString(iterable) + " is not iterable");
          if (isArrayIteratorMethod(iterFn)) {
            for (index = 0, length = lengthOfArrayLike5(iterable); length > index; index++) {
              result = callFn(iterable[index]);
              if (result && isPrototypeOf4(ResultPrototype, result))
                return result;
            }
            return new Result(false);
          }
          iterator = getIterator(iterable, iterFn);
        }
        next2 = IS_RECORD ? iterable.next : iterator.next;
        while (!(step = call8(next2, iterator)).done) {
          try {
            result = callFn(step.value);
          } catch (error) {
            iteratorClose(iterator, "throw", error);
          }
          if (typeof result == "object" && result && isPrototypeOf4(ResultPrototype, result))
            return result;
        }
        return new Result(false);
      };
    }
  });

  // node_modules/core-js/internals/check-correctness-of-iteration.js
  var require_check_correctness_of_iteration = __commonJS({
    "node_modules/core-js/internals/check-correctness-of-iteration.js": function(exports, module) {
      var wellKnownSymbol7 = require_well_known_symbol();
      var ITERATOR2 = wellKnownSymbol7("iterator");
      var SAFE_CLOSING = false;
      try {
        called = 0;
        iteratorWithReturn = {
          next: function() {
            return { done: !!called++ };
          },
          "return": function() {
            SAFE_CLOSING = true;
          }
        };
        iteratorWithReturn[ITERATOR2] = function() {
          return this;
        };
        Array.from(iteratorWithReturn, function() {
          throw 2;
        });
      } catch (error) {
      }
      var called;
      var iteratorWithReturn;
      module.exports = function(exec3, SKIP_CLOSING) {
        if (!SKIP_CLOSING && !SAFE_CLOSING)
          return false;
        var ITERATION_SUPPORT = false;
        try {
          var object = {};
          object[ITERATOR2] = function() {
            return {
              next: function() {
                return { done: ITERATION_SUPPORT = true };
              }
            };
          };
          exec3(object);
        } catch (error) {
        }
        return ITERATION_SUPPORT;
      };
    }
  });

  // node_modules/core-js/internals/promise-statics-incorrect-iteration.js
  var require_promise_statics_incorrect_iteration = __commonJS({
    "node_modules/core-js/internals/promise-statics-incorrect-iteration.js": function(exports, module) {
      var NativePromiseConstructor2 = require_promise_native_constructor();
      var checkCorrectnessOfIteration2 = require_check_correctness_of_iteration();
      var FORCED_PROMISE_CONSTRUCTOR = require_promise_constructor_detection().CONSTRUCTOR;
      module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration2(function(iterable) {
        NativePromiseConstructor2.all(iterable).then(void 0, function() {
        });
      });
    }
  });

  // node_modules/core-js/modules/es.promise.all.js
  var require_es_promise_all = __commonJS({
    "node_modules/core-js/modules/es.promise.all.js": function() {
      "use strict";
      var $88 = require_export();
      var call8 = require_function_call();
      var aCallable2 = require_a_callable();
      var newPromiseCapabilityModule2 = require_new_promise_capability();
      var perform2 = require_perform();
      var iterate2 = require_iterate();
      var PROMISE_STATICS_INCORRECT_ITERATION2 = require_promise_statics_incorrect_iteration();
      $88({ target: "Promise", stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION2 }, {
        all: function all(iterable) {
          var C2 = this;
          var capability = newPromiseCapabilityModule2.f(C2);
          var resolve = capability.resolve;
          var reject = capability.reject;
          var result = perform2(function() {
            var $promiseResolve = aCallable2(C2.resolve);
            var values2 = [];
            var counter = 0;
            var remaining = 1;
            iterate2(iterable, function(promise) {
              var index = counter++;
              var alreadyCalled = false;
              remaining++;
              call8($promiseResolve, C2, promise).then(function(value) {
                if (alreadyCalled)
                  return;
                alreadyCalled = true;
                values2[index] = value;
                --remaining || resolve(values2);
              }, reject);
            });
            --remaining || resolve(values2);
          });
          if (result.error)
            reject(result.value);
          return capability.promise;
        }
      });
    }
  });

  // node_modules/core-js/modules/es.promise.catch.js
  var require_es_promise_catch = __commonJS({
    "node_modules/core-js/modules/es.promise.catch.js": function() {
      "use strict";
      var $88 = require_export();
      var IS_PURE5 = require_is_pure();
      var FORCED_PROMISE_CONSTRUCTOR = require_promise_constructor_detection().CONSTRUCTOR;
      var NativePromiseConstructor2 = require_promise_native_constructor();
      var getBuiltIn4 = require_get_built_in();
      var isCallable5 = require_is_callable();
      var defineBuiltIn6 = require_define_built_in();
      var NativePromisePrototype2 = NativePromiseConstructor2 && NativePromiseConstructor2.prototype;
      $88({ target: "Promise", proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {
        "catch": function(onRejected) {
          return this.then(void 0, onRejected);
        }
      });
      if (!IS_PURE5 && isCallable5(NativePromiseConstructor2)) {
        method = getBuiltIn4("Promise").prototype["catch"];
        if (NativePromisePrototype2["catch"] !== method) {
          defineBuiltIn6(NativePromisePrototype2, "catch", method, { unsafe: true });
        }
      }
      var method;
    }
  });

  // node_modules/core-js/modules/es.promise.race.js
  var require_es_promise_race = __commonJS({
    "node_modules/core-js/modules/es.promise.race.js": function() {
      "use strict";
      var $88 = require_export();
      var call8 = require_function_call();
      var aCallable2 = require_a_callable();
      var newPromiseCapabilityModule2 = require_new_promise_capability();
      var perform2 = require_perform();
      var iterate2 = require_iterate();
      var PROMISE_STATICS_INCORRECT_ITERATION2 = require_promise_statics_incorrect_iteration();
      $88({ target: "Promise", stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION2 }, {
        race: function race(iterable) {
          var C2 = this;
          var capability = newPromiseCapabilityModule2.f(C2);
          var reject = capability.reject;
          var result = perform2(function() {
            var $promiseResolve = aCallable2(C2.resolve);
            iterate2(iterable, function(promise) {
              call8($promiseResolve, C2, promise).then(capability.resolve, reject);
            });
          });
          if (result.error)
            reject(result.value);
          return capability.promise;
        }
      });
    }
  });

  // node_modules/core-js/modules/es.promise.reject.js
  var require_es_promise_reject = __commonJS({
    "node_modules/core-js/modules/es.promise.reject.js": function() {
      "use strict";
      var $88 = require_export();
      var call8 = require_function_call();
      var newPromiseCapabilityModule2 = require_new_promise_capability();
      var FORCED_PROMISE_CONSTRUCTOR = require_promise_constructor_detection().CONSTRUCTOR;
      $88({ target: "Promise", stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
        reject: function reject(r6) {
          var capability = newPromiseCapabilityModule2.f(this);
          call8(capability.reject, void 0, r6);
          return capability.promise;
        }
      });
    }
  });

  // node_modules/core-js/internals/promise-resolve.js
  var require_promise_resolve = __commonJS({
    "node_modules/core-js/internals/promise-resolve.js": function(exports, module) {
      var anObject10 = require_an_object();
      var isObject6 = require_is_object();
      var newPromiseCapability = require_new_promise_capability();
      module.exports = function(C2, x2) {
        anObject10(C2);
        if (isObject6(x2) && x2.constructor === C2)
          return x2;
        var promiseCapability = newPromiseCapability.f(C2);
        var resolve = promiseCapability.resolve;
        resolve(x2);
        return promiseCapability.promise;
      };
    }
  });

  // node_modules/core-js/modules/es.promise.resolve.js
  var require_es_promise_resolve = __commonJS({
    "node_modules/core-js/modules/es.promise.resolve.js": function() {
      "use strict";
      var $88 = require_export();
      var getBuiltIn4 = require_get_built_in();
      var IS_PURE5 = require_is_pure();
      var NativePromiseConstructor2 = require_promise_native_constructor();
      var FORCED_PROMISE_CONSTRUCTOR = require_promise_constructor_detection().CONSTRUCTOR;
      var promiseResolve2 = require_promise_resolve();
      var PromiseConstructorWrapper = getBuiltIn4("Promise");
      var CHECK_WRAPPER = IS_PURE5 && !FORCED_PROMISE_CONSTRUCTOR;
      $88({ target: "Promise", stat: true, forced: IS_PURE5 || FORCED_PROMISE_CONSTRUCTOR }, {
        resolve: function resolve(x2) {
          return promiseResolve2(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor2 : this, x2);
        }
      });
    }
  });

  // node_modules/core-js/internals/correct-prototype-getter.js
  var require_correct_prototype_getter = __commonJS({
    "node_modules/core-js/internals/correct-prototype-getter.js": function(exports, module) {
      var fails17 = require_fails();
      module.exports = !fails17(function() {
        function F() {
        }
        F.prototype.constructor = null;
        return Object.getPrototypeOf(new F()) !== F.prototype;
      });
    }
  });

  // node_modules/core-js/internals/object-get-prototype-of.js
  var require_object_get_prototype_of = __commonJS({
    "node_modules/core-js/internals/object-get-prototype-of.js": function(exports, module) {
      var hasOwn5 = require_has_own_property();
      var isCallable5 = require_is_callable();
      var toObject6 = require_to_object();
      var sharedKey = require_shared_key();
      var CORRECT_PROTOTYPE_GETTER2 = require_correct_prototype_getter();
      var IE_PROTO = sharedKey("IE_PROTO");
      var $Object = Object;
      var ObjectPrototype2 = $Object.prototype;
      module.exports = CORRECT_PROTOTYPE_GETTER2 ? $Object.getPrototypeOf : function(O) {
        var object = toObject6(O);
        if (hasOwn5(object, IE_PROTO))
          return object[IE_PROTO];
        var constructor = object.constructor;
        if (isCallable5(constructor) && object instanceof constructor) {
          return constructor.prototype;
        }
        return object instanceof $Object ? ObjectPrototype2 : null;
      };
    }
  });

  // node_modules/core-js/internals/iterators-core.js
  var require_iterators_core = __commonJS({
    "node_modules/core-js/internals/iterators-core.js": function(exports, module) {
      "use strict";
      var fails17 = require_fails();
      var isCallable5 = require_is_callable();
      var isObject6 = require_is_object();
      var create3 = require_object_create();
      var getPrototypeOf3 = require_object_get_prototype_of();
      var defineBuiltIn6 = require_define_built_in();
      var wellKnownSymbol7 = require_well_known_symbol();
      var IS_PURE5 = require_is_pure();
      var ITERATOR2 = wellKnownSymbol7("iterator");
      var BUGGY_SAFARI_ITERATORS = false;
      var IteratorPrototype;
      var PrototypeOfArrayIteratorPrototype;
      var arrayIterator;
      if ([].keys) {
        arrayIterator = [].keys();
        if (!("next" in arrayIterator))
          BUGGY_SAFARI_ITERATORS = true;
        else {
          PrototypeOfArrayIteratorPrototype = getPrototypeOf3(getPrototypeOf3(arrayIterator));
          if (PrototypeOfArrayIteratorPrototype !== Object.prototype)
            IteratorPrototype = PrototypeOfArrayIteratorPrototype;
        }
      }
      var NEW_ITERATOR_PROTOTYPE = !isObject6(IteratorPrototype) || fails17(function() {
        var test2 = {};
        return IteratorPrototype[ITERATOR2].call(test2) !== test2;
      });
      if (NEW_ITERATOR_PROTOTYPE)
        IteratorPrototype = {};
      else if (IS_PURE5)
        IteratorPrototype = create3(IteratorPrototype);
      if (!isCallable5(IteratorPrototype[ITERATOR2])) {
        defineBuiltIn6(IteratorPrototype, ITERATOR2, function() {
          return this;
        });
      }
      module.exports = {
        IteratorPrototype: IteratorPrototype,
        BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
      };
    }
  });

  // node_modules/core-js/internals/iterator-create-constructor.js
  var require_iterator_create_constructor = __commonJS({
    "node_modules/core-js/internals/iterator-create-constructor.js": function(exports, module) {
      "use strict";
      var IteratorPrototype = require_iterators_core().IteratorPrototype;
      var create3 = require_object_create();
      var createPropertyDescriptor = require_create_property_descriptor();
      var setToStringTag5 = require_set_to_string_tag();
      var Iterators = require_iterators();
      var returnThis = function() {
        return this;
      };
      module.exports = function(IteratorConstructor, NAME2, next2, ENUMERABLE_NEXT) {
        var TO_STRING_TAG2 = NAME2 + " Iterator";
        IteratorConstructor.prototype = create3(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next2) });
        setToStringTag5(IteratorConstructor, TO_STRING_TAG2, false, true);
        Iterators[TO_STRING_TAG2] = returnThis;
        return IteratorConstructor;
      };
    }
  });

  // node_modules/core-js/internals/iterator-define.js
  var require_iterator_define = __commonJS({
    "node_modules/core-js/internals/iterator-define.js": function(exports, module) {
      "use strict";
      var $88 = require_export();
      var call8 = require_function_call();
      var IS_PURE5 = require_is_pure();
      var FunctionName = require_function_name();
      var isCallable5 = require_is_callable();
      var createIteratorConstructor = require_iterator_create_constructor();
      var getPrototypeOf3 = require_object_get_prototype_of();
      var setPrototypeOf2 = require_object_set_prototype_of();
      var setToStringTag5 = require_set_to_string_tag();
      var createNonEnumerableProperty4 = require_create_non_enumerable_property();
      var defineBuiltIn6 = require_define_built_in();
      var wellKnownSymbol7 = require_well_known_symbol();
      var Iterators = require_iterators();
      var IteratorsCore = require_iterators_core();
      var PROPER_FUNCTION_NAME2 = FunctionName.PROPER;
      var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
      var IteratorPrototype = IteratorsCore.IteratorPrototype;
      var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
      var ITERATOR2 = wellKnownSymbol7("iterator");
      var KEYS = "keys";
      var VALUES = "values";
      var ENTRIES = "entries";
      var returnThis = function() {
        return this;
      };
      module.exports = function(Iterable, NAME2, IteratorConstructor, next2, DEFAULT, IS_SET, FORCED9) {
        createIteratorConstructor(IteratorConstructor, NAME2, next2);
        var getIterationMethod = function(KIND) {
          if (KIND === DEFAULT && defaultIterator)
            return defaultIterator;
          if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype)
            return IterablePrototype[KIND];
          switch (KIND) {
            case KEYS:
              return function keys2() {
                return new IteratorConstructor(this, KIND);
              };
            case VALUES:
              return function values2() {
                return new IteratorConstructor(this, KIND);
              };
            case ENTRIES:
              return function entries2() {
                return new IteratorConstructor(this, KIND);
              };
          }
          return function() {
            return new IteratorConstructor(this);
          };
        };
        var TO_STRING_TAG2 = NAME2 + " Iterator";
        var INCORRECT_VALUES_NAME = false;
        var IterablePrototype = Iterable.prototype;
        var nativeIterator = IterablePrototype[ITERATOR2] || IterablePrototype["@@iterator"] || DEFAULT && IterablePrototype[DEFAULT];
        var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
        var anyNativeIterator = NAME2 == "Array" ? IterablePrototype.entries || nativeIterator : nativeIterator;
        var CurrentIteratorPrototype, methods, KEY;
        if (anyNativeIterator) {
          CurrentIteratorPrototype = getPrototypeOf3(anyNativeIterator.call(new Iterable()));
          if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
            if (!IS_PURE5 && getPrototypeOf3(CurrentIteratorPrototype) !== IteratorPrototype) {
              if (setPrototypeOf2) {
                setPrototypeOf2(CurrentIteratorPrototype, IteratorPrototype);
              } else if (!isCallable5(CurrentIteratorPrototype[ITERATOR2])) {
                defineBuiltIn6(CurrentIteratorPrototype, ITERATOR2, returnThis);
              }
            }
            setToStringTag5(CurrentIteratorPrototype, TO_STRING_TAG2, true, true);
            if (IS_PURE5)
              Iterators[TO_STRING_TAG2] = returnThis;
          }
        }
        if (PROPER_FUNCTION_NAME2 && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
          if (!IS_PURE5 && CONFIGURABLE_FUNCTION_NAME) {
            createNonEnumerableProperty4(IterablePrototype, "name", VALUES);
          } else {
            INCORRECT_VALUES_NAME = true;
            defaultIterator = function values2() {
              return call8(nativeIterator, this);
            };
          }
        }
        if (DEFAULT) {
          methods = {
            values: getIterationMethod(VALUES),
            keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
            entries: getIterationMethod(ENTRIES)
          };
          if (FORCED9)
            for (KEY in methods) {
              if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
                defineBuiltIn6(IterablePrototype, KEY, methods[KEY]);
              }
            }
          else
            $88({ target: NAME2, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
        }
        if ((!IS_PURE5 || FORCED9) && IterablePrototype[ITERATOR2] !== defaultIterator) {
          defineBuiltIn6(IterablePrototype, ITERATOR2, defaultIterator, { name: DEFAULT });
        }
        Iterators[NAME2] = defaultIterator;
        return methods;
      };
    }
  });

  // node_modules/core-js/internals/create-iter-result-object.js
  var require_create_iter_result_object = __commonJS({
    "node_modules/core-js/internals/create-iter-result-object.js": function(exports, module) {
      module.exports = function(value, done) {
        return { value: value, done: done };
      };
    }
  });

  // node_modules/core-js/modules/es.array.iterator.js
  var require_es_array_iterator = __commonJS({
    "node_modules/core-js/modules/es.array.iterator.js": function(exports, module) {
      "use strict";
      var toIndexedObject5 = require_to_indexed_object();
      var addToUnscopables5 = require_add_to_unscopables();
      var Iterators = require_iterators();
      var InternalStateModule2 = require_internal_state();
      var defineProperty3 = require_object_define_property().f;
      var defineIterator2 = require_iterator_define();
      var createIterResultObject2 = require_create_iter_result_object();
      var IS_PURE5 = require_is_pure();
      var DESCRIPTORS10 = require_descriptors();
      var ARRAY_ITERATOR = "Array Iterator";
      var setInternalState2 = InternalStateModule2.set;
      var getInternalState3 = InternalStateModule2.getterFor(ARRAY_ITERATOR);
      module.exports = defineIterator2(Array, "Array", function(iterated, kind) {
        setInternalState2(this, {
          type: ARRAY_ITERATOR,
          target: toIndexedObject5(iterated),
          index: 0,
          kind: kind
        });
      }, function() {
        var state = getInternalState3(this);
        var target = state.target;
        var kind = state.kind;
        var index = state.index++;
        if (!target || index >= target.length) {
          state.target = void 0;
          return createIterResultObject2(void 0, true);
        }
        if (kind == "keys")
          return createIterResultObject2(index, false);
        if (kind == "values")
          return createIterResultObject2(target[index], false);
        return createIterResultObject2([index, target[index]], false);
      }, "values");
      var values2 = Iterators.Arguments = Iterators.Array;
      addToUnscopables5("keys");
      addToUnscopables5("values");
      addToUnscopables5("entries");
      if (!IS_PURE5 && DESCRIPTORS10 && values2.name !== "values")
        try {
          defineProperty3(values2, "name", { value: "values" });
        } catch (error) {
        }
    }
  });

  // node_modules/core-js/internals/dom-iterables.js
  var require_dom_iterables = __commonJS({
    "node_modules/core-js/internals/dom-iterables.js": function(exports, module) {
      module.exports = {
        CSSRuleList: 0,
        CSSStyleDeclaration: 0,
        CSSValueList: 0,
        ClientRectList: 0,
        DOMRectList: 0,
        DOMStringList: 0,
        DOMTokenList: 1,
        DataTransferItemList: 0,
        FileList: 0,
        HTMLAllCollection: 0,
        HTMLCollection: 0,
        HTMLFormElement: 0,
        HTMLSelectElement: 0,
        MediaList: 0,
        MimeTypeArray: 0,
        NamedNodeMap: 0,
        NodeList: 1,
        PaintRequestList: 0,
        Plugin: 0,
        PluginArray: 0,
        SVGLengthList: 0,
        SVGNumberList: 0,
        SVGPathSegList: 0,
        SVGPointList: 0,
        SVGStringList: 0,
        SVGTransformList: 0,
        SourceBufferList: 0,
        StyleSheetList: 0,
        TextTrackCueList: 0,
        TextTrackList: 0,
        TouchList: 0
      };
    }
  });

  // node_modules/core-js/internals/dom-token-list-prototype.js
  var require_dom_token_list_prototype = __commonJS({
    "node_modules/core-js/internals/dom-token-list-prototype.js": function(exports, module) {
      var documentCreateElement = require_document_create_element();
      var classList = documentCreateElement("span").classList;
      var DOMTokenListPrototype3 = classList && classList.constructor && classList.constructor.prototype;
      module.exports = DOMTokenListPrototype3 === Object.prototype ? void 0 : DOMTokenListPrototype3;
    }
  });

  // node_modules/core-js/internals/array-for-each.js
  var require_array_for_each = __commonJS({
    "node_modules/core-js/internals/array-for-each.js": function(exports, module) {
      "use strict";
      var $forEach = require_array_iteration().forEach;
      var arrayMethodIsStrict5 = require_array_method_is_strict();
      var STRICT_METHOD2 = arrayMethodIsStrict5("forEach");
      module.exports = !STRICT_METHOD2 ? function forEach3(callbackfn) {
        return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
      } : [].forEach;
    }
  });

  // node_modules/core-js/internals/regexp-get-flags.js
  var require_regexp_get_flags = __commonJS({
    "node_modules/core-js/internals/regexp-get-flags.js": function(exports, module) {
      var call8 = require_function_call();
      var hasOwn5 = require_has_own_property();
      var isPrototypeOf4 = require_object_is_prototype_of();
      var regExpFlags = require_regexp_flags();
      var RegExpPrototype4 = RegExp.prototype;
      module.exports = function(R2) {
        var flags = R2.flags;
        return flags === void 0 && !("flags" in RegExpPrototype4) && !hasOwn5(R2, "flags") && isPrototypeOf4(RegExpPrototype4, R2) ? call8(regExpFlags, R2) : flags;
      };
    }
  });

  // node_modules/core-js/internals/array-set-length.js
  var require_array_set_length = __commonJS({
    "node_modules/core-js/internals/array-set-length.js": function(exports, module) {
      "use strict";
      var DESCRIPTORS10 = require_descriptors();
      var isArray4 = require_is_array();
      var $TypeError2 = TypeError;
      var getOwnPropertyDescriptor5 = Object.getOwnPropertyDescriptor;
      var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS10 && !function() {
        if (this !== void 0)
          return true;
        try {
          Object.defineProperty([], "length", { writable: false }).length = 1;
        } catch (error) {
          return error instanceof TypeError;
        }
      }();
      module.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function(O, length) {
        if (isArray4(O) && !getOwnPropertyDescriptor5(O, "length").writable) {
          throw $TypeError2("Cannot set read only .length");
        }
        return O.length = length;
      } : function(O, length) {
        return O.length = length;
      };
    }
  });

  // node_modules/core-js/internals/delete-property-or-throw.js
  var require_delete_property_or_throw = __commonJS({
    "node_modules/core-js/internals/delete-property-or-throw.js": function(exports, module) {
      "use strict";
      var tryToString = require_try_to_string();
      var $TypeError2 = TypeError;
      module.exports = function(O, P3) {
        if (!delete O[P3])
          throw $TypeError2("Cannot delete property " + tryToString(P3) + " of " + tryToString(O));
      };
    }
  });

  // node_modules/core-js/internals/function-bind.js
  var require_function_bind = __commonJS({
    "node_modules/core-js/internals/function-bind.js": function(exports, module) {
      "use strict";
      var uncurryThis15 = require_function_uncurry_this();
      var aCallable2 = require_a_callable();
      var isObject6 = require_is_object();
      var hasOwn5 = require_has_own_property();
      var arraySlice2 = require_array_slice();
      var NATIVE_BIND = require_function_bind_native();
      var $Function = Function;
      var concat3 = uncurryThis15([].concat);
      var join2 = uncurryThis15([].join);
      var factories = {};
      var construct2 = function(C2, argsLength, args) {
        if (!hasOwn5(factories, argsLength)) {
          for (var list = [], i5 = 0; i5 < argsLength; i5++)
            list[i5] = "a[" + i5 + "]";
          factories[argsLength] = $Function("C,a", "return new C(" + join2(list, ",") + ")");
        }
        return factories[argsLength](C2, args);
      };
      module.exports = NATIVE_BIND ? $Function.bind : function bind2(that) {
        var F = aCallable2(this);
        var Prototype = F.prototype;
        var partArgs = arraySlice2(arguments, 1);
        var boundFunction = function bound() {
          var args = concat3(partArgs, arraySlice2(arguments));
          return this instanceof boundFunction ? construct2(F, args.length, args) : F.apply(that, args);
        };
        if (isObject6(Prototype))
          boundFunction.prototype = Prototype;
        return boundFunction;
      };
    }
  });

  // node_modules/core-js/internals/string-trim-forced.js
  var require_string_trim_forced = __commonJS({
    "node_modules/core-js/internals/string-trim-forced.js": function(exports, module) {
      var PROPER_FUNCTION_NAME2 = require_function_name().PROPER;
      var fails17 = require_fails();
      var whitespaces = require_whitespaces();
      var non = "\u200B\x85\u180E";
      module.exports = function(METHOD_NAME) {
        return fails17(function() {
          return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() !== non || PROPER_FUNCTION_NAME2 && whitespaces[METHOD_NAME].name !== METHOD_NAME;
        });
      };
    }
  });

  // node_modules/core-js/internals/call-with-safe-iteration-closing.js
  var require_call_with_safe_iteration_closing = __commonJS({
    "node_modules/core-js/internals/call-with-safe-iteration-closing.js": function(exports, module) {
      var anObject10 = require_an_object();
      var iteratorClose = require_iterator_close();
      module.exports = function(iterator, fn, value, ENTRIES) {
        try {
          return ENTRIES ? fn(anObject10(value)[0], value[1]) : fn(value);
        } catch (error) {
          iteratorClose(iterator, "throw", error);
        }
      };
    }
  });

  // node_modules/core-js/internals/array-from.js
  var require_array_from = __commonJS({
    "node_modules/core-js/internals/array-from.js": function(exports, module) {
      "use strict";
      var bind2 = require_function_bind_context();
      var call8 = require_function_call();
      var toObject6 = require_to_object();
      var callWithSafeIterationClosing = require_call_with_safe_iteration_closing();
      var isArrayIteratorMethod = require_is_array_iterator_method();
      var isConstructor2 = require_is_constructor();
      var lengthOfArrayLike5 = require_length_of_array_like();
      var createProperty5 = require_create_property();
      var getIterator = require_get_iterator();
      var getIteratorMethod = require_get_iterator_method();
      var $Array2 = Array;
      module.exports = function from2(arrayLike) {
        var O = toObject6(arrayLike);
        var IS_CONSTRUCTOR = isConstructor2(this);
        var argumentsLength = arguments.length;
        var mapfn = argumentsLength > 1 ? arguments[1] : void 0;
        var mapping = mapfn !== void 0;
        if (mapping)
          mapfn = bind2(mapfn, argumentsLength > 2 ? arguments[2] : void 0);
        var iteratorMethod = getIteratorMethod(O);
        var index = 0;
        var length, result, step, iterator, next2, value;
        if (iteratorMethod && !(this === $Array2 && isArrayIteratorMethod(iteratorMethod))) {
          iterator = getIterator(O, iteratorMethod);
          next2 = iterator.next;
          result = IS_CONSTRUCTOR ? new this() : [];
          for (; !(step = call8(next2, iterator)).done; index++) {
            value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
            createProperty5(result, index, value);
          }
        } else {
          length = lengthOfArrayLike5(O);
          result = IS_CONSTRUCTOR ? new this(length) : $Array2(length);
          for (; length > index; index++) {
            value = mapping ? mapfn(O[index], index) : O[index];
            createProperty5(result, index, value);
          }
        }
        result.length = index;
        return result;
      };
    }
  });

  // node_modules/core-js/internals/is-data-descriptor.js
  var require_is_data_descriptor = __commonJS({
    "node_modules/core-js/internals/is-data-descriptor.js": function(exports, module) {
      var hasOwn5 = require_has_own_property();
      module.exports = function(descriptor) {
        return descriptor !== void 0 && (hasOwn5(descriptor, "value") || hasOwn5(descriptor, "writable"));
      };
    }
  });

  // node_modules/core-js/internals/object-to-array.js
  var require_object_to_array = __commonJS({
    "node_modules/core-js/internals/object-to-array.js": function(exports, module) {
      var DESCRIPTORS10 = require_descriptors();
      var uncurryThis15 = require_function_uncurry_this();
      var objectKeys = require_object_keys();
      var toIndexedObject5 = require_to_indexed_object();
      var $propertyIsEnumerable = require_object_property_is_enumerable().f;
      var propertyIsEnumerable = uncurryThis15($propertyIsEnumerable);
      var push4 = uncurryThis15([].push);
      var createMethod = function(TO_ENTRIES) {
        return function(it) {
          var O = toIndexedObject5(it);
          var keys2 = objectKeys(O);
          var length = keys2.length;
          var i5 = 0;
          var result = [];
          var key;
          while (length > i5) {
            key = keys2[i5++];
            if (!DESCRIPTORS10 || propertyIsEnumerable(O, key)) {
              push4(result, TO_ENTRIES ? [key, O[key]] : O[key]);
            }
          }
          return result;
        };
      };
      module.exports = {
        entries: createMethod(true),
        values: createMethod(false)
      };
    }
  });

  // node_modules/core-js/internals/freezing.js
  var require_freezing = __commonJS({
    "node_modules/core-js/internals/freezing.js": function(exports, module) {
      var fails17 = require_fails();
      module.exports = !fails17(function() {
        return Object.isExtensible(Object.preventExtensions({}));
      });
    }
  });

  // node_modules/core-js/internals/array-buffer-non-extensible.js
  var require_array_buffer_non_extensible = __commonJS({
    "node_modules/core-js/internals/array-buffer-non-extensible.js": function(exports, module) {
      var fails17 = require_fails();
      module.exports = fails17(function() {
        if (typeof ArrayBuffer == "function") {
          var buffer = new ArrayBuffer(8);
          if (Object.isExtensible(buffer))
            Object.defineProperty(buffer, "a", { value: 8 });
        }
      });
    }
  });

  // node_modules/core-js/internals/object-is-extensible.js
  var require_object_is_extensible = __commonJS({
    "node_modules/core-js/internals/object-is-extensible.js": function(exports, module) {
      var fails17 = require_fails();
      var isObject6 = require_is_object();
      var classof2 = require_classof_raw();
      var ARRAY_BUFFER_NON_EXTENSIBLE = require_array_buffer_non_extensible();
      var $isExtensible = Object.isExtensible;
      var FAILS_ON_PRIMITIVES5 = fails17(function() {
        $isExtensible(1);
      });
      module.exports = FAILS_ON_PRIMITIVES5 || ARRAY_BUFFER_NON_EXTENSIBLE ? function isExtensible(it) {
        if (!isObject6(it))
          return false;
        if (ARRAY_BUFFER_NON_EXTENSIBLE && classof2(it) == "ArrayBuffer")
          return false;
        return $isExtensible ? $isExtensible(it) : true;
      } : $isExtensible;
    }
  });

  // node_modules/core-js/internals/internal-metadata.js
  var require_internal_metadata = __commonJS({
    "node_modules/core-js/internals/internal-metadata.js": function(exports, module) {
      var $88 = require_export();
      var uncurryThis15 = require_function_uncurry_this();
      var hiddenKeys = require_hidden_keys();
      var isObject6 = require_is_object();
      var hasOwn5 = require_has_own_property();
      var defineProperty3 = require_object_define_property().f;
      var getOwnPropertyNamesModule = require_object_get_own_property_names();
      var getOwnPropertyNamesExternalModule = require_object_get_own_property_names_external();
      var isExtensible = require_object_is_extensible();
      var uid = require_uid();
      var FREEZING2 = require_freezing();
      var REQUIRED = false;
      var METADATA = uid("meta");
      var id = 0;
      var setMetadata = function(it) {
        defineProperty3(it, METADATA, { value: {
          objectID: "O" + id++,
          weakData: {}
        } });
      };
      var fastKey = function(it, create3) {
        if (!isObject6(it))
          return typeof it == "symbol" ? it : (typeof it == "string" ? "S" : "P") + it;
        if (!hasOwn5(it, METADATA)) {
          if (!isExtensible(it))
            return "F";
          if (!create3)
            return "E";
          setMetadata(it);
        }
        return it[METADATA].objectID;
      };
      var getWeakData = function(it, create3) {
        if (!hasOwn5(it, METADATA)) {
          if (!isExtensible(it))
            return true;
          if (!create3)
            return false;
          setMetadata(it);
        }
        return it[METADATA].weakData;
      };
      var onFreeze2 = function(it) {
        if (FREEZING2 && REQUIRED && isExtensible(it) && !hasOwn5(it, METADATA))
          setMetadata(it);
        return it;
      };
      var enable = function() {
        meta.enable = function() {
        };
        REQUIRED = true;
        var getOwnPropertyNames4 = getOwnPropertyNamesModule.f;
        var splice2 = uncurryThis15([].splice);
        var test2 = {};
        test2[METADATA] = 1;
        if (getOwnPropertyNames4(test2).length) {
          getOwnPropertyNamesModule.f = function(it) {
            var result = getOwnPropertyNames4(it);
            for (var i5 = 0, length = result.length; i5 < length; i5++) {
              if (result[i5] === METADATA) {
                splice2(result, i5, 1);
                break;
              }
            }
            return result;
          };
          $88({ target: "Object", stat: true, forced: true }, {
            getOwnPropertyNames: getOwnPropertyNamesExternalModule.f
          });
        }
      };
      var meta = module.exports = {
        enable: enable,
        fastKey: fastKey,
        getWeakData: getWeakData,
        onFreeze: onFreeze2
      };
      hiddenKeys[METADATA] = true;
    }
  });

  // node_modules/core-js/internals/collection.js
  var require_collection = __commonJS({
    "node_modules/core-js/internals/collection.js": function(exports, module) {
      "use strict";
      var $88 = require_export();
      var global11 = require_global();
      var uncurryThis15 = require_function_uncurry_this();
      var isForced3 = require_is_forced();
      var defineBuiltIn6 = require_define_built_in();
      var InternalMetadataModule = require_internal_metadata();
      var iterate2 = require_iterate();
      var anInstance = require_an_instance();
      var isCallable5 = require_is_callable();
      var isNullOrUndefined5 = require_is_null_or_undefined();
      var isObject6 = require_is_object();
      var fails17 = require_fails();
      var checkCorrectnessOfIteration2 = require_check_correctness_of_iteration();
      var setToStringTag5 = require_set_to_string_tag();
      var inheritIfRequired3 = require_inherit_if_required();
      module.exports = function(CONSTRUCTOR_NAME, wrapper, common) {
        var IS_MAP = CONSTRUCTOR_NAME.indexOf("Map") !== -1;
        var IS_WEAK = CONSTRUCTOR_NAME.indexOf("Weak") !== -1;
        var ADDER = IS_MAP ? "set" : "add";
        var NativeConstructor = global11[CONSTRUCTOR_NAME];
        var NativePrototype = NativeConstructor && NativeConstructor.prototype;
        var Constructor = NativeConstructor;
        var exported = {};
        var fixMethod = function(KEY) {
          var uncurriedNativeMethod = uncurryThis15(NativePrototype[KEY]);
          defineBuiltIn6(
            NativePrototype,
            KEY,
            KEY == "add" ? function add(value) {
              uncurriedNativeMethod(this, value === 0 ? 0 : value);
              return this;
            } : KEY == "delete" ? function(key) {
              return IS_WEAK && !isObject6(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
            } : KEY == "get" ? function get3(key) {
              return IS_WEAK && !isObject6(key) ? void 0 : uncurriedNativeMethod(this, key === 0 ? 0 : key);
            } : KEY == "has" ? function has(key) {
              return IS_WEAK && !isObject6(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
            } : function set(key, value) {
              uncurriedNativeMethod(this, key === 0 ? 0 : key, value);
              return this;
            }
          );
        };
        var REPLACE2 = isForced3(
          CONSTRUCTOR_NAME,
          !isCallable5(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails17(function() {
            new NativeConstructor().entries().next();
          }))
        );
        if (REPLACE2) {
          Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
          InternalMetadataModule.enable();
        } else if (isForced3(CONSTRUCTOR_NAME, true)) {
          var instance = new Constructor();
          var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
          var THROWS_ON_PRIMITIVES = fails17(function() {
            instance.has(1);
          });
          var ACCEPT_ITERABLES = checkCorrectnessOfIteration2(function(iterable) {
            new NativeConstructor(iterable);
          });
          var BUGGY_ZERO = !IS_WEAK && fails17(function() {
            var $instance = new NativeConstructor();
            var index = 5;
            while (index--)
              $instance[ADDER](index, index);
            return !$instance.has(-0);
          });
          if (!ACCEPT_ITERABLES) {
            Constructor = wrapper(function(dummy, iterable) {
              anInstance(dummy, NativePrototype);
              var that = inheritIfRequired3(new NativeConstructor(), dummy, Constructor);
              if (!isNullOrUndefined5(iterable))
                iterate2(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
              return that;
            });
            Constructor.prototype = NativePrototype;
            NativePrototype.constructor = Constructor;
          }
          if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
            fixMethod("delete");
            fixMethod("has");
            IS_MAP && fixMethod("get");
          }
          if (BUGGY_ZERO || HASNT_CHAINING)
            fixMethod(ADDER);
          if (IS_WEAK && NativePrototype.clear)
            delete NativePrototype.clear;
        }
        exported[CONSTRUCTOR_NAME] = Constructor;
        $88({ global: true, constructor: true, forced: Constructor != NativeConstructor }, exported);
        setToStringTag5(Constructor, CONSTRUCTOR_NAME);
        if (!IS_WEAK)
          common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
        return Constructor;
      };
    }
  });

  // node_modules/core-js/internals/define-built-ins.js
  var require_define_built_ins = __commonJS({
    "node_modules/core-js/internals/define-built-ins.js": function(exports, module) {
      var defineBuiltIn6 = require_define_built_in();
      module.exports = function(target, src, options) {
        for (var key in src)
          defineBuiltIn6(target, key, src[key], options);
        return target;
      };
    }
  });

  // node_modules/core-js/internals/collection-strong.js
  var require_collection_strong = __commonJS({
    "node_modules/core-js/internals/collection-strong.js": function(exports, module) {
      "use strict";
      var create3 = require_object_create();
      var defineBuiltInAccessor4 = require_define_built_in_accessor();
      var defineBuiltIns = require_define_built_ins();
      var bind2 = require_function_bind_context();
      var anInstance = require_an_instance();
      var isNullOrUndefined5 = require_is_null_or_undefined();
      var iterate2 = require_iterate();
      var defineIterator2 = require_iterator_define();
      var createIterResultObject2 = require_create_iter_result_object();
      var setSpecies3 = require_set_species();
      var DESCRIPTORS10 = require_descriptors();
      var fastKey = require_internal_metadata().fastKey;
      var InternalStateModule2 = require_internal_state();
      var setInternalState2 = InternalStateModule2.set;
      var internalStateGetterFor = InternalStateModule2.getterFor;
      module.exports = {
        getConstructor: function(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
          var Constructor = wrapper(function(that, iterable) {
            anInstance(that, Prototype);
            setInternalState2(that, {
              type: CONSTRUCTOR_NAME,
              index: create3(null),
              first: void 0,
              last: void 0,
              size: 0
            });
            if (!DESCRIPTORS10)
              that.size = 0;
            if (!isNullOrUndefined5(iterable))
              iterate2(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
          });
          var Prototype = Constructor.prototype;
          var getInternalState3 = internalStateGetterFor(CONSTRUCTOR_NAME);
          var define = function(that, key, value) {
            var state = getInternalState3(that);
            var entry = getEntry(that, key);
            var previous, index;
            if (entry) {
              entry.value = value;
            } else {
              state.last = entry = {
                index: index = fastKey(key, true),
                key: key,
                value: value,
                previous: previous = state.last,
                next: void 0,
                removed: false
              };
              if (!state.first)
                state.first = entry;
              if (previous)
                previous.next = entry;
              if (DESCRIPTORS10)
                state.size++;
              else
                that.size++;
              if (index !== "F")
                state.index[index] = entry;
            }
            return that;
          };
          var getEntry = function(that, key) {
            var state = getInternalState3(that);
            var index = fastKey(key);
            var entry;
            if (index !== "F")
              return state.index[index];
            for (entry = state.first; entry; entry = entry.next) {
              if (entry.key == key)
                return entry;
            }
          };
          defineBuiltIns(Prototype, {
            clear: function clear() {
              var that = this;
              var state = getInternalState3(that);
              var data = state.index;
              var entry = state.first;
              while (entry) {
                entry.removed = true;
                if (entry.previous)
                  entry.previous = entry.previous.next = void 0;
                delete data[entry.index];
                entry = entry.next;
              }
              state.first = state.last = void 0;
              if (DESCRIPTORS10)
                state.size = 0;
              else
                that.size = 0;
            },
            "delete": function(key) {
              var that = this;
              var state = getInternalState3(that);
              var entry = getEntry(that, key);
              if (entry) {
                var next2 = entry.next;
                var prev = entry.previous;
                delete state.index[entry.index];
                entry.removed = true;
                if (prev)
                  prev.next = next2;
                if (next2)
                  next2.previous = prev;
                if (state.first == entry)
                  state.first = next2;
                if (state.last == entry)
                  state.last = prev;
                if (DESCRIPTORS10)
                  state.size--;
                else
                  that.size--;
              }
              return !!entry;
            },
            forEach: function forEach3(callbackfn) {
              var state = getInternalState3(this);
              var boundFunction = bind2(callbackfn, arguments.length > 1 ? arguments[1] : void 0);
              var entry;
              while (entry = entry ? entry.next : state.first) {
                boundFunction(entry.value, entry.key, this);
                while (entry && entry.removed)
                  entry = entry.previous;
              }
            },
            has: function has(key) {
              return !!getEntry(this, key);
            }
          });
          defineBuiltIns(Prototype, IS_MAP ? {
            get: function get3(key) {
              var entry = getEntry(this, key);
              return entry && entry.value;
            },
            set: function set(key, value) {
              return define(this, key === 0 ? 0 : key, value);
            }
          } : {
            add: function add(value) {
              return define(this, value = value === 0 ? 0 : value, value);
            }
          });
          if (DESCRIPTORS10)
            defineBuiltInAccessor4(Prototype, "size", {
              configurable: true,
              get: function() {
                return getInternalState3(this).size;
              }
            });
          return Constructor;
        },
        setStrong: function(Constructor, CONSTRUCTOR_NAME, IS_MAP) {
          var ITERATOR_NAME = CONSTRUCTOR_NAME + " Iterator";
          var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
          var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
          defineIterator2(Constructor, CONSTRUCTOR_NAME, function(iterated, kind) {
            setInternalState2(this, {
              type: ITERATOR_NAME,
              target: iterated,
              state: getInternalCollectionState(iterated),
              kind: kind,
              last: void 0
            });
          }, function() {
            var state = getInternalIteratorState(this);
            var kind = state.kind;
            var entry = state.last;
            while (entry && entry.removed)
              entry = entry.previous;
            if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
              state.target = void 0;
              return createIterResultObject2(void 0, true);
            }
            if (kind == "keys")
              return createIterResultObject2(entry.key, false);
            if (kind == "values")
              return createIterResultObject2(entry.value, false);
            return createIterResultObject2([entry.key, entry.value], false);
          }, IS_MAP ? "entries" : "values", !IS_MAP, true);
          setSpecies3(CONSTRUCTOR_NAME);
        }
      };
    }
  });

  // node_modules/core-js/modules/es.map.constructor.js
  var require_es_map_constructor = __commonJS({
    "node_modules/core-js/modules/es.map.constructor.js": function() {
      "use strict";
      var collection = require_collection();
      var collectionStrong = require_collection_strong();
      collection("Map", function(init2) {
        return function Map2() {
          return init2(this, arguments.length ? arguments[0] : void 0);
        };
      }, collectionStrong);
    }
  });

  // node_modules/core-js/internals/collection-weak.js
  var require_collection_weak = __commonJS({
    "node_modules/core-js/internals/collection-weak.js": function(exports, module) {
      "use strict";
      var uncurryThis15 = require_function_uncurry_this();
      var defineBuiltIns = require_define_built_ins();
      var getWeakData = require_internal_metadata().getWeakData;
      var anInstance = require_an_instance();
      var anObject10 = require_an_object();
      var isNullOrUndefined5 = require_is_null_or_undefined();
      var isObject6 = require_is_object();
      var iterate2 = require_iterate();
      var ArrayIterationModule = require_array_iteration();
      var hasOwn5 = require_has_own_property();
      var InternalStateModule2 = require_internal_state();
      var setInternalState2 = InternalStateModule2.set;
      var internalStateGetterFor = InternalStateModule2.getterFor;
      var find2 = ArrayIterationModule.find;
      var findIndex = ArrayIterationModule.findIndex;
      var splice2 = uncurryThis15([].splice);
      var id = 0;
      var uncaughtFrozenStore = function(state) {
        return state.frozen || (state.frozen = new UncaughtFrozenStore());
      };
      var UncaughtFrozenStore = function() {
        this.entries = [];
      };
      var findUncaughtFrozen = function(store, key) {
        return find2(store.entries, function(it) {
          return it[0] === key;
        });
      };
      UncaughtFrozenStore.prototype = {
        get: function(key) {
          var entry = findUncaughtFrozen(this, key);
          if (entry)
            return entry[1];
        },
        has: function(key) {
          return !!findUncaughtFrozen(this, key);
        },
        set: function(key, value) {
          var entry = findUncaughtFrozen(this, key);
          if (entry)
            entry[1] = value;
          else
            this.entries.push([key, value]);
        },
        "delete": function(key) {
          var index = findIndex(this.entries, function(it) {
            return it[0] === key;
          });
          if (~index)
            splice2(this.entries, index, 1);
          return !!~index;
        }
      };
      module.exports = {
        getConstructor: function(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
          var Constructor = wrapper(function(that, iterable) {
            anInstance(that, Prototype);
            setInternalState2(that, {
              type: CONSTRUCTOR_NAME,
              id: id++,
              frozen: void 0
            });
            if (!isNullOrUndefined5(iterable))
              iterate2(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
          });
          var Prototype = Constructor.prototype;
          var getInternalState3 = internalStateGetterFor(CONSTRUCTOR_NAME);
          var define = function(that, key, value) {
            var state = getInternalState3(that);
            var data = getWeakData(anObject10(key), true);
            if (data === true)
              uncaughtFrozenStore(state).set(key, value);
            else
              data[state.id] = value;
            return that;
          };
          defineBuiltIns(Prototype, {
            "delete": function(key) {
              var state = getInternalState3(this);
              if (!isObject6(key))
                return false;
              var data = getWeakData(key);
              if (data === true)
                return uncaughtFrozenStore(state)["delete"](key);
              return data && hasOwn5(data, state.id) && delete data[state.id];
            },
            has: function has(key) {
              var state = getInternalState3(this);
              if (!isObject6(key))
                return false;
              var data = getWeakData(key);
              if (data === true)
                return uncaughtFrozenStore(state).has(key);
              return data && hasOwn5(data, state.id);
            }
          });
          defineBuiltIns(Prototype, IS_MAP ? {
            get: function get3(key) {
              var state = getInternalState3(this);
              if (isObject6(key)) {
                var data = getWeakData(key);
                if (data === true)
                  return uncaughtFrozenStore(state).get(key);
                return data ? data[state.id] : void 0;
              }
            },
            set: function set(key, value) {
              return define(this, key, value);
            }
          } : {
            add: function add(value) {
              return define(this, value, true);
            }
          });
          return Constructor;
        }
      };
    }
  });

  // node_modules/core-js/modules/es.weak-map.constructor.js
  var require_es_weak_map_constructor = __commonJS({
    "node_modules/core-js/modules/es.weak-map.constructor.js": function() {
      "use strict";
      var FREEZING2 = require_freezing();
      var global11 = require_global();
      var uncurryThis15 = require_function_uncurry_this();
      var defineBuiltIns = require_define_built_ins();
      var InternalMetadataModule = require_internal_metadata();
      var collection = require_collection();
      var collectionWeak = require_collection_weak();
      var isObject6 = require_is_object();
      var enforceInternalState2 = require_internal_state().enforce;
      var fails17 = require_fails();
      var NATIVE_WEAK_MAP = require_weak_map_basic_detection();
      var $Object = Object;
      var isArray4 = Array.isArray;
      var isExtensible = $Object.isExtensible;
      var isFrozen = $Object.isFrozen;
      var isSealed = $Object.isSealed;
      var freeze2 = $Object.freeze;
      var seal = $Object.seal;
      var FROZEN = {};
      var SEALED = {};
      var IS_IE11 = !global11.ActiveXObject && "ActiveXObject" in global11;
      var InternalWeakMap;
      var wrapper = function(init2) {
        return function WeakMap2() {
          return init2(this, arguments.length ? arguments[0] : void 0);
        };
      };
      var $WeakMap = collection("WeakMap", wrapper, collectionWeak);
      var WeakMapPrototype = $WeakMap.prototype;
      var nativeSet = uncurryThis15(WeakMapPrototype.set);
      var hasMSEdgeFreezingBug = function() {
        return FREEZING2 && fails17(function() {
          var frozenArray = freeze2([]);
          nativeSet(new $WeakMap(), frozenArray, 1);
          return !isFrozen(frozenArray);
        });
      };
      if (NATIVE_WEAK_MAP) {
        if (IS_IE11) {
          InternalWeakMap = collectionWeak.getConstructor(wrapper, "WeakMap", true);
          InternalMetadataModule.enable();
          nativeDelete = uncurryThis15(WeakMapPrototype["delete"]);
          nativeHas = uncurryThis15(WeakMapPrototype.has);
          nativeGet = uncurryThis15(WeakMapPrototype.get);
          defineBuiltIns(WeakMapPrototype, {
            "delete": function(key) {
              if (isObject6(key) && !isExtensible(key)) {
                var state = enforceInternalState2(this);
                if (!state.frozen)
                  state.frozen = new InternalWeakMap();
                return nativeDelete(this, key) || state.frozen["delete"](key);
              }
              return nativeDelete(this, key);
            },
            has: function has(key) {
              if (isObject6(key) && !isExtensible(key)) {
                var state = enforceInternalState2(this);
                if (!state.frozen)
                  state.frozen = new InternalWeakMap();
                return nativeHas(this, key) || state.frozen.has(key);
              }
              return nativeHas(this, key);
            },
            get: function get3(key) {
              if (isObject6(key) && !isExtensible(key)) {
                var state = enforceInternalState2(this);
                if (!state.frozen)
                  state.frozen = new InternalWeakMap();
                return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key);
              }
              return nativeGet(this, key);
            },
            set: function set(key, value) {
              if (isObject6(key) && !isExtensible(key)) {
                var state = enforceInternalState2(this);
                if (!state.frozen)
                  state.frozen = new InternalWeakMap();
                nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value);
              } else
                nativeSet(this, key, value);
              return this;
            }
          });
        } else if (hasMSEdgeFreezingBug()) {
          defineBuiltIns(WeakMapPrototype, {
            set: function set(key, value) {
              var arrayIntegrityLevel;
              if (isArray4(key)) {
                if (isFrozen(key))
                  arrayIntegrityLevel = FROZEN;
                else if (isSealed(key))
                  arrayIntegrityLevel = SEALED;
              }
              nativeSet(this, key, value);
              if (arrayIntegrityLevel == FROZEN)
                freeze2(key);
              if (arrayIntegrityLevel == SEALED)
                seal(key);
              return this;
            }
          });
        }
      }
      var nativeDelete;
      var nativeHas;
      var nativeGet;
    }
  });

  // node_modules/core-js/modules/es.set.constructor.js
  var require_es_set_constructor = __commonJS({
    "node_modules/core-js/modules/es.set.constructor.js": function() {
      "use strict";
      var collection = require_collection();
      var collectionStrong = require_collection_strong();
      collection("Set", function(init2) {
        return function Set2() {
          return init2(this, arguments.length ? arguments[0] : void 0);
        };
      }, collectionStrong);
    }
  });

  // node_modules/core-js/internals/flatten-into-array.js
  var require_flatten_into_array = __commonJS({
    "node_modules/core-js/internals/flatten-into-array.js": function(exports, module) {
      "use strict";
      var isArray4 = require_is_array();
      var lengthOfArrayLike5 = require_length_of_array_like();
      var doesNotExceedSafeInteger3 = require_does_not_exceed_safe_integer();
      var bind2 = require_function_bind_context();
      var flattenIntoArray2 = function(target, original, source, sourceLen, start, depth, mapper, thisArg) {
        var targetIndex = start;
        var sourceIndex = 0;
        var mapFn = mapper ? bind2(mapper, thisArg) : false;
        var element, elementLen;
        while (sourceIndex < sourceLen) {
          if (sourceIndex in source) {
            element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
            if (depth > 0 && isArray4(element)) {
              elementLen = lengthOfArrayLike5(element);
              targetIndex = flattenIntoArray2(target, original, element, elementLen, targetIndex, depth - 1) - 1;
            } else {
              doesNotExceedSafeInteger3(targetIndex + 1);
              target[targetIndex] = element;
            }
            targetIndex++;
          }
          sourceIndex++;
        }
        return targetIndex;
      };
      module.exports = flattenIntoArray2;
    }
  });

  // node_modules/core-js/internals/array-reduce.js
  var require_array_reduce = __commonJS({
    "node_modules/core-js/internals/array-reduce.js": function(exports, module) {
      var aCallable2 = require_a_callable();
      var toObject6 = require_to_object();
      var IndexedObject2 = require_indexed_object();
      var lengthOfArrayLike5 = require_length_of_array_like();
      var $TypeError2 = TypeError;
      var createMethod = function(IS_RIGHT) {
        return function(that, callbackfn, argumentsLength, memo) {
          aCallable2(callbackfn);
          var O = toObject6(that);
          var self2 = IndexedObject2(O);
          var length = lengthOfArrayLike5(O);
          var index = IS_RIGHT ? length - 1 : 0;
          var i5 = IS_RIGHT ? -1 : 1;
          if (argumentsLength < 2)
            while (true) {
              if (index in self2) {
                memo = self2[index];
                index += i5;
                break;
              }
              index += i5;
              if (IS_RIGHT ? index < 0 : length <= index) {
                throw $TypeError2("Reduce of empty array with no initial value");
              }
            }
          for (; IS_RIGHT ? index >= 0 : length > index; index += i5)
            if (index in self2) {
              memo = callbackfn(memo, self2[index], index, O);
            }
          return memo;
        };
      };
      module.exports = {
        left: createMethod(false),
        right: createMethod(true)
      };
    }
  });

  // node_modules/core-js/internals/proxy-accessor.js
  var require_proxy_accessor = __commonJS({
    "node_modules/core-js/internals/proxy-accessor.js": function(exports, module) {
      var defineProperty3 = require_object_define_property().f;
      module.exports = function(Target, Source, key) {
        key in Target || defineProperty3(Target, key, {
          configurable: true,
          get: function() {
            return Source[key];
          },
          set: function(it) {
            Source[key] = it;
          }
        });
      };
    }
  });

  // node_modules/core-js/internals/not-a-regexp.js
  var require_not_a_regexp = __commonJS({
    "node_modules/core-js/internals/not-a-regexp.js": function(exports, module) {
      var isRegExp3 = require_is_regexp();
      var $TypeError2 = TypeError;
      module.exports = function(it) {
        if (isRegExp3(it)) {
          throw $TypeError2("The method doesn't accept regular expressions");
        }
        return it;
      };
    }
  });

  // node_modules/core-js/internals/correct-is-regexp-logic.js
  var require_correct_is_regexp_logic = __commonJS({
    "node_modules/core-js/internals/correct-is-regexp-logic.js": function(exports, module) {
      var wellKnownSymbol7 = require_well_known_symbol();
      var MATCH2 = wellKnownSymbol7("match");
      module.exports = function(METHOD_NAME) {
        var regexp = /./;
        try {
          "/./"[METHOD_NAME](regexp);
        } catch (error1) {
          try {
            regexp[MATCH2] = false;
            return "/./"[METHOD_NAME](regexp);
          } catch (error2) {
          }
        }
        return false;
      };
    }
  });

  // node_modules/core-js/internals/array-fill.js
  var require_array_fill = __commonJS({
    "node_modules/core-js/internals/array-fill.js": function(exports, module) {
      "use strict";
      var toObject6 = require_to_object();
      var toAbsoluteIndex4 = require_to_absolute_index();
      var lengthOfArrayLike5 = require_length_of_array_like();
      module.exports = function fill2(value) {
        var O = toObject6(this);
        var length = lengthOfArrayLike5(O);
        var argumentsLength = arguments.length;
        var index = toAbsoluteIndex4(argumentsLength > 1 ? arguments[1] : void 0, length);
        var end = argumentsLength > 2 ? arguments[2] : void 0;
        var endPos = end === void 0 ? length : toAbsoluteIndex4(end, length);
        while (endPos > index)
          O[index++] = value;
        return O;
      };
    }
  });

  // node_modules/core-js/internals/array-buffer-basic-detection.js
  var require_array_buffer_basic_detection = __commonJS({
    "node_modules/core-js/internals/array-buffer-basic-detection.js": function(exports, module) {
      module.exports = typeof ArrayBuffer != "undefined" && typeof DataView != "undefined";
    }
  });

  // node_modules/core-js/internals/to-index.js
  var require_to_index = __commonJS({
    "node_modules/core-js/internals/to-index.js": function(exports, module) {
      var toIntegerOrInfinity4 = require_to_integer_or_infinity();
      var toLength7 = require_to_length();
      var $RangeError = RangeError;
      module.exports = function(it) {
        if (it === void 0)
          return 0;
        var number = toIntegerOrInfinity4(it);
        var length = toLength7(number);
        if (number !== length)
          throw $RangeError("Wrong length or index");
        return length;
      };
    }
  });

  // node_modules/core-js/internals/ieee754.js
  var require_ieee754 = __commonJS({
    "node_modules/core-js/internals/ieee754.js": function(exports, module) {
      var $Array2 = Array;
      var abs = Math.abs;
      var pow = Math.pow;
      var floor = Math.floor;
      var log = Math.log;
      var LN2 = Math.LN2;
      var pack = function(number, mantissaLength, bytes) {
        var buffer = $Array2(bytes);
        var exponentLength = bytes * 8 - mantissaLength - 1;
        var eMax = (1 << exponentLength) - 1;
        var eBias = eMax >> 1;
        var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;
        var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;
        var index = 0;
        var exponent, mantissa, c5;
        number = abs(number);
        if (number != number || number === Infinity) {
          mantissa = number != number ? 1 : 0;
          exponent = eMax;
        } else {
          exponent = floor(log(number) / LN2);
          c5 = pow(2, -exponent);
          if (number * c5 < 1) {
            exponent--;
            c5 *= 2;
          }
          if (exponent + eBias >= 1) {
            number += rt / c5;
          } else {
            number += rt * pow(2, 1 - eBias);
          }
          if (number * c5 >= 2) {
            exponent++;
            c5 /= 2;
          }
          if (exponent + eBias >= eMax) {
            mantissa = 0;
            exponent = eMax;
          } else if (exponent + eBias >= 1) {
            mantissa = (number * c5 - 1) * pow(2, mantissaLength);
            exponent = exponent + eBias;
          } else {
            mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);
            exponent = 0;
          }
        }
        while (mantissaLength >= 8) {
          buffer[index++] = mantissa & 255;
          mantissa /= 256;
          mantissaLength -= 8;
        }
        exponent = exponent << mantissaLength | mantissa;
        exponentLength += mantissaLength;
        while (exponentLength > 0) {
          buffer[index++] = exponent & 255;
          exponent /= 256;
          exponentLength -= 8;
        }
        buffer[--index] |= sign * 128;
        return buffer;
      };
      var unpack = function(buffer, mantissaLength) {
        var bytes = buffer.length;
        var exponentLength = bytes * 8 - mantissaLength - 1;
        var eMax = (1 << exponentLength) - 1;
        var eBias = eMax >> 1;
        var nBits = exponentLength - 7;
        var index = bytes - 1;
        var sign = buffer[index--];
        var exponent = sign & 127;
        var mantissa;
        sign >>= 7;
        while (nBits > 0) {
          exponent = exponent * 256 + buffer[index--];
          nBits -= 8;
        }
        mantissa = exponent & (1 << -nBits) - 1;
        exponent >>= -nBits;
        nBits += mantissaLength;
        while (nBits > 0) {
          mantissa = mantissa * 256 + buffer[index--];
          nBits -= 8;
        }
        if (exponent === 0) {
          exponent = 1 - eBias;
        } else if (exponent === eMax) {
          return mantissa ? NaN : sign ? -Infinity : Infinity;
        } else {
          mantissa = mantissa + pow(2, mantissaLength);
          exponent = exponent - eBias;
        }
        return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
      };
      module.exports = {
        pack: pack,
        unpack: unpack
      };
    }
  });

  // node_modules/core-js/internals/array-buffer.js
  var require_array_buffer = __commonJS({
    "node_modules/core-js/internals/array-buffer.js": function(exports, module) {
      "use strict";
      var global11 = require_global();
      var uncurryThis15 = require_function_uncurry_this();
      var DESCRIPTORS10 = require_descriptors();
      var NATIVE_ARRAY_BUFFER = require_array_buffer_basic_detection();
      var FunctionName = require_function_name();
      var createNonEnumerableProperty4 = require_create_non_enumerable_property();
      var defineBuiltInAccessor4 = require_define_built_in_accessor();
      var defineBuiltIns = require_define_built_ins();
      var fails17 = require_fails();
      var anInstance = require_an_instance();
      var toIntegerOrInfinity4 = require_to_integer_or_infinity();
      var toLength7 = require_to_length();
      var toIndex = require_to_index();
      var IEEE754 = require_ieee754();
      var getPrototypeOf3 = require_object_get_prototype_of();
      var setPrototypeOf2 = require_object_set_prototype_of();
      var getOwnPropertyNames4 = require_object_get_own_property_names().f;
      var arrayFill = require_array_fill();
      var arraySlice2 = require_array_slice_simple();
      var setToStringTag5 = require_set_to_string_tag();
      var InternalStateModule2 = require_internal_state();
      var PROPER_FUNCTION_NAME2 = FunctionName.PROPER;
      var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
      var ARRAY_BUFFER2 = "ArrayBuffer";
      var DATA_VIEW = "DataView";
      var PROTOTYPE = "prototype";
      var WRONG_LENGTH = "Wrong length";
      var WRONG_INDEX = "Wrong index";
      var getInternalArrayBufferState = InternalStateModule2.getterFor(ARRAY_BUFFER2);
      var getInternalDataViewState = InternalStateModule2.getterFor(DATA_VIEW);
      var setInternalState2 = InternalStateModule2.set;
      var NativeArrayBuffer2 = global11[ARRAY_BUFFER2];
      var $ArrayBuffer = NativeArrayBuffer2;
      var ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE];
      var $DataView = global11[DATA_VIEW];
      var DataViewPrototype2 = $DataView && $DataView[PROTOTYPE];
      var ObjectPrototype2 = Object.prototype;
      var Array2 = global11.Array;
      var RangeError2 = global11.RangeError;
      var fill2 = uncurryThis15(arrayFill);
      var reverse2 = uncurryThis15([].reverse);
      var packIEEE754 = IEEE754.pack;
      var unpackIEEE754 = IEEE754.unpack;
      var packInt8 = function(number) {
        return [number & 255];
      };
      var packInt16 = function(number) {
        return [number & 255, number >> 8 & 255];
      };
      var packInt32 = function(number) {
        return [number & 255, number >> 8 & 255, number >> 16 & 255, number >> 24 & 255];
      };
      var unpackInt32 = function(buffer) {
        return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0];
      };
      var packFloat32 = function(number) {
        return packIEEE754(number, 23, 4);
      };
      var packFloat64 = function(number) {
        return packIEEE754(number, 52, 8);
      };
      var addGetter = function(Constructor, key2, getInternalState3) {
        defineBuiltInAccessor4(Constructor[PROTOTYPE], key2, {
          configurable: true,
          get: function() {
            return getInternalState3(this)[key2];
          }
        });
      };
      var get3 = function(view, count, index, isLittleEndian) {
        var intIndex = toIndex(index);
        var store = getInternalDataViewState(view);
        if (intIndex + count > store.byteLength)
          throw RangeError2(WRONG_INDEX);
        var bytes = store.bytes;
        var start = intIndex + store.byteOffset;
        var pack = arraySlice2(bytes, start, start + count);
        return isLittleEndian ? pack : reverse2(pack);
      };
      var set = function(view, count, index, conversion, value, isLittleEndian) {
        var intIndex = toIndex(index);
        var store = getInternalDataViewState(view);
        if (intIndex + count > store.byteLength)
          throw RangeError2(WRONG_INDEX);
        var bytes = store.bytes;
        var start = intIndex + store.byteOffset;
        var pack = conversion(+value);
        for (var i5 = 0; i5 < count; i5++)
          bytes[start + i5] = pack[isLittleEndian ? i5 : count - i5 - 1];
      };
      if (!NATIVE_ARRAY_BUFFER) {
        $ArrayBuffer = function ArrayBuffer4(length) {
          anInstance(this, ArrayBufferPrototype);
          var byteLength = toIndex(length);
          setInternalState2(this, {
            type: ARRAY_BUFFER2,
            bytes: fill2(Array2(byteLength), 0),
            byteLength: byteLength
          });
          if (!DESCRIPTORS10) {
            this.byteLength = byteLength;
            this.detached = false;
          }
        };
        ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE];
        $DataView = function DataView3(buffer, byteOffset, byteLength) {
          anInstance(this, DataViewPrototype2);
          anInstance(buffer, ArrayBufferPrototype);
          var bufferState = getInternalArrayBufferState(buffer);
          var bufferLength = bufferState.byteLength;
          var offset = toIntegerOrInfinity4(byteOffset);
          if (offset < 0 || offset > bufferLength)
            throw RangeError2("Wrong offset");
          byteLength = byteLength === void 0 ? bufferLength - offset : toLength7(byteLength);
          if (offset + byteLength > bufferLength)
            throw RangeError2(WRONG_LENGTH);
          setInternalState2(this, {
            type: DATA_VIEW,
            buffer: buffer,
            byteLength: byteLength,
            byteOffset: offset,
            bytes: bufferState.bytes
          });
          if (!DESCRIPTORS10) {
            this.buffer = buffer;
            this.byteLength = byteLength;
            this.byteOffset = offset;
          }
        };
        DataViewPrototype2 = $DataView[PROTOTYPE];
        if (DESCRIPTORS10) {
          addGetter($ArrayBuffer, "byteLength", getInternalArrayBufferState);
          addGetter($DataView, "buffer", getInternalDataViewState);
          addGetter($DataView, "byteLength", getInternalDataViewState);
          addGetter($DataView, "byteOffset", getInternalDataViewState);
        }
        defineBuiltIns(DataViewPrototype2, {
          getInt8: function getInt8(byteOffset) {
            return get3(this, 1, byteOffset)[0] << 24 >> 24;
          },
          getUint8: function getUint82(byteOffset) {
            return get3(this, 1, byteOffset)[0];
          },
          getInt16: function getInt16(byteOffset) {
            var bytes = get3(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : void 0);
            return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
          },
          getUint16: function getUint16(byteOffset) {
            var bytes = get3(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : void 0);
            return bytes[1] << 8 | bytes[0];
          },
          getInt32: function getInt32(byteOffset) {
            return unpackInt32(get3(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : void 0));
          },
          getUint32: function getUint32(byteOffset) {
            return unpackInt32(get3(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : void 0)) >>> 0;
          },
          getFloat32: function getFloat32(byteOffset) {
            return unpackIEEE754(get3(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : void 0), 23);
          },
          getFloat64: function getFloat64(byteOffset) {
            return unpackIEEE754(get3(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : void 0), 52);
          },
          setInt8: function setInt8(byteOffset, value) {
            set(this, 1, byteOffset, packInt8, value);
          },
          setUint8: function setUint82(byteOffset, value) {
            set(this, 1, byteOffset, packInt8, value);
          },
          setInt16: function setInt16(byteOffset, value) {
            set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : void 0);
          },
          setUint16: function setUint16(byteOffset, value) {
            set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : void 0);
          },
          setInt32: function setInt32(byteOffset, value) {
            set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : void 0);
          },
          setUint32: function setUint32(byteOffset, value) {
            set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : void 0);
          },
          setFloat32: function setFloat32(byteOffset, value) {
            set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : void 0);
          },
          setFloat64: function setFloat64(byteOffset, value) {
            set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : void 0);
          }
        });
      } else {
        INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME2 && NativeArrayBuffer2.name !== ARRAY_BUFFER2;
        if (!fails17(function() {
          NativeArrayBuffer2(1);
        }) || !fails17(function() {
          new NativeArrayBuffer2(-1);
        }) || fails17(function() {
          new NativeArrayBuffer2();
          new NativeArrayBuffer2(1.5);
          new NativeArrayBuffer2(NaN);
          return NativeArrayBuffer2.length != 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME;
        })) {
          $ArrayBuffer = function ArrayBuffer4(length) {
            anInstance(this, ArrayBufferPrototype);
            return new NativeArrayBuffer2(toIndex(length));
          };
          $ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype;
          for (keys2 = getOwnPropertyNames4(NativeArrayBuffer2), j3 = 0; keys2.length > j3; ) {
            if (!((key = keys2[j3++]) in $ArrayBuffer)) {
              createNonEnumerableProperty4($ArrayBuffer, key, NativeArrayBuffer2[key]);
            }
          }
          ArrayBufferPrototype.constructor = $ArrayBuffer;
        } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) {
          createNonEnumerableProperty4(NativeArrayBuffer2, "name", ARRAY_BUFFER2);
        }
        if (setPrototypeOf2 && getPrototypeOf3(DataViewPrototype2) !== ObjectPrototype2) {
          setPrototypeOf2(DataViewPrototype2, ObjectPrototype2);
        }
        testView = new $DataView(new $ArrayBuffer(2));
        $setInt8 = uncurryThis15(DataViewPrototype2.setInt8);
        testView.setInt8(0, 2147483648);
        testView.setInt8(1, 2147483649);
        if (testView.getInt8(0) || !testView.getInt8(1))
          defineBuiltIns(DataViewPrototype2, {
            setInt8: function setInt8(byteOffset, value) {
              $setInt8(this, byteOffset, value << 24 >> 24);
            },
            setUint8: function setUint82(byteOffset, value) {
              $setInt8(this, byteOffset, value << 24 >> 24);
            }
          }, { unsafe: true });
      }
      var INCORRECT_ARRAY_BUFFER_NAME;
      var keys2;
      var j3;
      var key;
      var testView;
      var $setInt8;
      setToStringTag5($ArrayBuffer, ARRAY_BUFFER2);
      setToStringTag5($DataView, DATA_VIEW);
      module.exports = {
        ArrayBuffer: $ArrayBuffer,
        DataView: $DataView
      };
    }
  });

  // node_modules/core-js/modules/es.data-view.constructor.js
  var require_es_data_view_constructor = __commonJS({
    "node_modules/core-js/modules/es.data-view.constructor.js": function() {
      var $88 = require_export();
      var ArrayBufferModule2 = require_array_buffer();
      var NATIVE_ARRAY_BUFFER = require_array_buffer_basic_detection();
      $88({ global: true, constructor: true, forced: !NATIVE_ARRAY_BUFFER }, {
        DataView: ArrayBufferModule2.DataView
      });
    }
  });

  // node_modules/core-js/modules/es.weak-set.constructor.js
  var require_es_weak_set_constructor = __commonJS({
    "node_modules/core-js/modules/es.weak-set.constructor.js": function() {
      "use strict";
      var collection = require_collection();
      var collectionWeak = require_collection_weak();
      collection("WeakSet", function(init2) {
        return function WeakSet2() {
          return init2(this, arguments.length ? arguments[0] : void 0);
        };
      }, collectionWeak);
    }
  });

  // node_modules/core-js/modules/es.array.index-of.js
  var $ = require_export();
  var uncurryThis = require_function_uncurry_this_clause();
  var $indexOf = require_array_includes().indexOf;
  var arrayMethodIsStrict = require_array_method_is_strict();
  var nativeIndexOf = uncurryThis([].indexOf);
  var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
  var FORCED = NEGATIVE_ZERO || !arrayMethodIsStrict("indexOf");
  $({ target: "Array", proto: true, forced: FORCED }, {
    indexOf: function indexOf(searchElement) {
      var fromIndex = arguments.length > 1 ? arguments[1] : void 0;
      return NEGATIVE_ZERO ? nativeIndexOf(this, searchElement, fromIndex) || 0 : $indexOf(this, searchElement, fromIndex);
    }
  });

  // node_modules/core-js/modules/es.parse-int.js
  var $2 = require_export();
  var $parseInt = require_number_parse_int();
  $2({ global: true, forced: parseInt != $parseInt }, {
    parseInt: $parseInt
  });

  // srcts/src/initialize/browser.ts
  var import_es_regexp_exec = __toESM(require_es_regexp_exec());

  // node_modules/core-js/modules/es.regexp.test.js
  require_es_regexp_exec();
  var $3 = require_export();
  var call = require_function_call();
  var isCallable = require_is_callable();
  var anObject = require_an_object();
  var toString = require_to_string();
  var DELEGATES_TO_EXEC = function() {
    var execCalled = false;
    var re = /[ac]/;
    re.exec = function() {
      execCalled = true;
      return /./.exec.apply(this, arguments);
    };
    return re.test("abc") === true && execCalled;
  }();
  var nativeTest = /./.test;
  $3({ target: "RegExp", proto: true, forced: !DELEGATES_TO_EXEC }, {
    test: function(S4) {
      var R2 = anObject(this);
      var string = toString(S4);
      var exec3 = R2.exec;
      if (!isCallable(exec3))
        return call(nativeTest, R2, string);
      var result = call(exec3, R2, string);
      if (result === null)
        return false;
      anObject(result);
      return true;
    }
  });

  // srcts/src/initialize/browser.ts
  var import_jquery = __toESM(require_jquery());

  // srcts/src/utils/browser.ts
  var isQtVal = false;
  var isIEVal = false;
  var versionIE = -1;
  function setIsQt(isQt2) {
    isQtVal = isQt2;
  }
  function setIsIE(isIE2) {
    isIEVal = isIE2;
  }
  function setIEVersion(versionIE_) {
    versionIE = versionIE_;
  }
  function isQt() {
    return isQtVal;
  }
  function isIE() {
    return isIEVal;
  }
  function IEVersion() {
    return versionIE;
  }

  // srcts/src/utils/userAgent.ts
  var userAgent;
  function setUserAgent(userAgent_) {
    userAgent = userAgent_;
  }

  // srcts/src/initialize/browser.ts
  function getIEVersion() {
    var msie = userAgent.indexOf("MSIE ");
    if (isIE() && msie > 0) {
      return parseInt(userAgent.substring(msie + 5, userAgent.indexOf(".", msie)), 10);
    }
    var trident = userAgent.indexOf("Trident/");
    if (trident > 0) {
      var rv = userAgent.indexOf("rv:");
      return parseInt(userAgent.substring(rv + 3, userAgent.indexOf(".", rv)), 10);
    }
    return -1;
  }
  function determineBrowserInfo() {
    if (/\bQt\//.test(userAgent)) {
      (0, import_jquery.default)(document.documentElement).addClass("qt");
      setIsQt(true);
    } else {
      setIsQt(false);
    }
    if (/\bQt/.test(userAgent) && /\bMacintosh/.test(userAgent)) {
      (0, import_jquery.default)(document.documentElement).addClass("qtmac");
    }
    if (/\bQt\/5/.test(userAgent) && /Linux/.test(userAgent)) {
      (0, import_jquery.default)(document.documentElement).addClass("qt5");
    }
    setIsIE(/MSIE|Trident|Edge/.test(userAgent));
    setIEVersion(getIEVersion());
  }

  // srcts/src/initialize/disableForm.ts
  var import_jquery2 = __toESM(require_jquery());
  function disableFormSubmission() {
    (0, import_jquery2.default)(document).on("submit", "form:not([action])", function(e4) {
      e4.preventDefault();
    });
  }

  // srcts/src/initialize/history.ts
  var import_jquery3 = __toESM(require_jquery());
  function trackHistory() {
    var origPushState = window.history.pushState;
    window.history.pushState = function() {
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      var result = origPushState.apply(this, args);
      (0, import_jquery3.default)(document).trigger("pushstate");
      return result;
    };
  }

  // node_modules/core-js/modules/es.array.find.js
  var $7 = require_export();
  var $find = require_array_iteration().find;
  var addToUnscopables = require_add_to_unscopables();
  var FIND = "find";
  var SKIPS_HOLES = true;
  if (FIND in [])
    Array(1)[FIND](function() {
      SKIPS_HOLES = false;
    });
  $7({ target: "Array", proto: true, forced: SKIPS_HOLES }, {
    find: function find(callbackfn) {
      return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
    }
  });
  addToUnscopables(FIND);

  // node_modules/core-js/modules/es.object.to-string.js
  var TO_STRING_TAG_SUPPORT = require_to_string_tag_support();
  var defineBuiltIn = require_define_built_in();
  var toString2 = require_object_to_string();
  if (!TO_STRING_TAG_SUPPORT) {
    defineBuiltIn(Object.prototype, "toString", toString2, { unsafe: true });
  }

  // srcts/src/shiny/index.ts
  var import_es_regexp_exec17 = __toESM(require_es_regexp_exec());

  // node_modules/core-js/modules/es.string.match.js
  var call2 = require_function_call();
  var fixRegExpWellKnownSymbolLogic = require_fix_regexp_well_known_symbol_logic();
  var anObject2 = require_an_object();
  var isNullOrUndefined = require_is_null_or_undefined();
  var toLength = require_to_length();
  var toString3 = require_to_string();
  var requireObjectCoercible = require_require_object_coercible();
  var getMethod = require_get_method();
  var advanceStringIndex = require_advance_string_index();
  var regExpExec = require_regexp_exec_abstract();
  fixRegExpWellKnownSymbolLogic("match", function(MATCH2, nativeMatch, maybeCallNative) {
    return [
      function match(regexp) {
        var O = requireObjectCoercible(this);
        var matcher = isNullOrUndefined(regexp) ? void 0 : getMethod(regexp, MATCH2);
        return matcher ? call2(matcher, regexp, O) : new RegExp(regexp)[MATCH2](toString3(O));
      },
      function(string) {
        var rx = anObject2(this);
        var S4 = toString3(string);
        var res = maybeCallNative(nativeMatch, rx, S4);
        if (res.done)
          return res.value;
        if (!rx.global)
          return regExpExec(rx, S4);
        var fullUnicode = rx.unicode;
        rx.lastIndex = 0;
        var A2 = [];
        var n4 = 0;
        var result;
        while ((result = regExpExec(rx, S4)) !== null) {
          var matchStr = toString3(result[0]);
          A2[n4] = matchStr;
          if (matchStr === "")
            rx.lastIndex = advanceStringIndex(S4, toLength(rx.lastIndex), fullUnicode);
          n4++;
        }
        return n4 === 0 ? null : A2;
      }
    ];
  });

  // node_modules/core-js/modules/es.parse-float.js
  var $8 = require_export();
  var $parseFloat = require_number_parse_float();
  $8({ global: true, forced: parseFloat != $parseFloat }, {
    parseFloat: $parseFloat
  });

  // node_modules/core-js/modules/es.string.replace.js
  var apply = require_function_apply();
  var call3 = require_function_call();
  var uncurryThis2 = require_function_uncurry_this();
  var fixRegExpWellKnownSymbolLogic2 = require_fix_regexp_well_known_symbol_logic();
  var fails = require_fails();
  var anObject3 = require_an_object();
  var isCallable2 = require_is_callable();
  var isNullOrUndefined2 = require_is_null_or_undefined();
  var toIntegerOrInfinity = require_to_integer_or_infinity();
  var toLength2 = require_to_length();
  var toString4 = require_to_string();
  var requireObjectCoercible2 = require_require_object_coercible();
  var advanceStringIndex2 = require_advance_string_index();
  var getMethod2 = require_get_method();
  var getSubstitution = require_get_substitution();
  var regExpExec2 = require_regexp_exec_abstract();
  var wellKnownSymbol = require_well_known_symbol();
  var REPLACE = wellKnownSymbol("replace");
  var max = Math.max;
  var min = Math.min;
  var concat = uncurryThis2([].concat);
  var push = uncurryThis2([].push);
  var stringIndexOf = uncurryThis2("".indexOf);
  var stringSlice = uncurryThis2("".slice);
  var maybeToString = function(it) {
    return it === void 0 ? it : String(it);
  };
  var REPLACE_KEEPS_$0 = function() {
    return "a".replace(/./, "$0") === "$0";
  }();
  var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = function() {
    if (/./[REPLACE]) {
      return /./[REPLACE]("a", "$0") === "";
    }
    return false;
  }();
  var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function() {
    var re = /./;
    re.exec = function() {
      var result = [];
      result.groups = { a: "7" };
      return result;
    };
    return "".replace(re, "$<a>") !== "7";
  });
  fixRegExpWellKnownSymbolLogic2("replace", function(_2, nativeReplace, maybeCallNative) {
    var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? "$" : "$0";
    return [
      function replace2(searchValue, replaceValue) {
        var O = requireObjectCoercible2(this);
        var replacer = isNullOrUndefined2(searchValue) ? void 0 : getMethod2(searchValue, REPLACE);
        return replacer ? call3(replacer, searchValue, O, replaceValue) : call3(nativeReplace, toString4(O), searchValue, replaceValue);
      },
      function(string, replaceValue) {
        var rx = anObject3(this);
        var S4 = toString4(string);
        if (typeof replaceValue == "string" && stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 && stringIndexOf(replaceValue, "$<") === -1) {
          var res = maybeCallNative(nativeReplace, rx, S4, replaceValue);
          if (res.done)
            return res.value;
        }
        var functionalReplace = isCallable2(replaceValue);
        if (!functionalReplace)
          replaceValue = toString4(replaceValue);
        var global11 = rx.global;
        if (global11) {
          var fullUnicode = rx.unicode;
          rx.lastIndex = 0;
        }
        var results = [];
        while (true) {
          var result = regExpExec2(rx, S4);
          if (result === null)
            break;
          push(results, result);
          if (!global11)
            break;
          var matchStr = toString4(result[0]);
          if (matchStr === "")
            rx.lastIndex = advanceStringIndex2(S4, toLength2(rx.lastIndex), fullUnicode);
        }
        var accumulatedResult = "";
        var nextSourcePosition = 0;
        for (var i5 = 0; i5 < results.length; i5++) {
          result = results[i5];
          var matched = toString4(result[0]);
          var position = max(min(toIntegerOrInfinity(result.index), S4.length), 0);
          var captures = [];
          for (var j3 = 1; j3 < result.length; j3++)
            push(captures, maybeToString(result[j3]));
          var namedCaptures = result.groups;
          if (functionalReplace) {
            var replacerArgs = concat([matched], captures, position, S4);
            if (namedCaptures !== void 0)
              push(replacerArgs, namedCaptures);
            var replacement = toString4(apply(replaceValue, void 0, replacerArgs));
          } else {
            replacement = getSubstitution(matched, S4, position, captures, namedCaptures, replaceValue);
          }
          if (position >= nextSourcePosition) {
            accumulatedResult += stringSlice(S4, nextSourcePosition, position) + replacement;
            nextSourcePosition = position + matched.length;
          }
        }
        return accumulatedResult + stringSlice(S4, nextSourcePosition);
      }
    ];
  }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);

  // node_modules/core-js/modules/es.array.concat.js
  var $9 = require_export();
  var fails2 = require_fails();
  var isArray = require_is_array();
  var isObject = require_is_object();
  var toObject = require_to_object();
  var lengthOfArrayLike = require_length_of_array_like();
  var doesNotExceedSafeInteger = require_does_not_exceed_safe_integer();
  var createProperty = require_create_property();
  var arraySpeciesCreate = require_array_species_create();
  var arrayMethodHasSpeciesSupport = require_array_method_has_species_support();
  var wellKnownSymbol2 = require_well_known_symbol();
  var V8_VERSION = require_engine_v8_version();
  var IS_CONCAT_SPREADABLE = wellKnownSymbol2("isConcatSpreadable");
  var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails2(function() {
    var array = [];
    array[IS_CONCAT_SPREADABLE] = false;
    return array.concat()[0] !== array;
  });
  var isConcatSpreadable = function(O) {
    if (!isObject(O))
      return false;
    var spreadable = O[IS_CONCAT_SPREADABLE];
    return spreadable !== void 0 ? !!spreadable : isArray(O);
  };
  var FORCED2 = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport("concat");
  $9({ target: "Array", proto: true, arity: 1, forced: FORCED2 }, {
    concat: function concat2(arg) {
      var O = toObject(this);
      var A2 = arraySpeciesCreate(O, 0);
      var n4 = 0;
      var i5, k2, length, len, E2;
      for (i5 = -1, length = arguments.length; i5 < length; i5++) {
        E2 = i5 === -1 ? O : arguments[i5];
        if (isConcatSpreadable(E2)) {
          len = lengthOfArrayLike(E2);
          doesNotExceedSafeInteger(n4 + len);
          for (k2 = 0; k2 < len; k2++, n4++)
            if (k2 in E2)
              createProperty(A2, n4, E2[k2]);
        } else {
          doesNotExceedSafeInteger(n4 + 1);
          createProperty(A2, n4++, E2);
        }
      }
      A2.length = n4;
      return A2;
    }
  });

  // node_modules/core-js/modules/es.string.search.js
  var call4 = require_function_call();
  var fixRegExpWellKnownSymbolLogic3 = require_fix_regexp_well_known_symbol_logic();
  var anObject4 = require_an_object();
  var isNullOrUndefined3 = require_is_null_or_undefined();
  var requireObjectCoercible3 = require_require_object_coercible();
  var sameValue = require_same_value();
  var toString5 = require_to_string();
  var getMethod3 = require_get_method();
  var regExpExec3 = require_regexp_exec_abstract();
  fixRegExpWellKnownSymbolLogic3("search", function(SEARCH, nativeSearch, maybeCallNative) {
    return [
      function search(regexp) {
        var O = requireObjectCoercible3(this);
        var searcher = isNullOrUndefined3(regexp) ? void 0 : getMethod3(regexp, SEARCH);
        return searcher ? call4(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString5(O));
      },
      function(string) {
        var rx = anObject4(this);
        var S4 = toString5(string);
        var res = maybeCallNative(nativeSearch, rx, S4);
        if (res.done)
          return res.value;
        var previousLastIndex = rx.lastIndex;
        if (!sameValue(previousLastIndex, 0))
          rx.lastIndex = 0;
        var result = regExpExec3(rx, S4);
        if (!sameValue(rx.lastIndex, previousLastIndex))
          rx.lastIndex = previousLastIndex;
        return result === null ? -1 : result.index;
      }
    ];
  });

  // node_modules/core-js/modules/es.string.split.js
  var apply2 = require_function_apply();
  var call5 = require_function_call();
  var uncurryThis3 = require_function_uncurry_this();
  var fixRegExpWellKnownSymbolLogic4 = require_fix_regexp_well_known_symbol_logic();
  var anObject5 = require_an_object();
  var isNullOrUndefined4 = require_is_null_or_undefined();
  var isRegExp = require_is_regexp();
  var requireObjectCoercible4 = require_require_object_coercible();
  var speciesConstructor = require_species_constructor();
  var advanceStringIndex3 = require_advance_string_index();
  var toLength3 = require_to_length();
  var toString6 = require_to_string();
  var getMethod4 = require_get_method();
  var arraySlice = require_array_slice_simple();
  var callRegExpExec = require_regexp_exec_abstract();
  var regexpExec = require_regexp_exec();
  var stickyHelpers = require_regexp_sticky_helpers();
  var fails3 = require_fails();
  var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
  var MAX_UINT32 = 4294967295;
  var min2 = Math.min;
  var $push = [].push;
  var exec = uncurryThis3(/./.exec);
  var push2 = uncurryThis3($push);
  var stringSlice2 = uncurryThis3("".slice);
  var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails3(function() {
    var re = /(?:)/;
    var originalExec = re.exec;
    re.exec = function() {
      return originalExec.apply(this, arguments);
    };
    var result = "ab".split(re);
    return result.length !== 2 || result[0] !== "a" || result[1] !== "b";
  });
  fixRegExpWellKnownSymbolLogic4("split", function(SPLIT, nativeSplit, maybeCallNative) {
    var internalSplit;
    if ("abbc".split(/(b)*/)[1] == "c" || "test".split(/(?:)/, -1).length != 4 || "ab".split(/(?:ab)*/).length != 2 || ".".split(/(.?)(.?)/).length != 4 || ".".split(/()()/).length > 1 || "".split(/.?/).length) {
      internalSplit = function(separator, limit) {
        var string = toString6(requireObjectCoercible4(this));
        var lim = limit === void 0 ? MAX_UINT32 : limit >>> 0;
        if (lim === 0)
          return [];
        if (separator === void 0)
          return [string];
        if (!isRegExp(separator)) {
          return call5(nativeSplit, string, separator, lim);
        }
        var output = [];
        var flags = (separator.ignoreCase ? "i" : "") + (separator.multiline ? "m" : "") + (separator.unicode ? "u" : "") + (separator.sticky ? "y" : "");
        var lastLastIndex = 0;
        var separatorCopy = new RegExp(separator.source, flags + "g");
        var match, lastIndex, lastLength;
        while (match = call5(regexpExec, separatorCopy, string)) {
          lastIndex = separatorCopy.lastIndex;
          if (lastIndex > lastLastIndex) {
            push2(output, stringSlice2(string, lastLastIndex, match.index));
            if (match.length > 1 && match.index < string.length)
              apply2($push, output, arraySlice(match, 1));
            lastLength = match[0].length;
            lastLastIndex = lastIndex;
            if (output.length >= lim)
              break;
          }
          if (separatorCopy.lastIndex === match.index)
            separatorCopy.lastIndex++;
        }
        if (lastLastIndex === string.length) {
          if (lastLength || !exec(separatorCopy, ""))
            push2(output, "");
        } else
          push2(output, stringSlice2(string, lastLastIndex));
        return output.length > lim ? arraySlice(output, 0, lim) : output;
      };
    } else if ("0".split(void 0, 0).length) {
      internalSplit = function(separator, limit) {
        return separator === void 0 && limit === 0 ? [] : call5(nativeSplit, this, separator, limit);
      };
    } else
      internalSplit = nativeSplit;
    return [
      function split(separator, limit) {
        var O = requireObjectCoercible4(this);
        var splitter = isNullOrUndefined4(separator) ? void 0 : getMethod4(separator, SPLIT);
        return splitter ? call5(splitter, separator, O, limit) : call5(internalSplit, toString6(O), separator, limit);
      },
      function(string, limit) {
        var rx = anObject5(this);
        var S4 = toString6(string);
        var res = maybeCallNative(internalSplit, rx, S4, limit, internalSplit !== nativeSplit);
        if (res.done)
          return res.value;
        var C2 = speciesConstructor(rx, RegExp);
        var unicodeMatching = rx.unicode;
        var flags = (rx.ignoreCase ? "i" : "") + (rx.multiline ? "m" : "") + (rx.unicode ? "u" : "") + (UNSUPPORTED_Y ? "g" : "y");
        var splitter = new C2(UNSUPPORTED_Y ? "^(?:" + rx.source + ")" : rx, flags);
        var lim = limit === void 0 ? MAX_UINT32 : limit >>> 0;
        if (lim === 0)
          return [];
        if (S4.length === 0)
          return callRegExpExec(splitter, S4) === null ? [S4] : [];
        var p3 = 0;
        var q = 0;
        var A2 = [];
        while (q < S4.length) {
          splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
          var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice2(S4, q) : S4);
          var e4;
          if (z === null || (e4 = min2(toLength3(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S4.length)) === p3) {
            q = advanceStringIndex3(S4, q, unicodeMatching);
          } else {
            push2(A2, stringSlice2(S4, p3, q));
            if (A2.length === lim)
              return A2;
            for (var i5 = 1; i5 <= z.length - 1; i5++) {
              push2(A2, z[i5]);
              if (A2.length === lim)
                return A2;
            }
            q = p3 = e4;
          }
        }
        push2(A2, stringSlice2(S4, p3));
        return A2;
      }
    ];
  }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);

  // node_modules/core-js/modules/es.symbol.to-primitive.js
  var defineWellKnownSymbol = require_well_known_symbol_define();
  var defineSymbolToPrimitive = require_symbol_define_to_primitive();
  defineWellKnownSymbol("toPrimitive");
  defineSymbolToPrimitive();

  // node_modules/core-js/modules/es.date.to-primitive.js
  var hasOwn = require_has_own_property();
  var defineBuiltIn2 = require_define_built_in();
  var dateToPrimitive = require_date_to_primitive();
  var wellKnownSymbol3 = require_well_known_symbol();
  var TO_PRIMITIVE = wellKnownSymbol3("toPrimitive");
  var DatePrototype = Date.prototype;
  if (!hasOwn(DatePrototype, TO_PRIMITIVE)) {
    defineBuiltIn2(DatePrototype, TO_PRIMITIVE, dateToPrimitive);
  }

  // node_modules/core-js/modules/es.symbol.js
  require_es_symbol_constructor();
  require_es_symbol_for();
  require_es_symbol_key_for();
  require_es_json_stringify();
  require_es_object_get_own_property_symbols();

  // node_modules/core-js/modules/es.symbol.description.js
  var $10 = require_export();
  var DESCRIPTORS = require_descriptors();
  var global2 = require_global();
  var uncurryThis4 = require_function_uncurry_this();
  var hasOwn2 = require_has_own_property();
  var isCallable3 = require_is_callable();
  var isPrototypeOf = require_object_is_prototype_of();
  var toString7 = require_to_string();
  var defineBuiltInAccessor = require_define_built_in_accessor();
  var copyConstructorProperties = require_copy_constructor_properties();
  var NativeSymbol = global2.Symbol;
  var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
  if (DESCRIPTORS && isCallable3(NativeSymbol) && (!("description" in SymbolPrototype) || NativeSymbol().description !== void 0)) {
    EmptyStringDescriptionStore = {};
    SymbolWrapper = function Symbol2() {
      var description = arguments.length < 1 || arguments[0] === void 0 ? void 0 : toString7(arguments[0]);
      var result = isPrototypeOf(SymbolPrototype, this) ? new NativeSymbol(description) : description === void 0 ? NativeSymbol() : NativeSymbol(description);
      if (description === "")
        EmptyStringDescriptionStore[result] = true;
      return result;
    };
    copyConstructorProperties(SymbolWrapper, NativeSymbol);
    SymbolWrapper.prototype = SymbolPrototype;
    SymbolPrototype.constructor = SymbolWrapper;
    NATIVE_SYMBOL = String(NativeSymbol("test")) == "Symbol(test)";
    thisSymbolValue = uncurryThis4(SymbolPrototype.valueOf);
    symbolDescriptiveString = uncurryThis4(SymbolPrototype.toString);
    regexp = /^Symbol\((.*)\)[^)]+$/;
    replace2 = uncurryThis4("".replace);
    stringSlice6 = uncurryThis4("".slice);
    defineBuiltInAccessor(SymbolPrototype, "description", {
      configurable: true,
      get: function description() {
        var symbol = thisSymbolValue(this);
        if (hasOwn2(EmptyStringDescriptionStore, symbol))
          return "";
        var string = symbolDescriptiveString(symbol);
        var desc = NATIVE_SYMBOL ? stringSlice6(string, 7, -1) : replace2(string, regexp, "$1");
        return desc === "" ? void 0 : desc;
      }
    });
    $10({ global: true, constructor: true, forced: true }, {
      Symbol: SymbolWrapper
    });
  }
  var EmptyStringDescriptionStore;
  var SymbolWrapper;
  var NATIVE_SYMBOL;
  var thisSymbolValue;
  var symbolDescriptiveString;
  var regexp;
  var replace2;
  var stringSlice6;

  // node_modules/core-js/modules/es.number.constructor.js
  var $11 = require_export();
  var IS_PURE = require_is_pure();
  var DESCRIPTORS2 = require_descriptors();
  var global3 = require_global();
  var path = require_path();
  var uncurryThis5 = require_function_uncurry_this();
  var isForced = require_is_forced();
  var hasOwn3 = require_has_own_property();
  var inheritIfRequired = require_inherit_if_required();
  var isPrototypeOf2 = require_object_is_prototype_of();
  var isSymbol = require_is_symbol();
  var toPrimitive = require_to_primitive();
  var fails4 = require_fails();
  var getOwnPropertyNames = require_object_get_own_property_names().f;
  var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
  var defineProperty = require_object_define_property().f;
  var thisNumberValue = require_this_number_value();
  var trim = require_string_trim().trim;
  var NUMBER = "Number";
  var NativeNumber = global3[NUMBER];
  var PureNumberNamespace = path[NUMBER];
  var NumberPrototype = NativeNumber.prototype;
  var TypeError2 = global3.TypeError;
  var stringSlice3 = uncurryThis5("".slice);
  var charCodeAt = uncurryThis5("".charCodeAt);
  var toNumeric = function(value) {
    var primValue = toPrimitive(value, "number");
    return typeof primValue == "bigint" ? primValue : toNumber(primValue);
  };
  var toNumber = function(argument) {
    var it = toPrimitive(argument, "number");
    var first, third, radix, maxCode, digits, length, index, code;
    if (isSymbol(it))
      throw TypeError2("Cannot convert a Symbol value to a number");
    if (typeof it == "string" && it.length > 2) {
      it = trim(it);
      first = charCodeAt(it, 0);
      if (first === 43 || first === 45) {
        third = charCodeAt(it, 2);
        if (third === 88 || third === 120)
          return NaN;
      } else if (first === 48) {
        switch (charCodeAt(it, 1)) {
          case 66:
          case 98:
            radix = 2;
            maxCode = 49;
            break;
          case 79:
          case 111:
            radix = 8;
            maxCode = 55;
            break;
          default:
            return +it;
        }
        digits = stringSlice3(it, 2);
        length = digits.length;
        for (index = 0; index < length; index++) {
          code = charCodeAt(digits, index);
          if (code < 48 || code > maxCode)
            return NaN;
        }
        return parseInt(digits, radix);
      }
    }
    return +it;
  };
  var FORCED3 = isForced(NUMBER, !NativeNumber(" 0o1") || !NativeNumber("0b1") || NativeNumber("+0x1"));
  var calledWithNew = function(dummy) {
    return isPrototypeOf2(NumberPrototype, dummy) && fails4(function() {
      thisNumberValue(dummy);
    });
  };
  var NumberWrapper = function Number2(value) {
    var n4 = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value));
    return calledWithNew(this) ? inheritIfRequired(Object(n4), this, NumberWrapper) : n4;
  };
  NumberWrapper.prototype = NumberPrototype;
  if (FORCED3 && !IS_PURE)
    NumberPrototype.constructor = NumberWrapper;
  $11({ global: true, constructor: true, wrap: true, forced: FORCED3 }, {
    Number: NumberWrapper
  });
  var copyConstructorProperties2 = function(target, source) {
    for (var keys2 = DESCRIPTORS2 ? getOwnPropertyNames(source) : "MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","), j3 = 0, key; keys2.length > j3; j3++) {
      if (hasOwn3(source, key = keys2[j3]) && !hasOwn3(target, key)) {
        defineProperty(target, key, getOwnPropertyDescriptor(source, key));
      }
    }
  };
  if (IS_PURE && PureNumberNamespace)
    copyConstructorProperties2(path[NUMBER], PureNumberNamespace);
  if (FORCED3 || IS_PURE)
    copyConstructorProperties2(path[NUMBER], NativeNumber);

  // node_modules/core-js/modules/es.object.define-property.js
  var $12 = require_export();
  var DESCRIPTORS3 = require_descriptors();
  var defineProperty2 = require_object_define_property().f;
  $12({ target: "Object", stat: true, forced: Object.defineProperty !== defineProperty2, sham: !DESCRIPTORS3 }, {
    defineProperty: defineProperty2
  });

  // node_modules/core-js/modules/es.promise.js
  require_es_promise_constructor();
  require_es_promise_all();
  require_es_promise_catch();
  require_es_promise_race();
  require_es_promise_reject();
  require_es_promise_resolve();

  // node_modules/core-js/modules/es.symbol.iterator.js
  var defineWellKnownSymbol2 = require_well_known_symbol_define();
  defineWellKnownSymbol2("iterator");

  // srcts/src/shiny/index.ts
  var import_es_array_iterator52 = __toESM(require_es_array_iterator());

  // node_modules/core-js/modules/es.string.iterator.js
  var charAt = require_string_multibyte().charAt;
  var toString8 = require_to_string();
  var InternalStateModule = require_internal_state();
  var defineIterator = require_iterator_define();
  var createIterResultObject = require_create_iter_result_object();
  var STRING_ITERATOR = "String Iterator";
  var setInternalState = InternalStateModule.set;
  var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
  defineIterator(String, "String", function(iterated) {
    setInternalState(this, {
      type: STRING_ITERATOR,
      string: toString8(iterated),
      index: 0
    });
  }, function next() {
    var state = getInternalState(this);
    var string = state.string;
    var index = state.index;
    var point;
    if (index >= string.length)
      return createIterResultObject(void 0, true);
    point = charAt(string, index);
    state.index += point.length;
    return createIterResultObject(point, false);
  });

  // node_modules/core-js/modules/web.dom-collections.iterator.js
  var global4 = require_global();
  var DOMIterables = require_dom_iterables();
  var DOMTokenListPrototype = require_dom_token_list_prototype();
  var ArrayIteratorMethods = require_es_array_iterator();
  var createNonEnumerableProperty = require_create_non_enumerable_property();
  var wellKnownSymbol4 = require_well_known_symbol();
  var ITERATOR = wellKnownSymbol4("iterator");
  var TO_STRING_TAG = wellKnownSymbol4("toStringTag");
  var ArrayValues = ArrayIteratorMethods.values;
  var handlePrototype = function(CollectionPrototype, COLLECTION_NAME) {
    if (CollectionPrototype) {
      if (CollectionPrototype[ITERATOR] !== ArrayValues)
        try {
          createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
        } catch (error) {
          CollectionPrototype[ITERATOR] = ArrayValues;
        }
      if (!CollectionPrototype[TO_STRING_TAG]) {
        createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
      }
      if (DOMIterables[COLLECTION_NAME])
        for (var METHOD_NAME in ArrayIteratorMethods) {
          if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME])
            try {
              createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
            } catch (error) {
              CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
            }
        }
    }
  };
  for (COLLECTION_NAME in DOMIterables) {
    handlePrototype(global4[COLLECTION_NAME] && global4[COLLECTION_NAME].prototype, COLLECTION_NAME);
  }
  var COLLECTION_NAME;
  handlePrototype(DOMTokenListPrototype, "DOMTokenList");

  // node_modules/core-js/modules/es.symbol.async-iterator.js
  var defineWellKnownSymbol3 = require_well_known_symbol_define();
  defineWellKnownSymbol3("asyncIterator");

  // node_modules/core-js/modules/es.symbol.to-string-tag.js
  var getBuiltIn = require_get_built_in();
  var defineWellKnownSymbol4 = require_well_known_symbol_define();
  var setToStringTag = require_set_to_string_tag();
  defineWellKnownSymbol4("toStringTag");
  setToStringTag(getBuiltIn("Symbol"), "Symbol");

  // node_modules/core-js/modules/es.json.to-string-tag.js
  var global5 = require_global();
  var setToStringTag2 = require_set_to_string_tag();
  setToStringTag2(global5.JSON, "JSON", true);

  // node_modules/core-js/modules/es.math.to-string-tag.js
  var setToStringTag3 = require_set_to_string_tag();
  setToStringTag3(Math, "Math", true);

  // node_modules/core-js/modules/es.object.get-prototype-of.js
  var $13 = require_export();
  var fails5 = require_fails();
  var toObject2 = require_to_object();
  var nativeGetPrototypeOf = require_object_get_prototype_of();
  var CORRECT_PROTOTYPE_GETTER = require_correct_prototype_getter();
  var FAILS_ON_PRIMITIVES = fails5(function() {
    nativeGetPrototypeOf(1);
  });
  $13({ target: "Object", stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
    getPrototypeOf: function getPrototypeOf(it) {
      return nativeGetPrototypeOf(toObject2(it));
    }
  });

  // node_modules/core-js/modules/es.array.for-each.js
  var $14 = require_export();
  var forEach = require_array_for_each();
  $14({ target: "Array", proto: true, forced: [].forEach != forEach }, {
    forEach: forEach
  });

  // node_modules/core-js/modules/web.dom-collections.for-each.js
  var global6 = require_global();
  var DOMIterables2 = require_dom_iterables();
  var DOMTokenListPrototype2 = require_dom_token_list_prototype();
  var forEach2 = require_array_for_each();
  var createNonEnumerableProperty2 = require_create_non_enumerable_property();
  var handlePrototype2 = function(CollectionPrototype) {
    if (CollectionPrototype && CollectionPrototype.forEach !== forEach2)
      try {
        createNonEnumerableProperty2(CollectionPrototype, "forEach", forEach2);
      } catch (error) {
        CollectionPrototype.forEach = forEach2;
      }
  };
  for (COLLECTION_NAME in DOMIterables2) {
    if (DOMIterables2[COLLECTION_NAME]) {
      handlePrototype2(global6[COLLECTION_NAME] && global6[COLLECTION_NAME].prototype);
    }
  }
  var COLLECTION_NAME;
  handlePrototype2(DOMTokenListPrototype2);

  // node_modules/core-js/modules/es.function.name.js
  var DESCRIPTORS4 = require_descriptors();
  var FUNCTION_NAME_EXISTS = require_function_name().EXISTS;
  var uncurryThis6 = require_function_uncurry_this();
  var defineBuiltInAccessor2 = require_define_built_in_accessor();
  var FunctionPrototype = Function.prototype;
  var functionToString = uncurryThis6(FunctionPrototype.toString);
  var nameRE = /function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/;
  var regExpExec4 = uncurryThis6(nameRE.exec);
  var NAME = "name";
  if (DESCRIPTORS4 && !FUNCTION_NAME_EXISTS) {
    defineBuiltInAccessor2(FunctionPrototype, NAME, {
      configurable: true,
      get: function() {
        try {
          return regExpExec4(nameRE, functionToString(this))[1];
        } catch (error) {
          return "";
        }
      }
    });
  }

  // node_modules/core-js/modules/es.object.set-prototype-of.js
  var $15 = require_export();
  var setPrototypeOf = require_object_set_prototype_of();
  $15({ target: "Object", stat: true }, {
    setPrototypeOf: setPrototypeOf
  });

  // node_modules/core-js/modules/es.array.reverse.js
  var $16 = require_export();
  var uncurryThis7 = require_function_uncurry_this();
  var isArray2 = require_is_array();
  var nativeReverse = uncurryThis7([].reverse);
  var test = [1, 2];
  $16({ target: "Array", proto: true, forced: String(test) === String(test.reverse()) }, {
    reverse: function reverse() {
      if (isArray2(this))
        this.length = this.length;
      return nativeReverse(this);
    }
  });

  // node_modules/core-js/modules/es.array.slice.js
  var $17 = require_export();
  var isArray3 = require_is_array();
  var isConstructor = require_is_constructor();
  var isObject2 = require_is_object();
  var toAbsoluteIndex = require_to_absolute_index();
  var lengthOfArrayLike2 = require_length_of_array_like();
  var toIndexedObject = require_to_indexed_object();
  var createProperty2 = require_create_property();
  var wellKnownSymbol5 = require_well_known_symbol();
  var arrayMethodHasSpeciesSupport2 = require_array_method_has_species_support();
  var nativeSlice = require_array_slice();
  var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport2("slice");
  var SPECIES = wellKnownSymbol5("species");
  var $Array = Array;
  var max2 = Math.max;
  $17({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT }, {
    slice: function slice(start, end) {
      var O = toIndexedObject(this);
      var length = lengthOfArrayLike2(O);
      var k2 = toAbsoluteIndex(start, length);
      var fin = toAbsoluteIndex(end === void 0 ? length : end, length);
      var Constructor, result, n4;
      if (isArray3(O)) {
        Constructor = O.constructor;
        if (isConstructor(Constructor) && (Constructor === $Array || isArray3(Constructor.prototype))) {
          Constructor = void 0;
        } else if (isObject2(Constructor)) {
          Constructor = Constructor[SPECIES];
          if (Constructor === null)
            Constructor = void 0;
        }
        if (Constructor === $Array || Constructor === void 0) {
          return nativeSlice(O, k2, fin);
        }
      }
      result = new (Constructor === void 0 ? $Array : Constructor)(max2(fin - k2, 0));
      for (n4 = 0; k2 < fin; k2++, n4++)
        if (k2 in O)
          createProperty2(result, n4, O[k2]);
      result.length = n4;
      return result;
    }
  });

  // srcts/src/shiny/index.ts
  var import_jquery39 = __toESM(require_jquery());

  // srcts/src/bindings/registry.ts
  var import_es_array_iterator = __toESM(require_es_array_iterator());

  // srcts/src/utils/index.ts
  var import_es_regexp_exec2 = __toESM(require_es_regexp_exec());

  // node_modules/core-js/modules/es.regexp.to-string.js
  var PROPER_FUNCTION_NAME = require_function_name().PROPER;
  var defineBuiltIn3 = require_define_built_in();
  var anObject6 = require_an_object();
  var $toString = require_to_string();
  var fails6 = require_fails();
  var getRegExpFlags = require_regexp_get_flags();
  var TO_STRING = "toString";
  var RegExpPrototype = RegExp.prototype;
  var nativeToString = RegExpPrototype[TO_STRING];
  var NOT_GENERIC = fails6(function() {
    return nativeToString.call({ source: "a", flags: "b" }) != "/a/b";
  });
  var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name != TO_STRING;
  if (NOT_GENERIC || INCORRECT_NAME) {
    defineBuiltIn3(RegExp.prototype, TO_STRING, function toString13() {
      var R2 = anObject6(this);
      var pattern = $toString(R2.source);
      var flags = $toString(getRegExpFlags(R2));
      return "/" + pattern + "/" + flags;
    }, { unsafe: true });
  }

  // node_modules/core-js/modules/es.number.to-precision.js
  var $18 = require_export();
  var uncurryThis8 = require_function_uncurry_this();
  var fails7 = require_fails();
  var thisNumberValue2 = require_this_number_value();
  var nativeToPrecision = uncurryThis8(1 .toPrecision);
  var FORCED4 = fails7(function() {
    return nativeToPrecision(1, void 0) !== "1";
  }) || !fails7(function() {
    nativeToPrecision({});
  });
  $18({ target: "Number", proto: true, forced: FORCED4 }, {
    toPrecision: function toPrecision(precision) {
      return precision === void 0 ? nativeToPrecision(thisNumberValue2(this)) : nativeToPrecision(thisNumberValue2(this), precision);
    }
  });

  // node_modules/core-js/modules/es.array.splice.js
  var $19 = require_export();
  var toObject3 = require_to_object();
  var toAbsoluteIndex2 = require_to_absolute_index();
  var toIntegerOrInfinity2 = require_to_integer_or_infinity();
  var lengthOfArrayLike3 = require_length_of_array_like();
  var setArrayLength = require_array_set_length();
  var doesNotExceedSafeInteger2 = require_does_not_exceed_safe_integer();
  var arraySpeciesCreate2 = require_array_species_create();
  var createProperty3 = require_create_property();
  var deletePropertyOrThrow = require_delete_property_or_throw();
  var arrayMethodHasSpeciesSupport3 = require_array_method_has_species_support();
  var HAS_SPECIES_SUPPORT2 = arrayMethodHasSpeciesSupport3("splice");
  var max3 = Math.max;
  var min3 = Math.min;
  $19({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT2 }, {
    splice: function splice(start, deleteCount) {
      var O = toObject3(this);
      var len = lengthOfArrayLike3(O);
      var actualStart = toAbsoluteIndex2(start, len);
      var argumentsLength = arguments.length;
      var insertCount, actualDeleteCount, A2, k2, from2, to;
      if (argumentsLength === 0) {
        insertCount = actualDeleteCount = 0;
      } else if (argumentsLength === 1) {
        insertCount = 0;
        actualDeleteCount = len - actualStart;
      } else {
        insertCount = argumentsLength - 2;
        actualDeleteCount = min3(max3(toIntegerOrInfinity2(deleteCount), 0), len - actualStart);
      }
      doesNotExceedSafeInteger2(len + insertCount - actualDeleteCount);
      A2 = arraySpeciesCreate2(O, actualDeleteCount);
      for (k2 = 0; k2 < actualDeleteCount; k2++) {
        from2 = actualStart + k2;
        if (from2 in O)
          createProperty3(A2, k2, O[from2]);
      }
      A2.length = actualDeleteCount;
      if (insertCount < actualDeleteCount) {
        for (k2 = actualStart; k2 < len - actualDeleteCount; k2++) {
          from2 = k2 + actualDeleteCount;
          to = k2 + insertCount;
          if (from2 in O)
            O[to] = O[from2];
          else
            deletePropertyOrThrow(O, to);
        }
        for (k2 = len; k2 > len - actualDeleteCount + insertCount; k2--)
          deletePropertyOrThrow(O, k2 - 1);
      } else if (insertCount > actualDeleteCount) {
        for (k2 = len - actualDeleteCount; k2 > actualStart; k2--) {
          from2 = k2 + actualDeleteCount - 1;
          to = k2 + insertCount - 1;
          if (from2 in O)
            O[to] = O[from2];
          else
            deletePropertyOrThrow(O, to);
        }
      }
      for (k2 = 0; k2 < insertCount; k2++) {
        O[k2 + actualStart] = arguments[k2 + 2];
      }
      setArrayLength(O, len - actualDeleteCount + insertCount);
      return A2;
    }
  });

  // node_modules/core-js/modules/es.object.keys.js
  var $20 = require_export();
  var toObject4 = require_to_object();
  var nativeKeys = require_object_keys();
  var fails8 = require_fails();
  var FAILS_ON_PRIMITIVES2 = fails8(function() {
    nativeKeys(1);
  });
  $20({ target: "Object", stat: true, forced: FAILS_ON_PRIMITIVES2 }, {
    keys: function keys(it) {
      return nativeKeys(toObject4(it));
    }
  });

  // srcts/src/utils/index.ts
  var import_jquery4 = __toESM(require_jquery());

  // srcts/src/window/pixelRatio.ts
  function windowDevicePixelRatio() {
    return window.devicePixelRatio;
  }

  // srcts/src/utils/object.ts
  function hasOwnProperty(obj, prop) {
    return Object.prototype.hasOwnProperty.call(obj, prop);
  }
  function hasDefinedProperty(obj, prop) {
    return Object.prototype.hasOwnProperty.call(obj, prop) && obj[prop] !== void 0;
  }
  function ifUndefined(value, alternate) {
    if (value === void 0)
      return alternate;
    return value;
  }

  // srcts/src/utils/index.ts
  function escapeHTML(str) {
    var escaped = {
      "&": "&amp;",
      "<": "&lt;",
      ">": "&gt;",
      '"': "&quot;",
      "'": "&#039;",
      "/": "&#x2F;"
    };
    return str.replace(/[&<>'"/]/g, function(m2) {
      return escaped[m2];
    });
  }
  function randomId() {
    return Math.floor(4294967296 + Math.random() * 64424509440).toString(16);
  }
  function strToBool(str) {
    if (!str || !str.toLowerCase)
      return void 0;
    switch (str.toLowerCase()) {
      case "true":
        return true;
      case "false":
        return false;
      default:
        return void 0;
    }
  }
  function getStyle(el, styleProp) {
    var x2 = void 0;
    if ("currentStyle" in el) {
      x2 = el.currentStyle[styleProp];
    } else {
      var _document, _document$defaultView;
      var style = (_document = document) === null || _document === void 0 ? void 0 : (_document$defaultView = _document.defaultView) === null || _document$defaultView === void 0 ? void 0 : _document$defaultView.getComputedStyle(el, null);
      if (style)
        x2 = style.getPropertyValue(styleProp);
    }
    return x2;
  }
  function padZeros(n4, digits) {
    var str = n4.toString();
    while (str.length < digits)
      str = "0" + str;
    return str;
  }
  function roundSignif(x2) {
    var digits = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
    if (digits < 1)
      throw "Significant digits must be at least 1.";
    return parseFloat(x2.toPrecision(digits));
  }
  function parseDate(dateString) {
    var date = new Date(dateString);
    if (date.toString() === "Invalid Date") {
      date = new Date(dateString.replace(/-/g, "/"));
    }
    return date;
  }
  function formatDateUTC(date) {
    if (date instanceof Date) {
      return date.getUTCFullYear() + "-" + padZeros(date.getUTCMonth() + 1, 2) + "-" + padZeros(date.getUTCDate(), 2);
    } else {
      return null;
    }
  }
  function makeResizeFilter(el, func) {
    var lastSize = {};
    return function() {
      var rect = el.getBoundingClientRect();
      var size = {
        w: rect.width,
        h: rect.height
      };
      if (size.w === 0 && size.h === 0)
        return;
      if (size.w === lastSize.w && size.h === lastSize.h)
        return;
      lastSize = size;
      func(size.w, size.h);
    };
  }
  function pixelRatio() {
    if (windowDevicePixelRatio()) {
      return Math.round(windowDevicePixelRatio() * 100) / 100;
    } else {
      return 1;
    }
  }
  function getBoundingClientSizeBeforeZoom(el) {
    var rect = el.getBoundingClientRect();
    var zoom = el.currentCSSZoom || 1;
    return {
      width: rect.width / zoom,
      height: rect.height / zoom
    };
  }
  function scopeExprToFunc(expr) {
    var exprEscaped = expr.replace(/[\\"']/g, "\\$&").replace(/\u0000/g, "\\0").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\b]/g, "\\b");
    var func;
    try {
      func = new Function("with (this) {\n        try {\n          return (".concat(expr, ");\n        } catch (e) {\n          console.error('Error evaluating expression: ").concat(exprEscaped, "');\n          throw e;\n        }\n      }"));
    } catch (e4) {
      console.error("Error parsing expression: " + expr);
      throw e4;
    }
    return function(scope) {
      return func.call(scope);
    };
  }
  function asArray(value) {
    if (value === null || value === void 0)
      return [];
    if (Array.isArray(value))
      return value;
    return [value];
  }
  function mergeSort(list, sortfunc) {
    function merge(a3, b3) {
      var ia = 0;
      var ib = 0;
      var sorted = [];
      while (ia < a3.length && ib < b3.length) {
        if (sortfunc(a3[ia], b3[ib]) <= 0) {
          sorted.push(a3[ia++]);
        } else {
          sorted.push(b3[ib++]);
        }
      }
      while (ia < a3.length)
        sorted.push(a3[ia++]);
      while (ib < b3.length)
        sorted.push(b3[ib++]);
      return sorted;
    }
    list = list.slice(0);
    for (var chunkSize = 1; chunkSize < list.length; chunkSize *= 2) {
      for (var i5 = 0; i5 < list.length; i5 += chunkSize * 2) {
        var listA = list.slice(i5, i5 + chunkSize);
        var listB = list.slice(i5 + chunkSize, i5 + chunkSize * 2);
        var merged = merge(listA, listB);
        var args = [i5, merged.length];
        Array.prototype.push.apply(args, merged);
        Array.prototype.splice.apply(list, args);
      }
    }
    return list;
  }
  function $escape(val) {
    if (typeof val === "undefined")
      return val;
    return val.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
  }
  function mapValues(obj, f4) {
    var newObj = {};
    Object.keys(obj).forEach(function(key) {
      newObj[key] = f4(obj[key], key, obj);
    });
    return newObj;
  }
  function isnan(x2) {
    return typeof x2 === "number" && isNaN(x2);
  }
  function _equal(x2, y4) {
    if (import_jquery4.default.type(x2) === "object" && import_jquery4.default.type(y4) === "object") {
      var xo = x2;
      var yo = y4;
      if (Object.keys(xo).length !== Object.keys(yo).length)
        return false;
      for (var prop in xo) {
        if (!hasOwnProperty(yo, prop) || !_equal(xo[prop], yo[prop]))
          return false;
      }
      return true;
    } else if (import_jquery4.default.type(x2) === "array" && import_jquery4.default.type(y4) === "array") {
      var xa = x2;
      var ya = y4;
      if (xa.length !== ya.length)
        return false;
      for (var i5 = 0; i5 < xa.length; i5++)
        if (!_equal(xa[i5], ya[i5]))
          return false;
      return true;
    } else {
      return x2 === y4;
    }
  }
  function equal() {
    if (arguments.length < 2)
      throw new Error("equal requires at least two arguments.");
    for (var i5 = 0; i5 < arguments.length - 1; i5++) {
      if (!_equal(i5 < 0 || arguments.length <= i5 ? void 0 : arguments[i5], i5 + 1 < 0 || arguments.length <= i5 + 1 ? void 0 : arguments[i5 + 1]))
        return false;
    }
    return true;
  }
  var compareVersion = function compareVersion2(a3, op, b3) {
    function versionParts(ver) {
      return (ver + "").replace(/-/, ".").replace(/(\.0)+[^.]*$/, "").split(".");
    }
    function cmpVersion(a4, b4) {
      var aParts = versionParts(a4);
      var bParts = versionParts(b4);
      var len = Math.min(aParts.length, bParts.length);
      var cmp;
      for (var i5 = 0; i5 < len; i5++) {
        cmp = parseInt(aParts[i5], 10) - parseInt(bParts[i5], 10);
        if (cmp !== 0) {
          return cmp;
        }
      }
      return aParts.length - bParts.length;
    }
    var diff = cmpVersion(a3, b3);
    if (op === "==")
      return diff === 0;
    else if (op === ">=")
      return diff >= 0;
    else if (op === ">")
      return diff > 0;
    else if (op === "<=")
      return diff <= 0;
    else if (op === "<")
      return diff < 0;
    else
      throw "Unknown operator: ".concat(op);
  };
  function updateLabel(labelTxt, labelNode) {
    if (typeof labelTxt === "undefined")
      return;
    if (labelNode.length !== 1) {
      throw new Error("labelNode must be of length 1");
    }
    var emptyLabel = Array.isArray(labelTxt) && labelTxt.length === 0;
    if (emptyLabel) {
      labelNode.addClass("shiny-label-null");
    } else {
      labelNode.text(labelTxt);
      labelNode.removeClass("shiny-label-null");
    }
  }
  function getComputedLinkColor(el) {
    var a3 = document.createElement("a");
    a3.href = "/";
    var div = document.createElement("div");
    div.style.setProperty("position", "absolute", "important");
    div.style.setProperty("top", "-1000px", "important");
    div.style.setProperty("left", "0", "important");
    div.style.setProperty("width", "30px", "important");
    div.style.setProperty("height", "10px", "important");
    div.appendChild(a3);
    el.appendChild(div);
    var linkColor = window.getComputedStyle(a3).getPropertyValue("color");
    el.removeChild(div);
    return linkColor;
  }
  function isBS3() {
    return !window.bootstrap;
  }

  // srcts/src/bindings/registry.ts
  function _typeof(obj) {
    "@babel/helpers - typeof";
    return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof(obj);
  }
  function _classCallCheck(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
    }
  }
  function _createClass(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _defineProperty(obj, key, value) {
    key = _toPropertyKey(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey(arg) {
    var key = _toPrimitive(arg, "string");
    return _typeof(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive(input, hint) {
    if (_typeof(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  var BindingRegistry = /* @__PURE__ */ function() {
    function BindingRegistry2() {
      _classCallCheck(this, BindingRegistry2);
      _defineProperty(this, "name", void 0);
      _defineProperty(this, "bindings", []);
      _defineProperty(this, "bindingNames", {});
    }
    _createClass(BindingRegistry2, [{
      key: "register",
      value: function register2(binding, bindingName) {
        var priority = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
        var bindingObj = {
          binding: binding,
          priority: priority
        };
        this.bindings.unshift(bindingObj);
        if (bindingName) {
          this.bindingNames[bindingName] = bindingObj;
          binding.name = bindingName;
        }
      }
    }, {
      key: "setPriority",
      value: function setPriority(bindingName, priority) {
        var bindingObj = this.bindingNames[bindingName];
        if (!bindingObj)
          throw "Tried to set priority on unknown binding " + bindingName;
        bindingObj.priority = priority || 0;
      }
    }, {
      key: "getPriority",
      value: function getPriority(bindingName) {
        var bindingObj = this.bindingNames[bindingName];
        if (!bindingObj)
          return false;
        return bindingObj.priority;
      }
    }, {
      key: "getBindings",
      value: function getBindings() {
        return mergeSort(this.bindings, function(a3, b3) {
          return b3.priority - a3.priority;
        });
      }
    }]);
    return BindingRegistry2;
  }();

  // srcts/src/bindings/input/inputBinding.ts
  var import_es_array_iterator2 = __toESM(require_es_array_iterator());
  function _typeof2(obj) {
    "@babel/helpers - typeof";
    return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof2(obj);
  }
  function _classCallCheck2(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties2(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey2(descriptor.key), descriptor);
    }
  }
  function _createClass2(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties2(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties2(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _defineProperty2(obj, key, value) {
    key = _toPropertyKey2(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey2(arg) {
    var key = _toPrimitive2(arg, "string");
    return _typeof2(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive2(input, hint) {
    if (_typeof2(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof2(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  var InputBinding = /* @__PURE__ */ function() {
    function InputBinding2() {
      _classCallCheck2(this, InputBinding2);
      _defineProperty2(this, "name", void 0);
    }
    _createClass2(InputBinding2, [{
      key: "find",
      value: function find2(scope) {
        throw "Not implemented";
        scope;
      }
    }, {
      key: "getId",
      value: function getId(el) {
        return el.getAttribute("data-input-id") || el.id;
      }
    }, {
      key: "getType",
      value: function getType(el) {
        return null;
        el;
      }
    }, {
      key: "getValue",
      value: function getValue(el) {
        throw "Not implemented";
        el;
      }
    }, {
      key: "subscribe",
      value: function subscribe(el, callback) {
        el;
        callback;
      }
    }, {
      key: "unsubscribe",
      value: function unsubscribe(el) {
        el;
      }
    }, {
      key: "receiveMessage",
      value: function receiveMessage(el, data) {
        throw "Not implemented";
        el;
        data;
      }
    }, {
      key: "getState",
      value: function getState(el) {
        throw "Not implemented";
        el;
      }
    }, {
      key: "getRatePolicy",
      value: function getRatePolicy(el) {
        return null;
        el;
      }
    }, {
      key: "initialize",
      value: function initialize(el) {
        el;
      }
    }, {
      key: "dispose",
      value: function dispose(el) {
        el;
      }
    }]);
    return InputBinding2;
  }();

  // node_modules/core-js/modules/es.reflect.to-string-tag.js
  var $22 = require_export();
  var global7 = require_global();
  var setToStringTag4 = require_set_to_string_tag();
  $22({ global: true }, { Reflect: {} });
  setToStringTag4(global7.Reflect, "Reflect", true);

  // node_modules/core-js/modules/es.reflect.construct.js
  var $23 = require_export();
  var getBuiltIn2 = require_get_built_in();
  var apply3 = require_function_apply();
  var bind = require_function_bind();
  var aConstructor = require_a_constructor();
  var anObject7 = require_an_object();
  var isObject3 = require_is_object();
  var create = require_object_create();
  var fails9 = require_fails();
  var nativeConstruct = getBuiltIn2("Reflect", "construct");
  var ObjectPrototype = Object.prototype;
  var push3 = [].push;
  var NEW_TARGET_BUG = fails9(function() {
    function F() {
    }
    return !(nativeConstruct(function() {
    }, [], F) instanceof F);
  });
  var ARGS_BUG = !fails9(function() {
    nativeConstruct(function() {
    });
  });
  var FORCED5 = NEW_TARGET_BUG || ARGS_BUG;
  $23({ target: "Reflect", stat: true, forced: FORCED5, sham: FORCED5 }, {
    construct: function construct(Target, args) {
      aConstructor(Target);
      anObject7(args);
      var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
      if (ARGS_BUG && !NEW_TARGET_BUG)
        return nativeConstruct(Target, args, newTarget);
      if (Target == newTarget) {
        switch (args.length) {
          case 0:
            return new Target();
          case 1:
            return new Target(args[0]);
          case 2:
            return new Target(args[0], args[1]);
          case 3:
            return new Target(args[0], args[1], args[2]);
          case 4:
            return new Target(args[0], args[1], args[2], args[3]);
        }
        var $args = [null];
        apply3(push3, $args, args);
        return new (apply3(bind, Target, $args))();
      }
      var proto = newTarget.prototype;
      var instance = create(isObject3(proto) ? proto : ObjectPrototype);
      var result = apply3(Target, instance, args);
      return isObject3(result) ? result : instance;
    }
  });

  // srcts/src/bindings/input/actionbutton.ts
  var import_es_array_iterator3 = __toESM(require_es_array_iterator());
  var import_jquery5 = __toESM(require_jquery());
  function _typeof3(obj) {
    "@babel/helpers - typeof";
    return _typeof3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof3(obj);
  }
  function _classCallCheck3(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties3(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey3(descriptor.key), descriptor);
    }
  }
  function _createClass3(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties3(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties3(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey3(arg) {
    var key = _toPrimitive3(arg, "string");
    return _typeof3(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive3(input, hint) {
    if (_typeof3(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof3(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _inherits(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf(subClass, superClass);
  }
  function _setPrototypeOf(o4, p3) {
    _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf(o4, p3);
  }
  function _createSuper(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn(this, result);
    };
  }
  function _possibleConstructorReturn(self2, call8) {
    if (call8 && (_typeof3(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized(self2);
  }
  function _assertThisInitialized(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf(o4) {
    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf(o4);
  }
  var ActionButtonInputBinding = /* @__PURE__ */ function(_InputBinding) {
    _inherits(ActionButtonInputBinding2, _InputBinding);
    var _super = _createSuper(ActionButtonInputBinding2);
    function ActionButtonInputBinding2() {
      _classCallCheck3(this, ActionButtonInputBinding2);
      return _super.apply(this, arguments);
    }
    _createClass3(ActionButtonInputBinding2, [{
      key: "find",
      value: function find2(scope) {
        return (0, import_jquery5.default)(scope).find(".action-button");
      }
    }, {
      key: "getValue",
      value: function getValue(el) {
        return (0, import_jquery5.default)(el).data("val") || 0;
      }
    }, {
      key: "setValue",
      value: function setValue(el, value) {
        (0, import_jquery5.default)(el).data("val", value);
      }
    }, {
      key: "getType",
      value: function getType(el) {
        return "shiny.action";
        el;
      }
    }, {
      key: "subscribe",
      value: function subscribe(el, callback) {
        (0, import_jquery5.default)(el).on(
          "click.actionButtonInputBinding",
          function() {
            var $el = (0, import_jquery5.default)(this);
            var val = $el.data("val") || 0;
            $el.data("val", val + 1);
            callback(false);
          }
        );
      }
    }, {
      key: "getState",
      value: function getState(el) {
        return {
          value: this.getValue(el)
        };
      }
    }, {
      key: "receiveMessage",
      value: function receiveMessage(el, data) {
        var $el = (0, import_jquery5.default)(el);
        if (hasDefinedProperty(data, "label") || hasDefinedProperty(data, "icon")) {
          var label = $el.text();
          var icon = "";
          if ($el.find("i[class]").length > 0) {
            var iconHtml = $el.find("i[class]")[0];
            if (iconHtml === $el.children()[0]) {
              icon = (0, import_jquery5.default)(iconHtml).prop("outerHTML");
            }
          }
          if (hasDefinedProperty(data, "label")) {
            label = data.label;
          }
          if (hasDefinedProperty(data, "icon")) {
            var _data$icon;
            icon = Array.isArray(data.icon) ? "" : (_data$icon = data.icon) !== null && _data$icon !== void 0 ? _data$icon : "";
          }
          $el.html(icon + " " + label);
        }
        if (hasDefinedProperty(data, "disabled")) {
          if (data.disabled) {
            $el.attr("disabled", "");
          } else {
            $el.attr("disabled", null);
          }
        }
      }
    }, {
      key: "unsubscribe",
      value: function unsubscribe(el) {
        (0, import_jquery5.default)(el).off(".actionButtonInputBinding");
      }
    }]);
    return ActionButtonInputBinding2;
  }(InputBinding);
  (0, import_jquery5.default)(document).on("click", "a.action-button", function(e4) {
    e4.preventDefault();
  });

  // srcts/src/bindings/input/checkbox.ts
  var import_es_array_iterator4 = __toESM(require_es_array_iterator());
  var import_jquery6 = __toESM(require_jquery());
  function _typeof4(obj) {
    "@babel/helpers - typeof";
    return _typeof4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof4(obj);
  }
  function _classCallCheck4(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties4(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey4(descriptor.key), descriptor);
    }
  }
  function _createClass4(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties4(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties4(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey4(arg) {
    var key = _toPrimitive4(arg, "string");
    return _typeof4(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive4(input, hint) {
    if (_typeof4(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof4(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _inherits2(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf2(subClass, superClass);
  }
  function _setPrototypeOf2(o4, p3) {
    _setPrototypeOf2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf2(o4, p3);
  }
  function _createSuper2(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct2();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf2(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf2(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn2(this, result);
    };
  }
  function _possibleConstructorReturn2(self2, call8) {
    if (call8 && (_typeof4(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized2(self2);
  }
  function _assertThisInitialized2(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct2() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf2(o4) {
    _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf2(o4);
  }
  var CheckboxInputBinding = /* @__PURE__ */ function(_InputBinding) {
    _inherits2(CheckboxInputBinding2, _InputBinding);
    var _super = _createSuper2(CheckboxInputBinding2);
    function CheckboxInputBinding2() {
      _classCallCheck4(this, CheckboxInputBinding2);
      return _super.apply(this, arguments);
    }
    _createClass4(CheckboxInputBinding2, [{
      key: "find",
      value: function find2(scope) {
        return (0, import_jquery6.default)(scope).find('input[type="checkbox"]');
      }
    }, {
      key: "getValue",
      value: function getValue(el) {
        return el.checked;
      }
    }, {
      key: "setValue",
      value: function setValue(el, value) {
        el.checked = value;
      }
    }, {
      key: "subscribe",
      value: function subscribe(el, callback) {
        (0, import_jquery6.default)(el).on("change.checkboxInputBinding", function() {
          callback(true);
        });
      }
    }, {
      key: "unsubscribe",
      value: function unsubscribe(el) {
        (0, import_jquery6.default)(el).off(".checkboxInputBinding");
      }
    }, {
      key: "getState",
      value: function getState(el) {
        return {
          label: (0, import_jquery6.default)(el).parent().find("span").text(),
          value: el.checked
        };
      }
    }, {
      key: "receiveMessage",
      value: function receiveMessage(el, data) {
        if (hasDefinedProperty(data, "value")) {
          el.checked = data.value;
        }
        if (hasDefinedProperty(data, "label")) {
          (0, import_jquery6.default)(el).parent().find("span").text(data.label);
        }
        (0, import_jquery6.default)(el).trigger("change");
      }
    }]);
    return CheckboxInputBinding2;
  }(InputBinding);

  // node_modules/core-js/modules/es.string.trim.js
  var $26 = require_export();
  var $trim = require_string_trim().trim;
  var forcedStringTrimMethod = require_string_trim_forced();
  $26({ target: "String", proto: true, forced: forcedStringTrimMethod("trim") }, {
    trim: function trim2() {
      return $trim(this);
    }
  });

  // srcts/src/bindings/input/checkboxgroup.ts
  var import_es_array_iterator5 = __toESM(require_es_array_iterator());
  var import_jquery7 = __toESM(require_jquery());
  function _typeof5(obj) {
    "@babel/helpers - typeof";
    return _typeof5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof5(obj);
  }
  function _classCallCheck5(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties5(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey5(descriptor.key), descriptor);
    }
  }
  function _createClass5(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties5(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties5(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey5(arg) {
    var key = _toPrimitive5(arg, "string");
    return _typeof5(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive5(input, hint) {
    if (_typeof5(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof5(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _inherits3(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf3(subClass, superClass);
  }
  function _setPrototypeOf3(o4, p3) {
    _setPrototypeOf3 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf3(o4, p3);
  }
  function _createSuper3(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct3();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf3(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf3(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn3(this, result);
    };
  }
  function _possibleConstructorReturn3(self2, call8) {
    if (call8 && (_typeof5(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized3(self2);
  }
  function _assertThisInitialized3(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct3() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf3(o4) {
    _getPrototypeOf3 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf3(o4);
  }
  function getLabelNode(el) {
    return (0, import_jquery7.default)(el).find('label[for="' + $escape(el.id) + '"]');
  }
  function getLabel(obj) {
    var parentNode = obj.parentNode;
    if (parentNode.tagName === "LABEL") {
      return (0, import_jquery7.default)(parentNode).find("span").text().trim();
    }
    return null;
  }
  var CheckboxGroupInputBinding = /* @__PURE__ */ function(_InputBinding) {
    _inherits3(CheckboxGroupInputBinding2, _InputBinding);
    var _super = _createSuper3(CheckboxGroupInputBinding2);
    function CheckboxGroupInputBinding2() {
      _classCallCheck5(this, CheckboxGroupInputBinding2);
      return _super.apply(this, arguments);
    }
    _createClass5(CheckboxGroupInputBinding2, [{
      key: "find",
      value: function find2(scope) {
        return (0, import_jquery7.default)(scope).find(".shiny-input-checkboxgroup");
      }
    }, {
      key: "getValue",
      value: function getValue(el) {
        var $objs = (0, import_jquery7.default)('input:checkbox[name="' + $escape(el.id) + '"]:checked');
        var values2 = new Array($objs.length);
        for (var i5 = 0; i5 < $objs.length; i5++) {
          values2[i5] = $objs[i5].value;
        }
        return values2;
      }
    }, {
      key: "setValue",
      value: function setValue(el, value) {
        var _value;
        value = (_value = value) !== null && _value !== void 0 ? _value : [];
        (0, import_jquery7.default)('input:checkbox[name="' + $escape(el.id) + '"]').prop("checked", false);
        if (value instanceof Array) {
          for (var i5 = 0; i5 < value.length; i5++) {
            (0, import_jquery7.default)('input:checkbox[name="' + $escape(el.id) + '"][value="' + $escape(value[i5]) + '"]').prop("checked", true);
          }
        } else {
          (0, import_jquery7.default)('input:checkbox[name="' + $escape(el.id) + '"][value="' + $escape(value) + '"]').prop("checked", true);
        }
      }
    }, {
      key: "getState",
      value: function getState(el) {
        var $objs = (0, import_jquery7.default)('input:checkbox[name="' + $escape(el.id) + '"]');
        var options = new Array($objs.length);
        for (var i5 = 0; i5 < options.length; i5++) {
          options[i5] = {
            value: $objs[i5].value,
            label: getLabel($objs[i5])
          };
        }
        return {
          label: getLabelNode(el).text(),
          value: this.getValue(el),
          options: options
        };
      }
    }, {
      key: "receiveMessage",
      value: function receiveMessage(el, data) {
        var $el = (0, import_jquery7.default)(el);
        if (hasDefinedProperty(data, "options")) {
          $el.find("div.shiny-options-group").remove();
          $el.find("label.checkbox").remove();
          $el.append(data.options);
        }
        if (hasDefinedProperty(data, "value")) {
          this.setValue(el, data.value);
        }
        updateLabel(data.label, getLabelNode(el));
        (0, import_jquery7.default)(el).trigger("change");
      }
    }, {
      key: "subscribe",
      value: function subscribe(el, callback) {
        (0, import_jquery7.default)(el).on("change.checkboxGroupInputBinding", function() {
          callback(false);
        });
      }
    }, {
      key: "unsubscribe",
      value: function unsubscribe(el) {
        (0, import_jquery7.default)(el).off(".checkboxGroupInputBinding");
      }
    }]);
    return CheckboxGroupInputBinding2;
  }(InputBinding);

  // srcts/src/bindings/input/date.ts
  var import_es_array_iterator6 = __toESM(require_es_array_iterator());
  var import_jquery8 = __toESM(require_jquery());
  function _typeof6(obj) {
    "@babel/helpers - typeof";
    return _typeof6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof6(obj);
  }
  function _classCallCheck6(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties6(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey6(descriptor.key), descriptor);
    }
  }
  function _createClass6(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties6(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties6(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey6(arg) {
    var key = _toPrimitive6(arg, "string");
    return _typeof6(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive6(input, hint) {
    if (_typeof6(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof6(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _inherits4(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf4(subClass, superClass);
  }
  function _setPrototypeOf4(o4, p3) {
    _setPrototypeOf4 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf4(o4, p3);
  }
  function _createSuper4(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct4();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf4(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf4(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn4(this, result);
    };
  }
  function _possibleConstructorReturn4(self2, call8) {
    if (call8 && (_typeof6(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized4(self2);
  }
  function _assertThisInitialized4(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct4() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf4(o4) {
    _getPrototypeOf4 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf4(o4);
  }
  var DateInputBindingBase = /* @__PURE__ */ function(_InputBinding) {
    _inherits4(DateInputBindingBase2, _InputBinding);
    var _super = _createSuper4(DateInputBindingBase2);
    function DateInputBindingBase2() {
      _classCallCheck6(this, DateInputBindingBase2);
      return _super.apply(this, arguments);
    }
    _createClass6(DateInputBindingBase2, [{
      key: "find",
      value: function find2(scope) {
        return (0, import_jquery8.default)(scope).find(".shiny-date-input");
      }
    }, {
      key: "getType",
      value: function getType(el) {
        return "shiny.date";
        el;
      }
    }, {
      key: "subscribe",
      value: function subscribe(el, callback) {
        (0, import_jquery8.default)(el).on(
          "changeDate.dateInputBinding change.dateInputBinding",
          function() {
            callback(false);
          }
        );
      }
    }, {
      key: "unsubscribe",
      value: function unsubscribe(el) {
        (0, import_jquery8.default)(el).off(".dateInputBinding");
      }
    }, {
      key: "getRatePolicy",
      value: function getRatePolicy() {
        return {
          policy: "debounce",
          delay: 250
        };
      }
    }, {
      key: "setValue",
      value: function setValue(el, data) {
        throw "not implemented";
        el;
        data;
      }
    }, {
      key: "initialize",
      value: function initialize(el) {
        var $input = (0, import_jquery8.default)(el).find("input");
        var date = $input.data("initial-date");
        if (date === void 0 || date === null) {
          date = this._floorDateTime(this._dateAsUTC(new Date()));
        }
        this.setValue(el, date);
        if ($input.data("min-date") !== void 0) {
          this._setMin($input[0], $input.data("min-date"));
        }
        if ($input.data("max-date") !== void 0) {
          this._setMax($input[0], $input.data("max-date"));
        }
      }
    }, {
      key: "_getLabelNode",
      value: function _getLabelNode(el) {
        return (0, import_jquery8.default)(el).find('label[for="' + $escape(el.id) + '"]');
      }
    }, {
      key: "_formatToString",
      value: function _formatToString(format) {
        var str = "";
        var i5;
        for (i5 = 0; i5 < format.parts.length; i5++) {
          str += format.separators[i5] + format.parts[i5];
        }
        str += format.separators[i5];
        return str;
      }
    }, {
      key: "_setMin",
      value: function _setMin(el, date) {
        if (date === null) {
          (0, import_jquery8.default)(el).bsDatepicker("setStartDate", null);
          return;
        }
        var parsedDate = this._newDate(date);
        if (parsedDate === null)
          return;
        date = parsedDate;
        if (isNaN(date.valueOf()))
          return;
        var curValue = (0, import_jquery8.default)(el).bsDatepicker("getUTCDate");
        (0, import_jquery8.default)(el).bsDatepicker("setStartDate", this._utcDateAsLocal(date));
        if (date && curValue && date.getTime() > curValue.getTime()) {
          (0, import_jquery8.default)(el).bsDatepicker("clearDates");
        } else {
          (0, import_jquery8.default)(el).bsDatepicker("setUTCDate", curValue);
        }
      }
    }, {
      key: "_setMax",
      value: function _setMax(el, date) {
        if (date === null) {
          (0, import_jquery8.default)(el).bsDatepicker("setEndDate", null);
          return;
        }
        var parsedDate = this._newDate(date);
        if (parsedDate === null)
          return;
        date = parsedDate;
        if (isNaN(date.valueOf()))
          return;
        var curValue = (0, import_jquery8.default)(el).bsDatepicker("getUTCDate");
        (0, import_jquery8.default)(el).bsDatepicker("setEndDate", this._utcDateAsLocal(date));
        if (date && curValue && date.getTime() < curValue.getTime()) {
          (0, import_jquery8.default)(el).bsDatepicker("clearDates");
        } else {
          (0, import_jquery8.default)(el).bsDatepicker("setUTCDate", curValue);
        }
      }
    }, {
      key: "_newDate",
      value: function _newDate(date) {
        if (date instanceof Date)
          return date;
        if (!date)
          return null;
        var d4 = parseDate(date);
        if (isNaN(d4.valueOf()))
          return null;
        return d4;
      }
    }, {
      key: "_floorDateTime",
      value: function _floorDateTime(date) {
        date = new Date(date.getTime());
        date.setUTCHours(0, 0, 0, 0);
        return date;
      }
    }, {
      key: "_dateAsUTC",
      value: function _dateAsUTC(date) {
        return new Date(date.getTime() - date.getTimezoneOffset() * 6e4);
      }
    }, {
      key: "_utcDateAsLocal",
      value: function _utcDateAsLocal(date) {
        return new Date(date.getTime() + date.getTimezoneOffset() * 6e4);
      }
    }]);
    return DateInputBindingBase2;
  }(InputBinding);
  var DateInputBinding = /* @__PURE__ */ function(_DateInputBindingBase) {
    _inherits4(DateInputBinding2, _DateInputBindingBase);
    var _super2 = _createSuper4(DateInputBinding2);
    function DateInputBinding2() {
      _classCallCheck6(this, DateInputBinding2);
      return _super2.apply(this, arguments);
    }
    _createClass6(DateInputBinding2, [{
      key: "getValue",
      value: function getValue(el) {
        var date = (0, import_jquery8.default)(el).find("input").bsDatepicker("getUTCDate");
        return formatDateUTC(date);
      }
    }, {
      key: "setValue",
      value: function setValue(el, value) {
        if (value === null) {
          (0, import_jquery8.default)(el).find("input").val("").bsDatepicker("update");
          return;
        }
        var date = this._newDate(value);
        if (date === null) {
          return;
        }
        if (isNaN(date.valueOf()))
          return;
        (0, import_jquery8.default)(el).find("input").bsDatepicker("setUTCDate", date);
      }
    }, {
      key: "getState",
      value: function getState(el) {
        var $el = (0, import_jquery8.default)(el);
        var $input = $el.find("input");
        var min6 = $input.data("datepicker").startDate;
        var max4 = $input.data("datepicker").endDate;
        min6 = min6 === -Infinity ? null : formatDateUTC(min6);
        max4 = max4 === Infinity ? null : formatDateUTC(max4);
        var startview = $input.data("datepicker").startViewMode;
        if (startview === 2)
          startview = "decade";
        else if (startview === 1)
          startview = "year";
        else if (startview === 0)
          startview = "month";
        return {
          label: this._getLabelNode(el).text(),
          value: this.getValue(el),
          valueString: $input.val(),
          min: min6,
          max: max4,
          language: $input.data("datepicker").language,
          weekstart: $input.data("datepicker").weekStart,
          format: this._formatToString($input.data("datepicker").format),
          startview: startview
        };
      }
    }, {
      key: "receiveMessage",
      value: function receiveMessage(el, data) {
        var $input = (0, import_jquery8.default)(el).find("input");
        updateLabel(data.label, this._getLabelNode(el));
        if (hasDefinedProperty(data, "min"))
          this._setMin($input[0], data.min);
        if (hasDefinedProperty(data, "max"))
          this._setMax($input[0], data.max);
        if (hasDefinedProperty(data, "value"))
          this.setValue(el, data.value);
        (0, import_jquery8.default)(el).trigger("change");
      }
    }]);
    return DateInputBinding2;
  }(DateInputBindingBase);

  // srcts/src/bindings/input/daterange.ts
  var import_es_array_iterator7 = __toESM(require_es_array_iterator());
  var import_jquery9 = __toESM(require_jquery());
  function _typeof7(obj) {
    "@babel/helpers - typeof";
    return _typeof7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof7(obj);
  }
  function _classCallCheck7(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties7(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey7(descriptor.key), descriptor);
    }
  }
  function _createClass7(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties7(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties7(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey7(arg) {
    var key = _toPrimitive7(arg, "string");
    return _typeof7(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive7(input, hint) {
    if (_typeof7(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof7(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _inherits5(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf5(subClass, superClass);
  }
  function _setPrototypeOf5(o4, p3) {
    _setPrototypeOf5 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf5(o4, p3);
  }
  function _createSuper5(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct5();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf5(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf5(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn5(this, result);
    };
  }
  function _possibleConstructorReturn5(self2, call8) {
    if (call8 && (_typeof7(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized5(self2);
  }
  function _assertThisInitialized5(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct5() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf5(o4) {
    _getPrototypeOf5 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf5(o4);
  }
  function getLabelNode2(el) {
    return (0, import_jquery9.default)(el).find('label[for="' + $escape(el.id) + '"]');
  }
  var DateRangeInputBinding = /* @__PURE__ */ function(_DateInputBindingBase) {
    _inherits5(DateRangeInputBinding2, _DateInputBindingBase);
    var _super = _createSuper5(DateRangeInputBinding2);
    function DateRangeInputBinding2() {
      _classCallCheck7(this, DateRangeInputBinding2);
      return _super.apply(this, arguments);
    }
    _createClass7(DateRangeInputBinding2, [{
      key: "find",
      value: function find2(scope) {
        return (0, import_jquery9.default)(scope).find(".shiny-date-range-input");
      }
    }, {
      key: "getValue",
      value: function getValue(el) {
        var $inputs = (0, import_jquery9.default)(el).find("input");
        var start = $inputs.eq(0).bsDatepicker("getUTCDate");
        var end = $inputs.eq(1).bsDatepicker("getUTCDate");
        return [formatDateUTC(start), formatDateUTC(end)];
      }
    }, {
      key: "setValue",
      value: function setValue(el, value) {
        if (!(value instanceof Object)) {
          return;
        }
        var $inputs = (0, import_jquery9.default)(el).find("input");
        if (value.start !== void 0) {
          if (value.start === null) {
            $inputs.eq(0).val("").bsDatepicker("update");
          } else {
            var start = this._newDate(value.start);
            $inputs.eq(0).bsDatepicker("setUTCDate", start);
          }
        }
        if (value.end !== void 0) {
          if (value.end === null) {
            $inputs.eq(1).val("").bsDatepicker("update");
          } else {
            var end = this._newDate(value.end);
            $inputs.eq(1).bsDatepicker("setUTCDate", end);
          }
        }
      }
    }, {
      key: "getState",
      value: function getState(el) {
        var $el = (0, import_jquery9.default)(el);
        var $inputs = $el.find("input");
        var $startinput = $inputs.eq(0);
        var $endinput = $inputs.eq(1);
        var min6 = $startinput.bsDatepicker("getStartDate");
        var max4 = $startinput.bsDatepicker("getEndDate");
        var minStr = min6 === -Infinity ? null : formatDateUTC(min6);
        var maxStr = max4 === Infinity ? null : formatDateUTC(max4);
        var startview = $startinput.data("datepicker").startView;
        if (startview === 2)
          startview = "decade";
        else if (startview === 1)
          startview = "year";
        else if (startview === 0)
          startview = "month";
        return {
          label: getLabelNode2(el).text(),
          value: this.getValue(el),
          valueString: [$startinput.val(), $endinput.val()],
          min: minStr,
          max: maxStr,
          weekstart: $startinput.data("datepicker").weekStart,
          format: this._formatToString($startinput.data("datepicker").format),
          language: $startinput.data("datepicker").language,
          startview: startview
        };
      }
    }, {
      key: "receiveMessage",
      value: function receiveMessage(el, data) {
        var $el = (0, import_jquery9.default)(el);
        var $inputs = $el.find("input");
        var $startinput = $inputs.eq(0);
        var $endinput = $inputs.eq(1);
        updateLabel(data.label, getLabelNode2(el));
        if (hasDefinedProperty(data, "min")) {
          this._setMin($startinput[0], data.min);
          this._setMin($endinput[0], data.min);
        }
        if (hasDefinedProperty(data, "max")) {
          this._setMax($startinput[0], data.max);
          this._setMax($endinput[0], data.max);
        }
        if (hasDefinedProperty(data, "value")) {
          this.setValue(el, data.value);
        }
        $el.trigger("change");
      }
    }, {
      key: "initialize",
      value: function initialize(el) {
        var $el = (0, import_jquery9.default)(el);
        var $inputs = $el.find("input");
        var $startinput = $inputs.eq(0);
        var $endinput = $inputs.eq(1);
        var start = $startinput.data("initial-date");
        var end = $endinput.data("initial-date");
        if (start === void 0 || start === null)
          start = this._dateAsUTC(new Date());
        if (end === void 0 || end === null)
          end = this._dateAsUTC(new Date());
        this.setValue(el, {
          start: start,
          end: end
        });
        this._setMin($startinput[0], $startinput.data("min-date"));
        this._setMin($endinput[0], $startinput.data("min-date"));
        this._setMax($startinput[0], $endinput.data("max-date"));
        this._setMax($endinput[0], $endinput.data("max-date"));
      }
    }, {
      key: "subscribe",
      value: function subscribe(el, callback) {
        (0, import_jquery9.default)(el).on(
          "changeDate.dateRangeInputBinding change.dateRangeInputBinding",
          function() {
            callback(false);
          }
        );
      }
    }, {
      key: "unsubscribe",
      value: function unsubscribe(el) {
        (0, import_jquery9.default)(el).off(".dateRangeInputBinding");
      }
    }]);
    return DateRangeInputBinding2;
  }(DateInputBindingBase);

  // srcts/src/bindings/input/fileinput.ts
  var import_es_array_iterator10 = __toESM(require_es_array_iterator());
  var import_jquery12 = __toESM(require_jquery());

  // node_modules/core-js/modules/es.array.from.js
  var $30 = require_export();
  var from = require_array_from();
  var checkCorrectnessOfIteration = require_check_correctness_of_iteration();
  var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function(iterable) {
    Array.from(iterable);
  });
  $30({ target: "Array", stat: true, forced: INCORRECT_ITERATION }, {
    from: from
  });

  // node_modules/core-js/modules/es.array.map.js
  var $31 = require_export();
  var $map = require_array_iteration().map;
  var arrayMethodHasSpeciesSupport4 = require_array_method_has_species_support();
  var HAS_SPECIES_SUPPORT3 = arrayMethodHasSpeciesSupport4("map");
  $31({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT3 }, {
    map: function map(callbackfn) {
      return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
    }
  });

  // srcts/src/file/fileProcessor.ts
  var import_es_array_iterator9 = __toESM(require_es_array_iterator());
  var import_jquery11 = __toESM(require_jquery());

  // srcts/src/events/inputChanged.ts
  var import_jquery10 = __toESM(require_jquery());
  function triggerFileInputChanged(name, value, binding, el, inputType, onEl) {
    var evt = import_jquery10.default.Event("shiny:inputchanged");
    evt.name = name;
    evt.value = value;
    evt.binding = binding;
    evt.el = el;
    evt.inputType = inputType;
    (0, import_jquery10.default)(onEl).trigger(evt);
    return evt;
  }

  // srcts/src/shiny/initedMethods.ts
  var import_es_array_iterator8 = __toESM(require_es_array_iterator());
  function _typeof8(obj) {
    "@babel/helpers - typeof";
    return _typeof8 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof8(obj);
  }
  function _regeneratorRuntime() {
    "use strict";
    _regeneratorRuntime = function _regeneratorRuntime15() {
      return exports;
    };
    var exports = {}, Op = Object.prototype, hasOwn5 = Op.hasOwnProperty, defineProperty3 = Object.defineProperty || function(obj, key, desc) {
      obj[key] = desc.value;
    }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
    function define(obj, key, value) {
      return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }), obj[key];
    }
    try {
      define({}, "");
    } catch (err) {
      define = function define2(obj, key, value) {
        return obj[key] = value;
      };
    }
    function wrap(innerFn, outerFn, self2, tryLocsList) {
      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []);
      return defineProperty3(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) }), generator;
    }
    function tryCatch(fn, obj, arg) {
      try {
        return { type: "normal", arg: fn.call(obj, arg) };
      } catch (err) {
        return { type: "throw", arg: err };
      }
    }
    exports.wrap = wrap;
    var ContinueSentinel = {};
    function Generator() {
    }
    function GeneratorFunction() {
    }
    function GeneratorFunctionPrototype() {
    }
    var IteratorPrototype = {};
    define(IteratorPrototype, iteratorSymbol, function() {
      return this;
    });
    var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values2([])));
    NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn5.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
    var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
    function defineIteratorMethods(prototype) {
      ["next", "throw", "return"].forEach(function(method) {
        define(prototype, method, function(arg) {
          return this._invoke(method, arg);
        });
      });
    }
    function AsyncIterator(generator, PromiseImpl) {
      function invoke(method, arg, resolve, reject) {
        var record = tryCatch(generator[method], generator, arg);
        if ("throw" !== record.type) {
          var result = record.arg, value = result.value;
          return value && "object" == _typeof8(value) && hasOwn5.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
            invoke("next", value2, resolve, reject);
          }, function(err) {
            invoke("throw", err, resolve, reject);
          }) : PromiseImpl.resolve(value).then(function(unwrapped) {
            result.value = unwrapped, resolve(result);
          }, function(error) {
            return invoke("throw", error, resolve, reject);
          });
        }
        reject(record.arg);
      }
      var previousPromise;
      defineProperty3(this, "_invoke", { value: function value(method, arg) {
        function callInvokeWithMethodAndArg() {
          return new PromiseImpl(function(resolve, reject) {
            invoke(method, arg, resolve, reject);
          });
        }
        return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
      } });
    }
    function makeInvokeMethod(innerFn, self2, context) {
      var state = "suspendedStart";
      return function(method, arg) {
        if ("executing" === state)
          throw new Error("Generator is already running");
        if ("completed" === state) {
          if ("throw" === method)
            throw arg;
          return doneResult();
        }
        for (context.method = method, context.arg = arg; ; ) {
          var delegate = context.delegate;
          if (delegate) {
            var delegateResult = maybeInvokeDelegate(delegate, context);
            if (delegateResult) {
              if (delegateResult === ContinueSentinel)
                continue;
              return delegateResult;
            }
          }
          if ("next" === context.method)
            context.sent = context._sent = context.arg;
          else if ("throw" === context.method) {
            if ("suspendedStart" === state)
              throw state = "completed", context.arg;
            context.dispatchException(context.arg);
          } else
            "return" === context.method && context.abrupt("return", context.arg);
          state = "executing";
          var record = tryCatch(innerFn, self2, context);
          if ("normal" === record.type) {
            if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel)
              continue;
            return { value: record.arg, done: context.done };
          }
          "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
        }
      };
    }
    function maybeInvokeDelegate(delegate, context) {
      var methodName = context.method, method = delegate.iterator[methodName];
      if (void 0 === method)
        return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
      var record = tryCatch(method, delegate.iterator, context.arg);
      if ("throw" === record.type)
        return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
      var info = record.arg;
      return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
    }
    function pushTryEntry(locs) {
      var entry = { tryLoc: locs[0] };
      1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
    }
    function resetTryEntry(entry) {
      var record = entry.completion || {};
      record.type = "normal", delete record.arg, entry.completion = record;
    }
    function Context(tryLocsList) {
      this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(true);
    }
    function values2(iterable) {
      if (iterable) {
        var iteratorMethod = iterable[iteratorSymbol];
        if (iteratorMethod)
          return iteratorMethod.call(iterable);
        if ("function" == typeof iterable.next)
          return iterable;
        if (!isNaN(iterable.length)) {
          var i5 = -1, next2 = function next3() {
            for (; ++i5 < iterable.length; )
              if (hasOwn5.call(iterable, i5))
                return next3.value = iterable[i5], next3.done = false, next3;
            return next3.value = void 0, next3.done = true, next3;
          };
          return next2.next = next2;
        }
      }
      return { next: doneResult };
    }
    function doneResult() {
      return { value: void 0, done: true };
    }
    return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty3(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }), defineProperty3(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) {
      var ctor = "function" == typeof genFun && genFun.constructor;
      return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
    }, exports.mark = function(genFun) {
      return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
    }, exports.awrap = function(arg) {
      return { __await: arg };
    }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
      return this;
    }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
      void 0 === PromiseImpl && (PromiseImpl = Promise);
      var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl);
      return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
        return result.done ? result.value : iter.next();
      });
    }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() {
      return this;
    }), define(Gp, "toString", function() {
      return "[object Generator]";
    }), exports.keys = function(val) {
      var object = Object(val), keys2 = [];
      for (var key in object)
        keys2.push(key);
      return keys2.reverse(), function next2() {
        for (; keys2.length; ) {
          var key2 = keys2.pop();
          if (key2 in object)
            return next2.value = key2, next2.done = false, next2;
        }
        return next2.done = true, next2;
      };
    }, exports.values = values2, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) {
      if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
        for (var name in this)
          "t" === name.charAt(0) && hasOwn5.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
    }, stop: function stop() {
      this.done = true;
      var rootRecord = this.tryEntries[0].completion;
      if ("throw" === rootRecord.type)
        throw rootRecord.arg;
      return this.rval;
    }, dispatchException: function dispatchException(exception) {
      if (this.done)
        throw exception;
      var context = this;
      function handle(loc, caught) {
        return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;
      }
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5], record = entry.completion;
        if ("root" === entry.tryLoc)
          return handle("end");
        if (entry.tryLoc <= this.prev) {
          var hasCatch = hasOwn5.call(entry, "catchLoc"), hasFinally = hasOwn5.call(entry, "finallyLoc");
          if (hasCatch && hasFinally) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          } else if (hasCatch) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
          } else {
            if (!hasFinally)
              throw new Error("try statement without catch or finally");
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          }
        }
      }
    }, abrupt: function abrupt(type, arg) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc <= this.prev && hasOwn5.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
          var finallyEntry = entry;
          break;
        }
      }
      finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
      var record = finallyEntry ? finallyEntry.completion : {};
      return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
    }, complete: function complete(record, afterLoc) {
      if ("throw" === record.type)
        throw record.arg;
      return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
    }, finish: function finish(finallyLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.finallyLoc === finallyLoc)
          return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
      }
    }, catch: function _catch(tryLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc === tryLoc) {
          var record = entry.completion;
          if ("throw" === record.type) {
            var thrown = record.arg;
            resetTryEntry(entry);
          }
          return thrown;
        }
      }
      throw new Error("illegal catch attempt");
    }, delegateYield: function delegateYield(iterable, resultName, nextLoc) {
      return this.delegate = { iterator: values2(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = void 0), ContinueSentinel;
    } }, exports;
  }
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
      var info = gen[key](arg);
      var value = info.value;
    } catch (error) {
      reject(error);
      return;
    }
    if (info.done) {
      resolve(value);
    } else {
      Promise.resolve(value).then(_next, _throw);
    }
  }
  function _asyncToGenerator(fn) {
    return function() {
      var self2 = this, args = arguments;
      return new Promise(function(resolve, reject) {
        var gen = fn.apply(self2, args);
        function _next(value) {
          asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
        }
        function _throw(err) {
          asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
        }
        _next(void 0);
      });
    };
  }
  var fullShinyObj;
  function setShinyObj(shiny) {
    fullShinyObj = shiny;
  }
  function validateShinyHasBeenSet() {
    if (typeof fullShinyObj === "undefined") {
      throw "Shiny has not finish initialization yet. Please wait for the 'shiny-initialized' event.";
    }
    return fullShinyObj;
  }
  function shinySetInputValue(name, value, opts) {
    validateShinyHasBeenSet().setInputValue(name, value, opts);
  }
  function shinyShinyApp() {
    return validateShinyHasBeenSet().shinyapp;
  }
  function setShinyUser(user) {
    validateShinyHasBeenSet().user = user;
  }
  function shinyForgetLastInputValue(name) {
    validateShinyHasBeenSet().forgetLastInputValue(name);
  }
  function shinyBindAll(_x) {
    return _shinyBindAll.apply(this, arguments);
  }
  function _shinyBindAll() {
    _shinyBindAll = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(scope) {
      return _regeneratorRuntime().wrap(function _callee$(_context) {
        while (1)
          switch (_context.prev = _context.next) {
            case 0:
              _context.next = 2;
              return validateShinyHasBeenSet().bindAll(scope);
            case 2:
            case "end":
              return _context.stop();
          }
      }, _callee);
    }));
    return _shinyBindAll.apply(this, arguments);
  }
  function shinyUnbindAll(scope) {
    var includeSelf = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
    validateShinyHasBeenSet().unbindAll(scope, includeSelf);
  }
  function shinyInitializeInputs(scope) {
    validateShinyHasBeenSet().initializeInputs(scope);
  }
  function shinyAppBindOutput(_x2, _x3) {
    return _shinyAppBindOutput.apply(this, arguments);
  }
  function _shinyAppBindOutput() {
    _shinyAppBindOutput = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee2(id, binding) {
      return _regeneratorRuntime().wrap(function _callee2$(_context2) {
        while (1)
          switch (_context2.prev = _context2.next) {
            case 0:
              _context2.next = 2;
              return shinyShinyApp().bindOutput(id, binding);
            case 2:
            case "end":
              return _context2.stop();
          }
      }, _callee2);
    }));
    return _shinyAppBindOutput.apply(this, arguments);
  }
  function shinyAppUnbindOutput(id, binding) {
    return shinyShinyApp().unbindOutput(id, binding);
  }
  function getShinyOnCustomMessage() {
    return validateShinyHasBeenSet().oncustommessage;
  }
  var fileInputBinding;
  function getFileInputBinding() {
    return fileInputBinding;
  }
  function setFileInputBinding(fileInputBinding_) {
    fileInputBinding = fileInputBinding_;
  }
  function getShinyCreateWebsocket() {
    return validateShinyHasBeenSet().createSocket;
  }

  // srcts/src/file/fileProcessor.ts
  function _typeof9(obj) {
    "@babel/helpers - typeof";
    return _typeof9 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof9(obj);
  }
  function _inherits6(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf6(subClass, superClass);
  }
  function _setPrototypeOf6(o4, p3) {
    _setPrototypeOf6 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf6(o4, p3);
  }
  function _createSuper6(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct6();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf6(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf6(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn6(this, result);
    };
  }
  function _possibleConstructorReturn6(self2, call8) {
    if (call8 && (_typeof9(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized6(self2);
  }
  function _assertThisInitialized6(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct6() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf6(o4) {
    _getPrototypeOf6 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf6(o4);
  }
  function _classCallCheck8(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties8(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey8(descriptor.key), descriptor);
    }
  }
  function _createClass8(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties8(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties8(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _defineProperty3(obj, key, value) {
    key = _toPropertyKey8(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey8(arg) {
    var key = _toPrimitive8(arg, "string");
    return _typeof9(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive8(input, hint) {
    if (_typeof9(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof9(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  var FileProcessor = /* @__PURE__ */ function() {
    function FileProcessor2(files) {
      var exec$run = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
      _classCallCheck8(this, FileProcessor2);
      _defineProperty3(this, "files", void 0);
      _defineProperty3(this, "fileIndex", -1);
      _defineProperty3(this, "aborted", false);
      _defineProperty3(this, "completed", false);
      this.files = Array.from(files);
      if (exec$run) {
        this.$run();
      }
    }
    _createClass8(FileProcessor2, [{
      key: "onBegin",
      value: function onBegin(files, cont) {
        files;
        setTimeout(cont, 0);
      }
    }, {
      key: "onFile",
      value: function onFile(file, cont) {
        file;
        setTimeout(cont, 0);
      }
    }, {
      key: "onComplete",
      value: function onComplete() {
        return;
      }
    }, {
      key: "onAbort",
      value: function onAbort() {
        return;
      }
    }, {
      key: "abort",
      value: function abort() {
        if (this.completed || this.aborted)
          return;
        this.aborted = true;
        this.onAbort();
      }
    }, {
      key: "$getRun",
      value: function $getRun() {
        var _this = this;
        var called = false;
        return function() {
          if (called)
            return;
          called = true;
          _this.$run();
        };
      }
    }, {
      key: "$run",
      value: function $run() {
        if (this.aborted || this.completed)
          return;
        if (this.fileIndex < 0) {
          this.fileIndex = 0;
          this.onBegin(this.files, this.$getRun());
          return;
        }
        if (this.fileIndex === this.files.length) {
          this.completed = true;
          this.onComplete();
          return;
        }
        var file = this.files[this.fileIndex++];
        this.onFile(file, this.$getRun());
      }
    }]);
    return FileProcessor2;
  }();
  var FileUploader = /* @__PURE__ */ function(_FileProcessor) {
    _inherits6(FileUploader2, _FileProcessor);
    var _super = _createSuper6(FileUploader2);
    function FileUploader2(shinyapp, id, files, el) {
      var _this2;
      _classCallCheck8(this, FileUploader2);
      _this2 = _super.call(this, files, false);
      _defineProperty3(_assertThisInitialized6(_this2), "shinyapp", void 0);
      _defineProperty3(_assertThisInitialized6(_this2), "id", void 0);
      _defineProperty3(_assertThisInitialized6(_this2), "el", void 0);
      _defineProperty3(_assertThisInitialized6(_this2), "jobId", void 0);
      _defineProperty3(_assertThisInitialized6(_this2), "uploadUrl", void 0);
      _defineProperty3(_assertThisInitialized6(_this2), "progressBytes", void 0);
      _defineProperty3(_assertThisInitialized6(_this2), "totalBytes", void 0);
      _this2.shinyapp = shinyapp;
      _this2.id = id;
      _this2.el = el;
      _this2.$run();
      return _this2;
    }
    _createClass8(FileUploader2, [{
      key: "makeRequest",
      value: function makeRequest(method, args, onSuccess, onFailure, blobs) {
        this.shinyapp.makeRequest(method, args, onSuccess, onFailure, blobs);
      }
    }, {
      key: "onBegin",
      value: function onBegin(files, cont) {
        var _this3 = this;
        this.$setError(null);
        this.$setActive(true);
        this.$setVisible(true);
        this.onProgress(null, 0);
        this.totalBytes = 0;
        this.progressBytes = 0;
        import_jquery11.default.each(files, function(i5, file) {
          _this3.totalBytes += file.size;
        });
        var fileInfo = import_jquery11.default.map(files, function(file) {
          return {
            name: file.name,
            size: file.size,
            type: file.type
          };
        });
        this.makeRequest("uploadInit", [fileInfo], function(response) {
          _this3.jobId = response.jobId;
          _this3.uploadUrl = response.uploadUrl;
          cont();
        }, function(error) {
          _this3.onError(error);
        }, void 0);
      }
    }, {
      key: "onFile",
      value: function onFile(file, cont) {
        var _this4 = this;
        this.onProgress(file, 0);
        import_jquery11.default.ajax(this.uploadUrl, {
          type: "POST",
          cache: false,
          xhr: function xhr() {
            if (typeof import_jquery11.default.ajaxSettings.xhr !== "function")
              throw "jQuery's XHR is not a function";
            var xhrVal = import_jquery11.default.ajaxSettings.xhr();
            if (xhrVal.upload) {
              xhrVal.upload.onprogress = function(e4) {
                if (e4.lengthComputable) {
                  _this4.onProgress(file, (_this4.progressBytes + e4.loaded) / _this4.totalBytes);
                }
              };
            }
            return xhrVal;
          },
          data: file,
          contentType: "application/octet-stream",
          processData: false,
          success: function success() {
            _this4.progressBytes += file.size;
            cont();
          },
          error: function error(jqXHR, textStatus, errorThrown) {
            errorThrown;
            _this4.onError(jqXHR.responseText || textStatus);
          }
        });
      }
    }, {
      key: "onComplete",
      value: function onComplete() {
        var _this5 = this;
        var fileInfo = import_jquery11.default.map(this.files, function(file, i5) {
          return {
            name: file.name,
            size: file.size,
            type: file.type
          };
          i5;
        });
        var evt = triggerFileInputChanged(this.id, fileInfo, getFileInputBinding(), this.el, "shiny.fileupload", document);
        this.makeRequest("uploadEnd", [this.jobId, this.id], function() {
          _this5.$setActive(false);
          _this5.onProgress(null, 1);
          _this5.$bar().text("Upload complete");
          (0, import_jquery11.default)(evt.el).val("");
        }, function(error) {
          _this5.onError(error);
        }, void 0);
        this.$bar().text("Finishing upload");
      }
    }, {
      key: "onError",
      value: function onError(message) {
        this.$setError(message || "");
        this.$setActive(false);
      }
    }, {
      key: "onAbort",
      value: function onAbort() {
        this.$setVisible(false);
      }
    }, {
      key: "onProgress",
      value: function onProgress(file, completed) {
        this.$bar().width(Math.round(completed * 100) + "%");
        this.$bar().text(file ? file.name : "");
      }
    }, {
      key: "$container",
      value: function $container() {
        return (0, import_jquery11.default)("#" + $escape(this.id) + "_progress.shiny-file-input-progress");
      }
    }, {
      key: "$bar",
      value: function $bar() {
        return (0, import_jquery11.default)("#" + $escape(this.id) + "_progress.shiny-file-input-progress .progress-bar");
      }
    }, {
      key: "$setVisible",
      value: function $setVisible(visible) {
        this.$container().css("visibility", visible ? "visible" : "hidden");
      }
    }, {
      key: "$setError",
      value: function $setError(error) {
        this.$bar().toggleClass("progress-bar-danger", error !== null);
        if (error !== null) {
          this.onProgress(null, 1);
          this.$bar().text(error);
        }
      }
    }, {
      key: "$setActive",
      value: function $setActive(active) {
        this.$container().toggleClass("active", !!active);
      }
    }]);
    return FileUploader2;
  }(FileProcessor);

  // srcts/src/bindings/input/fileinput.ts
  function _typeof10(obj) {
    "@babel/helpers - typeof";
    return _typeof10 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof10(obj);
  }
  function _classCallCheck9(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties9(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey9(descriptor.key), descriptor);
    }
  }
  function _createClass9(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties9(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties9(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey9(arg) {
    var key = _toPrimitive9(arg, "string");
    return _typeof10(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive9(input, hint) {
    if (_typeof10(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof10(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _inherits7(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf7(subClass, superClass);
  }
  function _setPrototypeOf7(o4, p3) {
    _setPrototypeOf7 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf7(o4, p3);
  }
  function _createSuper7(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct7();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf7(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf7(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn7(this, result);
    };
  }
  function _possibleConstructorReturn7(self2, call8) {
    if (call8 && (_typeof10(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized7(self2);
  }
  function _assertThisInitialized7(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct7() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf7(o4) {
    _getPrototypeOf7 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf7(o4);
  }
  var zoneActive = "shiny-file-input-active";
  var zoneOver = "shiny-file-input-over";
  function zoneOf(el) {
    return (0, import_jquery12.default)(el).closest("div.input-group");
  }
  function enableDraghover(el) {
    var $el = (0, import_jquery12.default)(el);
    var childCounter = 0;
    $el.on({
      "dragenter.draghover": function dragenterDraghover(e4) {
        if (childCounter++ === 0) {
          $el.trigger("draghover:enter", e4);
        }
      },
      "dragleave.draghover": function dragleaveDraghover(e4) {
        if (--childCounter === 0) {
          $el.trigger("draghover:leave", e4);
        }
        if (childCounter < 0) {
          console.error("draghover childCounter is negative somehow");
        }
      },
      "dragover.draghover": function dragoverDraghover(e4) {
        e4.preventDefault();
      },
      "drop.draghover": function dropDraghover(e4) {
        childCounter = 0;
        $el.trigger("draghover:drop", e4);
        e4.preventDefault();
      }
    });
    return $el;
  }
  function disableDraghover(el) {
    return (0, import_jquery12.default)(el).off(".draghover");
  }
  function enableDocumentEvents() {
    var $doc = (0, import_jquery12.default)("html");
    enableDraghover($doc).on({
      "draghover:enter.draghover": function draghoverEnterDraghover() {
        zoneOf($fileInputs).addClass(zoneActive);
      },
      "draghover:leave.draghover": function draghoverLeaveDraghover() {
        zoneOf($fileInputs).removeClass(zoneActive);
      },
      "draghover:drop.draghover": function draghoverDropDraghover() {
        zoneOf($fileInputs).removeClass(zoneOver).removeClass(zoneActive);
      }
    });
  }
  function disableDocumentEvents() {
    var $doc = (0, import_jquery12.default)("html");
    $doc.off(".draghover");
    disableDraghover($doc);
  }
  function canSetFiles(fileList) {
    var testEl = document.createElement("input");
    testEl.type = "file";
    try {
      testEl.files = fileList;
    } catch (e4) {
      return false;
    }
    return true;
  }
  function handleDrop(e4, el) {
    var _e$originalEvent, _e$originalEvent$data;
    var files = (_e$originalEvent = e4.originalEvent) === null || _e$originalEvent === void 0 ? void 0 : (_e$originalEvent$data = _e$originalEvent.dataTransfer) === null || _e$originalEvent$data === void 0 ? void 0 : _e$originalEvent$data.files, $el = (0, import_jquery12.default)(el);
    if (files === void 0 || files === null) {
      console.log("Dropping files is not supported on this browser. (no FileList)");
    } else if (!canSetFiles(files)) {
      $el.val("");
      uploadDroppedFilesIE10Plus(el, files);
    } else {
      $el.val("");
      el.files = files;
      $el.trigger("change");
    }
  }
  function setFileText($el, files) {
    var $fileText = $el.closest("div.input-group").find("input[type=text]");
    if (files.length === 1) {
      $fileText.val(files[0].name);
    } else {
      $fileText.val(files.length + " files");
    }
  }
  function abortCurrentUpload($el) {
    var uploader = $el.data("currentUploader");
    if (uploader)
      uploader.abort();
    $el.removeAttr("data-restore");
  }
  function uploadDroppedFilesIE10Plus(el, files) {
    var $el = (0, import_jquery12.default)(el);
    abortCurrentUpload($el);
    setFileText($el, files);
    $el.data("currentUploader", new FileUploader(shinyShinyApp(), fileInputBindingGetId(el), files, el));
  }
  function uploadFiles(evt) {
    var $el = (0, import_jquery12.default)(evt.target);
    abortCurrentUpload($el);
    var files = evt.target.files;
    var id = fileInputBindingGetId(evt.target);
    if (files.length === 0)
      return;
    setFileText($el, files);
    $el.data("currentUploader", new FileUploader(shinyShinyApp(), id, files, evt.target));
  }
  var $fileInputs = (0, import_jquery12.default)();
  function fileInputBindingGetId(el) {
    return InputBinding.prototype.getId.call(this, el) || el.name;
  }
  var FileInputBinding = /* @__PURE__ */ function(_InputBinding) {
    _inherits7(FileInputBinding2, _InputBinding);
    var _super = _createSuper7(FileInputBinding2);
    function FileInputBinding2() {
      _classCallCheck9(this, FileInputBinding2);
      return _super.apply(this, arguments);
    }
    _createClass9(FileInputBinding2, [{
      key: "find",
      value: function find2(scope) {
        return (0, import_jquery12.default)(scope).find('input[type="file"]');
      }
    }, {
      key: "getId",
      value: function getId(el) {
        return fileInputBindingGetId(el);
      }
    }, {
      key: "getValue",
      value: function getValue(el) {
        var data = (0, import_jquery12.default)(el).attr("data-restore");
        if (data) {
          var dataParsed = JSON.parse(data);
          var $fileText = (0, import_jquery12.default)(el).closest("div.input-group").find("input[type=text]");
          if (dataParsed.name.length === 1) {
            $fileText.val(dataParsed.name[0]);
          } else {
            $fileText.val(dataParsed.name.length + " files");
          }
          var $progress = (0, import_jquery12.default)(el).closest("div.form-group").find(".progress");
          var $bar = $progress.find(".progress-bar");
          $progress.removeClass("active");
          $bar.width("100%");
          $bar.css("visibility", "visible");
          return dataParsed;
        } else {
          return null;
        }
      }
    }, {
      key: "setValue",
      value: function setValue(el, value) {
        el;
        value;
      }
    }, {
      key: "getType",
      value: function getType(el) {
        return "shiny.file";
        el;
      }
    }, {
      key: "subscribe",
      value: function subscribe(el, callback) {
        callback;
        (0, import_jquery12.default)(el).on("change.fileInputBinding", uploadFiles);
        if ($fileInputs.length === 0)
          enableDocumentEvents();
        $fileInputs = $fileInputs.add(el);
        var $zone = zoneOf(el);
        enableDraghover($zone).on({
          "draghover:enter.draghover": function draghoverEnterDraghover(e4) {
            e4;
            $zone.addClass(zoneOver);
          },
          "draghover:leave.draghover": function draghoverLeaveDraghover(e4) {
            $zone.removeClass(zoneOver);
            e4.stopPropagation();
          },
          "draghover:drop.draghover": function draghoverDropDraghover(e4, dropEvent) {
            e4;
            handleDrop(dropEvent, el);
          }
        });
      }
    }, {
      key: "unsubscribe",
      value: function unsubscribe(el) {
        var $el = (0, import_jquery12.default)(el), $zone = zoneOf(el);
        $zone.removeClass(zoneOver).removeClass(zoneActive);
        disableDraghover($zone);
        $el.off(".fileInputBinding");
        $zone.off(".draghover");
        $fileInputs = $fileInputs.not(el);
        if ($fileInputs.length === 0)
          disableDocumentEvents();
      }
    }]);
    return FileInputBinding2;
  }(InputBinding);

  // srcts/src/bindings/input/number.ts
  var import_es_regexp_exec3 = __toESM(require_es_regexp_exec());
  var import_es_array_iterator12 = __toESM(require_es_array_iterator());
  var import_jquery14 = __toESM(require_jquery());

  // node_modules/core-js/modules/es.reflect.get.js
  var $35 = require_export();
  var call6 = require_function_call();
  var isObject4 = require_is_object();
  var anObject8 = require_an_object();
  var isDataDescriptor = require_is_data_descriptor();
  var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
  var getPrototypeOf2 = require_object_get_prototype_of();
  function get(target, propertyKey) {
    var receiver = arguments.length < 3 ? target : arguments[2];
    var descriptor, prototype;
    if (anObject8(target) === receiver)
      return target[propertyKey];
    descriptor = getOwnPropertyDescriptorModule.f(target, propertyKey);
    if (descriptor)
      return isDataDescriptor(descriptor) ? descriptor.value : descriptor.get === void 0 ? void 0 : call6(descriptor.get, receiver);
    if (isObject4(prototype = getPrototypeOf2(target)))
      return get(prototype, propertyKey, receiver);
  }
  $35({ target: "Reflect", stat: true }, {
    get: get
  });

  // node_modules/core-js/modules/es.object.get-own-property-descriptor.js
  var $36 = require_export();
  var fails10 = require_fails();
  var toIndexedObject2 = require_to_indexed_object();
  var nativeGetOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
  var DESCRIPTORS5 = require_descriptors();
  var FORCED6 = !DESCRIPTORS5 || fails10(function() {
    nativeGetOwnPropertyDescriptor(1);
  });
  $36({ target: "Object", stat: true, forced: FORCED6, sham: !DESCRIPTORS5 }, {
    getOwnPropertyDescriptor: function getOwnPropertyDescriptor2(it, key) {
      return nativeGetOwnPropertyDescriptor(toIndexedObject2(it), key);
    }
  });

  // srcts/src/bindings/input/text.ts
  var import_es_array_iterator11 = __toESM(require_es_array_iterator());
  var import_jquery13 = __toESM(require_jquery());
  function _typeof11(obj) {
    "@babel/helpers - typeof";
    return _typeof11 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof11(obj);
  }
  function _classCallCheck10(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties10(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey10(descriptor.key), descriptor);
    }
  }
  function _createClass10(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties10(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties10(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey10(arg) {
    var key = _toPrimitive10(arg, "string");
    return _typeof11(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive10(input, hint) {
    if (_typeof11(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof11(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _get() {
    if (typeof Reflect !== "undefined" && Reflect.get) {
      _get = Reflect.get.bind();
    } else {
      _get = function _get3(target, property, receiver) {
        var base = _superPropBase(target, property);
        if (!base)
          return;
        var desc = Object.getOwnPropertyDescriptor(base, property);
        if (desc.get) {
          return desc.get.call(arguments.length < 3 ? target : receiver);
        }
        return desc.value;
      };
    }
    return _get.apply(this, arguments);
  }
  function _superPropBase(object, property) {
    while (!Object.prototype.hasOwnProperty.call(object, property)) {
      object = _getPrototypeOf8(object);
      if (object === null)
        break;
    }
    return object;
  }
  function _inherits8(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf8(subClass, superClass);
  }
  function _setPrototypeOf8(o4, p3) {
    _setPrototypeOf8 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf8(o4, p3);
  }
  function _createSuper8(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct8();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf8(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf8(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn8(this, result);
    };
  }
  function _possibleConstructorReturn8(self2, call8) {
    if (call8 && (_typeof11(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized8(self2);
  }
  function _assertThisInitialized8(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct8() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf8(o4) {
    _getPrototypeOf8 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf8(o4);
  }
  function getLabelNode3(el) {
    return (0, import_jquery13.default)(el).parent().find('label[for="' + $escape(el.id) + '"]');
  }
  var TextInputBindingBase = /* @__PURE__ */ function(_InputBinding) {
    _inherits8(TextInputBindingBase2, _InputBinding);
    var _super = _createSuper8(TextInputBindingBase2);
    function TextInputBindingBase2() {
      _classCallCheck10(this, TextInputBindingBase2);
      return _super.apply(this, arguments);
    }
    _createClass10(TextInputBindingBase2, [{
      key: "find",
      value: function find2(scope) {
        var $inputs = (0, import_jquery13.default)(scope).find('input[type="text"], input[type="search"], input[type="url"], input[type="email"]');
        return $inputs.not('input[type="text"][id$="-selectized"]');
      }
    }, {
      key: "getId",
      value: function getId(el) {
        return _get(_getPrototypeOf8(TextInputBindingBase2.prototype), "getId", this).call(this, el) || el.name;
      }
    }, {
      key: "getValue",
      value: function getValue(el) {
        throw "not implemented";
        el;
      }
    }, {
      key: "setValue",
      value: function setValue(el, value) {
        throw "not implemented";
        el;
        value;
      }
    }, {
      key: "subscribe",
      value: function subscribe(el, callback) {
        (0, import_jquery13.default)(el).on(
          "keyup.textInputBinding input.textInputBinding",
          function() {
            callback(true);
          }
        );
        (0, import_jquery13.default)(el).on(
          "change.textInputBinding",
          function() {
            callback(false);
          }
        );
      }
    }, {
      key: "unsubscribe",
      value: function unsubscribe(el) {
        (0, import_jquery13.default)(el).off(".textInputBinding");
      }
    }, {
      key: "receiveMessage",
      value: function receiveMessage(el, data) {
        throw "not implemented";
        el;
        data;
      }
    }, {
      key: "getState",
      value: function getState(el) {
        throw "not implemented";
        el;
      }
    }, {
      key: "getRatePolicy",
      value: function getRatePolicy(el) {
        return {
          policy: "debounce",
          delay: 250
        };
        el;
      }
    }]);
    return TextInputBindingBase2;
  }(InputBinding);
  var TextInputBinding = /* @__PURE__ */ function(_TextInputBindingBase) {
    _inherits8(TextInputBinding2, _TextInputBindingBase);
    var _super2 = _createSuper8(TextInputBinding2);
    function TextInputBinding2() {
      _classCallCheck10(this, TextInputBinding2);
      return _super2.apply(this, arguments);
    }
    _createClass10(TextInputBinding2, [{
      key: "setValue",
      value: function setValue(el, value) {
        el.value = value;
      }
    }, {
      key: "getValue",
      value: function getValue(el) {
        return el.value;
      }
    }, {
      key: "getState",
      value: function getState(el) {
        return {
          label: getLabelNode3(el).text(),
          value: el.value,
          placeholder: el.placeholder
        };
      }
    }, {
      key: "receiveMessage",
      value: function receiveMessage(el, data) {
        if (hasDefinedProperty(data, "value"))
          this.setValue(el, data.value);
        updateLabel(data.label, getLabelNode3(el));
        if (hasDefinedProperty(data, "placeholder"))
          el.placeholder = data.placeholder;
        (0, import_jquery13.default)(el).trigger("change");
      }
    }]);
    return TextInputBinding2;
  }(TextInputBindingBase);

  // srcts/src/bindings/input/number.ts
  function _typeof12(obj) {
    "@babel/helpers - typeof";
    return _typeof12 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof12(obj);
  }
  function _classCallCheck11(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties11(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey11(descriptor.key), descriptor);
    }
  }
  function _createClass11(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties11(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties11(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey11(arg) {
    var key = _toPrimitive11(arg, "string");
    return _typeof12(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive11(input, hint) {
    if (_typeof12(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof12(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _inherits9(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf9(subClass, superClass);
  }
  function _setPrototypeOf9(o4, p3) {
    _setPrototypeOf9 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf9(o4, p3);
  }
  function _createSuper9(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct9();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf9(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf9(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn9(this, result);
    };
  }
  function _possibleConstructorReturn9(self2, call8) {
    if (call8 && (_typeof12(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized9(self2);
  }
  function _assertThisInitialized9(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct9() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf9(o4) {
    _getPrototypeOf9 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf9(o4);
  }
  function getLabelNode4(el) {
    return (0, import_jquery14.default)(el).parent().find('label[for="' + $escape(el.id) + '"]');
  }
  var NumberInputBinding = /* @__PURE__ */ function(_TextInputBindingBase) {
    _inherits9(NumberInputBinding2, _TextInputBindingBase);
    var _super = _createSuper9(NumberInputBinding2);
    function NumberInputBinding2() {
      _classCallCheck11(this, NumberInputBinding2);
      return _super.apply(this, arguments);
    }
    _createClass11(NumberInputBinding2, [{
      key: "find",
      value: function find2(scope) {
        return (0, import_jquery14.default)(scope).find('input[type="number"]');
      }
    }, {
      key: "getValue",
      value: function getValue(el) {
        var numberVal = (0, import_jquery14.default)(el).val();
        if (typeof numberVal == "string") {
          if (/^\s*$/.test(numberVal))
            return null;
        }
        var numberValue = Number(numberVal);
        if (!isNaN(numberValue)) {
          return numberValue;
        }
        return numberVal;
      }
    }, {
      key: "setValue",
      value: function setValue(el, value) {
        el.value = "" + value;
      }
    }, {
      key: "getType",
      value: function getType(el) {
        return "shiny.number";
        el;
      }
    }, {
      key: "receiveMessage",
      value: function receiveMessage(el, data) {
        var _data$value, _data$min, _data$max, _data$step;
        if (hasDefinedProperty(data, "value"))
          el.value = (_data$value = data.value) !== null && _data$value !== void 0 ? _data$value : "";
        if (hasDefinedProperty(data, "min"))
          el.min = (_data$min = data.min) !== null && _data$min !== void 0 ? _data$min : "";
        if (hasDefinedProperty(data, "max"))
          el.max = (_data$max = data.max) !== null && _data$max !== void 0 ? _data$max : "";
        if (hasDefinedProperty(data, "step"))
          el.step = (_data$step = data.step) !== null && _data$step !== void 0 ? _data$step : "";
        updateLabel(data.label, getLabelNode4(el));
        (0, import_jquery14.default)(el).trigger("change");
      }
    }, {
      key: "getState",
      value: function getState(el) {
        return {
          label: getLabelNode4(el).text(),
          value: this.getValue(el),
          min: Number(el.min),
          max: Number(el.max),
          step: Number(el.step)
        };
      }
    }]);
    return NumberInputBinding2;
  }(TextInputBindingBase);

  // srcts/src/bindings/input/password.ts
  var import_es_array_iterator13 = __toESM(require_es_array_iterator());
  var import_jquery15 = __toESM(require_jquery());
  function _typeof13(obj) {
    "@babel/helpers - typeof";
    return _typeof13 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof13(obj);
  }
  function _classCallCheck12(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties12(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey12(descriptor.key), descriptor);
    }
  }
  function _createClass12(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties12(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties12(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey12(arg) {
    var key = _toPrimitive12(arg, "string");
    return _typeof13(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive12(input, hint) {
    if (_typeof13(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof13(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _inherits10(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf10(subClass, superClass);
  }
  function _setPrototypeOf10(o4, p3) {
    _setPrototypeOf10 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf10(o4, p3);
  }
  function _createSuper10(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct10();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf10(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf10(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn10(this, result);
    };
  }
  function _possibleConstructorReturn10(self2, call8) {
    if (call8 && (_typeof13(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized10(self2);
  }
  function _assertThisInitialized10(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct10() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf10(o4) {
    _getPrototypeOf10 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf10(o4);
  }
  var PasswordInputBinding = /* @__PURE__ */ function(_TextInputBinding) {
    _inherits10(PasswordInputBinding2, _TextInputBinding);
    var _super = _createSuper10(PasswordInputBinding2);
    function PasswordInputBinding2() {
      _classCallCheck12(this, PasswordInputBinding2);
      return _super.apply(this, arguments);
    }
    _createClass12(PasswordInputBinding2, [{
      key: "find",
      value: function find2(scope) {
        return (0, import_jquery15.default)(scope).find('input[type="password"]');
      }
    }, {
      key: "getType",
      value: function getType(el) {
        return "shiny.password";
        el;
      }
    }]);
    return PasswordInputBinding2;
  }(TextInputBinding);

  // srcts/src/bindings/input/radio.ts
  var import_es_array_iterator14 = __toESM(require_es_array_iterator());
  var import_jquery16 = __toESM(require_jquery());
  function _typeof14(obj) {
    "@babel/helpers - typeof";
    return _typeof14 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof14(obj);
  }
  function _classCallCheck13(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties13(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey13(descriptor.key), descriptor);
    }
  }
  function _createClass13(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties13(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties13(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey13(arg) {
    var key = _toPrimitive13(arg, "string");
    return _typeof14(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive13(input, hint) {
    if (_typeof14(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof14(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _inherits11(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf11(subClass, superClass);
  }
  function _setPrototypeOf11(o4, p3) {
    _setPrototypeOf11 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf11(o4, p3);
  }
  function _createSuper11(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct11();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf11(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf11(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn11(this, result);
    };
  }
  function _possibleConstructorReturn11(self2, call8) {
    if (call8 && (_typeof14(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized11(self2);
  }
  function _assertThisInitialized11(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct11() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf11(o4) {
    _getPrototypeOf11 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf11(o4);
  }
  function getLabelNode5(el) {
    return (0, import_jquery16.default)(el).parent().find('label[for="' + $escape(el.id) + '"]');
  }
  function getLabel2(obj) {
    var parentNode = obj.parentNode;
    if (parentNode.tagName === "LABEL") {
      return (0, import_jquery16.default)(parentNode).find("span").text().trim();
    }
    return null;
  }
  var RadioInputBinding = /* @__PURE__ */ function(_InputBinding) {
    _inherits11(RadioInputBinding2, _InputBinding);
    var _super = _createSuper11(RadioInputBinding2);
    function RadioInputBinding2() {
      _classCallCheck13(this, RadioInputBinding2);
      return _super.apply(this, arguments);
    }
    _createClass13(RadioInputBinding2, [{
      key: "find",
      value: function find2(scope) {
        return (0, import_jquery16.default)(scope).find(".shiny-input-radiogroup");
      }
    }, {
      key: "getValue",
      value: function getValue(el) {
        var checkedItems = (0, import_jquery16.default)('input:radio[name="' + $escape(el.id) + '"]:checked');
        if (checkedItems.length === 0) {
          return null;
        }
        return checkedItems.val();
      }
    }, {
      key: "setValue",
      value: function setValue(el, value) {
        if (Array.isArray(value) && value.length === 0) {
          (0, import_jquery16.default)('input:radio[name="' + $escape(el.id) + '"]').prop("checked", false);
        } else {
          (0, import_jquery16.default)('input:radio[name="' + $escape(el.id) + '"][value="' + $escape(value) + '"]').prop("checked", true);
        }
      }
    }, {
      key: "getState",
      value: function getState(el) {
        var $objs = (0, import_jquery16.default)('input:radio[name="' + $escape(el.id) + '"]');
        var options = new Array($objs.length);
        for (var i5 = 0; i5 < options.length; i5++) {
          options[i5] = {
            value: $objs[i5].value,
            label: getLabel2($objs[i5])
          };
        }
        return {
          label: getLabelNode5(el).text(),
          value: this.getValue(el),
          options: options
        };
      }
    }, {
      key: "receiveMessage",
      value: function receiveMessage(el, data) {
        var $el = (0, import_jquery16.default)(el);
        if (hasDefinedProperty(data, "options")) {
          $el.find("div.shiny-options-group").remove();
          $el.find("label.radio").remove();
          $el.append(data.options);
        }
        if (hasDefinedProperty(data, "value")) {
          this.setValue(el, data.value);
        }
        updateLabel(data.label, getLabelNode5(el));
        (0, import_jquery16.default)(el).trigger("change");
      }
    }, {
      key: "subscribe",
      value: function subscribe(el, callback) {
        (0, import_jquery16.default)(el).on("change.radioInputBinding", function() {
          callback(false);
        });
      }
    }, {
      key: "unsubscribe",
      value: function unsubscribe(el) {
        (0, import_jquery16.default)(el).off(".radioInputBinding");
      }
    }]);
    return RadioInputBinding2;
  }(InputBinding);

  // srcts/src/bindings/input/selectInput.ts
  var import_es_json_stringify = __toESM(require_es_json_stringify());
  var import_es_array_iterator15 = __toESM(require_es_array_iterator());
  var import_jquery17 = __toESM(require_jquery());

  // srcts/src/utils/eval.ts
  var indirectEval = eval;

  // srcts/src/bindings/input/selectInput.ts
  function _typeof15(obj) {
    "@babel/helpers - typeof";
    return _typeof15 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof15(obj);
  }
  function _classCallCheck14(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties14(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey14(descriptor.key), descriptor);
    }
  }
  function _createClass14(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties14(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties14(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey14(arg) {
    var key = _toPrimitive14(arg, "string");
    return _typeof15(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive14(input, hint) {
    if (_typeof15(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof15(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _inherits12(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf12(subClass, superClass);
  }
  function _setPrototypeOf12(o4, p3) {
    _setPrototypeOf12 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf12(o4, p3);
  }
  function _createSuper12(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct12();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf12(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf12(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn12(this, result);
    };
  }
  function _possibleConstructorReturn12(self2, call8) {
    if (call8 && (_typeof15(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized12(self2);
  }
  function _assertThisInitialized12(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct12() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf12(o4) {
    _getPrototypeOf12 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf12(o4);
  }
  function getLabelNode6(el) {
    var escapedId = $escape(el.id);
    if (isSelectize(el)) {
      escapedId += "-selectized";
    }
    return (0, import_jquery17.default)(el).parent().parent().find('label[for="' + escapedId + '"]');
  }
  function isSelectize(el) {
    var config = (0, import_jquery17.default)(el).parent().find('script[data-for="' + $escape(el.id) + '"]');
    return config.length > 0;
  }
  var SelectInputBinding = /* @__PURE__ */ function(_InputBinding) {
    _inherits12(SelectInputBinding2, _InputBinding);
    var _super = _createSuper12(SelectInputBinding2);
    function SelectInputBinding2() {
      _classCallCheck14(this, SelectInputBinding2);
      return _super.apply(this, arguments);
    }
    _createClass14(SelectInputBinding2, [{
      key: "find",
      value: function find2(scope) {
        return (0, import_jquery17.default)(scope).find("select");
      }
    }, {
      key: "getType",
      value: function getType(el) {
        var $el = (0, import_jquery17.default)(el);
        if (!$el.hasClass("symbol")) {
          return null;
        }
        if ($el.attr("multiple") === "multiple") {
          return "shiny.symbolList";
        } else {
          return "shiny.symbol";
        }
      }
    }, {
      key: "getId",
      value: function getId(el) {
        return InputBinding.prototype.getId.call(this, el) || el.name;
      }
    }, {
      key: "getValue",
      value: function getValue(el) {
        if (!isSelectize(el)) {
          return (0, import_jquery17.default)(el).val();
        } else {
          var selectize = this._selectize(el);
          return selectize === null || selectize === void 0 ? void 0 : selectize.getValue();
        }
      }
    }, {
      key: "setValue",
      value: function setValue(el, value) {
        if (!isSelectize(el)) {
          (0, import_jquery17.default)(el).val(value);
        } else {
          var selectize = this._selectize(el);
          selectize === null || selectize === void 0 ? void 0 : selectize.setValue(value);
        }
      }
    }, {
      key: "getState",
      value: function getState(el) {
        var options = new Array(el.length);
        for (var i5 = 0; i5 < el.length; i5++) {
          options[i5] = {
            value: el[i5].value,
            label: el[i5].label
          };
        }
        return {
          label: getLabelNode6(el),
          value: this.getValue(el),
          options: options
        };
      }
    }, {
      key: "receiveMessage",
      value: function receiveMessage(el, data) {
        var $el = (0, import_jquery17.default)(el);
        if (hasDefinedProperty(data, "options")) {
          var selectize = this._selectize(el);
          selectize === null || selectize === void 0 ? void 0 : selectize.destroy();
          $el.empty().append(data.options);
          this._selectize(el);
        }
        if (hasDefinedProperty(data, "config")) {
          $el.parent().find('script[data-for="' + $escape(el.id) + '"]').replaceWith(data.config);
          this._selectize(el, true);
        }
        if (hasDefinedProperty(data, "url")) {
          var _selectize2 = this._selectize(el);
          _selectize2.clear();
          _selectize2.clearOptions();
          var loaded = false;
          _selectize2.settings.load = function(query, callback) {
            var settings = _selectize2.settings;
            import_jquery17.default.ajax({
              url: data.url,
              data: {
                query: query,
                field: JSON.stringify([settings.searchField]),
                value: settings.valueField,
                conju: settings.searchConjunction,
                maxop: settings.maxOptions
              },
              type: "GET",
              error: function error() {
                callback();
              },
              success: function success(res) {
                import_jquery17.default.each(res, function(index, elem) {
                  var optgroupId = elem[settings.optgroupField || "optgroup"];
                  var optgroup = {};
                  optgroup[settings.optgroupLabelField || "label"] = optgroupId;
                  optgroup[settings.optgroupValueField || "value"] = optgroupId;
                  _selectize2.addOptionGroup(optgroupId, optgroup);
                });
                callback(res);
                if (!loaded) {
                  if (hasDefinedProperty(data, "value")) {
                    _selectize2.setValue(data.value);
                  } else if (settings.maxItems === 1) {
                    _selectize2.setValue(res[0].value);
                  }
                }
                loaded = true;
              }
            });
          };
          _selectize2.load(function(callback) {
            _selectize2.settings.load.apply(_selectize2, ["", callback]);
          });
        } else if (hasDefinedProperty(data, "value")) {
          this.setValue(el, data.value);
        }
        updateLabel(data.label, getLabelNode6(el));
        (0, import_jquery17.default)(el).trigger("change");
      }
    }, {
      key: "subscribe",
      value: function subscribe(el, callback) {
        var _this = this;
        (0, import_jquery17.default)(el).on(
          "change.selectInputBinding",
          function() {
            if (el.nonempty && _this.getValue(el) === "") {
              return;
            }
            callback(false);
          }
        );
      }
    }, {
      key: "unsubscribe",
      value: function unsubscribe(el) {
        (0, import_jquery17.default)(el).off(".selectInputBinding");
      }
    }, {
      key: "initialize",
      value: function initialize(el) {
        this._selectize(el);
      }
    }, {
      key: "_selectize",
      value: function _selectize(el) {
        var update = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
        if (!import_jquery17.default.fn.selectize)
          return void 0;
        var $el = (0, import_jquery17.default)(el);
        var config = $el.parent().find('script[data-for="' + $escape(el.id) + '"]');
        if (config.length === 0)
          return void 0;
        var options = import_jquery17.default.extend({
          labelField: "label",
          valueField: "value",
          searchField: ["label"]
        }, JSON.parse(config.html()));
        if (typeof config.data("nonempty") !== "undefined") {
          el.nonempty = true;
          options = import_jquery17.default.extend(options, {
            onItemRemove: function onItemRemove(value) {
              if (this.getValue() === "")
                (0, import_jquery17.default)("select#" + $escape(el.id)).empty().append((0, import_jquery17.default)("<option/>", {
                  value: value,
                  selected: true
                })).trigger("change");
            },
            onDropdownClose: function onDropdownClose() {
              if (this.getValue() === "") {
                this.setValue((0, import_jquery17.default)("select#" + $escape(el.id)).val());
              }
            }
          });
        } else {
          el.nonempty = false;
        }
        if (config.data("eval") instanceof Array)
          import_jquery17.default.each(config.data("eval"), function(i5, x2) {
            options[x2] = indirectEval("(" + options[x2] + ")");
          });
        var control = $el.selectize(options)[0].selectize;
        if (update) {
          var settings = import_jquery17.default.extend(control.settings, options);
          control.destroy();
          control = $el.selectize(settings)[0].selectize;
        }
        return control;
      }
    }]);
    return SelectInputBinding2;
  }(InputBinding);

  // srcts/src/bindings/input/slider.ts
  var import_es_regexp_exec4 = __toESM(require_es_regexp_exec());
  var import_es_array_iterator16 = __toESM(require_es_array_iterator());
  var import_jquery18 = __toESM(require_jquery());
  function _typeof16(obj) {
    "@babel/helpers - typeof";
    return _typeof16 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof16(obj);
  }
  function _classCallCheck15(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties15(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey15(descriptor.key), descriptor);
    }
  }
  function _createClass15(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties15(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties15(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey15(arg) {
    var key = _toPrimitive15(arg, "string");
    return _typeof16(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive15(input, hint) {
    if (_typeof16(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof16(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _inherits13(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf13(subClass, superClass);
  }
  function _setPrototypeOf13(o4, p3) {
    _setPrototypeOf13 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf13(o4, p3);
  }
  function _createSuper13(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct13();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf13(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf13(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn13(this, result);
    };
  }
  function _possibleConstructorReturn13(self2, call8) {
    if (call8 && (_typeof16(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized13(self2);
  }
  function _assertThisInitialized13(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct13() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf13(o4) {
    _getPrototypeOf13 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf13(o4);
  }
  function forceIonSliderUpdate(slider) {
    if (slider.$cache && slider.$cache.input)
      slider.$cache.input.trigger("change");
    else
      console.log("Couldn't force ion slider to update");
  }
  function getTypePrettifyer(dataType, timeFormat, timezone) {
    var timeFormatter;
    var prettify;
    if (dataType === "date") {
      timeFormatter = window.strftime.utc();
      prettify = function prettify2(num) {
        return timeFormatter(timeFormat, new Date(num));
      };
    } else if (dataType === "datetime") {
      if (timezone)
        timeFormatter = window.strftime.timezone(timezone);
      else
        timeFormatter = window.strftime;
      prettify = function prettify2(num) {
        return timeFormatter(timeFormat, new Date(num));
      };
    } else {
      prettify = function prettify2(num) {
        return formatNumber(num, this.prettify_separator);
      };
    }
    return prettify;
  }
  function getLabelNode7(el) {
    return (0, import_jquery18.default)(el).parent().find('label[for="' + $escape(el.id) + '"]');
  }
  function numValues(el) {
    if ((0, import_jquery18.default)(el).data("ionRangeSlider").options.type === "double")
      return 2;
    else
      return 1;
  }
  var SliderInputBinding = /* @__PURE__ */ function(_TextInputBindingBase) {
    _inherits13(SliderInputBinding2, _TextInputBindingBase);
    var _super = _createSuper13(SliderInputBinding2);
    function SliderInputBinding2() {
      _classCallCheck15(this, SliderInputBinding2);
      return _super.apply(this, arguments);
    }
    _createClass15(SliderInputBinding2, [{
      key: "find",
      value: function find2(scope) {
        if (!import_jquery18.default.fn.ionRangeSlider) {
          return (0, import_jquery18.default)();
        }
        return (0, import_jquery18.default)(scope).find("input.js-range-slider");
      }
    }, {
      key: "getType",
      value: function getType(el) {
        var dataType = (0, import_jquery18.default)(el).data("data-type");
        if (dataType === "date")
          return "shiny.date";
        else if (dataType === "datetime")
          return "shiny.datetime";
        else
          return null;
      }
    }, {
      key: "getValue",
      value: function getValue(el) {
        var $el = (0, import_jquery18.default)(el);
        var result = (0, import_jquery18.default)(el).data("ionRangeSlider").result;
        var convert;
        var dataType = $el.data("data-type");
        if (dataType === "date") {
          convert = function convert2(val) {
            return formatDateUTC(new Date(Number(val)));
          };
        } else if (dataType === "datetime") {
          convert = function convert2(val) {
            return Number(val) / 1e3;
          };
        } else {
          convert = function convert2(val) {
            return Number(val);
          };
        }
        if (numValues(el) === 2) {
          return [convert(result.from), convert(result.to)];
        } else {
          return convert(result.from);
        }
      }
    }, {
      key: "setValue",
      value: function setValue(el, value) {
        var $el = (0, import_jquery18.default)(el);
        var slider = $el.data("ionRangeSlider");
        $el.data("immediate", true);
        try {
          if (numValues(el) === 2 && value instanceof Array) {
            slider.update({
              from: value[0],
              to: value[1]
            });
          } else {
            slider.update({
              from: value
            });
          }
          forceIonSliderUpdate(slider);
        } finally {
          $el.data("immediate", false);
        }
      }
    }, {
      key: "subscribe",
      value: function subscribe(el, callback) {
        (0, import_jquery18.default)(el).on("change.sliderInputBinding", function() {
          callback(!(0, import_jquery18.default)(el).data("immediate") && !(0, import_jquery18.default)(el).data("animating"));
        });
      }
    }, {
      key: "unsubscribe",
      value: function unsubscribe(el) {
        (0, import_jquery18.default)(el).off(".sliderInputBinding");
      }
    }, {
      key: "receiveMessage",
      value: function receiveMessage(el, data) {
        var $el = (0, import_jquery18.default)(el);
        var slider = $el.data("ionRangeSlider");
        var msg = {};
        if (hasDefinedProperty(data, "value")) {
          if (numValues(el) === 2 && data.value instanceof Array) {
            msg.from = data.value[0];
            msg.to = data.value[1];
          } else {
            if (Array.isArray(data.value)) {
              var errorReason = ["an empty array.", "a single-value array.", "an array with more than two values."];
              throw "Slider requires two values to update with an array, but message value was " + errorReason[Math.min(data.value.length, 2)];
            }
            msg.from = data.value;
          }
        }
        var sliderFeatures = ["min", "max", "step"];
        for (var i5 = 0; i5 < sliderFeatures.length; i5++) {
          var feats = sliderFeatures[i5];
          if (hasDefinedProperty(data, feats)) {
            msg[feats] = data[feats];
          }
        }
        updateLabel(data.label, getLabelNode7(el));
        var domElements = ["data-type", "time-format", "timezone"];
        for (var _i = 0; _i < domElements.length; _i++) {
          var elem = domElements[_i];
          if (hasDefinedProperty(data, elem)) {
            $el.data(elem, data[elem]);
          }
        }
        var dataType = $el.data("data-type");
        var timeFormat = $el.data("time-format");
        var timezone = $el.data("timezone");
        msg.prettify = getTypePrettifyer(dataType, timeFormat, timezone);
        $el.data("immediate", true);
        try {
          slider.update(msg);
          forceIonSliderUpdate(slider);
        } finally {
          $el.data("immediate", false);
        }
      }
    }, {
      key: "getRatePolicy",
      value: function getRatePolicy(el) {
        return {
          policy: "debounce",
          delay: 250
        };
        el;
      }
    }, {
      key: "getState",
      value: function getState(el) {
        el;
      }
    }, {
      key: "initialize",
      value: function initialize(el) {
        var $el = (0, import_jquery18.default)(el);
        var dataType = $el.data("data-type");
        var timeFormat = $el.data("time-format");
        var timezone = $el.data("timezone");
        var opts = {
          prettify: getTypePrettifyer(dataType, timeFormat, timezone)
        };
        $el.ionRangeSlider(opts);
      }
    }]);
    return SliderInputBinding2;
  }(TextInputBindingBase);
  function formatNumber(num) {
    var thousandSep = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ",";
    var decimalSep = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
    var parts = num.toString().split(".");
    parts[0] = parts[0].replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g, "$1" + thousandSep);
    if (parts.length === 1)
      return parts[0];
    else if (parts.length === 2)
      return parts[0] + decimalSep + parts[1];
    else
      return "";
  }
  (0, import_jquery18.default)(document).on("click", ".slider-animate-button", function(evt) {
    evt.preventDefault();
    var self2 = (0, import_jquery18.default)(this);
    var target = (0, import_jquery18.default)("#" + $escape(self2.attr("data-target-id")));
    var startLabel = "Play";
    var stopLabel = "Pause";
    var loop = self2.attr("data-loop") !== void 0 && !/^\s*false\s*$/i.test(self2.attr("data-loop"));
    var animInterval = self2.attr("data-interval");
    if (isNaN(animInterval))
      animInterval = 1500;
    else
      animInterval = Number(animInterval);
    if (!target.data("animTimer")) {
      var timer;
      if (target.hasClass("jslider")) {
        var slider = target.slider();
        if (!slider.canStepNext())
          slider.resetToStart();
        timer = setInterval(function() {
          if (loop && !slider.canStepNext()) {
            slider.resetToStart();
          } else {
            slider.stepNext();
            if (!loop && !slider.canStepNext()) {
              self2.click();
            }
          }
        }, animInterval);
      } else {
        var _slider = target.data("ionRangeSlider");
        var sliderCanStep = function sliderCanStep2() {
          if (_slider.options.type === "double")
            return _slider.result.to < _slider.result.max;
          else
            return _slider.result.from < _slider.result.max;
        };
        var sliderReset = function sliderReset2() {
          var val = {
            from: _slider.result.min
          };
          if (_slider.options.type === "double")
            val.to = val.from + (_slider.result.to - _slider.result.from);
          _slider.update(val);
          forceIonSliderUpdate(_slider);
        };
        var sliderStep = function sliderStep2() {
          var val = {
            from: Math.min(_slider.result.max, _slider.result.from + _slider.options.step)
          };
          if (_slider.options.type === "double")
            val.to = Math.min(_slider.result.max, _slider.result.to + _slider.options.step);
          _slider.update(val);
          forceIonSliderUpdate(_slider);
        };
        if (!sliderCanStep())
          sliderReset();
        timer = setInterval(function() {
          if (loop && !sliderCanStep()) {
            sliderReset();
          } else {
            sliderStep();
            if (!loop && !sliderCanStep()) {
              self2.click();
            }
          }
        }, animInterval);
      }
      target.data("animTimer", timer);
      self2.attr("title", stopLabel);
      self2.addClass("playing");
      target.data("animating", true);
    } else {
      clearTimeout(target.data("animTimer"));
      target.removeData("animTimer");
      self2.attr("title", startLabel);
      self2.removeClass("playing");
      target.removeData("animating");
    }
  });

  // srcts/src/bindings/input/tabinput.ts
  var import_es_array_iterator17 = __toESM(require_es_array_iterator());
  var import_jquery19 = __toESM(require_jquery());
  function _typeof17(obj) {
    "@babel/helpers - typeof";
    return _typeof17 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof17(obj);
  }
  function _classCallCheck16(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties16(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey16(descriptor.key), descriptor);
    }
  }
  function _createClass16(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties16(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties16(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey16(arg) {
    var key = _toPrimitive16(arg, "string");
    return _typeof17(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive16(input, hint) {
    if (_typeof17(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof17(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _inherits14(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf14(subClass, superClass);
  }
  function _setPrototypeOf14(o4, p3) {
    _setPrototypeOf14 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf14(o4, p3);
  }
  function _createSuper14(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct14();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf14(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf14(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn14(this, result);
    };
  }
  function _possibleConstructorReturn14(self2, call8) {
    if (call8 && (_typeof17(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized14(self2);
  }
  function _assertThisInitialized14(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct14() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf14(o4) {
    _getPrototypeOf14 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf14(o4);
  }
  function getTabName(anchor) {
    return anchor.attr("data-value") || anchor.text();
  }
  var BootstrapTabInputBinding = /* @__PURE__ */ function(_InputBinding) {
    _inherits14(BootstrapTabInputBinding2, _InputBinding);
    var _super = _createSuper14(BootstrapTabInputBinding2);
    function BootstrapTabInputBinding2() {
      _classCallCheck16(this, BootstrapTabInputBinding2);
      return _super.apply(this, arguments);
    }
    _createClass16(BootstrapTabInputBinding2, [{
      key: "find",
      value: function find2(scope) {
        return (0, import_jquery19.default)(scope).find("ul.nav.shiny-tab-input");
      }
    }, {
      key: "getValue",
      value: function getValue(el) {
        var anchor = isBS3() ? (0, import_jquery19.default)(el).find("li:not(.dropdown).active > a") : (0, import_jquery19.default)(el).find(".nav-link:not(.dropdown-toggle).active, .dropdown-menu .dropdown-item.active");
        if (anchor.length === 1)
          return getTabName(anchor);
        return null;
      }
    }, {
      key: "setValue",
      value: function setValue(el, value) {
        var success = false;
        if (value) {
          var anchors = isBS3() ? (0, import_jquery19.default)(el).find("li:not(.dropdown) > a") : (0, import_jquery19.default)(el).find(".nav-link:not(.dropdown-toggle), .dropdown-menu .dropdown-item");
          anchors.each(function() {
            if (getTabName((0, import_jquery19.default)(this)) === value) {
              (0, import_jquery19.default)(this).tab("show");
              success = true;
              return false;
            }
            return;
          });
        }
        if (!success) {
          (0, import_jquery19.default)(el).trigger("change");
        }
      }
    }, {
      key: "getState",
      value: function getState(el) {
        return {
          value: this.getValue(el)
        };
      }
    }, {
      key: "receiveMessage",
      value: function receiveMessage(el, data) {
        if (hasDefinedProperty(data, "value"))
          this.setValue(el, data.value);
        (0, import_jquery19.default)(el).trigger("change");
      }
    }, {
      key: "subscribe",
      value: function subscribe(el, callback) {
        (0, import_jquery19.default)(el).on(
          "change shown.bootstrapTabInputBinding shown.bs.tab.bootstrapTabInputBinding",
          function() {
            callback(false);
          }
        );
      }
    }, {
      key: "unsubscribe",
      value: function unsubscribe(el) {
        (0, import_jquery19.default)(el).off(".bootstrapTabInputBinding");
      }
    }]);
    return BootstrapTabInputBinding2;
  }(InputBinding);

  // srcts/src/bindings/input/textarea.ts
  var import_es_array_iterator18 = __toESM(require_es_array_iterator());
  var import_jquery20 = __toESM(require_jquery());
  function _typeof18(obj) {
    "@babel/helpers - typeof";
    return _typeof18 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof18(obj);
  }
  function _classCallCheck17(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties17(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey17(descriptor.key), descriptor);
    }
  }
  function _createClass17(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties17(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties17(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey17(arg) {
    var key = _toPrimitive17(arg, "string");
    return _typeof18(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive17(input, hint) {
    if (_typeof18(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof18(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _inherits15(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf15(subClass, superClass);
  }
  function _setPrototypeOf15(o4, p3) {
    _setPrototypeOf15 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf15(o4, p3);
  }
  function _createSuper15(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct15();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf15(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf15(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn15(this, result);
    };
  }
  function _possibleConstructorReturn15(self2, call8) {
    if (call8 && (_typeof18(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized15(self2);
  }
  function _assertThisInitialized15(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct15() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf15(o4) {
    _getPrototypeOf15 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf15(o4);
  }
  var TextareaInputBinding = /* @__PURE__ */ function(_TextInputBinding) {
    _inherits15(TextareaInputBinding2, _TextInputBinding);
    var _super = _createSuper15(TextareaInputBinding2);
    function TextareaInputBinding2() {
      _classCallCheck17(this, TextareaInputBinding2);
      return _super.apply(this, arguments);
    }
    _createClass17(TextareaInputBinding2, [{
      key: "find",
      value: function find2(scope) {
        return (0, import_jquery20.default)(scope).find("textarea");
      }
    }]);
    return TextareaInputBinding2;
  }(TextInputBinding);

  // srcts/src/bindings/input/index.ts
  function initInputBindings() {
    var inputBindings = new BindingRegistry();
    inputBindings.register(new TextInputBinding(), "shiny.textInput");
    inputBindings.register(new TextareaInputBinding(), "shiny.textareaInput");
    inputBindings.register(new PasswordInputBinding(), "shiny.passwordInput");
    inputBindings.register(new NumberInputBinding(), "shiny.numberInput");
    inputBindings.register(new CheckboxInputBinding(), "shiny.checkboxInput");
    inputBindings.register(new CheckboxGroupInputBinding(), "shiny.checkboxGroupInput");
    inputBindings.register(new RadioInputBinding(), "shiny.radioInput");
    inputBindings.register(new SliderInputBinding(), "shiny.sliderInput");
    inputBindings.register(new DateInputBinding(), "shiny.dateInput");
    inputBindings.register(new DateRangeInputBinding(), "shiny.dateRangeInput");
    inputBindings.register(new SelectInputBinding(), "shiny.selectInput");
    inputBindings.register(new ActionButtonInputBinding(), "shiny.actionButtonInput");
    inputBindings.register(new BootstrapTabInputBinding(), "shiny.bootstrapTabInput");
    var fileInputBinding2 = new FileInputBinding();
    inputBindings.register(fileInputBinding2, "shiny.fileInputBinding");
    return {
      inputBindings: inputBindings,
      fileInputBinding: fileInputBinding2
    };
  }

  // node_modules/core-js/modules/es.array.join.js
  var $45 = require_export();
  var uncurryThis9 = require_function_uncurry_this();
  var IndexedObject = require_indexed_object();
  var toIndexedObject3 = require_to_indexed_object();
  var arrayMethodIsStrict2 = require_array_method_is_strict();
  var nativeJoin = uncurryThis9([].join);
  var ES3_STRINGS = IndexedObject != Object;
  var FORCED7 = ES3_STRINGS || !arrayMethodIsStrict2("join", ",");
  $45({ target: "Array", proto: true, forced: FORCED7 }, {
    join: function join(separator) {
      return nativeJoin(toIndexedObject3(this), separator === void 0 ? "," : separator);
    }
  });

  // srcts/src/bindings/output/datatable.ts
  var import_es_regexp_exec6 = __toESM(require_es_regexp_exec());
  var import_es_array_iterator23 = __toESM(require_es_array_iterator());
  var import_jquery22 = __toESM(require_jquery());

  // srcts/src/time/debounce.ts
  var import_es_array_iterator19 = __toESM(require_es_array_iterator());
  function _typeof19(obj) {
    "@babel/helpers - typeof";
    return _typeof19 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof19(obj);
  }
  function _classCallCheck18(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties18(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey18(descriptor.key), descriptor);
    }
  }
  function _createClass18(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties18(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties18(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _defineProperty4(obj, key, value) {
    key = _toPropertyKey18(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey18(arg) {
    var key = _toPrimitive18(arg, "string");
    return _typeof19(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive18(input, hint) {
    if (_typeof19(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof19(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  var Debouncer = /* @__PURE__ */ function() {
    function Debouncer2(target, func, delayMs) {
      _classCallCheck18(this, Debouncer2);
      _defineProperty4(this, "target", void 0);
      _defineProperty4(this, "func", void 0);
      _defineProperty4(this, "delayMs", void 0);
      _defineProperty4(this, "timerId", void 0);
      _defineProperty4(this, "args", void 0);
      this.target = target;
      this.func = func;
      this.delayMs = delayMs;
      this.timerId = null;
      this.args = null;
    }
    _createClass18(Debouncer2, [{
      key: "normalCall",
      value: function normalCall() {
        var _this = this;
        this.$clearTimer();
        for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
          args[_key] = arguments[_key];
        }
        this.args = args;
        this.timerId = setTimeout(function() {
          if (_this.timerId === null)
            return;
          _this.$clearTimer();
          _this.$invoke();
        }, this.delayMs);
      }
    }, {
      key: "immediateCall",
      value: function immediateCall() {
        this.$clearTimer();
        for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
          args[_key2] = arguments[_key2];
        }
        this.args = args;
        this.$invoke();
      }
    }, {
      key: "isPending",
      value: function isPending() {
        return this.timerId !== null;
      }
    }, {
      key: "$clearTimer",
      value: function $clearTimer() {
        if (this.timerId !== null) {
          clearTimeout(this.timerId);
          this.timerId = null;
        }
      }
    }, {
      key: "$invoke",
      value: function $invoke() {
        if (this.args && this.args.length > 0) {
          this.func.apply(this.target, this.args);
        } else {
          this.func.apply(this.target);
        }
        this.args = null;
      }
    }]);
    return Debouncer2;
  }();
  function debounce(threshold, func) {
    var timerId = null;
    return function thisFunc() {
      for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
        args[_key3] = arguments[_key3];
      }
      if (timerId !== null) {
        clearTimeout(timerId);
        timerId = null;
      }
      timerId = setTimeout(function() {
        if (timerId === null)
          return;
        timerId = null;
        func.apply(thisFunc, args);
      }, threshold);
    };
  }

  // srcts/src/time/invoke.ts
  var import_es_array_iterator20 = __toESM(require_es_array_iterator());
  function _typeof20(obj) {
    "@babel/helpers - typeof";
    return _typeof20 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof20(obj);
  }
  function _classCallCheck19(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties19(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey19(descriptor.key), descriptor);
    }
  }
  function _createClass19(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties19(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties19(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _defineProperty5(obj, key, value) {
    key = _toPropertyKey19(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey19(arg) {
    var key = _toPrimitive19(arg, "string");
    return _typeof20(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive19(input, hint) {
    if (_typeof20(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof20(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  var Invoker = /* @__PURE__ */ function() {
    function Invoker2(target, func) {
      _classCallCheck19(this, Invoker2);
      _defineProperty5(this, "target", void 0);
      _defineProperty5(this, "func", void 0);
      this.target = target;
      this.func = func;
    }
    _createClass19(Invoker2, [{
      key: "normalCall",
      value: function normalCall() {
        for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
          args[_key] = arguments[_key];
        }
        this.func.apply(this.target, args);
      }
    }, {
      key: "immediateCall",
      value: function immediateCall() {
        for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
          args[_key2] = arguments[_key2];
        }
        this.func.apply(this.target, args);
      }
    }]);
    return Invoker2;
  }();

  // srcts/src/time/throttle.ts
  var import_es_array_iterator21 = __toESM(require_es_array_iterator());
  function _typeof21(obj) {
    "@babel/helpers - typeof";
    return _typeof21 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof21(obj);
  }
  function _classCallCheck20(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties20(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey20(descriptor.key), descriptor);
    }
  }
  function _createClass20(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties20(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties20(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _defineProperty6(obj, key, value) {
    key = _toPropertyKey20(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey20(arg) {
    var key = _toPrimitive20(arg, "string");
    return _typeof21(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive20(input, hint) {
    if (_typeof21(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof21(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  var Throttler = /* @__PURE__ */ function() {
    function Throttler2(target, func, delayMs) {
      _classCallCheck20(this, Throttler2);
      _defineProperty6(this, "target", void 0);
      _defineProperty6(this, "func", void 0);
      _defineProperty6(this, "delayMs", void 0);
      _defineProperty6(this, "timerId", void 0);
      _defineProperty6(this, "args", void 0);
      this.target = target;
      this.func = func;
      this.delayMs = delayMs;
      this.timerId = null;
      this.args = null;
    }
    _createClass20(Throttler2, [{
      key: "normalCall",
      value: function normalCall() {
        for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
          args[_key] = arguments[_key];
        }
        this.args = args;
        if (this.timerId === null) {
          this.$invoke();
        }
      }
    }, {
      key: "immediateCall",
      value: function immediateCall() {
        this.$clearTimer();
        for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
          args[_key2] = arguments[_key2];
        }
        this.args = args;
        this.$invoke();
      }
    }, {
      key: "isPending",
      value: function isPending() {
        return this.args !== null;
      }
    }, {
      key: "$clearTimer",
      value: function $clearTimer() {
        if (this.timerId !== null) {
          clearTimeout(this.timerId);
          this.timerId = null;
        }
      }
    }, {
      key: "$invoke",
      value: function $invoke() {
        var _this = this;
        if (this.args === null) {
          return;
        }
        this.func.apply(this.target, this.args);
        this.args = null;
        this.timerId = setTimeout(function() {
          if (_this.timerId === null)
            return;
          _this.$clearTimer();
          if (_this.isPending()) {
            _this.$invoke();
          }
        }, this.delayMs);
      }
    }]);
    return Throttler2;
  }();

  // srcts/src/bindings/output/outputBinding.ts
  var import_es_regexp_exec5 = __toESM(require_es_regexp_exec());
  var import_es_array_iterator22 = __toESM(require_es_array_iterator());
  var import_jquery21 = __toESM(require_jquery());
  function _typeof22(obj) {
    "@babel/helpers - typeof";
    return _typeof22 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof22(obj);
  }
  function _regeneratorRuntime2() {
    "use strict";
    _regeneratorRuntime2 = function _regeneratorRuntime15() {
      return exports;
    };
    var exports = {}, Op = Object.prototype, hasOwn5 = Op.hasOwnProperty, defineProperty3 = Object.defineProperty || function(obj, key, desc) {
      obj[key] = desc.value;
    }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
    function define(obj, key, value) {
      return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }), obj[key];
    }
    try {
      define({}, "");
    } catch (err) {
      define = function define2(obj, key, value) {
        return obj[key] = value;
      };
    }
    function wrap(innerFn, outerFn, self2, tryLocsList) {
      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []);
      return defineProperty3(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) }), generator;
    }
    function tryCatch(fn, obj, arg) {
      try {
        return { type: "normal", arg: fn.call(obj, arg) };
      } catch (err) {
        return { type: "throw", arg: err };
      }
    }
    exports.wrap = wrap;
    var ContinueSentinel = {};
    function Generator() {
    }
    function GeneratorFunction() {
    }
    function GeneratorFunctionPrototype() {
    }
    var IteratorPrototype = {};
    define(IteratorPrototype, iteratorSymbol, function() {
      return this;
    });
    var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values2([])));
    NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn5.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
    var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
    function defineIteratorMethods(prototype) {
      ["next", "throw", "return"].forEach(function(method) {
        define(prototype, method, function(arg) {
          return this._invoke(method, arg);
        });
      });
    }
    function AsyncIterator(generator, PromiseImpl) {
      function invoke(method, arg, resolve, reject) {
        var record = tryCatch(generator[method], generator, arg);
        if ("throw" !== record.type) {
          var result = record.arg, value = result.value;
          return value && "object" == _typeof22(value) && hasOwn5.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
            invoke("next", value2, resolve, reject);
          }, function(err) {
            invoke("throw", err, resolve, reject);
          }) : PromiseImpl.resolve(value).then(function(unwrapped) {
            result.value = unwrapped, resolve(result);
          }, function(error) {
            return invoke("throw", error, resolve, reject);
          });
        }
        reject(record.arg);
      }
      var previousPromise;
      defineProperty3(this, "_invoke", { value: function value(method, arg) {
        function callInvokeWithMethodAndArg() {
          return new PromiseImpl(function(resolve, reject) {
            invoke(method, arg, resolve, reject);
          });
        }
        return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
      } });
    }
    function makeInvokeMethod(innerFn, self2, context) {
      var state = "suspendedStart";
      return function(method, arg) {
        if ("executing" === state)
          throw new Error("Generator is already running");
        if ("completed" === state) {
          if ("throw" === method)
            throw arg;
          return doneResult();
        }
        for (context.method = method, context.arg = arg; ; ) {
          var delegate = context.delegate;
          if (delegate) {
            var delegateResult = maybeInvokeDelegate(delegate, context);
            if (delegateResult) {
              if (delegateResult === ContinueSentinel)
                continue;
              return delegateResult;
            }
          }
          if ("next" === context.method)
            context.sent = context._sent = context.arg;
          else if ("throw" === context.method) {
            if ("suspendedStart" === state)
              throw state = "completed", context.arg;
            context.dispatchException(context.arg);
          } else
            "return" === context.method && context.abrupt("return", context.arg);
          state = "executing";
          var record = tryCatch(innerFn, self2, context);
          if ("normal" === record.type) {
            if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel)
              continue;
            return { value: record.arg, done: context.done };
          }
          "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
        }
      };
    }
    function maybeInvokeDelegate(delegate, context) {
      var methodName = context.method, method = delegate.iterator[methodName];
      if (void 0 === method)
        return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
      var record = tryCatch(method, delegate.iterator, context.arg);
      if ("throw" === record.type)
        return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
      var info = record.arg;
      return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
    }
    function pushTryEntry(locs) {
      var entry = { tryLoc: locs[0] };
      1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
    }
    function resetTryEntry(entry) {
      var record = entry.completion || {};
      record.type = "normal", delete record.arg, entry.completion = record;
    }
    function Context(tryLocsList) {
      this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(true);
    }
    function values2(iterable) {
      if (iterable) {
        var iteratorMethod = iterable[iteratorSymbol];
        if (iteratorMethod)
          return iteratorMethod.call(iterable);
        if ("function" == typeof iterable.next)
          return iterable;
        if (!isNaN(iterable.length)) {
          var i5 = -1, next2 = function next3() {
            for (; ++i5 < iterable.length; )
              if (hasOwn5.call(iterable, i5))
                return next3.value = iterable[i5], next3.done = false, next3;
            return next3.value = void 0, next3.done = true, next3;
          };
          return next2.next = next2;
        }
      }
      return { next: doneResult };
    }
    function doneResult() {
      return { value: void 0, done: true };
    }
    return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty3(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }), defineProperty3(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) {
      var ctor = "function" == typeof genFun && genFun.constructor;
      return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
    }, exports.mark = function(genFun) {
      return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
    }, exports.awrap = function(arg) {
      return { __await: arg };
    }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
      return this;
    }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
      void 0 === PromiseImpl && (PromiseImpl = Promise);
      var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl);
      return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
        return result.done ? result.value : iter.next();
      });
    }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() {
      return this;
    }), define(Gp, "toString", function() {
      return "[object Generator]";
    }), exports.keys = function(val) {
      var object = Object(val), keys2 = [];
      for (var key in object)
        keys2.push(key);
      return keys2.reverse(), function next2() {
        for (; keys2.length; ) {
          var key2 = keys2.pop();
          if (key2 in object)
            return next2.value = key2, next2.done = false, next2;
        }
        return next2.done = true, next2;
      };
    }, exports.values = values2, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) {
      if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
        for (var name in this)
          "t" === name.charAt(0) && hasOwn5.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
    }, stop: function stop() {
      this.done = true;
      var rootRecord = this.tryEntries[0].completion;
      if ("throw" === rootRecord.type)
        throw rootRecord.arg;
      return this.rval;
    }, dispatchException: function dispatchException(exception) {
      if (this.done)
        throw exception;
      var context = this;
      function handle(loc, caught) {
        return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;
      }
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5], record = entry.completion;
        if ("root" === entry.tryLoc)
          return handle("end");
        if (entry.tryLoc <= this.prev) {
          var hasCatch = hasOwn5.call(entry, "catchLoc"), hasFinally = hasOwn5.call(entry, "finallyLoc");
          if (hasCatch && hasFinally) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          } else if (hasCatch) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
          } else {
            if (!hasFinally)
              throw new Error("try statement without catch or finally");
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          }
        }
      }
    }, abrupt: function abrupt(type, arg) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc <= this.prev && hasOwn5.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
          var finallyEntry = entry;
          break;
        }
      }
      finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
      var record = finallyEntry ? finallyEntry.completion : {};
      return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
    }, complete: function complete(record, afterLoc) {
      if ("throw" === record.type)
        throw record.arg;
      return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
    }, finish: function finish(finallyLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.finallyLoc === finallyLoc)
          return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
      }
    }, catch: function _catch(tryLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc === tryLoc) {
          var record = entry.completion;
          if ("throw" === record.type) {
            var thrown = record.arg;
            resetTryEntry(entry);
          }
          return thrown;
        }
      }
      throw new Error("illegal catch attempt");
    }, delegateYield: function delegateYield(iterable, resultName, nextLoc) {
      return this.delegate = { iterator: values2(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = void 0), ContinueSentinel;
    } }, exports;
  }
  function asyncGeneratorStep2(gen, resolve, reject, _next, _throw, key, arg) {
    try {
      var info = gen[key](arg);
      var value = info.value;
    } catch (error) {
      reject(error);
      return;
    }
    if (info.done) {
      resolve(value);
    } else {
      Promise.resolve(value).then(_next, _throw);
    }
  }
  function _asyncToGenerator2(fn) {
    return function() {
      var self2 = this, args = arguments;
      return new Promise(function(resolve, reject) {
        var gen = fn.apply(self2, args);
        function _next(value) {
          asyncGeneratorStep2(gen, resolve, reject, _next, _throw, "next", value);
        }
        function _throw(err) {
          asyncGeneratorStep2(gen, resolve, reject, _next, _throw, "throw", err);
        }
        _next(void 0);
      });
    };
  }
  function _classCallCheck21(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties21(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey21(descriptor.key), descriptor);
    }
  }
  function _createClass21(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties21(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties21(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _defineProperty7(obj, key, value) {
    key = _toPropertyKey21(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey21(arg) {
    var key = _toPrimitive21(arg, "string");
    return _typeof22(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive21(input, hint) {
    if (_typeof22(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof22(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  var OutputBinding = /* @__PURE__ */ function() {
    function OutputBinding2() {
      _classCallCheck21(this, OutputBinding2);
      _defineProperty7(this, "name", void 0);
    }
    _createClass21(OutputBinding2, [{
      key: "find",
      value: function find2(scope) {
        throw "Not implemented";
        scope;
      }
    }, {
      key: "renderValue",
      value: function renderValue(el, data) {
        throw "Not implemented";
        el;
        data;
      }
    }, {
      key: "getId",
      value: function getId(el) {
        return el.getAttribute("data-input-id") || el.id;
      }
    }, {
      key: "onValueChange",
      value: function() {
        var _onValueChange = _asyncToGenerator2(/* @__PURE__ */ _regeneratorRuntime2().mark(function _callee(el, data) {
          return _regeneratorRuntime2().wrap(function _callee$(_context) {
            while (1)
              switch (_context.prev = _context.next) {
                case 0:
                  this.clearError(el);
                  _context.next = 3;
                  return this.renderValue(el, data);
                case 3:
                case "end":
                  return _context.stop();
              }
          }, _callee, this);
        }));
        function onValueChange(_x, _x2) {
          return _onValueChange.apply(this, arguments);
        }
        return onValueChange;
      }()
    }, {
      key: "onValueError",
      value: function onValueError(el, err) {
        this.renderError(el, err);
      }
    }, {
      key: "renderError",
      value: function renderError(el, err) {
        this.clearError(el);
        if (err.message === "") {
          (0, import_jquery21.default)(el).empty();
          return;
        }
        var errClass = "shiny-output-error";
        if (err.type !== null) {
          errClass = errClass + " " + import_jquery21.default.map(asArray(err.type), function(type) {
            return errClass + "-" + type;
          }).join(" ");
        }
        (0, import_jquery21.default)(el).addClass(errClass).text(err.message);
      }
    }, {
      key: "clearError",
      value: function clearError(el) {
        (0, import_jquery21.default)(el).attr("class", function(i5, c5) {
          return c5.replace(/(^|\s)shiny-output-error\S*/g, "");
        });
      }
    }, {
      key: "showProgress",
      value: function showProgress(el, show3) {
        var recalcClass = "recalculating";
        if (show3)
          (0, import_jquery21.default)(el).addClass(recalcClass);
        else
          (0, import_jquery21.default)(el).removeClass(recalcClass);
      }
    }]);
    return OutputBinding2;
  }();

  // srcts/src/bindings/output/datatable.ts
  function _typeof23(obj) {
    "@babel/helpers - typeof";
    return _typeof23 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof23(obj);
  }
  function _classCallCheck22(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties22(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey22(descriptor.key), descriptor);
    }
  }
  function _createClass22(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties22(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties22(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey22(arg) {
    var key = _toPrimitive22(arg, "string");
    return _typeof23(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive22(input, hint) {
    if (_typeof23(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof23(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _inherits16(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf16(subClass, superClass);
  }
  function _setPrototypeOf16(o4, p3) {
    _setPrototypeOf16 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf16(o4, p3);
  }
  function _createSuper16(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct16();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf16(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf16(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn16(this, result);
    };
  }
  function _possibleConstructorReturn16(self2, call8) {
    if (call8 && (_typeof23(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized16(self2);
  }
  function _assertThisInitialized16(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct16() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf16(o4) {
    _getPrototypeOf16 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf16(o4);
  }
  var DatatableOutputBinding = /* @__PURE__ */ function(_OutputBinding) {
    _inherits16(DatatableOutputBinding2, _OutputBinding);
    var _super = _createSuper16(DatatableOutputBinding2);
    function DatatableOutputBinding2() {
      _classCallCheck22(this, DatatableOutputBinding2);
      return _super.apply(this, arguments);
    }
    _createClass22(DatatableOutputBinding2, [{
      key: "find",
      value: function find2(scope) {
        return (0, import_jquery22.default)(scope).find(".shiny-datatable-output");
      }
    }, {
      key: "onValueError",
      value: function onValueError(el, err) {
        shinyUnbindAll(el);
        this.renderError(el, err);
      }
    }, {
      key: "renderValue",
      value: function renderValue(el, _data) {
        var _data$options$searchi, _data$options, _data$options2, _data$options2$search;
        var $el = (0, import_jquery22.default)(el).empty();
        if (!_data || !_data.colnames)
          return;
        var colnames = import_jquery22.default.makeArray(_data.colnames);
        var header = import_jquery22.default.map(colnames, function(x2) {
          return "<th>" + x2 + "</th>";
        }).join("");
        header = "<thead><tr>" + header + "</tr></thead>";
        var footer = "";
        if ((_data$options$searchi = (_data$options = _data.options) === null || _data$options === void 0 ? void 0 : _data$options.searching) !== null && _data$options$searchi !== void 0 ? _data$options$searchi : true) {
          footer = import_jquery22.default.map(colnames, function(x2) {
            return '<th><input type="text" placeholder="' + escapeHTML(x2.replace(/(<([^>]+)>)/gi, "")) + '" /></th>';
          }).join("");
          footer = "<tfoot>" + footer + "</tfoot>";
        }
        var content = '<table class="table table-striped table-hover">' + header + footer + "</table>";
        $el.append(content);
        if (_data.evalOptions) {
          import_jquery22.default.each(_data.evalOptions, function(i5, x2) {
            _data.options[x2] = indirectEval("(" + _data.options[x2] + ")");
          });
        }
        var searchCI = ((_data$options2 = _data.options) === null || _data$options2 === void 0 ? void 0 : (_data$options2$search = _data$options2.search) === null || _data$options2$search === void 0 ? void 0 : _data$options2$search.caseInsensitive) !== false;
        var oTable = (0, import_jquery22.default)(el).children("table").DataTable(import_jquery22.default.extend({
          processing: true,
          serverSide: true,
          order: [],
          orderClasses: false,
          pageLength: 25,
          ajax: {
            url: _data.action,
            type: "POST",
            data: function data(d4) {
              d4.search || (d4.search = {});
              d4.search.caseInsensitive = searchCI;
              d4.escape = _data.escape;
            }
          }
        }, _data.options));
        if (typeof _data.callback === "string") {
          var callback = indirectEval("(" + _data.callback + ")");
          if (typeof callback === "function")
            callback(oTable);
        }
        $el.find("label input").first().unbind("keyup").keyup(debounce(_data.searchDelay, function() {
          oTable.search(this.value).draw();
        }));
        var searchInputs = $el.find("tfoot input");
        if (searchInputs.length > 0) {
          import_jquery22.default.each(oTable.settings()[0].aoColumns, function(i5, x2) {
            if (!x2.bSearchable)
              searchInputs.eq(i5).hide();
          });
          searchInputs.keyup(debounce(_data.searchDelay, function() {
            oTable.column(searchInputs.index(this)).search(this.value).draw();
          }));
        }
        $el.parents(".tab-content").css("overflow", "visible");
      }
    }]);
    return DatatableOutputBinding2;
  }(OutputBinding);

  // srcts/src/bindings/output/downloadlink.ts
  var import_es_array_iterator24 = __toESM(require_es_array_iterator());
  var import_jquery23 = __toESM(require_jquery());
  function _typeof24(obj) {
    "@babel/helpers - typeof";
    return _typeof24 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof24(obj);
  }
  function _classCallCheck23(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties23(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey23(descriptor.key), descriptor);
    }
  }
  function _createClass23(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties23(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties23(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey23(arg) {
    var key = _toPrimitive23(arg, "string");
    return _typeof24(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive23(input, hint) {
    if (_typeof24(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof24(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _inherits17(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf17(subClass, superClass);
  }
  function _setPrototypeOf17(o4, p3) {
    _setPrototypeOf17 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf17(o4, p3);
  }
  function _createSuper17(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct17();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf17(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf17(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn17(this, result);
    };
  }
  function _possibleConstructorReturn17(self2, call8) {
    if (call8 && (_typeof24(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized17(self2);
  }
  function _assertThisInitialized17(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct17() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf17(o4) {
    _getPrototypeOf17 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf17(o4);
  }
  var DownloadLinkOutputBinding = /* @__PURE__ */ function(_OutputBinding) {
    _inherits17(DownloadLinkOutputBinding2, _OutputBinding);
    var _super = _createSuper17(DownloadLinkOutputBinding2);
    function DownloadLinkOutputBinding2() {
      _classCallCheck23(this, DownloadLinkOutputBinding2);
      return _super.apply(this, arguments);
    }
    _createClass23(DownloadLinkOutputBinding2, [{
      key: "find",
      value: function find2(scope) {
        return (0, import_jquery23.default)(scope).find("a.shiny-download-link");
      }
    }, {
      key: "renderValue",
      value: function renderValue(el, data) {
        el.setAttribute("href", data);
        el.classList.remove("disabled");
        el.removeAttribute("aria-disabled");
        el.removeAttribute("tabindex");
      }
    }, {
      key: "showProgress",
      value: function showProgress(el, show3) {
        return;
        el;
        show3;
      }
    }]);
    return DownloadLinkOutputBinding2;
  }(OutputBinding);
  (0, import_jquery23.default)(document).on("click.shinyDownloadLink", "a.shiny-download-link", function(e4) {
    e4;
    var evt = import_jquery23.default.Event("shiny:filedownload");
    evt.name = this.id;
    evt.href = this.href;
    (0, import_jquery23.default)(document).trigger(evt);
  });

  // srcts/src/bindings/output/html.ts
  var import_es_array_iterator27 = __toESM(require_es_array_iterator());
  var import_jquery26 = __toESM(require_jquery());

  // srcts/src/shiny/render.ts
  var import_es_regexp_exec8 = __toESM(require_es_regexp_exec());

  // node_modules/core-js/modules/es.object.entries.js
  var $49 = require_export();
  var $entries = require_object_to_array().entries;
  $49({ target: "Object", stat: true }, {
    entries: function entries(O) {
      return $entries(O);
    }
  });

  // srcts/src/shiny/render.ts
  var import_es_array_iterator26 = __toESM(require_es_array_iterator());

  // node_modules/core-js/modules/es.promise.all-settled.js
  var $50 = require_export();
  var call7 = require_function_call();
  var aCallable = require_a_callable();
  var newPromiseCapabilityModule = require_new_promise_capability();
  var perform = require_perform();
  var iterate = require_iterate();
  var PROMISE_STATICS_INCORRECT_ITERATION = require_promise_statics_incorrect_iteration();
  $50({ target: "Promise", stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
    allSettled: function allSettled(iterable) {
      var C2 = this;
      var capability = newPromiseCapabilityModule.f(C2);
      var resolve = capability.resolve;
      var reject = capability.reject;
      var result = perform(function() {
        var promiseResolve2 = aCallable(C2.resolve);
        var values2 = [];
        var counter = 0;
        var remaining = 1;
        iterate(iterable, function(promise) {
          var index = counter++;
          var alreadyCalled = false;
          remaining++;
          call7(promiseResolve2, C2, promise).then(function(value) {
            if (alreadyCalled)
              return;
            alreadyCalled = true;
            values2[index] = { status: "fulfilled", value: value };
            --remaining || resolve(values2);
          }, function(error) {
            if (alreadyCalled)
              return;
            alreadyCalled = true;
            values2[index] = { status: "rejected", reason: error };
            --remaining || resolve(values2);
          });
        });
        --remaining || resolve(values2);
      });
      if (result.error)
        reject(result.value);
      return capability.promise;
    }
  });

  // srcts/src/shiny/render.ts
  var import_jquery25 = __toESM(require_jquery());

  // srcts/src/shiny/sendImageSize.ts
  var import_es_array_iterator25 = __toESM(require_es_array_iterator());
  function _typeof25(obj) {
    "@babel/helpers - typeof";
    return _typeof25 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof25(obj);
  }
  function _classCallCheck24(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties24(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey24(descriptor.key), descriptor);
    }
  }
  function _createClass24(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties24(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties24(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _defineProperty8(obj, key, value) {
    key = _toPropertyKey24(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey24(arg) {
    var key = _toPrimitive24(arg, "string");
    return _typeof25(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive24(input, hint) {
    if (_typeof25(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof25(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  var SendImageSize = /* @__PURE__ */ function() {
    function SendImageSize2() {
      _classCallCheck24(this, SendImageSize2);
      _defineProperty8(this, "regular", void 0);
      _defineProperty8(this, "transitioned", void 0);
    }
    _createClass24(SendImageSize2, [{
      key: "setImageSend",
      value: function setImageSend(inputBatchSender, doSendImageSize) {
        var sendImageSizeDebouncer = new Debouncer(null, doSendImageSize, 0);
        this.regular = function() {
          sendImageSizeDebouncer.normalCall();
        };
        inputBatchSender.lastChanceCallback.push(function() {
          if (sendImageSizeDebouncer.isPending())
            sendImageSizeDebouncer.immediateCall();
        });
        this.transitioned = debounce(200, this.regular);
        return sendImageSizeDebouncer;
      }
    }]);
    return SendImageSize2;
  }();
  var sendImageSizeFns = new SendImageSize();

  // srcts/src/shiny/singletons.ts
  var import_es_regexp_exec7 = __toESM(require_es_regexp_exec());
  var import_jquery24 = __toESM(require_jquery());
  var reSingleton = /<!--(SHINY.SINGLETON\[([\w]+)\])-->([\s\S]*?)<!--\/\1-->/;
  var reHead = /<head(?:\s[^>]*)?>([\s\S]*?)<\/head>/;
  var knownSingletons = {};
  function renderHtml(html, el, where) {
    var processed = processHtml(html);
    addToHead(processed.head);
    register(processed.singletons);
    switch (where.toLowerCase()) {
      case "replace":
        (0, import_jquery24.default)(el).html(processed.html);
        break;
      case "beforebegin":
        (0, import_jquery24.default)(el).before(processed.html);
        break;
      case "afterbegin":
        (0, import_jquery24.default)(el).prepend(processed.html);
        break;
      case "beforeend":
        (0, import_jquery24.default)(el).append(processed.html);
        break;
      case "afterend":
        (0, import_jquery24.default)(el).after(processed.html);
        break;
      default:
        throw new Error("Unknown where position: " + where);
    }
    return processed;
  }
  function register(s4) {
    import_jquery24.default.extend(knownSingletons, s4);
  }
  function registerNames(s4) {
    if (typeof s4 === "string") {
      knownSingletons[s4] = true;
    } else if (s4 instanceof Array) {
      for (var i5 = 0; i5 < s4.length; i5++) {
        knownSingletons[s4[i5]] = true;
      }
    }
  }
  function addToHead(head) {
    if (head.length > 0) {
      var tempDiv = (0, import_jquery24.default)("<div>" + head + "</div>").get(0);
      var $head = (0, import_jquery24.default)("head");
      while (tempDiv.hasChildNodes()) {
        $head.append(tempDiv.firstChild);
      }
    }
  }
  function processHtml(val) {
    var newSingletons = {};
    var newVal;
    var findNewPayload = function findNewPayload2(match, p1, sig, payload) {
      if (knownSingletons[sig] || newSingletons[sig])
        return "";
      newSingletons[sig] = true;
      return payload;
    };
    while (true) {
      newVal = val.replace(reSingleton, findNewPayload);
      if (val.length === newVal.length)
        break;
      val = newVal;
    }
    var heads = [];
    var headAddPayload = function headAddPayload2(match, payload) {
      heads.push(payload);
      return "";
    };
    while (true) {
      newVal = val.replace(reHead, headAddPayload);
      if (val.length === newVal.length)
        break;
      val = newVal;
    }
    return {
      html: val,
      head: heads.join("\n"),
      singletons: newSingletons
    };
  }

  // srcts/src/shiny/render.ts
  function _regeneratorRuntime3() {
    "use strict";
    _regeneratorRuntime3 = function _regeneratorRuntime15() {
      return exports;
    };
    var exports = {}, Op = Object.prototype, hasOwn5 = Op.hasOwnProperty, defineProperty3 = Object.defineProperty || function(obj, key, desc) {
      obj[key] = desc.value;
    }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
    function define(obj, key, value) {
      return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }), obj[key];
    }
    try {
      define({}, "");
    } catch (err) {
      define = function define2(obj, key, value) {
        return obj[key] = value;
      };
    }
    function wrap(innerFn, outerFn, self2, tryLocsList) {
      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []);
      return defineProperty3(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) }), generator;
    }
    function tryCatch(fn, obj, arg) {
      try {
        return { type: "normal", arg: fn.call(obj, arg) };
      } catch (err) {
        return { type: "throw", arg: err };
      }
    }
    exports.wrap = wrap;
    var ContinueSentinel = {};
    function Generator() {
    }
    function GeneratorFunction() {
    }
    function GeneratorFunctionPrototype() {
    }
    var IteratorPrototype = {};
    define(IteratorPrototype, iteratorSymbol, function() {
      return this;
    });
    var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values2([])));
    NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn5.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
    var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
    function defineIteratorMethods(prototype) {
      ["next", "throw", "return"].forEach(function(method) {
        define(prototype, method, function(arg) {
          return this._invoke(method, arg);
        });
      });
    }
    function AsyncIterator(generator, PromiseImpl) {
      function invoke(method, arg, resolve, reject) {
        var record = tryCatch(generator[method], generator, arg);
        if ("throw" !== record.type) {
          var result = record.arg, value = result.value;
          return value && "object" == _typeof26(value) && hasOwn5.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
            invoke("next", value2, resolve, reject);
          }, function(err) {
            invoke("throw", err, resolve, reject);
          }) : PromiseImpl.resolve(value).then(function(unwrapped) {
            result.value = unwrapped, resolve(result);
          }, function(error) {
            return invoke("throw", error, resolve, reject);
          });
        }
        reject(record.arg);
      }
      var previousPromise;
      defineProperty3(this, "_invoke", { value: function value(method, arg) {
        function callInvokeWithMethodAndArg() {
          return new PromiseImpl(function(resolve, reject) {
            invoke(method, arg, resolve, reject);
          });
        }
        return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
      } });
    }
    function makeInvokeMethod(innerFn, self2, context) {
      var state = "suspendedStart";
      return function(method, arg) {
        if ("executing" === state)
          throw new Error("Generator is already running");
        if ("completed" === state) {
          if ("throw" === method)
            throw arg;
          return doneResult();
        }
        for (context.method = method, context.arg = arg; ; ) {
          var delegate = context.delegate;
          if (delegate) {
            var delegateResult = maybeInvokeDelegate(delegate, context);
            if (delegateResult) {
              if (delegateResult === ContinueSentinel)
                continue;
              return delegateResult;
            }
          }
          if ("next" === context.method)
            context.sent = context._sent = context.arg;
          else if ("throw" === context.method) {
            if ("suspendedStart" === state)
              throw state = "completed", context.arg;
            context.dispatchException(context.arg);
          } else
            "return" === context.method && context.abrupt("return", context.arg);
          state = "executing";
          var record = tryCatch(innerFn, self2, context);
          if ("normal" === record.type) {
            if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel)
              continue;
            return { value: record.arg, done: context.done };
          }
          "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
        }
      };
    }
    function maybeInvokeDelegate(delegate, context) {
      var methodName = context.method, method = delegate.iterator[methodName];
      if (void 0 === method)
        return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
      var record = tryCatch(method, delegate.iterator, context.arg);
      if ("throw" === record.type)
        return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
      var info = record.arg;
      return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
    }
    function pushTryEntry(locs) {
      var entry = { tryLoc: locs[0] };
      1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
    }
    function resetTryEntry(entry) {
      var record = entry.completion || {};
      record.type = "normal", delete record.arg, entry.completion = record;
    }
    function Context(tryLocsList) {
      this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(true);
    }
    function values2(iterable) {
      if (iterable) {
        var iteratorMethod = iterable[iteratorSymbol];
        if (iteratorMethod)
          return iteratorMethod.call(iterable);
        if ("function" == typeof iterable.next)
          return iterable;
        if (!isNaN(iterable.length)) {
          var i5 = -1, next2 = function next3() {
            for (; ++i5 < iterable.length; )
              if (hasOwn5.call(iterable, i5))
                return next3.value = iterable[i5], next3.done = false, next3;
            return next3.value = void 0, next3.done = true, next3;
          };
          return next2.next = next2;
        }
      }
      return { next: doneResult };
    }
    function doneResult() {
      return { value: void 0, done: true };
    }
    return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty3(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }), defineProperty3(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) {
      var ctor = "function" == typeof genFun && genFun.constructor;
      return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
    }, exports.mark = function(genFun) {
      return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
    }, exports.awrap = function(arg) {
      return { __await: arg };
    }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
      return this;
    }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
      void 0 === PromiseImpl && (PromiseImpl = Promise);
      var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl);
      return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
        return result.done ? result.value : iter.next();
      });
    }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() {
      return this;
    }), define(Gp, "toString", function() {
      return "[object Generator]";
    }), exports.keys = function(val) {
      var object = Object(val), keys2 = [];
      for (var key in object)
        keys2.push(key);
      return keys2.reverse(), function next2() {
        for (; keys2.length; ) {
          var key2 = keys2.pop();
          if (key2 in object)
            return next2.value = key2, next2.done = false, next2;
        }
        return next2.done = true, next2;
      };
    }, exports.values = values2, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) {
      if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
        for (var name in this)
          "t" === name.charAt(0) && hasOwn5.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
    }, stop: function stop() {
      this.done = true;
      var rootRecord = this.tryEntries[0].completion;
      if ("throw" === rootRecord.type)
        throw rootRecord.arg;
      return this.rval;
    }, dispatchException: function dispatchException(exception) {
      if (this.done)
        throw exception;
      var context = this;
      function handle(loc, caught) {
        return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;
      }
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5], record = entry.completion;
        if ("root" === entry.tryLoc)
          return handle("end");
        if (entry.tryLoc <= this.prev) {
          var hasCatch = hasOwn5.call(entry, "catchLoc"), hasFinally = hasOwn5.call(entry, "finallyLoc");
          if (hasCatch && hasFinally) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          } else if (hasCatch) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
          } else {
            if (!hasFinally)
              throw new Error("try statement without catch or finally");
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          }
        }
      }
    }, abrupt: function abrupt(type, arg) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc <= this.prev && hasOwn5.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
          var finallyEntry = entry;
          break;
        }
      }
      finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
      var record = finallyEntry ? finallyEntry.completion : {};
      return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
    }, complete: function complete(record, afterLoc) {
      if ("throw" === record.type)
        throw record.arg;
      return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
    }, finish: function finish(finallyLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.finallyLoc === finallyLoc)
          return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
      }
    }, catch: function _catch(tryLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc === tryLoc) {
          var record = entry.completion;
          if ("throw" === record.type) {
            var thrown = record.arg;
            resetTryEntry(entry);
          }
          return thrown;
        }
      }
      throw new Error("illegal catch attempt");
    }, delegateYield: function delegateYield(iterable, resultName, nextLoc) {
      return this.delegate = { iterator: values2(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = void 0), ContinueSentinel;
    } }, exports;
  }
  function _slicedToArray(arr, i5) {
    return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i5) || _unsupportedIterableToArray(arr, i5) || _nonIterableRest();
  }
  function _nonIterableRest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _iterableToArrayLimit(arr, i5) {
    var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
    if (null != _i) {
      var _s, _e, _x, _r, _arr = [], _n = true, _d = false;
      try {
        if (_x = (_i = _i.call(arr)).next, 0 === i5) {
          if (Object(_i) !== _i)
            return;
          _n = false;
        } else
          for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i5); _n = true)
            ;
      } catch (err) {
        _d = true, _e = err;
      } finally {
        try {
          if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r))
            return;
        } finally {
          if (_d)
            throw _e;
        }
      }
      return _arr;
    }
  }
  function _arrayWithHoles(arr) {
    if (Array.isArray(arr))
      return arr;
  }
  function _createForOfIteratorHelper(o4, allowArrayLike) {
    var it = typeof Symbol !== "undefined" && o4[Symbol.iterator] || o4["@@iterator"];
    if (!it) {
      if (Array.isArray(o4) || (it = _unsupportedIterableToArray(o4)) || allowArrayLike && o4 && typeof o4.length === "number") {
        if (it)
          o4 = it;
        var i5 = 0;
        var F = function F2() {
        };
        return { s: F, n: function n4() {
          if (i5 >= o4.length)
            return { done: true };
          return { done: false, value: o4[i5++] };
        }, e: function e4(_e2) {
          throw _e2;
        }, f: F };
      }
      throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }
    var normalCompletion = true, didErr = false, err;
    return { s: function s4() {
      it = it.call(o4);
    }, n: function n4() {
      var step = it.next();
      normalCompletion = step.done;
      return step;
    }, e: function e4(_e3) {
      didErr = true;
      err = _e3;
    }, f: function f4() {
      try {
        if (!normalCompletion && it.return != null)
          it.return();
      } finally {
        if (didErr)
          throw err;
      }
    } };
  }
  function _unsupportedIterableToArray(o4, minLen) {
    if (!o4)
      return;
    if (typeof o4 === "string")
      return _arrayLikeToArray(o4, minLen);
    var n4 = Object.prototype.toString.call(o4).slice(8, -1);
    if (n4 === "Object" && o4.constructor)
      n4 = o4.constructor.name;
    if (n4 === "Map" || n4 === "Set")
      return Array.from(o4);
    if (n4 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n4))
      return _arrayLikeToArray(o4, minLen);
  }
  function _arrayLikeToArray(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i5 = 0, arr2 = new Array(len); i5 < len; i5++)
      arr2[i5] = arr[i5];
    return arr2;
  }
  function _typeof26(obj) {
    "@babel/helpers - typeof";
    return _typeof26 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof26(obj);
  }
  function asyncGeneratorStep3(gen, resolve, reject, _next, _throw, key, arg) {
    try {
      var info = gen[key](arg);
      var value = info.value;
    } catch (error) {
      reject(error);
      return;
    }
    if (info.done) {
      resolve(value);
    } else {
      Promise.resolve(value).then(_next, _throw);
    }
  }
  function _asyncToGenerator3(fn) {
    return function() {
      var self2 = this, args = arguments;
      return new Promise(function(resolve, reject) {
        var gen = fn.apply(self2, args);
        function _next(value) {
          asyncGeneratorStep3(gen, resolve, reject, _next, _throw, "next", value);
        }
        function _throw(err) {
          asyncGeneratorStep3(gen, resolve, reject, _next, _throw, "throw", err);
        }
        _next(void 0);
      });
    };
  }
  function renderContentAsync(_x, _x2) {
    return _renderContentAsync.apply(this, arguments);
  }
  function _renderContentAsync() {
    _renderContentAsync = _asyncToGenerator3(/* @__PURE__ */ _regeneratorRuntime3().mark(function _callee(el, content) {
      var where, html, dependencies, scope, $parent, $grandparent, _args = arguments;
      return _regeneratorRuntime3().wrap(function _callee$(_context) {
        while (1)
          switch (_context.prev = _context.next) {
            case 0:
              where = _args.length > 2 && _args[2] !== void 0 ? _args[2] : "replace";
              if (where === "replace") {
                shinyUnbindAll(el);
              }
              html = "";
              dependencies = [];
              if (content === null) {
                html = "";
              } else if (typeof content === "string") {
                html = content;
              } else if (_typeof26(content) === "object") {
                html = content.html;
                dependencies = content.deps || [];
              }
              _context.next = 7;
              return renderHtmlAsync(html, el, dependencies, where);
            case 7:
              scope = el;
              if (!(where === "replace")) {
                _context.next = 14;
                break;
              }
              shinyInitializeInputs(el);
              _context.next = 12;
              return shinyBindAll(el);
            case 12:
              _context.next = 19;
              break;
            case 14:
              $parent = (0, import_jquery25.default)(el).parent();
              if ($parent.length > 0) {
                scope = $parent;
                if (where === "beforeBegin" || where === "afterEnd") {
                  $grandparent = $parent.parent();
                  if ($grandparent.length > 0)
                    scope = $grandparent;
                }
              }
              shinyInitializeInputs(scope);
              _context.next = 19;
              return shinyBindAll(scope);
            case 19:
            case "end":
              return _context.stop();
          }
      }, _callee);
    }));
    return _renderContentAsync.apply(this, arguments);
  }
  function renderContent(el, content) {
    var where = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "replace";
    if (where === "replace") {
      shinyUnbindAll(el);
    }
    var html = "";
    var dependencies = [];
    if (content === null) {
      html = "";
    } else if (typeof content === "string") {
      html = content;
    } else if (_typeof26(content) === "object") {
      html = content.html;
      dependencies = content.deps || [];
    }
    renderHtml2(html, el, dependencies, where);
    var scope = el;
    if (where === "replace") {
      shinyInitializeInputs(el);
      return shinyBindAll(el);
    } else {
      var $parent = (0, import_jquery25.default)(el).parent();
      if ($parent.length > 0) {
        scope = $parent;
        if (where === "beforeBegin" || where === "afterEnd") {
          var $grandparent = $parent.parent();
          if ($grandparent.length > 0)
            scope = $grandparent;
        }
      }
      shinyInitializeInputs(scope);
      return shinyBindAll(scope);
    }
  }
  function renderHtmlAsync(_x3, _x4, _x5) {
    return _renderHtmlAsync.apply(this, arguments);
  }
  function _renderHtmlAsync() {
    _renderHtmlAsync = _asyncToGenerator3(/* @__PURE__ */ _regeneratorRuntime3().mark(function _callee2(html, el, dependencies) {
      var where, _args2 = arguments;
      return _regeneratorRuntime3().wrap(function _callee2$(_context2) {
        while (1)
          switch (_context2.prev = _context2.next) {
            case 0:
              where = _args2.length > 3 && _args2[3] !== void 0 ? _args2[3] : "replace";
              _context2.next = 3;
              return renderDependenciesAsync(dependencies);
            case 3:
              return _context2.abrupt("return", renderHtml(html, el, where));
            case 4:
            case "end":
              return _context2.stop();
          }
      }, _callee2);
    }));
    return _renderHtmlAsync.apply(this, arguments);
  }
  function renderHtml2(html, el, dependencies) {
    var where = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "replace";
    renderDependencies(dependencies);
    return renderHtml(html, el, where);
  }
  function renderDependenciesAsync(_x6) {
    return _renderDependenciesAsync.apply(this, arguments);
  }
  function _renderDependenciesAsync() {
    _renderDependenciesAsync = _asyncToGenerator3(/* @__PURE__ */ _regeneratorRuntime3().mark(function _callee3(dependencies) {
      var _iterator2, _step2, dep;
      return _regeneratorRuntime3().wrap(function _callee3$(_context3) {
        while (1)
          switch (_context3.prev = _context3.next) {
            case 0:
              if (!dependencies) {
                _context3.next = 18;
                break;
              }
              _iterator2 = _createForOfIteratorHelper(dependencies);
              _context3.prev = 2;
              _iterator2.s();
            case 4:
              if ((_step2 = _iterator2.n()).done) {
                _context3.next = 10;
                break;
              }
              dep = _step2.value;
              _context3.next = 8;
              return renderDependencyAsync(dep);
            case 8:
              _context3.next = 4;
              break;
            case 10:
              _context3.next = 15;
              break;
            case 12:
              _context3.prev = 12;
              _context3.t0 = _context3["catch"](2);
              _iterator2.e(_context3.t0);
            case 15:
              _context3.prev = 15;
              _iterator2.f();
              return _context3.finish(15);
            case 18:
            case "end":
              return _context3.stop();
          }
      }, _callee3, null, [[2, 12, 15, 18]]);
    }));
    return _renderDependenciesAsync.apply(this, arguments);
  }
  function renderDependencies(dependencies) {
    if (dependencies) {
      var _iterator = _createForOfIteratorHelper(dependencies), _step;
      try {
        for (_iterator.s(); !(_step = _iterator.n()).done; ) {
          var dep = _step.value;
          renderDependency(dep);
        }
      } catch (err) {
        _iterator.e(err);
      } finally {
        _iterator.f();
      }
    }
  }
  var htmlDependencies = {};
  function registerDependency(name, version) {
    htmlDependencies[name] = version;
  }
  function needsRestyle(dep) {
    if (!dep.restyle) {
      return false;
    }
    var names = Object.keys(htmlDependencies);
    var idx = names.indexOf(dep.name);
    if (idx === -1) {
      return false;
    }
    return htmlDependencies[names[idx]] === dep.version;
  }
  function addStylesheetsAndRestyle(links) {
    var $head = (0, import_jquery25.default)("head").first();
    var refreshStyle = function refreshStyle2(href, oldSheet) {
      var xhr = new XMLHttpRequest();
      xhr.open("GET", href);
      xhr.onload = function() {
        var id = "shiny_restyle_" + href.split("?restyle")[0].replace(/\W/g, "_");
        var oldStyle = $head.find("style#" + id);
        var newStyle = (0, import_jquery25.default)("<style>").attr("id", id).html(xhr.responseText);
        $head.append(newStyle);
        oldStyle.remove();
        removeSheet(oldSheet);
        sendImageSizeFns.transitioned();
      };
      xhr.send();
    };
    var findSheet = function findSheet2(href) {
      if (!href)
        return null;
      for (var i5 = 0; i5 < document.styleSheets.length; i5++) {
        var sheet = document.styleSheets[i5];
        if (typeof sheet.href === "string" && sheet.href.indexOf(href) > -1) {
          return sheet;
        }
      }
      return null;
    };
    var removeSheet = function removeSheet2(sheet) {
      if (!sheet)
        return;
      sheet.disabled = true;
      if (isIE())
        sheet.cssText = "";
      if (sheet.ownerNode instanceof Element) {
        (0, import_jquery25.default)(sheet.ownerNode).remove();
      }
    };
    links.map(function(link) {
      var $link = (0, import_jquery25.default)(link);
      var oldSheet = findSheet($link.attr("href"));
      var href = $link.attr("href") + "?restyle=" + new Date().getTime();
      if (isIE()) {
        refreshStyle(href, oldSheet);
      } else {
        $link.attr("href", href);
        $link.attr("onload", function() {
          var $dummyEl = (0, import_jquery25.default)("<div>").css("transition", "0.1s all").css("position", "absolute").css("top", "-1000px").css("left", "0");
          $dummyEl.one("transitionend", function() {
            $dummyEl.remove();
            removeSheet(oldSheet);
            sendImageSizeFns.transitioned();
          });
          (0, import_jquery25.default)(document.body).append($dummyEl);
          var color = "#" + Math.floor(Math.random() * 16777215).toString(16);
          setTimeout(function() {
            return $dummyEl.css("color", color);
          }, 10);
        });
        $head.append(link);
      }
    });
  }
  function getStylesheetLinkTags(dep) {
    return dep.stylesheet.map(function(x2) {
      if (!hasDefinedProperty(x2, "rel"))
        x2.rel = "stylesheet";
      if (!hasDefinedProperty(x2, "type"))
        x2.type = "text/css";
      var link = document.createElement("link");
      Object.entries(x2).forEach(function(_ref) {
        var _ref2 = _slicedToArray(_ref, 2), attr = _ref2[0], val = _ref2[1];
        if (attr === "href") {
          val = encodeURI(val);
        }
        link.setAttribute(attr, val ? val : "");
      });
      return link;
    });
  }
  function appendStylesheetLinkTags(dep, $head) {
    var stylesheetLinks = getStylesheetLinkTags(dep);
    if (stylesheetLinks.length !== 0) {
      $head.append(stylesheetLinks);
    }
  }
  function appendScriptTags(dep, $head) {
    dep.script.forEach(function(x2) {
      var script = document.createElement("script");
      Object.entries(x2).forEach(function(_ref3) {
        var _ref4 = _slicedToArray(_ref3, 2), attr = _ref4[0], val = _ref4[1];
        if (attr === "src") {
          val = encodeURI(val);
        }
        script.setAttribute(attr, val ? val : "");
      });
      $head.append(script);
    });
  }
  function appendScriptTagsAsync(_x7) {
    return _appendScriptTagsAsync.apply(this, arguments);
  }
  function _appendScriptTagsAsync() {
    _appendScriptTagsAsync = _asyncToGenerator3(/* @__PURE__ */ _regeneratorRuntime3().mark(function _callee4(dep) {
      var scriptPromises;
      return _regeneratorRuntime3().wrap(function _callee4$(_context4) {
        while (1)
          switch (_context4.prev = _context4.next) {
            case 0:
              scriptPromises = [];
              dep.script.forEach(function(x2) {
                var script = document.createElement("script");
                if (!hasDefinedProperty(x2, "async")) {
                  script.async = false;
                }
                Object.entries(x2).forEach(function(_ref9) {
                  var _ref10 = _slicedToArray(_ref9, 2), attr = _ref10[0], val = _ref10[1];
                  if (attr === "src") {
                    val = encodeURI(val);
                  }
                  script.setAttribute(attr, val ? val : "");
                });
                var p3 = new Promise(function(resolve, reject) {
                  script.onload = function(e4) {
                    resolve(null);
                  };
                  script.onerror = function(e4) {
                    reject(e4);
                  };
                });
                scriptPromises.push(p3);
                document.head.append(script);
              });
              _context4.next = 4;
              return Promise.allSettled(scriptPromises);
            case 4:
            case "end":
              return _context4.stop();
          }
      }, _callee4);
    }));
    return _appendScriptTagsAsync.apply(this, arguments);
  }
  function appendMetaTags(dep, $head) {
    dep.meta.forEach(function(x2) {
      var meta = document.createElement("meta");
      for (var _i2 = 0, _Object$entries = Object.entries(x2); _i2 < _Object$entries.length; _i2++) {
        var _Object$entries$_i = _slicedToArray(_Object$entries[_i2], 2), attr = _Object$entries$_i[0], val = _Object$entries$_i[1];
        meta.setAttribute(attr, val);
      }
      $head.append(meta);
    });
  }
  function appendAttachmentLinkTags(dep, $head) {
    dep.attachment.forEach(function(x2) {
      var link = (0, import_jquery25.default)("<link rel='attachment'>").attr("id", dep.name + "-" + x2.key + "-attachment").attr("href", encodeURI(x2.href));
      $head.append(link);
    });
  }
  function appendExtraHeadContent(dep, $head) {
    if (dep.head) {
      var $newHead = (0, import_jquery25.default)("<head></head>");
      $newHead.html(dep.head);
      $head.append($newHead.children());
    }
  }
  function renderDependencyAsync(_x8) {
    return _renderDependencyAsync.apply(this, arguments);
  }
  function _renderDependencyAsync() {
    _renderDependencyAsync = _asyncToGenerator3(/* @__PURE__ */ _regeneratorRuntime3().mark(function _callee5(dep_) {
      var dep, $head;
      return _regeneratorRuntime3().wrap(function _callee5$(_context5) {
        while (1)
          switch (_context5.prev = _context5.next) {
            case 0:
              dep = normalizeHtmlDependency(dep_);
              if (!needsRestyle(dep)) {
                _context5.next = 4;
                break;
              }
              addStylesheetsAndRestyle(getStylesheetLinkTags(dep));
              return _context5.abrupt("return", true);
            case 4:
              if (!hasDefinedProperty(htmlDependencies, dep.name)) {
                _context5.next = 6;
                break;
              }
              return _context5.abrupt("return", false);
            case 6:
              registerDependency(dep.name, dep.version);
              $head = (0, import_jquery25.default)("head").first();
              appendMetaTags(dep, $head);
              appendStylesheetLinkTags(dep, $head);
              _context5.next = 12;
              return appendScriptTagsAsync(dep);
            case 12:
              appendAttachmentLinkTags(dep, $head);
              appendExtraHeadContent(dep, $head);
              return _context5.abrupt("return", true);
            case 15:
            case "end":
              return _context5.stop();
          }
      }, _callee5);
    }));
    return _renderDependencyAsync.apply(this, arguments);
  }
  function renderDependency(dep_) {
    var dep = normalizeHtmlDependency(dep_);
    if (needsRestyle(dep)) {
      addStylesheetsAndRestyle(getStylesheetLinkTags(dep));
      return true;
    }
    if (hasDefinedProperty(htmlDependencies, dep.name))
      return false;
    registerDependency(dep.name, dep.version);
    var $head = (0, import_jquery25.default)("head").first();
    appendMetaTags(dep, $head);
    appendStylesheetLinkTags(dep, $head);
    appendScriptTags(dep, $head);
    appendAttachmentLinkTags(dep, $head);
    appendExtraHeadContent(dep, $head);
    return true;
  }
  function normalizeHtmlDependency(dep) {
    var _dep$src;
    var hrefPrefix = (_dep$src = dep.src) === null || _dep$src === void 0 ? void 0 : _dep$src.href;
    var result = {
      name: dep.name,
      version: dep.version,
      restyle: dep.restyle,
      meta: [],
      stylesheet: [],
      script: [],
      attachment: [],
      head: dep.head
    };
    if (dep.meta) {
      if (Array.isArray(dep.meta)) {
        result.meta = dep.meta;
      } else {
        result.meta = Object.entries(dep.meta).map(function(_ref5) {
          var _ref6 = _slicedToArray(_ref5, 2), attr = _ref6[0], val = _ref6[1];
          return {
            name: attr,
            content: val
          };
        });
      }
    }
    result.stylesheet = asArray(dep.stylesheet).map(function(s4) {
      if (typeof s4 === "string") {
        s4 = {
          href: s4
        };
      }
      if (hrefPrefix) {
        s4.href = hrefPrefix + "/" + s4.href;
      }
      return s4;
    });
    result.script = asArray(dep.script).map(function(s4) {
      if (typeof s4 === "string") {
        s4 = {
          src: s4
        };
      }
      if (hrefPrefix) {
        s4.src = hrefPrefix + "/" + s4.src;
      }
      return s4;
    });
    var attachments = dep.attachment;
    if (!attachments)
      attachments = [];
    if (typeof attachments === "string")
      attachments = [attachments];
    if (Array.isArray(attachments)) {
      var tmp = attachments;
      attachments = tmp.map(function(attachment, index) {
        if (typeof attachment === "string") {
          return {
            key: (index + 1).toString(),
            href: attachment
          };
        } else {
          return attachment;
        }
      });
    } else {
      attachments = Object.entries(attachments).map(function(_ref7) {
        var _ref8 = _slicedToArray(_ref7, 2), attr = _ref8[0], val = _ref8[1];
        return {
          key: attr,
          href: val
        };
      });
    }
    result.attachment = attachments.map(function(s4) {
      if (hrefPrefix) {
        s4.href = hrefPrefix + "/" + s4.href;
      }
      return s4;
    });
    return result;
  }

  // srcts/src/bindings/output/html.ts
  function _typeof27(obj) {
    "@babel/helpers - typeof";
    return _typeof27 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof27(obj);
  }
  function _regeneratorRuntime4() {
    "use strict";
    _regeneratorRuntime4 = function _regeneratorRuntime15() {
      return exports;
    };
    var exports = {}, Op = Object.prototype, hasOwn5 = Op.hasOwnProperty, defineProperty3 = Object.defineProperty || function(obj, key, desc) {
      obj[key] = desc.value;
    }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
    function define(obj, key, value) {
      return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }), obj[key];
    }
    try {
      define({}, "");
    } catch (err) {
      define = function define2(obj, key, value) {
        return obj[key] = value;
      };
    }
    function wrap(innerFn, outerFn, self2, tryLocsList) {
      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []);
      return defineProperty3(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) }), generator;
    }
    function tryCatch(fn, obj, arg) {
      try {
        return { type: "normal", arg: fn.call(obj, arg) };
      } catch (err) {
        return { type: "throw", arg: err };
      }
    }
    exports.wrap = wrap;
    var ContinueSentinel = {};
    function Generator() {
    }
    function GeneratorFunction() {
    }
    function GeneratorFunctionPrototype() {
    }
    var IteratorPrototype = {};
    define(IteratorPrototype, iteratorSymbol, function() {
      return this;
    });
    var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values2([])));
    NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn5.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
    var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
    function defineIteratorMethods(prototype) {
      ["next", "throw", "return"].forEach(function(method) {
        define(prototype, method, function(arg) {
          return this._invoke(method, arg);
        });
      });
    }
    function AsyncIterator(generator, PromiseImpl) {
      function invoke(method, arg, resolve, reject) {
        var record = tryCatch(generator[method], generator, arg);
        if ("throw" !== record.type) {
          var result = record.arg, value = result.value;
          return value && "object" == _typeof27(value) && hasOwn5.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
            invoke("next", value2, resolve, reject);
          }, function(err) {
            invoke("throw", err, resolve, reject);
          }) : PromiseImpl.resolve(value).then(function(unwrapped) {
            result.value = unwrapped, resolve(result);
          }, function(error) {
            return invoke("throw", error, resolve, reject);
          });
        }
        reject(record.arg);
      }
      var previousPromise;
      defineProperty3(this, "_invoke", { value: function value(method, arg) {
        function callInvokeWithMethodAndArg() {
          return new PromiseImpl(function(resolve, reject) {
            invoke(method, arg, resolve, reject);
          });
        }
        return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
      } });
    }
    function makeInvokeMethod(innerFn, self2, context) {
      var state = "suspendedStart";
      return function(method, arg) {
        if ("executing" === state)
          throw new Error("Generator is already running");
        if ("completed" === state) {
          if ("throw" === method)
            throw arg;
          return doneResult();
        }
        for (context.method = method, context.arg = arg; ; ) {
          var delegate = context.delegate;
          if (delegate) {
            var delegateResult = maybeInvokeDelegate(delegate, context);
            if (delegateResult) {
              if (delegateResult === ContinueSentinel)
                continue;
              return delegateResult;
            }
          }
          if ("next" === context.method)
            context.sent = context._sent = context.arg;
          else if ("throw" === context.method) {
            if ("suspendedStart" === state)
              throw state = "completed", context.arg;
            context.dispatchException(context.arg);
          } else
            "return" === context.method && context.abrupt("return", context.arg);
          state = "executing";
          var record = tryCatch(innerFn, self2, context);
          if ("normal" === record.type) {
            if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel)
              continue;
            return { value: record.arg, done: context.done };
          }
          "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
        }
      };
    }
    function maybeInvokeDelegate(delegate, context) {
      var methodName = context.method, method = delegate.iterator[methodName];
      if (void 0 === method)
        return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
      var record = tryCatch(method, delegate.iterator, context.arg);
      if ("throw" === record.type)
        return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
      var info = record.arg;
      return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
    }
    function pushTryEntry(locs) {
      var entry = { tryLoc: locs[0] };
      1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
    }
    function resetTryEntry(entry) {
      var record = entry.completion || {};
      record.type = "normal", delete record.arg, entry.completion = record;
    }
    function Context(tryLocsList) {
      this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(true);
    }
    function values2(iterable) {
      if (iterable) {
        var iteratorMethod = iterable[iteratorSymbol];
        if (iteratorMethod)
          return iteratorMethod.call(iterable);
        if ("function" == typeof iterable.next)
          return iterable;
        if (!isNaN(iterable.length)) {
          var i5 = -1, next2 = function next3() {
            for (; ++i5 < iterable.length; )
              if (hasOwn5.call(iterable, i5))
                return next3.value = iterable[i5], next3.done = false, next3;
            return next3.value = void 0, next3.done = true, next3;
          };
          return next2.next = next2;
        }
      }
      return { next: doneResult };
    }
    function doneResult() {
      return { value: void 0, done: true };
    }
    return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty3(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }), defineProperty3(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) {
      var ctor = "function" == typeof genFun && genFun.constructor;
      return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
    }, exports.mark = function(genFun) {
      return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
    }, exports.awrap = function(arg) {
      return { __await: arg };
    }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
      return this;
    }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
      void 0 === PromiseImpl && (PromiseImpl = Promise);
      var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl);
      return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
        return result.done ? result.value : iter.next();
      });
    }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() {
      return this;
    }), define(Gp, "toString", function() {
      return "[object Generator]";
    }), exports.keys = function(val) {
      var object = Object(val), keys2 = [];
      for (var key in object)
        keys2.push(key);
      return keys2.reverse(), function next2() {
        for (; keys2.length; ) {
          var key2 = keys2.pop();
          if (key2 in object)
            return next2.value = key2, next2.done = false, next2;
        }
        return next2.done = true, next2;
      };
    }, exports.values = values2, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) {
      if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
        for (var name in this)
          "t" === name.charAt(0) && hasOwn5.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
    }, stop: function stop() {
      this.done = true;
      var rootRecord = this.tryEntries[0].completion;
      if ("throw" === rootRecord.type)
        throw rootRecord.arg;
      return this.rval;
    }, dispatchException: function dispatchException(exception) {
      if (this.done)
        throw exception;
      var context = this;
      function handle(loc, caught) {
        return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;
      }
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5], record = entry.completion;
        if ("root" === entry.tryLoc)
          return handle("end");
        if (entry.tryLoc <= this.prev) {
          var hasCatch = hasOwn5.call(entry, "catchLoc"), hasFinally = hasOwn5.call(entry, "finallyLoc");
          if (hasCatch && hasFinally) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          } else if (hasCatch) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
          } else {
            if (!hasFinally)
              throw new Error("try statement without catch or finally");
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          }
        }
      }
    }, abrupt: function abrupt(type, arg) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc <= this.prev && hasOwn5.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
          var finallyEntry = entry;
          break;
        }
      }
      finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
      var record = finallyEntry ? finallyEntry.completion : {};
      return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
    }, complete: function complete(record, afterLoc) {
      if ("throw" === record.type)
        throw record.arg;
      return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
    }, finish: function finish(finallyLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.finallyLoc === finallyLoc)
          return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
      }
    }, catch: function _catch(tryLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc === tryLoc) {
          var record = entry.completion;
          if ("throw" === record.type) {
            var thrown = record.arg;
            resetTryEntry(entry);
          }
          return thrown;
        }
      }
      throw new Error("illegal catch attempt");
    }, delegateYield: function delegateYield(iterable, resultName, nextLoc) {
      return this.delegate = { iterator: values2(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = void 0), ContinueSentinel;
    } }, exports;
  }
  function asyncGeneratorStep4(gen, resolve, reject, _next, _throw, key, arg) {
    try {
      var info = gen[key](arg);
      var value = info.value;
    } catch (error) {
      reject(error);
      return;
    }
    if (info.done) {
      resolve(value);
    } else {
      Promise.resolve(value).then(_next, _throw);
    }
  }
  function _asyncToGenerator4(fn) {
    return function() {
      var self2 = this, args = arguments;
      return new Promise(function(resolve, reject) {
        var gen = fn.apply(self2, args);
        function _next(value) {
          asyncGeneratorStep4(gen, resolve, reject, _next, _throw, "next", value);
        }
        function _throw(err) {
          asyncGeneratorStep4(gen, resolve, reject, _next, _throw, "throw", err);
        }
        _next(void 0);
      });
    };
  }
  function _classCallCheck25(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties25(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey25(descriptor.key), descriptor);
    }
  }
  function _createClass25(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties25(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties25(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey25(arg) {
    var key = _toPrimitive25(arg, "string");
    return _typeof27(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive25(input, hint) {
    if (_typeof27(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof27(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _inherits18(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf18(subClass, superClass);
  }
  function _setPrototypeOf18(o4, p3) {
    _setPrototypeOf18 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf18(o4, p3);
  }
  function _createSuper18(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct18();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf18(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf18(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn18(this, result);
    };
  }
  function _possibleConstructorReturn18(self2, call8) {
    if (call8 && (_typeof27(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized18(self2);
  }
  function _assertThisInitialized18(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct18() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf18(o4) {
    _getPrototypeOf18 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf18(o4);
  }
  var HtmlOutputBinding = /* @__PURE__ */ function(_OutputBinding) {
    _inherits18(HtmlOutputBinding2, _OutputBinding);
    var _super = _createSuper18(HtmlOutputBinding2);
    function HtmlOutputBinding2() {
      _classCallCheck25(this, HtmlOutputBinding2);
      return _super.apply(this, arguments);
    }
    _createClass25(HtmlOutputBinding2, [{
      key: "find",
      value: function find2(scope) {
        return (0, import_jquery26.default)(scope).find(".shiny-html-output");
      }
    }, {
      key: "onValueError",
      value: function onValueError(el, err) {
        shinyUnbindAll(el);
        this.renderError(el, err);
      }
    }, {
      key: "renderValue",
      value: function() {
        var _renderValue = _asyncToGenerator4(/* @__PURE__ */ _regeneratorRuntime4().mark(function _callee(el, data) {
          return _regeneratorRuntime4().wrap(function _callee$(_context) {
            while (1)
              switch (_context.prev = _context.next) {
                case 0:
                  _context.next = 2;
                  return renderContentAsync(el, data);
                case 2:
                case "end":
                  return _context.stop();
              }
          }, _callee);
        }));
        function renderValue(_x, _x2) {
          return _renderValue.apply(this, arguments);
        }
        return renderValue;
      }()
    }]);
    return HtmlOutputBinding2;
  }(OutputBinding);

  // node_modules/core-js/modules/es.array.filter.js
  var $54 = require_export();
  var $filter = require_array_iteration().filter;
  var arrayMethodHasSpeciesSupport5 = require_array_method_has_species_support();
  var HAS_SPECIES_SUPPORT4 = arrayMethodHasSpeciesSupport5("filter");
  $54({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT4 }, {
    filter: function filter(callbackfn) {
      return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
    }
  });

  // srcts/src/bindings/output/image.ts
  var import_es_array_iterator29 = __toESM(require_es_array_iterator());
  var import_jquery31 = __toESM(require_jquery());

  // node_modules/core-js/modules/es.array.some.js
  var $55 = require_export();
  var $some = require_array_iteration().some;
  var arrayMethodIsStrict3 = require_array_method_is_strict();
  var STRICT_METHOD = arrayMethodIsStrict3("some");
  $55({ target: "Array", proto: true, forced: !STRICT_METHOD }, {
    some: function some(callbackfn) {
      return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
    }
  });

  // node_modules/core-js/modules/es.object.values.js
  var $56 = require_export();
  var $values = require_object_to_array().values;
  $56({ target: "Object", stat: true }, {
    values: function values(O) {
      return $values(O);
    }
  });

  // node_modules/core-js/modules/es.object.get-own-property-descriptors.js
  var $57 = require_export();
  var DESCRIPTORS6 = require_descriptors();
  var ownKeys = require_own_keys();
  var toIndexedObject4 = require_to_indexed_object();
  var getOwnPropertyDescriptorModule2 = require_object_get_own_property_descriptor();
  var createProperty4 = require_create_property();
  $57({ target: "Object", stat: true, sham: !DESCRIPTORS6 }, {
    getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
      var O = toIndexedObject4(object);
      var getOwnPropertyDescriptor5 = getOwnPropertyDescriptorModule2.f;
      var keys2 = ownKeys(O);
      var result = {};
      var index = 0;
      var key, descriptor;
      while (keys2.length > index) {
        descriptor = getOwnPropertyDescriptor5(O, key = keys2[index++]);
        if (descriptor !== void 0)
          createProperty4(result, key, descriptor);
      }
      return result;
    }
  });

  // node_modules/core-js/modules/es.object.define-properties.js
  var $58 = require_export();
  var DESCRIPTORS7 = require_descriptors();
  var defineProperties = require_object_define_properties().f;
  $58({ target: "Object", stat: true, forced: Object.defineProperties !== defineProperties, sham: !DESCRIPTORS7 }, {
    defineProperties: defineProperties
  });

  // srcts/src/imageutils/createBrush.ts
  var import_es_array_iterator28 = __toESM(require_es_array_iterator());
  var import_jquery28 = __toESM(require_jquery());

  // srcts/src/imageutils/initCoordmap.ts
  var import_jquery27 = __toESM(require_jquery());

  // srcts/src/imageutils/initPanelScales.ts
  function mapLinear(x2, domainMin, domainMax, rangeMin, rangeMax) {
    var clip = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true;
    clip = clip || true;
    var factor = (rangeMax - rangeMin) / (domainMax - domainMin);
    var val = x2 - domainMin;
    var newval = val * factor + rangeMin;
    if (clip) {
      var max4 = Math.max(rangeMax, rangeMin);
      var min6 = Math.min(rangeMax, rangeMin);
      if (newval > max4)
        newval = max4;
      else if (newval < min6)
        newval = min6;
    }
    return newval;
  }
  function scaler1D(domainMin, domainMax, rangeMin, rangeMax, logbase) {
    return {
      scale: function scale(val, clip) {
        if (logbase)
          val = Math.log(val) / Math.log(logbase);
        return mapLinear(val, domainMin, domainMax, rangeMin, rangeMax, clip);
      },
      scaleInv: function scaleInv(val, clip) {
        var res = mapLinear(val, rangeMin, rangeMax, domainMin, domainMax, clip);
        if (logbase)
          res = Math.pow(logbase, res);
        return res;
      }
    };
  }
  function addScaleFuns(panel_) {
    var panel = panel_;
    var d4 = panel.domain;
    var r6 = panel.range;
    var xlog = panel.log && panel.log.x ? panel.log.x : null;
    var ylog = panel.log && panel.log.y ? panel.log.y : null;
    var xscaler = scaler1D(d4.left, d4.right, r6.left, r6.right, xlog);
    var yscaler = scaler1D(d4.bottom, d4.top, r6.bottom, r6.top, ylog);
    function scaleDataToImg(val, clip) {
      return mapValues(val, function(value, key) {
        var prefix = key.substring(0, 1);
        if (prefix === "x") {
          return xscaler.scale(value, clip);
        } else if (prefix === "y") {
          return yscaler.scale(value, clip);
        }
        return null;
      });
    }
    panel.scaleDataToImg = scaleDataToImg;
    function scaleImgToData(val, clip) {
      return mapValues(val, function(value, key) {
        var prefix = key.substring(0, 1);
        if (prefix === "x") {
          return xscaler.scaleInv(value, clip);
        } else if (prefix === "y") {
          return yscaler.scaleInv(value, clip);
        }
        return null;
      });
    }
    panel.scaleImgToData = scaleImgToData;
    panel.clipImg = function(offsetImg) {
      var newOffset = {
        x: offsetImg.x,
        y: offsetImg.y
      };
      var bounds = panel.range;
      if (offsetImg.x > bounds.right)
        newOffset.x = bounds.right;
      else if (offsetImg.x < bounds.left)
        newOffset.x = bounds.left;
      if (offsetImg.y > bounds.bottom)
        newOffset.y = bounds.bottom;
      else if (offsetImg.y < bounds.top)
        newOffset.y = bounds.top;
      return newOffset;
    };
    return panel;
  }
  function initPanelScales(panels) {
    return panels.map(function(panel) {
      return addScaleFuns(panel);
    });
  }

  // srcts/src/imageutils/initCoordmap.ts
  function findScalingRatio($el) {
    var boundingRect = $el[0].getBoundingClientRect();
    return {
      x: boundingRect.width / $el.outerWidth(),
      y: boundingRect.height / $el.outerHeight()
    };
  }
  function findOrigin($el) {
    var offset = $el.offset();
    var scalingRatio = findScalingRatio($el);
    var paddingBorder = {
      left: parseInt($el.css("border-left-width")) + parseInt($el.css("padding-left")),
      top: parseInt($el.css("border-top-width")) + parseInt($el.css("padding-top"))
    };
    return {
      x: offset.left + scalingRatio.x * paddingBorder.left,
      y: offset.top + scalingRatio.y * paddingBorder.top
    };
  }
  function findDims($el) {
    var contentRatio = {
      x: $el.width() / $el.outerWidth(),
      y: $el.height() / $el.outerHeight()
    };
    var boundingRect = $el[0].getBoundingClientRect();
    return {
      x: contentRatio.x * boundingRect.width,
      y: contentRatio.y * boundingRect.height
    };
  }
  function initCoordmap($el, coordmap_) {
    var $img = $el.find("img");
    var img = $img[0];
    if (coordmap_.panels.length === 0) {
      var bounds = {
        top: 0,
        left: 0,
        right: img.naturalWidth - 1,
        bottom: img.naturalHeight - 1
      };
      coordmap_.panels[0] = {
        domain: bounds,
        range: bounds,
        mapping: {}
      };
    }
    var coordmap = coordmap_;
    coordmap.dims.height = coordmap.dims.height || img.naturalHeight;
    coordmap.dims.width = coordmap.dims.width || img.naturalWidth;
    coordmap.panels = initPanelScales(coordmap_.panels);
    coordmap.mouseOffsetCss = function(mouseEvent) {
      var imgOrigin = findOrigin($img);
      return {
        x: mouseEvent.pageX - imgOrigin.x,
        y: mouseEvent.pageY - imgOrigin.y
      };
    };
    function scaleCssToImg(offsetCss) {
      var pixelScaling = coordmap.imgToCssScalingRatio();
      var result = mapValues(offsetCss, function(value, key) {
        var prefix = key.substring(0, 1);
        if (prefix === "x") {
          return offsetCss[key] / pixelScaling.x;
        } else if (prefix === "y") {
          return offsetCss[key] / pixelScaling.y;
        }
        return null;
      });
      return result;
    }
    coordmap.scaleCssToImg = scaleCssToImg;
    function scaleImgToCss(offsetImg) {
      var pixelScaling = coordmap.imgToCssScalingRatio();
      var result = mapValues(offsetImg, function(value, key) {
        var prefix = key.substring(0, 1);
        if (prefix === "x") {
          return offsetImg[key] * pixelScaling.x;
        } else if (prefix === "y") {
          return offsetImg[key] * pixelScaling.y;
        }
        return null;
      });
      return result;
    }
    coordmap.scaleImgToCss = scaleImgToCss;
    coordmap.imgToCssScalingRatio = function() {
      var imgDims = findDims($img);
      return {
        x: imgDims.x / coordmap.dims.width,
        y: imgDims.y / coordmap.dims.height
      };
    };
    coordmap.cssToImgScalingRatio = function() {
      var res = coordmap.imgToCssScalingRatio();
      return {
        x: 1 / res.x,
        y: 1 / res.y
      };
    };
    coordmap.getPanelCss = function(offsetCss) {
      var expand = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
      var offsetImg = coordmap.scaleCssToImg(offsetCss);
      var x2 = offsetImg.x;
      var y4 = offsetImg.y;
      var cssToImgRatio = coordmap.cssToImgScalingRatio();
      var expandImg = {
        x: expand * cssToImgRatio.x,
        y: expand * cssToImgRatio.y
      };
      var matches = [];
      var dists = [];
      var i5;
      for (i5 = 0; i5 < coordmap.panels.length; i5++) {
        var b3 = coordmap.panels[i5].range;
        if (x2 <= b3.right + expandImg.x && x2 >= b3.left - expandImg.x && y4 <= b3.bottom + expandImg.y && y4 >= b3.top - expandImg.y) {
          matches.push(coordmap.panels[i5]);
          var xdist = 0;
          var ydist = 0;
          if (x2 > b3.right && x2 <= b3.right + expandImg.x) {
            xdist = x2 - b3.right;
          } else if (x2 < b3.left && x2 >= b3.left - expandImg.x) {
            xdist = x2 - b3.left;
          }
          if (y4 > b3.bottom && y4 <= b3.bottom + expandImg.y) {
            ydist = y4 - b3.bottom;
          } else if (y4 < b3.top && y4 >= b3.top - expandImg.y) {
            ydist = y4 - b3.top;
          }
          dists.push(Math.sqrt(Math.pow(xdist, 2) + Math.pow(ydist, 2)));
        }
      }
      if (matches.length) {
        var minDist = Math.min.apply(null, dists);
        for (i5 = 0; i5 < matches.length; i5++) {
          if (dists[i5] === minDist) {
            return matches[i5];
          }
        }
      }
      return null;
    };
    coordmap.isInPanelCss = function(offsetCss) {
      var expand = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
      if (coordmap.getPanelCss(offsetCss, expand))
        return true;
      return false;
    };
    coordmap.mouseCoordinateSender = function(inputId) {
      var clip = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
      var nullOutside = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
      return function(e4) {
        if (e4 === null) {
          shinySetInputValue(inputId, null);
          return;
        }
        var coordsCss = coordmap.mouseOffsetCss(e4);
        if (!coordmap.isInPanelCss(coordsCss)) {
          if (nullOutside) {
            shinySetInputValue(inputId, null);
            return;
          }
          if (clip)
            return;
          var _coords = {
            coords_css: coordsCss,
            coords_img: coordmap.scaleCssToImg(coordsCss)
          };
          shinySetInputValue(inputId, _coords, {
            priority: "event"
          });
          return;
        }
        var panel = coordmap.getPanelCss(coordsCss);
        var coordsImg = coordmap.scaleCssToImg(coordsCss);
        var coordsData = panel.scaleImgToData(coordsImg);
        var coords = {
          x: coordsData === null || coordsData === void 0 ? void 0 : coordsData.x,
          y: coordsData === null || coordsData === void 0 ? void 0 : coordsData.y,
          coords_css: coordsCss,
          coords_img: coordsImg,
          img_css_ratio: coordmap.cssToImgScalingRatio()
        };
        import_jquery27.default.extend(coords, panel.panel_vars);
        coords.mapping = panel.mapping;
        coords.domain = panel.domain;
        coords.range = panel.range;
        coords.log = panel.log;
        shinySetInputValue(inputId, coords, {
          priority: "event"
        });
      };
    };
    return coordmap;
  }

  // srcts/src/imageutils/findbox.ts
  function findBox(offset1, offset2) {
    return {
      xmin: Math.min(offset1.x, offset2.x),
      xmax: Math.max(offset1.x, offset2.x),
      ymin: Math.min(offset1.y, offset2.y),
      ymax: Math.max(offset1.y, offset2.y)
    };
  }

  // srcts/src/imageutils/shiftToRange.ts
  function shiftToRange(vals, min6, max4) {
    if (!(vals instanceof Array))
      vals = [vals];
    var maxval = Math.max.apply(null, vals);
    var minval = Math.min.apply(null, vals);
    var shiftAmount = 0;
    if (maxval > max4) {
      shiftAmount = max4 - maxval;
    } else if (minval < min6) {
      shiftAmount = min6 - minval;
    }
    var newvals = [];
    for (var i5 = 0; i5 < vals.length; i5++) {
      newvals[i5] = vals[i5] + shiftAmount;
    }
    return newvals;
  }

  // srcts/src/imageutils/createBrush.ts
  function _typeof28(obj) {
    "@babel/helpers - typeof";
    return _typeof28 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof28(obj);
  }
  function ownKeys2(object, enumerableOnly) {
    var keys2 = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys2.push.apply(keys2, symbols);
    }
    return keys2;
  }
  function _objectSpread(target) {
    for (var i5 = 1; i5 < arguments.length; i5++) {
      var source = null != arguments[i5] ? arguments[i5] : {};
      i5 % 2 ? ownKeys2(Object(source), true).forEach(function(key) {
        _defineProperty9(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys2(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty9(obj, key, value) {
    key = _toPropertyKey26(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey26(arg) {
    var key = _toPrimitive26(arg, "string");
    return _typeof28(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive26(input, hint) {
    if (_typeof28(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof28(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function createBrush($el, opts, coordmap, expandPixels) {
    var resizeExpand = 10;
    var el = $el[0];
    var $div = null;
    var state = {};
    var cssToImg = coordmap.scaleCssToImg;
    var imgToCss = coordmap.scaleImgToCss;
    reset();
    function reset() {
      state.brushing = false;
      state.dragging = false;
      state.resizing = false;
      state.down = {
        x: NaN,
        y: NaN
      };
      state.up = {
        x: NaN,
        y: NaN
      };
      state.resizeSides = {
        left: false,
        right: false,
        top: false,
        bottom: false
      };
      state.boundsCss = {
        xmin: NaN,
        xmax: NaN,
        ymin: NaN,
        ymax: NaN
      };
      state.boundsData = {
        xmin: NaN,
        xmax: NaN,
        ymin: NaN,
        ymax: NaN
      };
      state.panel = null;
      state.changeStartBounds = {
        xmin: NaN,
        xmax: NaN,
        ymin: NaN,
        ymax: NaN
      };
      if ($div)
        $div.remove();
    }
    function hasOldBrush() {
      var oldDiv = $el.find("#" + el.id + "_brush");
      return oldDiv.length > 0;
    }
    function importOldBrush() {
      var oldDiv = $el.find("#" + el.id + "_brush");
      if (oldDiv.length === 0)
        return;
      var oldBoundsData = oldDiv.data("bounds-data");
      var oldPanel = oldDiv.data("panel");
      if (!oldBoundsData || !oldPanel)
        return;
      for (var i5 = 0; i5 < coordmap.panels.length; i5++) {
        var curPanel = coordmap.panels[i5];
        if (equal(oldPanel.mapping, curPanel.mapping) && equal(oldPanel.panel_vars, curPanel.panel_vars)) {
          state.panel = coordmap.panels[i5];
          break;
        }
      }
      if (state.panel === null) {
        oldDiv.remove();
        return;
      }
      $div = oldDiv;
      boundsData(oldBoundsData);
      updateDiv();
    }
    function onResize() {
      var boundsDataVal = boundsData();
      if (Object.values(boundsDataVal).some(isnan))
        return;
      boundsData(boundsDataVal);
      updateDiv();
    }
    function isInsideBrush(offsetCss) {
      var bounds = state.boundsCss;
      return offsetCss.x <= bounds.xmax && offsetCss.x >= bounds.xmin && offsetCss.y <= bounds.ymax && offsetCss.y >= bounds.ymin;
    }
    function isInResizeArea(offsetCss) {
      var sides = whichResizeSides(offsetCss);
      return sides.left || sides.right || sides.top || sides.bottom;
    }
    function whichResizeSides(offsetCss) {
      var b3 = state.boundsCss;
      var e4 = {
        xmin: b3.xmin - resizeExpand,
        xmax: b3.xmax + resizeExpand,
        ymin: b3.ymin - resizeExpand,
        ymax: b3.ymax + resizeExpand
      };
      var res = {
        left: false,
        right: false,
        top: false,
        bottom: false
      };
      if ((opts.brushDirection === "xy" || opts.brushDirection === "x") && offsetCss.y <= e4.ymax && offsetCss.y >= e4.ymin) {
        if (offsetCss.x < b3.xmin && offsetCss.x >= e4.xmin)
          res.left = true;
        else if (offsetCss.x > b3.xmax && offsetCss.x <= e4.xmax)
          res.right = true;
      }
      if ((opts.brushDirection === "xy" || opts.brushDirection === "y") && offsetCss.x <= e4.xmax && offsetCss.x >= e4.xmin) {
        if (offsetCss.y < b3.ymin && offsetCss.y >= e4.ymin)
          res.top = true;
        else if (offsetCss.y > b3.ymax && offsetCss.y <= e4.ymax)
          res.bottom = true;
      }
      return res;
    }
    function boundsCss(boxCss) {
      if (boxCss === void 0) {
        return _objectSpread({}, state.boundsCss);
      }
      var minCss = {
        x: boxCss.xmin,
        y: boxCss.ymin
      };
      var maxCss = {
        x: boxCss.xmax,
        y: boxCss.ymax
      };
      var panel = state.panel;
      var panelBoundsImg = panel.range;
      if (opts.brushClip) {
        minCss = imgToCss(panel.clipImg(cssToImg(minCss)));
        maxCss = imgToCss(panel.clipImg(cssToImg(maxCss)));
      }
      if (opts.brushDirection === "xy") {
      } else if (opts.brushDirection === "x") {
        minCss.y = imgToCss({
          y: panelBoundsImg.top
        }).y;
        maxCss.y = imgToCss({
          y: panelBoundsImg.bottom
        }).y;
      } else if (opts.brushDirection === "y") {
        minCss.x = imgToCss({
          x: panelBoundsImg.left
        }).x;
        maxCss.x = imgToCss({
          x: panelBoundsImg.right
        }).x;
      }
      state.boundsCss = {
        xmin: minCss.x,
        xmax: maxCss.x,
        ymin: minCss.y,
        ymax: maxCss.y
      };
      var minData = panel.scaleImgToData(cssToImg(minCss));
      var maxData = panel.scaleImgToData(cssToImg(maxCss));
      state.boundsData = findBox(minData, maxData);
      state.boundsData = mapValues(state.boundsData, function(val) {
        return roundSignif(val, 14);
      });
      $div.data("bounds-data", state.boundsData);
      $div.data("panel", state.panel);
      return void 0;
    }
    function boundsData(boxData) {
      if (typeof boxData === "undefined") {
        return _objectSpread({}, state.boundsData);
      }
      var boxCss = imgToCss(state.panel.scaleDataToImg(boxData));
      boxCss = mapValues(boxCss, function(val) {
        return roundSignif(val, 13);
      });
      boundsCss({
        xmin: Math.min(boxCss.xmin, boxCss.xmax),
        xmax: Math.max(boxCss.xmin, boxCss.xmax),
        ymin: Math.min(boxCss.ymin, boxCss.ymax),
        ymax: Math.max(boxCss.ymin, boxCss.ymax)
      });
      return void 0;
    }
    function getPanel2() {
      return state.panel;
    }
    function addDiv() {
      if ($div)
        $div.remove();
      $div = (0, import_jquery28.default)(document.createElement("div")).attr("id", el.id + "_brush").css({
        "background-color": opts.brushFill,
        opacity: opts.brushOpacity,
        "pointer-events": "none",
        position: "absolute"
      }).hide();
      var borderStyle = "1px solid " + opts.brushStroke;
      if (opts.brushDirection === "xy") {
        $div.css({
          border: borderStyle
        });
      } else if (opts.brushDirection === "x") {
        $div.css({
          "border-left": borderStyle,
          "border-right": borderStyle
        });
      } else if (opts.brushDirection === "y") {
        $div.css({
          "border-top": borderStyle,
          "border-bottom": borderStyle
        });
      }
      $el.append($div);
      $div.offset(
        {
          x: 0,
          y: 0
        }
      ).width(0).outerHeight(0);
    }
    function updateDiv() {
      var imgOffsetCss = findOrigin($el.find("img"));
      var b3 = state.boundsCss;
      $div.offset({
        top: imgOffsetCss.y + b3.ymin,
        left: imgOffsetCss.x + b3.xmin
      }).outerWidth(b3.xmax - b3.xmin + 1).outerHeight(b3.ymax - b3.ymin + 1);
    }
    function down(offsetCss) {
      if (offsetCss === void 0)
        return state.down;
      state.down = offsetCss;
      return void 0;
    }
    function up(offsetCss) {
      if (offsetCss === void 0)
        return state.up;
      state.up = offsetCss;
      return void 0;
    }
    function isBrushing() {
      return state.brushing;
    }
    function startBrushing() {
      state.brushing = true;
      addDiv();
      state.panel = coordmap.getPanelCss(state.down, expandPixels);
      boundsCss(findBox(state.down, state.down));
      updateDiv();
    }
    function brushTo(offsetCss) {
      boundsCss(findBox(state.down, offsetCss));
      $div.show();
      updateDiv();
    }
    function stopBrushing() {
      state.brushing = false;
      boundsCss(findBox(state.down, state.up));
    }
    function isDragging() {
      return state.dragging;
    }
    function startDragging() {
      state.dragging = true;
      state.changeStartBounds = _objectSpread({}, state.boundsCss);
    }
    function dragTo(offsetCss) {
      var dx = offsetCss.x - state.down.x;
      var dy = offsetCss.y - state.down.y;
      var start = state.changeStartBounds;
      var newBoundsCss = {
        xmin: start.xmin + dx,
        xmax: start.xmax + dx,
        ymin: start.ymin + dy,
        ymax: start.ymax + dy
      };
      if (opts.brushClip) {
        var panel = state.panel;
        var panelBoundsImg = panel.range;
        var newBoundsImg = cssToImg(newBoundsCss);
        var xvalsImg = [newBoundsImg.xmin, newBoundsImg.xmax];
        var yvalsImg = [newBoundsImg.ymin, newBoundsImg.ymax];
        xvalsImg = shiftToRange(xvalsImg, panelBoundsImg.left, panelBoundsImg.right);
        yvalsImg = shiftToRange(yvalsImg, panelBoundsImg.top, panelBoundsImg.bottom);
        newBoundsCss = imgToCss({
          xmin: xvalsImg[0],
          xmax: xvalsImg[1],
          ymin: yvalsImg[0],
          ymax: yvalsImg[1]
        });
      }
      boundsCss(newBoundsCss);
      updateDiv();
    }
    function stopDragging() {
      state.dragging = false;
    }
    function isResizing() {
      return state.resizing;
    }
    function startResizing() {
      state.resizing = true;
      state.changeStartBounds = _objectSpread({}, state.boundsCss);
      state.resizeSides = whichResizeSides(state.down);
    }
    function resizeTo(offsetCss) {
      var dCss = {
        x: offsetCss.x - state.down.x,
        y: offsetCss.y - state.down.y
      };
      var dImg = cssToImg(dCss);
      var bImg = cssToImg(state.changeStartBounds);
      var panel = state.panel;
      var panelBoundsImg = panel.range;
      if (state.resizeSides.left) {
        var xminImg = shiftToRange(bImg.xmin + dImg.x, panelBoundsImg.left, bImg.xmax)[0];
        bImg.xmin = xminImg;
      } else if (state.resizeSides.right) {
        var xmaxImg = shiftToRange(bImg.xmax + dImg.x, bImg.xmin, panelBoundsImg.right)[0];
        bImg.xmax = xmaxImg;
      }
      if (state.resizeSides.top) {
        var yminImg = shiftToRange(bImg.ymin + dImg.y, panelBoundsImg.top, bImg.ymax)[0];
        bImg.ymin = yminImg;
      } else if (state.resizeSides.bottom) {
        var ymaxImg = shiftToRange(bImg.ymax + dImg.y, bImg.ymin, panelBoundsImg.bottom)[0];
        bImg.ymax = ymaxImg;
      }
      boundsCss(imgToCss(bImg));
      updateDiv();
    }
    function stopResizing() {
      state.resizing = false;
    }
    return {
      reset: reset,
      hasOldBrush: hasOldBrush,
      importOldBrush: importOldBrush,
      isInsideBrush: isInsideBrush,
      isInResizeArea: isInResizeArea,
      whichResizeSides: whichResizeSides,
      onResize: onResize,
      boundsCss: boundsCss,
      boundsData: boundsData,
      getPanel: getPanel2,
      down: down,
      up: up,
      isBrushing: isBrushing,
      startBrushing: startBrushing,
      brushTo: brushTo,
      stopBrushing: stopBrushing,
      isDragging: isDragging,
      startDragging: startDragging,
      dragTo: dragTo,
      stopDragging: stopDragging,
      isResizing: isResizing,
      startResizing: startResizing,
      resizeTo: resizeTo,
      stopResizing: stopResizing
    };
  }

  // srcts/src/imageutils/createClickInfo.ts
  var import_jquery29 = __toESM(require_jquery());
  function createClickInfo($el, dblclickId, dblclickDelay) {
    var clickTimer = void 0;
    var pendingE = null;
    function triggerEvent(newEventType, e4) {
      var e22 = import_jquery29.default.Event(newEventType, {
        which: e4.which,
        pageX: e4.pageX,
        pageY: e4.pageY
      });
      $el.trigger(e22);
    }
    function triggerPendingMousedown2() {
      if (pendingE) {
        triggerEvent("mousedown2", pendingE);
        pendingE = null;
      }
    }
    function scheduleMousedown2(e4) {
      pendingE = e4;
      clickTimer = window.setTimeout(function() {
        triggerPendingMousedown2();
      }, dblclickDelay);
    }
    function mousedown(e4) {
      if (e4.which !== 1)
        return;
      if (!dblclickId) {
        triggerEvent("mousedown2", e4);
        return;
      }
      if (pendingE === null) {
        scheduleMousedown2(e4);
      } else {
        clearTimeout(clickTimer);
        if (pendingE && Math.abs(pendingE.pageX - e4.pageX) > 2 || Math.abs(pendingE.pageY - e4.pageY) > 2) {
          triggerPendingMousedown2();
          scheduleMousedown2(e4);
        } else {
          pendingE = null;
          triggerEvent("dblclick2", e4);
        }
      }
    }
    function dblclickIE8(e4) {
      e4.which = 1;
      triggerEvent("dblclick2", e4);
    }
    return {
      mousedown: mousedown,
      dblclickIE8: dblclickIE8
    };
  }

  // srcts/src/imageutils/createHandlers.ts
  var import_jquery30 = __toESM(require_jquery());
  function createClickHandler(inputId, clip, coordmap) {
    var clickInfoSender = coordmap.mouseCoordinateSender(inputId, clip);
    clickInfoSender(null);
    return {
      mousedown: function mousedown(e4) {
        if (e4.which !== 1)
          return;
        clickInfoSender(e4);
      },
      onResetImg: function onResetImg() {
        clickInfoSender(null);
      },
      onResize: null
    };
  }
  function createHoverHandler(inputId, delay, delayType, clip, nullOutside, coordmap) {
    var sendHoverInfo = coordmap.mouseCoordinateSender(inputId, clip, nullOutside);
    var hoverInfoSender;
    if (delayType === "throttle")
      hoverInfoSender = new Throttler(null, sendHoverInfo, delay);
    else
      hoverInfoSender = new Debouncer(null, sendHoverInfo, delay);
    hoverInfoSender.immediateCall(null);
    var mouseout;
    if (nullOutside)
      mouseout = function mouseout2() {
        hoverInfoSender.normalCall(null);
      };
    else
      mouseout = function mouseout2() {
      };
    return {
      mousemove: function mousemove(e4) {
        hoverInfoSender.normalCall(e4);
      },
      mouseout: mouseout,
      onResetImg: function onResetImg() {
        hoverInfoSender.immediateCall(null);
      },
      onResize: null
    };
  }
  function createBrushHandler(inputId, $el, opts, coordmap, outputId) {
    var expandPixels = 20;
    var brush = createBrush($el, opts, coordmap, expandPixels);
    $el.on("shiny-internal:brushed.image_output", function(e4, coords) {
      if (coords.brushId === inputId && coords.outputId !== outputId) {
        $el.data("mostRecentBrush", false);
        brush.reset();
      }
    });
    function setCursorStyle(style) {
      $el.removeClass("crosshair grabbable grabbing ns-resize ew-resize nesw-resize nwse-resize");
      if (style)
        $el.addClass(style);
    }
    function sendBrushInfo() {
      var coords = brush.boundsData();
      if (isNaN(coords.xmin)) {
        shinySetInputValue(inputId, null);
        imageOutputBinding.find(document.documentElement).trigger("shiny-internal:brushed", {
          brushId: inputId,
          outputId: null
        });
        return;
      }
      var panel = brush.getPanel();
      import_jquery30.default.extend(coords, panel.panel_vars);
      coords.coords_css = brush.boundsCss();
      coords.coords_img = coordmap.scaleCssToImg(coords.coords_css);
      coords.img_css_ratio = coordmap.cssToImgScalingRatio();
      coords.mapping = panel.mapping;
      coords.domain = panel.domain;
      coords.range = panel.range;
      coords.log = panel.log;
      coords.direction = opts.brushDirection;
      coords.brushId = inputId;
      coords.outputId = outputId;
      shinySetInputValue(inputId, coords);
      $el.data("mostRecentBrush", true);
      imageOutputBinding.find(document.documentElement).trigger("shiny-internal:brushed", coords);
    }
    var brushInfoSender;
    if (opts.brushDelayType === "throttle") {
      brushInfoSender = new Throttler(null, sendBrushInfo, opts.brushDelay);
    } else {
      brushInfoSender = new Debouncer(null, sendBrushInfo, opts.brushDelay);
    }
    if (!brush.hasOldBrush()) {
      brushInfoSender.immediateCall();
    }
    function mousedown(e4) {
      if (brush.isBrushing() || brush.isDragging() || brush.isResizing())
        return;
      if (e4.which !== 1)
        return;
      var offsetCss = coordmap.mouseOffsetCss(e4);
      if (opts.brushClip && !coordmap.isInPanelCss(offsetCss, expandPixels))
        return;
      brush.up({
        x: NaN,
        y: NaN
      });
      brush.down(offsetCss);
      if (brush.isInResizeArea(offsetCss)) {
        brush.startResizing(offsetCss);
        (0, import_jquery30.default)(document).on("mousemove.image_brush", mousemoveResizing).on("mouseup.image_brush", mouseupResizing);
      } else if (brush.isInsideBrush(offsetCss)) {
        brush.startDragging(offsetCss);
        setCursorStyle("grabbing");
        (0, import_jquery30.default)(document).on("mousemove.image_brush", mousemoveDragging).on("mouseup.image_brush", mouseupDragging);
      } else {
        var panel = coordmap.getPanelCss(offsetCss, expandPixels);
        brush.startBrushing(panel.clipImg(coordmap.scaleCssToImg(offsetCss)));
        (0, import_jquery30.default)(document).on("mousemove.image_brush", mousemoveBrushing).on("mouseup.image_brush", mouseupBrushing);
      }
    }
    function mousemove(e4) {
      var offsetCss = coordmap.mouseOffsetCss(e4);
      if (!(brush.isBrushing() || brush.isDragging() || brush.isResizing())) {
        if (brush.isInResizeArea(offsetCss)) {
          var r6 = brush.whichResizeSides(offsetCss);
          if (r6.left && r6.top || r6.right && r6.bottom) {
            setCursorStyle("nwse-resize");
          } else if (r6.left && r6.bottom || r6.right && r6.top) {
            setCursorStyle("nesw-resize");
          } else if (r6.left || r6.right) {
            setCursorStyle("ew-resize");
          } else if (r6.top || r6.bottom) {
            setCursorStyle("ns-resize");
          }
        } else if (brush.isInsideBrush(offsetCss)) {
          setCursorStyle("grabbable");
        } else if (coordmap.isInPanelCss(offsetCss, expandPixels)) {
          setCursorStyle("crosshair");
        } else {
          setCursorStyle(null);
        }
      }
    }
    function mousemoveBrushing(e4) {
      brush.brushTo(coordmap.mouseOffsetCss(e4));
      brushInfoSender.normalCall();
    }
    function mousemoveDragging(e4) {
      brush.dragTo(coordmap.mouseOffsetCss(e4));
      brushInfoSender.normalCall();
    }
    function mousemoveResizing(e4) {
      brush.resizeTo(coordmap.mouseOffsetCss(e4));
      brushInfoSender.normalCall();
    }
    function mouseupBrushing(e4) {
      if (e4.which !== 1)
        return;
      (0, import_jquery30.default)(document).off("mousemove.image_brush").off("mouseup.image_brush");
      brush.up(coordmap.mouseOffsetCss(e4));
      brush.stopBrushing();
      setCursorStyle("crosshair");
      if (brush.down().x === brush.up().x && brush.down().y === brush.up().y) {
        brush.reset();
        brushInfoSender.immediateCall();
        return;
      }
      if (brushInfoSender.isPending())
        brushInfoSender.immediateCall();
    }
    function mouseupDragging(e4) {
      if (e4.which !== 1)
        return;
      (0, import_jquery30.default)(document).off("mousemove.image_brush").off("mouseup.image_brush");
      brush.up(coordmap.mouseOffsetCss(e4));
      brush.stopDragging();
      setCursorStyle("grabbable");
      if (brushInfoSender.isPending())
        brushInfoSender.immediateCall();
    }
    function mouseupResizing(e4) {
      if (e4.which !== 1)
        return;
      (0, import_jquery30.default)(document).off("mousemove.image_brush").off("mouseup.image_brush");
      brush.up(coordmap.mouseOffsetCss(e4));
      brush.stopResizing();
      if (brushInfoSender.isPending())
        brushInfoSender.immediateCall();
    }
    function onResetImg() {
      if (opts.brushResetOnNew) {
        if ($el.data("mostRecentBrush")) {
          brush.reset();
          brushInfoSender.immediateCall();
        }
      }
    }
    if (!opts.brushResetOnNew) {
      if ($el.data("mostRecentBrush")) {
        brush.importOldBrush();
        brushInfoSender.immediateCall();
      }
    }
    function onResize() {
      brush.onResize();
      brushInfoSender.immediateCall();
    }
    return {
      mousedown: mousedown,
      mousemove: mousemove,
      onResetImg: onResetImg,
      onResize: onResize
    };
  }

  // srcts/src/imageutils/disableDrag.ts
  function disableDrag($el, $img) {
    $img.css("-webkit-user-drag", "none");
    $img.off("dragstart.image_output");
    $img.on("dragstart.image_output", function() {
      return false;
    });
    $el.off("selectstart.image_output");
    $el.on("selectstart.image_output", function() {
      return false;
    });
  }

  // srcts/src/bindings/output/image.ts
  function _typeof29(obj) {
    "@babel/helpers - typeof";
    return _typeof29 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof29(obj);
  }
  function _classCallCheck26(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties26(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey27(descriptor.key), descriptor);
    }
  }
  function _createClass26(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties26(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties26(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey27(arg) {
    var key = _toPrimitive27(arg, "string");
    return _typeof29(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive27(input, hint) {
    if (_typeof29(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof29(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _inherits19(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf19(subClass, superClass);
  }
  function _setPrototypeOf19(o4, p3) {
    _setPrototypeOf19 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf19(o4, p3);
  }
  function _createSuper19(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct19();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf19(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf19(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn19(this, result);
    };
  }
  function _possibleConstructorReturn19(self2, call8) {
    if (call8 && (_typeof29(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized19(self2);
  }
  function _assertThisInitialized19(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct19() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf19(o4) {
    _getPrototypeOf19 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf19(o4);
  }
  var ImageOutputBinding = /* @__PURE__ */ function(_OutputBinding) {
    _inherits19(ImageOutputBinding2, _OutputBinding);
    var _super = _createSuper19(ImageOutputBinding2);
    function ImageOutputBinding2() {
      _classCallCheck26(this, ImageOutputBinding2);
      return _super.apply(this, arguments);
    }
    _createClass26(ImageOutputBinding2, [{
      key: "find",
      value: function find2(scope) {
        return (0, import_jquery31.default)(scope).find(".shiny-image-output, .shiny-plot-output");
      }
    }, {
      key: "renderValue",
      value: function renderValue(el, data) {
        var outputId = this.getId(el);
        var $el = (0, import_jquery31.default)(el);
        var img;
        var $img = $el.find("img");
        if ($img.length === 0) {
          img = document.createElement("img");
          $el.append(img);
          $img = (0, import_jquery31.default)(img);
        } else {
          img = $img[0];
          $img.trigger("reset");
        }
        if (!data) {
          $el.empty();
          return;
        }
        var opts = {
          clickId: $el.data("click-id"),
          clickClip: ifUndefined(strToBool($el.data("click-clip")), true),
          dblclickId: $el.data("dblclick-id"),
          dblclickClip: ifUndefined(strToBool($el.data("dblclick-clip")), true),
          dblclickDelay: ifUndefined($el.data("dblclick-delay"), 400),
          hoverId: $el.data("hover-id"),
          hoverClip: ifUndefined(strToBool($el.data("hover-clip")), true),
          hoverDelayType: ifUndefined($el.data("hover-delay-type"), "debounce"),
          hoverDelay: ifUndefined($el.data("hover-delay"), 300),
          hoverNullOutside: ifUndefined(strToBool($el.data("hover-null-outside")), false),
          brushId: $el.data("brush-id"),
          brushClip: ifUndefined(strToBool($el.data("brush-clip")), true),
          brushDelayType: ifUndefined($el.data("brush-delay-type"), "debounce"),
          brushDelay: ifUndefined($el.data("brush-delay"), 300),
          brushFill: ifUndefined($el.data("brush-fill"), "#666"),
          brushStroke: ifUndefined($el.data("brush-stroke"), "#000"),
          brushOpacity: ifUndefined($el.data("brush-opacity"), 0.3),
          brushDirection: ifUndefined($el.data("brush-direction"), "xy"),
          brushResetOnNew: ifUndefined(strToBool($el.data("brush-reset-on-new")), false),
          coordmap: data.coordmap
        };
        if (opts.brushFill === "auto") {
          opts.brushFill = getComputedLinkColor($el[0]);
        }
        if (opts.brushStroke === "auto") {
          opts.brushStroke = getStyle($el[0], "color");
        }
        import_jquery31.default.each(data, function(key, value) {
          if (value === null || key === "coordmap") {
            return;
          }
          if (key === "src" && value === img.getAttribute("src")) {
            img.removeAttribute("src");
          }
          img.setAttribute(key, value);
        });
        for (var i5 = 0; i5 < img.attributes.length; i5++) {
          var attrib = img.attributes[i5];
          if (attrib.specified && !hasOwnProperty(data, attrib.name)) {
            img.removeAttribute(attrib.name);
          }
        }
        if (!opts.coordmap) {
          opts.coordmap = {
            panels: [],
            dims: {
              height: null,
              width: null
            }
          };
        }
        $el.off(".image_output");
        $img.off(".image_output");
        $img.off("load.shiny_image_interaction");
        $img.one("load.shiny_image_interaction", function() {
          var optsCoordmap = opts.coordmap = initCoordmap($el, opts.coordmap);
          var clickInfo = createClickInfo($el, opts.dblclickId, opts.dblclickDelay);
          $el.on("mousedown.image_output", clickInfo.mousedown);
          if (isIE() && IEVersion() === 8) {
            $el.on("dblclick.image_output", clickInfo.dblclickIE8);
          }
          if (opts.clickId) {
            disableDrag($el, $img);
            var clickHandler = createClickHandler(opts.clickId, opts.clickClip, optsCoordmap);
            $el.on("mousedown2.image_output", clickHandler.mousedown);
            $el.on("resize.image_output", clickHandler.onResize);
            $img.on("reset.image_output", clickHandler.onResetImg);
          }
          if (opts.dblclickId) {
            disableDrag($el, $img);
            var dblclickHandler = createClickHandler(opts.dblclickId, opts.clickClip, optsCoordmap);
            $el.on("dblclick2.image_output", dblclickHandler.mousedown);
            $el.on("resize.image_output", dblclickHandler.onResize);
            $img.on("reset.image_output", dblclickHandler.onResetImg);
          }
          if (opts.hoverId) {
            disableDrag($el, $img);
            var hoverHandler = createHoverHandler(opts.hoverId, opts.hoverDelay, opts.hoverDelayType, opts.hoverClip, opts.hoverNullOutside, optsCoordmap);
            $el.on("mousemove.image_output", hoverHandler.mousemove);
            $el.on("mouseout.image_output", hoverHandler.mouseout);
            $el.on("resize.image_output", hoverHandler.onResize);
            $img.on("reset.image_output", hoverHandler.onResetImg);
          }
          if (opts.brushId) {
            disableDrag($el, $img);
            var brushHandler = createBrushHandler(opts.brushId, $el, opts, optsCoordmap, outputId);
            $el.on("mousedown.image_output", brushHandler.mousedown);
            $el.on("mousemove.image_output", brushHandler.mousemove);
            $el.on("resize.image_output", brushHandler.onResize);
            $img.on("reset.image_output", brushHandler.onResetImg);
          }
          if (opts.clickId || opts.dblclickId || opts.hoverId || opts.brushId) {
            $el.addClass("crosshair");
          }
          if (data.error)
            console.log("Error on server extracting coordmap: " + data.error);
        });
      }
    }, {
      key: "renderError",
      value: function renderError(el, err) {
        (0, import_jquery31.default)(el).find("img").trigger("reset");
        OutputBinding.prototype.renderError.call(this, el, err);
      }
    }, {
      key: "clearError",
      value: function clearError(el) {
        (0, import_jquery31.default)(el).contents().filter(function() {
          return !(this instanceof HTMLElement && (this.tagName === "IMG" || this.id === el.id + "_brush"));
        }).remove();
        OutputBinding.prototype.clearError.call(this, el);
      }
    }, {
      key: "resize",
      value: function resize(el, width, height) {
        (0, import_jquery31.default)(el).find("img").trigger("resize");
        return;
        width;
        height;
      }
    }]);
    return ImageOutputBinding2;
  }(OutputBinding);
  var imageOutputBinding = new ImageOutputBinding();

  // srcts/src/bindings/output/text.ts
  var import_es_array_iterator30 = __toESM(require_es_array_iterator());
  var import_jquery32 = __toESM(require_jquery());
  function _typeof30(obj) {
    "@babel/helpers - typeof";
    return _typeof30 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof30(obj);
  }
  function _classCallCheck27(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties27(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey28(descriptor.key), descriptor);
    }
  }
  function _createClass27(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties27(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties27(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey28(arg) {
    var key = _toPrimitive28(arg, "string");
    return _typeof30(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive28(input, hint) {
    if (_typeof30(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof30(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _inherits20(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf20(subClass, superClass);
  }
  function _setPrototypeOf20(o4, p3) {
    _setPrototypeOf20 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf20(o4, p3);
  }
  function _createSuper20(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct20();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf20(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf20(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn20(this, result);
    };
  }
  function _possibleConstructorReturn20(self2, call8) {
    if (call8 && (_typeof30(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized20(self2);
  }
  function _assertThisInitialized20(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct20() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf20(o4) {
    _getPrototypeOf20 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf20(o4);
  }
  var TextOutputBinding = /* @__PURE__ */ function(_OutputBinding) {
    _inherits20(TextOutputBinding2, _OutputBinding);
    var _super = _createSuper20(TextOutputBinding2);
    function TextOutputBinding2() {
      _classCallCheck27(this, TextOutputBinding2);
      return _super.apply(this, arguments);
    }
    _createClass27(TextOutputBinding2, [{
      key: "find",
      value: function find2(scope) {
        return (0, import_jquery32.default)(scope).find(".shiny-text-output");
      }
    }, {
      key: "renderValue",
      value: function renderValue(el, data) {
        (0, import_jquery32.default)(el).text(data);
      }
    }]);
    return TextOutputBinding2;
  }(OutputBinding);

  // srcts/src/bindings/output/index.ts
  function initOutputBindings() {
    var outputBindings = new BindingRegistry();
    outputBindings.register(new TextOutputBinding(), "shiny.textOutput");
    outputBindings.register(new DownloadLinkOutputBinding(), "shiny.downloadLink");
    outputBindings.register(new DatatableOutputBinding(), "shiny.datatableOutput");
    outputBindings.register(new HtmlOutputBinding(), "shiny.htmlOutput");
    outputBindings.register(imageOutputBinding, "shiny.imageOutput");
    return {
      outputBindings: outputBindings
    };
  }

  // node_modules/core-js/modules/es.object.freeze.js
  var $65 = require_export();
  var FREEZING = require_freezing();
  var fails11 = require_fails();
  var isObject5 = require_is_object();
  var onFreeze = require_internal_metadata().onFreeze;
  var $freeze = Object.freeze;
  var FAILS_ON_PRIMITIVES3 = fails11(function() {
    $freeze(1);
  });
  $65({ target: "Object", stat: true, forced: FAILS_ON_PRIMITIVES3, sham: !FREEZING }, {
    freeze: function freeze(it) {
      return $freeze && isObject5(it) ? $freeze(onFreeze(it)) : it;
    }
  });

  // srcts/src/components/errorConsole.ts
  var import_es_array_iterator36 = __toESM(require_es_array_iterator());

  // node_modules/core-js/modules/es.map.js
  require_es_map_constructor();

  // node_modules/@lit/reactive-element/reactive-element.js
  var import_es_regexp_exec10 = __toESM(require_es_regexp_exec(), 1);

  // node_modules/core-js/modules/es.object.is.js
  var $66 = require_export();
  var is = require_same_value();
  $66({ target: "Object", stat: true }, {
    is: is
  });

  // node_modules/core-js/modules/es.object.get-own-property-names.js
  var $67 = require_export();
  var fails12 = require_fails();
  var getOwnPropertyNames2 = require_object_get_own_property_names_external().f;
  var FAILS_ON_PRIMITIVES4 = fails12(function() {
    return !Object.getOwnPropertyNames(1);
  });
  $67({ target: "Object", stat: true, forced: FAILS_ON_PRIMITIVES4 }, {
    getOwnPropertyNames: getOwnPropertyNames2
  });

  // node_modules/core-js/modules/es.global-this.js
  var $68 = require_export();
  var global8 = require_global();
  $68({ global: true, forced: global8.globalThis !== global8 }, {
    globalThis: global8
  });

  // node_modules/@lit/reactive-element/reactive-element.js
  var import_es_json_stringify2 = __toESM(require_es_json_stringify(), 1);
  var import_es_array_iterator32 = __toESM(require_es_array_iterator(), 1);

  // node_modules/core-js/modules/es.weak-map.js
  require_es_weak_map_constructor();

  // node_modules/core-js/modules/es.set.js
  require_es_set_constructor();

  // node_modules/core-js/modules/es.array.flat.js
  var $69 = require_export();
  var flattenIntoArray = require_flatten_into_array();
  var toObject5 = require_to_object();
  var lengthOfArrayLike4 = require_length_of_array_like();
  var toIntegerOrInfinity3 = require_to_integer_or_infinity();
  var arraySpeciesCreate3 = require_array_species_create();
  $69({ target: "Array", proto: true }, {
    flat: function flat() {
      var depthArg = arguments.length ? arguments[0] : void 0;
      var O = toObject5(this);
      var sourceLen = lengthOfArrayLike4(O);
      var A2 = arraySpeciesCreate3(O, 0);
      A2.length = flattenIntoArray(A2, O, O, sourceLen, 0, depthArg === void 0 ? 1 : toIntegerOrInfinity3(depthArg));
      return A2;
    }
  });

  // node_modules/core-js/modules/es.array.unscopables.flat.js
  var addToUnscopables2 = require_add_to_unscopables();
  addToUnscopables2("flat");

  // node_modules/@lit/reactive-element/css-tag.js
  var import_es_regexp_exec9 = __toESM(require_es_regexp_exec(), 1);
  var import_es_array_iterator31 = __toESM(require_es_array_iterator(), 1);

  // node_modules/core-js/modules/es.array.reduce.js
  var $70 = require_export();
  var $reduce = require_array_reduce().left;
  var arrayMethodIsStrict4 = require_array_method_is_strict();
  var CHROME_VERSION = require_engine_v8_version();
  var IS_NODE = require_engine_is_node();
  var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
  var FORCED8 = CHROME_BUG || !arrayMethodIsStrict4("reduce");
  $70({ target: "Array", proto: true, forced: FORCED8 }, {
    reduce: function reduce(callbackfn) {
      var length = arguments.length;
      return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : void 0);
    }
  });

  // node_modules/@lit/reactive-element/css-tag.js
  function _typeof31(obj) {
    "@babel/helpers - typeof";
    return _typeof31 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof31(obj);
  }
  function _createForOfIteratorHelper2(o4, allowArrayLike) {
    var it = typeof Symbol !== "undefined" && o4[Symbol.iterator] || o4["@@iterator"];
    if (!it) {
      if (Array.isArray(o4) || (it = _unsupportedIterableToArray2(o4)) || allowArrayLike && o4 && typeof o4.length === "number") {
        if (it)
          o4 = it;
        var i5 = 0;
        var F = function F2() {
        };
        return { s: F, n: function n4() {
          if (i5 >= o4.length)
            return { done: true };
          return { done: false, value: o4[i5++] };
        }, e: function e4(_e3) {
          throw _e3;
        }, f: F };
      }
      throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }
    var normalCompletion = true, didErr = false, err;
    return { s: function s4() {
      it = it.call(o4);
    }, n: function n4() {
      var step = it.next();
      normalCompletion = step.done;
      return step;
    }, e: function e4(_e4) {
      didErr = true;
      err = _e4;
    }, f: function f4() {
      try {
        if (!normalCompletion && it.return != null)
          it.return();
      } finally {
        if (didErr)
          throw err;
      }
    } };
  }
  function _unsupportedIterableToArray2(o4, minLen) {
    if (!o4)
      return;
    if (typeof o4 === "string")
      return _arrayLikeToArray2(o4, minLen);
    var n4 = Object.prototype.toString.call(o4).slice(8, -1);
    if (n4 === "Object" && o4.constructor)
      n4 = o4.constructor.name;
    if (n4 === "Map" || n4 === "Set")
      return Array.from(o4);
    if (n4 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n4))
      return _arrayLikeToArray2(o4, minLen);
  }
  function _arrayLikeToArray2(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i5 = 0, arr2 = new Array(len); i5 < len; i5++)
      arr2[i5] = arr[i5];
    return arr2;
  }
  function _classCallCheck28(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties28(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey29(descriptor.key), descriptor);
    }
  }
  function _createClass28(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties28(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties28(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey29(arg) {
    var key = _toPrimitive29(arg, "string");
    return _typeof31(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive29(input, hint) {
    if (_typeof31(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof31(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  var t = globalThis;
  var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype;
  var s = Symbol();
  var o = /* @__PURE__ */ new WeakMap();
  var n = /* @__PURE__ */ function() {
    function n4(t3, e4, o4) {
      _classCallCheck28(this, n4);
      if (this._$cssResult$ = true, o4 !== s)
        throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
      this.cssText = t3, this.t = e4;
    }
    _createClass28(n4, [{
      key: "styleSheet",
      get: function get3() {
        var t3 = this.o;
        var s4 = this.t;
        if (e && void 0 === t3) {
          var _e = void 0 !== s4 && 1 === s4.length;
          _e && (t3 = o.get(s4)), void 0 === t3 && ((this.o = t3 = new CSSStyleSheet()).replaceSync(this.cssText), _e && o.set(s4, t3));
        }
        return t3;
      }
    }, {
      key: "toString",
      value: function toString13() {
        return this.cssText;
      }
    }]);
    return n4;
  }();
  var r = function r2(t3) {
    return new n("string" == typeof t3 ? t3 : t3 + "", void 0, s);
  };
  var i = function i2(t3) {
    for (var _len = arguments.length, e4 = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      e4[_key - 1] = arguments[_key];
    }
    var o4 = 1 === t3.length ? t3[0] : e4.reduce(function(e5, s4, o5) {
      return e5 + function(t4) {
        if (true === t4._$cssResult$)
          return t4.cssText;
        if ("number" == typeof t4)
          return t4;
        throw Error("Value passed to 'css' function must be a 'css' function result: " + t4 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
      }(s4) + t3[o5 + 1];
    }, t3[0]);
    return new n(o4, t3, s);
  };
  var S = function S2(s4, o4) {
    if (e)
      s4.adoptedStyleSheets = o4.map(function(t3) {
        return t3 instanceof CSSStyleSheet ? t3 : t3.styleSheet;
      });
    else {
      var _iterator = _createForOfIteratorHelper2(o4), _step;
      try {
        for (_iterator.s(); !(_step = _iterator.n()).done; ) {
          var _e2 = _step.value;
          var _o = document.createElement("style"), _n = t.litNonce;
          void 0 !== _n && _o.setAttribute("nonce", _n), _o.textContent = _e2.cssText, s4.appendChild(_o);
        }
      } catch (err) {
        _iterator.e(err);
      } finally {
        _iterator.f();
      }
    }
  };
  var c = e ? function(t3) {
    return t3;
  } : function(t3) {
    return t3 instanceof CSSStyleSheet ? function(t4) {
      var e4 = "";
      var _iterator2 = _createForOfIteratorHelper2(t4.cssRules), _step2;
      try {
        for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
          var _s = _step2.value;
          e4 += _s.cssText;
        }
      } catch (err) {
        _iterator2.e(err);
      } finally {
        _iterator2.f();
      }
      return r(e4);
    }(t3) : t3;
  };

  // node_modules/@lit/reactive-element/reactive-element.js
  function _typeof32(obj) {
    "@babel/helpers - typeof";
    return _typeof32 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof32(obj);
  }
  var _Symbol$metadata;
  var _a$litPropertyMetadat;
  var _a$reactiveElementVer;
  function _toConsumableArray(arr) {
    return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray3(arr) || _nonIterableSpread();
  }
  function _nonIterableSpread() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _iterableToArray(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray3(arr);
  }
  function _slicedToArray2(arr, i5) {
    return _arrayWithHoles2(arr) || _iterableToArrayLimit2(arr, i5) || _unsupportedIterableToArray3(arr, i5) || _nonIterableRest2();
  }
  function _nonIterableRest2() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _iterableToArrayLimit2(arr, i5) {
    var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
    if (null != _i) {
      var _s, _e, _x, _r, _arr = [], _n = true, _d = false;
      try {
        if (_x = (_i = _i.call(arr)).next, 0 === i5) {
          if (Object(_i) !== _i)
            return;
          _n = false;
        } else
          for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i5); _n = true)
            ;
      } catch (err) {
        _d = true, _e = err;
      } finally {
        try {
          if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r))
            return;
        } finally {
          if (_d)
            throw _e;
        }
      }
      return _arr;
    }
  }
  function _arrayWithHoles2(arr) {
    if (Array.isArray(arr))
      return arr;
  }
  function _regeneratorRuntime5() {
    "use strict";
    _regeneratorRuntime5 = function _regeneratorRuntime15() {
      return exports;
    };
    var exports = {}, Op = Object.prototype, hasOwn5 = Op.hasOwnProperty, defineProperty3 = Object.defineProperty || function(obj, key, desc) {
      obj[key] = desc.value;
    }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
    function define(obj, key, value) {
      return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }), obj[key];
    }
    try {
      define({}, "");
    } catch (err) {
      define = function define2(obj, key, value) {
        return obj[key] = value;
      };
    }
    function wrap(innerFn, outerFn, self2, tryLocsList) {
      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []);
      return defineProperty3(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) }), generator;
    }
    function tryCatch(fn, obj, arg) {
      try {
        return { type: "normal", arg: fn.call(obj, arg) };
      } catch (err) {
        return { type: "throw", arg: err };
      }
    }
    exports.wrap = wrap;
    var ContinueSentinel = {};
    function Generator() {
    }
    function GeneratorFunction() {
    }
    function GeneratorFunctionPrototype() {
    }
    var IteratorPrototype = {};
    define(IteratorPrototype, iteratorSymbol, function() {
      return this;
    });
    var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values2([])));
    NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn5.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
    var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
    function defineIteratorMethods(prototype) {
      ["next", "throw", "return"].forEach(function(method) {
        define(prototype, method, function(arg) {
          return this._invoke(method, arg);
        });
      });
    }
    function AsyncIterator(generator, PromiseImpl) {
      function invoke(method, arg, resolve, reject) {
        var record = tryCatch(generator[method], generator, arg);
        if ("throw" !== record.type) {
          var result = record.arg, value = result.value;
          return value && "object" == _typeof32(value) && hasOwn5.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
            invoke("next", value2, resolve, reject);
          }, function(err) {
            invoke("throw", err, resolve, reject);
          }) : PromiseImpl.resolve(value).then(function(unwrapped) {
            result.value = unwrapped, resolve(result);
          }, function(error) {
            return invoke("throw", error, resolve, reject);
          });
        }
        reject(record.arg);
      }
      var previousPromise;
      defineProperty3(this, "_invoke", { value: function value(method, arg) {
        function callInvokeWithMethodAndArg() {
          return new PromiseImpl(function(resolve, reject) {
            invoke(method, arg, resolve, reject);
          });
        }
        return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
      } });
    }
    function makeInvokeMethod(innerFn, self2, context) {
      var state = "suspendedStart";
      return function(method, arg) {
        if ("executing" === state)
          throw new Error("Generator is already running");
        if ("completed" === state) {
          if ("throw" === method)
            throw arg;
          return doneResult();
        }
        for (context.method = method, context.arg = arg; ; ) {
          var delegate = context.delegate;
          if (delegate) {
            var delegateResult = maybeInvokeDelegate(delegate, context);
            if (delegateResult) {
              if (delegateResult === ContinueSentinel)
                continue;
              return delegateResult;
            }
          }
          if ("next" === context.method)
            context.sent = context._sent = context.arg;
          else if ("throw" === context.method) {
            if ("suspendedStart" === state)
              throw state = "completed", context.arg;
            context.dispatchException(context.arg);
          } else
            "return" === context.method && context.abrupt("return", context.arg);
          state = "executing";
          var record = tryCatch(innerFn, self2, context);
          if ("normal" === record.type) {
            if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel)
              continue;
            return { value: record.arg, done: context.done };
          }
          "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
        }
      };
    }
    function maybeInvokeDelegate(delegate, context) {
      var methodName = context.method, method = delegate.iterator[methodName];
      if (void 0 === method)
        return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
      var record = tryCatch(method, delegate.iterator, context.arg);
      if ("throw" === record.type)
        return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
      var info = record.arg;
      return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
    }
    function pushTryEntry(locs) {
      var entry = { tryLoc: locs[0] };
      1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
    }
    function resetTryEntry(entry) {
      var record = entry.completion || {};
      record.type = "normal", delete record.arg, entry.completion = record;
    }
    function Context(tryLocsList) {
      this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(true);
    }
    function values2(iterable) {
      if (iterable) {
        var iteratorMethod = iterable[iteratorSymbol];
        if (iteratorMethod)
          return iteratorMethod.call(iterable);
        if ("function" == typeof iterable.next)
          return iterable;
        if (!isNaN(iterable.length)) {
          var i5 = -1, next2 = function next3() {
            for (; ++i5 < iterable.length; )
              if (hasOwn5.call(iterable, i5))
                return next3.value = iterable[i5], next3.done = false, next3;
            return next3.value = void 0, next3.done = true, next3;
          };
          return next2.next = next2;
        }
      }
      return { next: doneResult };
    }
    function doneResult() {
      return { value: void 0, done: true };
    }
    return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty3(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }), defineProperty3(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) {
      var ctor = "function" == typeof genFun && genFun.constructor;
      return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
    }, exports.mark = function(genFun) {
      return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
    }, exports.awrap = function(arg) {
      return { __await: arg };
    }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
      return this;
    }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
      void 0 === PromiseImpl && (PromiseImpl = Promise);
      var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl);
      return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
        return result.done ? result.value : iter.next();
      });
    }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() {
      return this;
    }), define(Gp, "toString", function() {
      return "[object Generator]";
    }), exports.keys = function(val) {
      var object = Object(val), keys2 = [];
      for (var key in object)
        keys2.push(key);
      return keys2.reverse(), function next2() {
        for (; keys2.length; ) {
          var key2 = keys2.pop();
          if (key2 in object)
            return next2.value = key2, next2.done = false, next2;
        }
        return next2.done = true, next2;
      };
    }, exports.values = values2, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) {
      if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
        for (var name in this)
          "t" === name.charAt(0) && hasOwn5.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
    }, stop: function stop() {
      this.done = true;
      var rootRecord = this.tryEntries[0].completion;
      if ("throw" === rootRecord.type)
        throw rootRecord.arg;
      return this.rval;
    }, dispatchException: function dispatchException(exception) {
      if (this.done)
        throw exception;
      var context = this;
      function handle(loc, caught) {
        return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;
      }
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5], record = entry.completion;
        if ("root" === entry.tryLoc)
          return handle("end");
        if (entry.tryLoc <= this.prev) {
          var hasCatch = hasOwn5.call(entry, "catchLoc"), hasFinally = hasOwn5.call(entry, "finallyLoc");
          if (hasCatch && hasFinally) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          } else if (hasCatch) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
          } else {
            if (!hasFinally)
              throw new Error("try statement without catch or finally");
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          }
        }
      }
    }, abrupt: function abrupt(type, arg) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc <= this.prev && hasOwn5.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
          var finallyEntry = entry;
          break;
        }
      }
      finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
      var record = finallyEntry ? finallyEntry.completion : {};
      return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
    }, complete: function complete(record, afterLoc) {
      if ("throw" === record.type)
        throw record.arg;
      return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
    }, finish: function finish(finallyLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.finallyLoc === finallyLoc)
          return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
      }
    }, catch: function _catch(tryLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc === tryLoc) {
          var record = entry.completion;
          if ("throw" === record.type) {
            var thrown = record.arg;
            resetTryEntry(entry);
          }
          return thrown;
        }
      }
      throw new Error("illegal catch attempt");
    }, delegateYield: function delegateYield(iterable, resultName, nextLoc) {
      return this.delegate = { iterator: values2(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = void 0), ContinueSentinel;
    } }, exports;
  }
  function asyncGeneratorStep5(gen, resolve, reject, _next, _throw, key, arg) {
    try {
      var info = gen[key](arg);
      var value = info.value;
    } catch (error) {
      reject(error);
      return;
    }
    if (info.done) {
      resolve(value);
    } else {
      Promise.resolve(value).then(_next, _throw);
    }
  }
  function _asyncToGenerator5(fn) {
    return function() {
      var self2 = this, args = arguments;
      return new Promise(function(resolve, reject) {
        var gen = fn.apply(self2, args);
        function _next(value) {
          asyncGeneratorStep5(gen, resolve, reject, _next, _throw, "next", value);
        }
        function _throw(err) {
          asyncGeneratorStep5(gen, resolve, reject, _next, _throw, "throw", err);
        }
        _next(void 0);
      });
    };
  }
  function _createForOfIteratorHelper3(o4, allowArrayLike) {
    var it = typeof Symbol !== "undefined" && o4[Symbol.iterator] || o4["@@iterator"];
    if (!it) {
      if (Array.isArray(o4) || (it = _unsupportedIterableToArray3(o4)) || allowArrayLike && o4 && typeof o4.length === "number") {
        if (it)
          o4 = it;
        var i5 = 0;
        var F = function F2() {
        };
        return { s: F, n: function n4() {
          if (i5 >= o4.length)
            return { done: true };
          return { done: false, value: o4[i5++] };
        }, e: function e4(_e3) {
          throw _e3;
        }, f: F };
      }
      throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }
    var normalCompletion = true, didErr = false, err;
    return { s: function s4() {
      it = it.call(o4);
    }, n: function n4() {
      var step = it.next();
      normalCompletion = step.done;
      return step;
    }, e: function e4(_e4) {
      didErr = true;
      err = _e4;
    }, f: function f4() {
      try {
        if (!normalCompletion && it.return != null)
          it.return();
      } finally {
        if (didErr)
          throw err;
      }
    } };
  }
  function _unsupportedIterableToArray3(o4, minLen) {
    if (!o4)
      return;
    if (typeof o4 === "string")
      return _arrayLikeToArray3(o4, minLen);
    var n4 = Object.prototype.toString.call(o4).slice(8, -1);
    if (n4 === "Object" && o4.constructor)
      n4 = o4.constructor.name;
    if (n4 === "Map" || n4 === "Set")
      return Array.from(o4);
    if (n4 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n4))
      return _arrayLikeToArray3(o4, minLen);
  }
  function _arrayLikeToArray3(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i5 = 0, arr2 = new Array(len); i5 < len; i5++)
      arr2[i5] = arr[i5];
    return arr2;
  }
  function _classCallCheck29(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties29(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey30(descriptor.key), descriptor);
    }
  }
  function _createClass29(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties29(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties29(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey30(arg) {
    var key = _toPrimitive30(arg, "string");
    return _typeof32(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive30(input, hint) {
    if (_typeof32(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof32(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _inherits21(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf21(subClass, superClass);
  }
  function _createSuper21(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct21();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf21(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf21(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn21(this, result);
    };
  }
  function _possibleConstructorReturn21(self2, call8) {
    if (call8 && (_typeof32(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized21(self2);
  }
  function _assertThisInitialized21(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _wrapNativeSuper(Class) {
    var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
    _wrapNativeSuper = function _wrapNativeSuper4(Class2) {
      if (Class2 === null || !_isNativeFunction(Class2))
        return Class2;
      if (typeof Class2 !== "function") {
        throw new TypeError("Super expression must either be null or a function");
      }
      if (typeof _cache !== "undefined") {
        if (_cache.has(Class2))
          return _cache.get(Class2);
        _cache.set(Class2, Wrapper);
      }
      function Wrapper() {
        return _construct(Class2, arguments, _getPrototypeOf21(this).constructor);
      }
      Wrapper.prototype = Object.create(Class2.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } });
      return _setPrototypeOf21(Wrapper, Class2);
    };
    return _wrapNativeSuper(Class);
  }
  function _construct(Parent, args, Class) {
    if (_isNativeReflectConstruct21()) {
      _construct = Reflect.construct.bind();
    } else {
      _construct = function _construct4(Parent2, args2, Class2) {
        var a3 = [null];
        a3.push.apply(a3, args2);
        var Constructor = Function.bind.apply(Parent2, a3);
        var instance = new Constructor();
        if (Class2)
          _setPrototypeOf21(instance, Class2.prototype);
        return instance;
      };
    }
    return _construct.apply(null, arguments);
  }
  function _isNativeReflectConstruct21() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _isNativeFunction(fn) {
    return Function.toString.call(fn).indexOf("[native code]") !== -1;
  }
  function _setPrototypeOf21(o4, p3) {
    _setPrototypeOf21 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf21(o4, p3);
  }
  function _getPrototypeOf21(o4) {
    _getPrototypeOf21 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf21(o4);
  }
  var i3 = Object.is;
  var e2 = Object.defineProperty;
  var r3 = Object.getOwnPropertyDescriptor;
  var h = Object.getOwnPropertyNames;
  var o2 = Object.getOwnPropertySymbols;
  var n2 = Object.getPrototypeOf;
  var a = globalThis;
  var c2 = a.trustedTypes;
  var l = c2 ? c2.emptyScript : "";
  var p = a.reactiveElementPolyfillSupport;
  var d = function d2(t3, s4) {
    return t3;
  };
  var u = {
    toAttribute: function toAttribute(t3, s4) {
      switch (s4) {
        case Boolean:
          t3 = t3 ? l : null;
          break;
        case Object:
        case Array:
          t3 = null == t3 ? t3 : JSON.stringify(t3);
      }
      return t3;
    },
    fromAttribute: function fromAttribute(t3, s4) {
      var i5 = t3;
      switch (s4) {
        case Boolean:
          i5 = null !== t3;
          break;
        case Number:
          i5 = null === t3 ? null : Number(t3);
          break;
        case Object:
        case Array:
          try {
            i5 = JSON.parse(t3);
          } catch (t4) {
            i5 = null;
          }
      }
      return i5;
    }
  };
  var f = function f2(t3, s4) {
    return !i3(t3, s4);
  };
  var y = {
    attribute: true,
    type: String,
    converter: u,
    reflect: false,
    hasChanged: f
  };
  (_Symbol$metadata = Symbol.metadata) !== null && _Symbol$metadata !== void 0 ? _Symbol$metadata : Symbol.metadata = Symbol("metadata"), (_a$litPropertyMetadat = a.litPropertyMetadata) !== null && _a$litPropertyMetadat !== void 0 ? _a$litPropertyMetadat : a.litPropertyMetadata = /* @__PURE__ */ new WeakMap();
  var b = /* @__PURE__ */ function(_HTMLElement) {
    _inherits21(b3, _HTMLElement);
    var _super = _createSuper21(b3);
    function b3() {
      var _this;
      _classCallCheck29(this, b3);
      _this = _super.call(this), _this._$Ep = void 0, _this.isUpdatePending = false, _this.hasUpdated = false, _this._$Em = null, _this._$Ev();
      return _this;
    }
    _createClass29(b3, [{
      key: "_$Ev",
      value: function _$Ev() {
        var _this2 = this, _this$constructor$l;
        this._$Eg = new Promise(function(t3) {
          return _this2.enableUpdating = t3;
        }), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (_this$constructor$l = this.constructor.l) === null || _this$constructor$l === void 0 ? void 0 : _this$constructor$l.forEach(function(t3) {
          return t3(_this2);
        });
      }
    }, {
      key: "addController",
      value: function addController(t3) {
        var _this$_$ES, _t$hostConnected;
        ((_this$_$ES = this._$ES) !== null && _this$_$ES !== void 0 ? _this$_$ES : this._$ES = []).push(t3), void 0 !== this.renderRoot && this.isConnected && ((_t$hostConnected = t3.hostConnected) === null || _t$hostConnected === void 0 ? void 0 : _t$hostConnected.call(t3));
      }
    }, {
      key: "removeController",
      value: function removeController(t3) {
        var _this$_$ES2;
        (_this$_$ES2 = this._$ES) === null || _this$_$ES2 === void 0 ? void 0 : _this$_$ES2.splice(this._$ES.indexOf(t3) >>> 0, 1);
      }
    }, {
      key: "_$E_",
      value: function _$E_() {
        var t3 = /* @__PURE__ */ new Map(), s4 = this.constructor.elementProperties;
        var _iterator = _createForOfIteratorHelper3(s4.keys()), _step;
        try {
          for (_iterator.s(); !(_step = _iterator.n()).done; ) {
            var _i = _step.value;
            this.hasOwnProperty(_i) && (t3.set(_i, this[_i]), delete this[_i]);
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }
        t3.size > 0 && (this._$Ep = t3);
      }
    }, {
      key: "createRenderRoot",
      value: function createRenderRoot() {
        var _this$shadowRoot;
        var t3 = (_this$shadowRoot = this.shadowRoot) !== null && _this$shadowRoot !== void 0 ? _this$shadowRoot : this.attachShadow(this.constructor.shadowRootOptions);
        return S(t3, this.constructor.elementStyles), t3;
      }
    }, {
      key: "connectedCallback",
      value: function connectedCallback() {
        var _this$renderRoot, _this$_$ES3;
        (_this$renderRoot = this.renderRoot) !== null && _this$renderRoot !== void 0 ? _this$renderRoot : this.renderRoot = this.createRenderRoot(), this.enableUpdating(true), (_this$_$ES3 = this._$ES) === null || _this$_$ES3 === void 0 ? void 0 : _this$_$ES3.forEach(function(t3) {
          var _t$hostConnected2;
          return (_t$hostConnected2 = t3.hostConnected) === null || _t$hostConnected2 === void 0 ? void 0 : _t$hostConnected2.call(t3);
        });
      }
    }, {
      key: "enableUpdating",
      value: function enableUpdating(t3) {
      }
    }, {
      key: "disconnectedCallback",
      value: function disconnectedCallback() {
        var _this$_$ES4;
        (_this$_$ES4 = this._$ES) === null || _this$_$ES4 === void 0 ? void 0 : _this$_$ES4.forEach(function(t3) {
          var _t$hostDisconnected;
          return (_t$hostDisconnected = t3.hostDisconnected) === null || _t$hostDisconnected === void 0 ? void 0 : _t$hostDisconnected.call(t3);
        });
      }
    }, {
      key: "attributeChangedCallback",
      value: function attributeChangedCallback(t3, s4, i5) {
        this._$AK(t3, i5);
      }
    }, {
      key: "_$EO",
      value: function _$EO(t3, s4) {
        var i5 = this.constructor.elementProperties.get(t3), e4 = this.constructor._$Eu(t3, i5);
        if (void 0 !== e4 && true === i5.reflect) {
          var _i$converter;
          var _r = (void 0 !== ((_i$converter = i5.converter) === null || _i$converter === void 0 ? void 0 : _i$converter.toAttribute) ? i5.converter : u).toAttribute(s4, i5.type);
          this._$Em = t3, null == _r ? this.removeAttribute(e4) : this.setAttribute(e4, _r), this._$Em = null;
        }
      }
    }, {
      key: "_$AK",
      value: function _$AK(t3, s4) {
        var i5 = this.constructor, e4 = i5._$Eh.get(t3);
        if (void 0 !== e4 && this._$Em !== e4) {
          var _t$converter;
          var _t = i5.getPropertyOptions(e4), _r2 = "function" == typeof _t.converter ? {
            fromAttribute: _t.converter
          } : void 0 !== ((_t$converter = _t.converter) === null || _t$converter === void 0 ? void 0 : _t$converter.fromAttribute) ? _t.converter : u;
          this._$Em = e4, this[e4] = _r2.fromAttribute(s4, _t.type), this._$Em = null;
        }
      }
    }, {
      key: "requestUpdate",
      value: function requestUpdate(t3, s4, i5) {
        var e4 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
        var r6 = arguments.length > 4 ? arguments[4] : void 0;
        if (void 0 !== t3) {
          var _i2, _i$hasChanged;
          if ((_i2 = i5) !== null && _i2 !== void 0 ? _i2 : i5 = this.constructor.getPropertyOptions(t3), !((_i$hasChanged = i5.hasChanged) !== null && _i$hasChanged !== void 0 ? _i$hasChanged : f)(e4 ? r6 : this[t3], s4))
            return;
          this.C(t3, s4, i5);
        }
        false === this.isUpdatePending && (this._$Eg = this._$EP());
      }
    }, {
      key: "C",
      value: function C2(t3, s4, i5) {
        var _this$_$Ej;
        this._$AL.has(t3) || this._$AL.set(t3, s4), true === i5.reflect && this._$Em !== t3 && ((_this$_$Ej = this._$Ej) !== null && _this$_$Ej !== void 0 ? _this$_$Ej : this._$Ej = /* @__PURE__ */ new Set()).add(t3);
      }
    }, {
      key: "_$EP",
      value: function() {
        var _$EP2 = _asyncToGenerator5(/* @__PURE__ */ _regeneratorRuntime5().mark(function _callee() {
          var t3;
          return _regeneratorRuntime5().wrap(function _callee$(_context) {
            while (1)
              switch (_context.prev = _context.next) {
                case 0:
                  this.isUpdatePending = true;
                  _context.prev = 1;
                  _context.next = 4;
                  return this._$Eg;
                case 4:
                  _context.next = 9;
                  break;
                case 6:
                  _context.prev = 6;
                  _context.t0 = _context["catch"](1);
                  Promise.reject(_context.t0);
                case 9:
                  t3 = this.scheduleUpdate();
                  _context.t1 = null != t3;
                  if (!_context.t1) {
                    _context.next = 14;
                    break;
                  }
                  _context.next = 14;
                  return t3;
                case 14:
                  return _context.abrupt("return", !this.isUpdatePending);
                case 15:
                case "end":
                  return _context.stop();
              }
          }, _callee, this, [[1, 6]]);
        }));
        function _$EP() {
          return _$EP2.apply(this, arguments);
        }
        return _$EP;
      }()
    }, {
      key: "scheduleUpdate",
      value: function scheduleUpdate() {
        return this.performUpdate();
      }
    }, {
      key: "performUpdate",
      value: function performUpdate() {
        if (!this.isUpdatePending)
          return;
        if (!this.hasUpdated) {
          if (this._$Ep) {
            var _iterator2 = _createForOfIteratorHelper3(this._$Ep), _step2;
            try {
              for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
                var _step2$value = _slicedToArray2(_step2.value, 2), _t2 = _step2$value[0], _s2 = _step2$value[1];
                this[_t2] = _s2;
              }
            } catch (err) {
              _iterator2.e(err);
            } finally {
              _iterator2.f();
            }
            this._$Ep = void 0;
          }
          var _t3 = this.constructor.elementProperties;
          if (_t3.size > 0) {
            var _iterator3 = _createForOfIteratorHelper3(_t3), _step3;
            try {
              for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
                var _step3$value = _slicedToArray2(_step3.value, 2), _s3 = _step3$value[0], _i3 = _step3$value[1];
                true !== _i3.wrapped || this._$AL.has(_s3) || void 0 === this[_s3] || this.C(_s3, this[_s3], _i3);
              }
            } catch (err) {
              _iterator3.e(err);
            } finally {
              _iterator3.f();
            }
          }
        }
        var t3 = false;
        var s4 = this._$AL;
        try {
          var _this$_$ES5;
          t3 = this.shouldUpdate(s4), t3 ? (this.willUpdate(s4), (_this$_$ES5 = this._$ES) !== null && _this$_$ES5 !== void 0 && _this$_$ES5.forEach(function(t4) {
            var _t$hostUpdate;
            return (_t$hostUpdate = t4.hostUpdate) === null || _t$hostUpdate === void 0 ? void 0 : _t$hostUpdate.call(t4);
          }), this.update(s4)) : this._$ET();
        } catch (s5) {
          throw t3 = false, this._$ET(), s5;
        }
        t3 && this._$AE(s4);
      }
    }, {
      key: "willUpdate",
      value: function willUpdate(t3) {
      }
    }, {
      key: "_$AE",
      value: function _$AE(t3) {
        var _this$_$ES6;
        (_this$_$ES6 = this._$ES) !== null && _this$_$ES6 !== void 0 && _this$_$ES6.forEach(function(t4) {
          var _t$hostUpdated;
          return (_t$hostUpdated = t4.hostUpdated) === null || _t$hostUpdated === void 0 ? void 0 : _t$hostUpdated.call(t4);
        }), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t3)), this.updated(t3);
      }
    }, {
      key: "_$ET",
      value: function _$ET() {
        this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
      }
    }, {
      key: "updateComplete",
      get: function get3() {
        return this.getUpdateComplete();
      }
    }, {
      key: "getUpdateComplete",
      value: function getUpdateComplete() {
        return this._$Eg;
      }
    }, {
      key: "shouldUpdate",
      value: function shouldUpdate(t3) {
        return true;
      }
    }, {
      key: "update",
      value: function update(t3) {
        var _this3 = this;
        this._$Ej && (this._$Ej = this._$Ej.forEach(function(t4) {
          return _this3._$EO(t4, _this3[t4]);
        })), this._$ET();
      }
    }, {
      key: "updated",
      value: function updated(t3) {
      }
    }, {
      key: "firstUpdated",
      value: function firstUpdated(t3) {
      }
    }], [{
      key: "addInitializer",
      value: function addInitializer(t3) {
        var _this$l;
        this._$Ei(), ((_this$l = this.l) !== null && _this$l !== void 0 ? _this$l : this.l = []).push(t3);
      }
    }, {
      key: "observedAttributes",
      get: function get3() {
        return this.finalize(), this._$Eh && _toConsumableArray(this._$Eh.keys());
      }
    }, {
      key: "createProperty",
      value: function createProperty5(t3) {
        var s4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : y;
        if (s4.state && (s4.attribute = false), this._$Ei(), this.elementProperties.set(t3, s4), !s4.noAccessor) {
          var _i4 = Symbol(), _r3 = this.getPropertyDescriptor(t3, _i4, s4);
          void 0 !== _r3 && e2(this.prototype, t3, _r3);
        }
      }
    }, {
      key: "getPropertyDescriptor",
      value: function getPropertyDescriptor(t3, s4, i5) {
        var _r4;
        var _ref = (_r4 = r3(this.prototype, t3)) !== null && _r4 !== void 0 ? _r4 : {
          get: function get3() {
            return this[s4];
          },
          set: function set(t4) {
            this[s4] = t4;
          }
        }, e4 = _ref.get, h3 = _ref.set;
        return {
          get: function get3() {
            return e4 === null || e4 === void 0 ? void 0 : e4.call(this);
          },
          set: function set(s5) {
            var r6 = e4 === null || e4 === void 0 ? void 0 : e4.call(this);
            h3.call(this, s5), this.requestUpdate(t3, r6, i5);
          },
          configurable: true,
          enumerable: true
        };
      }
    }, {
      key: "getPropertyOptions",
      value: function getPropertyOptions(t3) {
        var _this$elementProperti;
        return (_this$elementProperti = this.elementProperties.get(t3)) !== null && _this$elementProperti !== void 0 ? _this$elementProperti : y;
      }
    }, {
      key: "_$Ei",
      value: function _$Ei() {
        if (this.hasOwnProperty(d("elementProperties")))
          return;
        var t3 = n2(this);
        t3.finalize(), void 0 !== t3.l && (this.l = _toConsumableArray(t3.l)), this.elementProperties = new Map(t3.elementProperties);
      }
    }, {
      key: "finalize",
      value: function finalize() {
        if (this.hasOwnProperty(d("finalized")))
          return;
        if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) {
          var _t4 = this.properties, _s4 = [].concat(_toConsumableArray(h(_t4)), _toConsumableArray(o2(_t4)));
          var _iterator4 = _createForOfIteratorHelper3(_s4), _step4;
          try {
            for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
              var _i5 = _step4.value;
              this.createProperty(_i5, _t4[_i5]);
            }
          } catch (err) {
            _iterator4.e(err);
          } finally {
            _iterator4.f();
          }
        }
        var t3 = this[Symbol.metadata];
        if (null !== t3) {
          var _s5 = litPropertyMetadata.get(t3);
          if (void 0 !== _s5) {
            var _iterator5 = _createForOfIteratorHelper3(_s5), _step5;
            try {
              for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) {
                var _step5$value = _slicedToArray2(_step5.value, 2), _t5 = _step5$value[0], _i6 = _step5$value[1];
                this.elementProperties.set(_t5, _i6);
              }
            } catch (err) {
              _iterator5.e(err);
            } finally {
              _iterator5.f();
            }
          }
        }
        this._$Eh = /* @__PURE__ */ new Map();
        var _iterator6 = _createForOfIteratorHelper3(this.elementProperties), _step6;
        try {
          for (_iterator6.s(); !(_step6 = _iterator6.n()).done; ) {
            var _step6$value = _slicedToArray2(_step6.value, 2), _t6 = _step6$value[0], _s6 = _step6$value[1];
            var _i7 = this._$Eu(_t6, _s6);
            void 0 !== _i7 && this._$Eh.set(_i7, _t6);
          }
        } catch (err) {
          _iterator6.e(err);
        } finally {
          _iterator6.f();
        }
        this.elementStyles = this.finalizeStyles(this.styles);
      }
    }, {
      key: "finalizeStyles",
      value: function finalizeStyles(s4) {
        var i5 = [];
        if (Array.isArray(s4)) {
          var _e2 = new Set(s4.flat(1 / 0).reverse());
          var _iterator7 = _createForOfIteratorHelper3(_e2), _step7;
          try {
            for (_iterator7.s(); !(_step7 = _iterator7.n()).done; ) {
              var _s7 = _step7.value;
              i5.unshift(c(_s7));
            }
          } catch (err) {
            _iterator7.e(err);
          } finally {
            _iterator7.f();
          }
        } else
          void 0 !== s4 && i5.push(c(s4));
        return i5;
      }
    }, {
      key: "_$Eu",
      value: function _$Eu(t3, s4) {
        var i5 = s4.attribute;
        return false === i5 ? void 0 : "string" == typeof i5 ? i5 : "string" == typeof t3 ? t3.toLowerCase() : void 0;
      }
    }]);
    return b3;
  }(/* @__PURE__ */ _wrapNativeSuper(HTMLElement));
  b.elementStyles = [], b.shadowRootOptions = {
    mode: "open"
  }, b[d("elementProperties")] = /* @__PURE__ */ new Map(), b[d("finalized")] = /* @__PURE__ */ new Map(), p !== null && p !== void 0 && p({
    ReactiveElement: b
  }), ((_a$reactiveElementVer = a.reactiveElementVersions) !== null && _a$reactiveElementVer !== void 0 ? _a$reactiveElementVer : a.reactiveElementVersions = []).push("2.0.0");

  // node_modules/lit-html/lit-html.js
  var import_es_array_iterator33 = __toESM(require_es_array_iterator(), 1);

  // node_modules/core-js/modules/es.regexp.constructor.js
  var DESCRIPTORS8 = require_descriptors();
  var global9 = require_global();
  var uncurryThis10 = require_function_uncurry_this();
  var isForced2 = require_is_forced();
  var inheritIfRequired2 = require_inherit_if_required();
  var createNonEnumerableProperty3 = require_create_non_enumerable_property();
  var getOwnPropertyNames3 = require_object_get_own_property_names().f;
  var isPrototypeOf3 = require_object_is_prototype_of();
  var isRegExp2 = require_is_regexp();
  var toString9 = require_to_string();
  var getRegExpFlags2 = require_regexp_get_flags();
  var stickyHelpers2 = require_regexp_sticky_helpers();
  var proxyAccessor = require_proxy_accessor();
  var defineBuiltIn4 = require_define_built_in();
  var fails13 = require_fails();
  var hasOwn4 = require_has_own_property();
  var enforceInternalState = require_internal_state().enforce;
  var setSpecies = require_set_species();
  var wellKnownSymbol6 = require_well_known_symbol();
  var UNSUPPORTED_DOT_ALL = require_regexp_unsupported_dot_all();
  var UNSUPPORTED_NCG = require_regexp_unsupported_ncg();
  var MATCH = wellKnownSymbol6("match");
  var NativeRegExp = global9.RegExp;
  var RegExpPrototype2 = NativeRegExp.prototype;
  var SyntaxError = global9.SyntaxError;
  var exec2 = uncurryThis10(RegExpPrototype2.exec);
  var charAt2 = uncurryThis10("".charAt);
  var replace = uncurryThis10("".replace);
  var stringIndexOf2 = uncurryThis10("".indexOf);
  var stringSlice4 = uncurryThis10("".slice);
  var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/;
  var re1 = /a/g;
  var re2 = /a/g;
  var CORRECT_NEW = new NativeRegExp(re1) !== re1;
  var MISSED_STICKY = stickyHelpers2.MISSED_STICKY;
  var UNSUPPORTED_Y2 = stickyHelpers2.UNSUPPORTED_Y;
  var BASE_FORCED = DESCRIPTORS8 && (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails13(function() {
    re2[MATCH] = false;
    return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, "i") != "/a/i";
  }));
  var handleDotAll = function(string) {
    var length = string.length;
    var index = 0;
    var result = "";
    var brackets = false;
    var chr;
    for (; index <= length; index++) {
      chr = charAt2(string, index);
      if (chr === "\\") {
        result += chr + charAt2(string, ++index);
        continue;
      }
      if (!brackets && chr === ".") {
        result += "[\\s\\S]";
      } else {
        if (chr === "[") {
          brackets = true;
        } else if (chr === "]") {
          brackets = false;
        }
        result += chr;
      }
    }
    return result;
  };
  var handleNCG = function(string) {
    var length = string.length;
    var index = 0;
    var result = "";
    var named = [];
    var names = {};
    var brackets = false;
    var ncg = false;
    var groupid = 0;
    var groupname = "";
    var chr;
    for (; index <= length; index++) {
      chr = charAt2(string, index);
      if (chr === "\\") {
        chr = chr + charAt2(string, ++index);
      } else if (chr === "]") {
        brackets = false;
      } else if (!brackets)
        switch (true) {
          case chr === "[":
            brackets = true;
            break;
          case chr === "(":
            if (exec2(IS_NCG, stringSlice4(string, index + 1))) {
              index += 2;
              ncg = true;
            }
            result += chr;
            groupid++;
            continue;
          case (chr === ">" && ncg):
            if (groupname === "" || hasOwn4(names, groupname)) {
              throw new SyntaxError("Invalid capture group name");
            }
            names[groupname] = true;
            named[named.length] = [groupname, groupid];
            ncg = false;
            groupname = "";
            continue;
        }
      if (ncg)
        groupname += chr;
      else
        result += chr;
    }
    return [result, named];
  };
  if (isForced2("RegExp", BASE_FORCED)) {
    RegExpWrapper = function RegExp2(pattern, flags) {
      var thisIsRegExp = isPrototypeOf3(RegExpPrototype2, this);
      var patternIsRegExp = isRegExp2(pattern);
      var flagsAreUndefined = flags === void 0;
      var groups = [];
      var rawPattern = pattern;
      var rawFlags, dotAll, sticky, handled, result, state;
      if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) {
        return pattern;
      }
      if (patternIsRegExp || isPrototypeOf3(RegExpPrototype2, pattern)) {
        pattern = pattern.source;
        if (flagsAreUndefined)
          flags = getRegExpFlags2(rawPattern);
      }
      pattern = pattern === void 0 ? "" : toString9(pattern);
      flags = flags === void 0 ? "" : toString9(flags);
      rawPattern = pattern;
      if (UNSUPPORTED_DOT_ALL && "dotAll" in re1) {
        dotAll = !!flags && stringIndexOf2(flags, "s") > -1;
        if (dotAll)
          flags = replace(flags, /s/g, "");
      }
      rawFlags = flags;
      if (MISSED_STICKY && "sticky" in re1) {
        sticky = !!flags && stringIndexOf2(flags, "y") > -1;
        if (sticky && UNSUPPORTED_Y2)
          flags = replace(flags, /y/g, "");
      }
      if (UNSUPPORTED_NCG) {
        handled = handleNCG(pattern);
        pattern = handled[0];
        groups = handled[1];
      }
      result = inheritIfRequired2(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype2, RegExpWrapper);
      if (dotAll || sticky || groups.length) {
        state = enforceInternalState(result);
        if (dotAll) {
          state.dotAll = true;
          state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags);
        }
        if (sticky)
          state.sticky = true;
        if (groups.length)
          state.groups = groups;
      }
      if (pattern !== rawPattern)
        try {
          createNonEnumerableProperty3(result, "source", rawPattern === "" ? "(?:)" : rawPattern);
        } catch (error) {
        }
      return result;
    };
    for (keys2 = getOwnPropertyNames3(NativeRegExp), index = 0; keys2.length > index; ) {
      proxyAccessor(RegExpWrapper, NativeRegExp, keys2[index++]);
    }
    RegExpPrototype2.constructor = RegExpWrapper;
    RegExpWrapper.prototype = RegExpPrototype2;
    defineBuiltIn4(global9, "RegExp", RegExpWrapper, { constructor: true });
  }
  var RegExpWrapper;
  var keys2;
  var index;
  setSpecies("RegExp");

  // node_modules/lit-html/lit-html.js
  var import_es_regexp_exec11 = __toESM(require_es_regexp_exec(), 1);

  // node_modules/core-js/modules/es.regexp.sticky.js
  var DESCRIPTORS9 = require_descriptors();
  var MISSED_STICKY2 = require_regexp_sticky_helpers().MISSED_STICKY;
  var classof = require_classof_raw();
  var defineBuiltInAccessor3 = require_define_built_in_accessor();
  var getInternalState2 = require_internal_state().get;
  var RegExpPrototype3 = RegExp.prototype;
  var $TypeError = TypeError;
  if (DESCRIPTORS9 && MISSED_STICKY2) {
    defineBuiltInAccessor3(RegExpPrototype3, "sticky", {
      configurable: true,
      get: function sticky() {
        if (this === RegExpPrototype3)
          return;
        if (classof(this) === "RegExp") {
          return !!getInternalState2(this).sticky;
        }
        throw $TypeError("Incompatible receiver, RegExp required");
      }
    });
  }

  // node_modules/core-js/modules/es.string.starts-with.js
  var $71 = require_export();
  var uncurryThis11 = require_function_uncurry_this_clause();
  var getOwnPropertyDescriptor3 = require_object_get_own_property_descriptor().f;
  var toLength4 = require_to_length();
  var toString10 = require_to_string();
  var notARegExp = require_not_a_regexp();
  var requireObjectCoercible5 = require_require_object_coercible();
  var correctIsRegExpLogic = require_correct_is_regexp_logic();
  var IS_PURE2 = require_is_pure();
  var nativeStartsWith = uncurryThis11("".startsWith);
  var stringSlice5 = uncurryThis11("".slice);
  var min4 = Math.min;
  var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic("startsWith");
  var MDN_POLYFILL_BUG = !IS_PURE2 && !CORRECT_IS_REGEXP_LOGIC && !!function() {
    var descriptor = getOwnPropertyDescriptor3(String.prototype, "startsWith");
    return descriptor && !descriptor.writable;
  }();
  $71({ target: "String", proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
    startsWith: function startsWith(searchString) {
      var that = toString10(requireObjectCoercible5(this));
      notARegExp(searchString);
      var index = toLength4(min4(arguments.length > 1 ? arguments[1] : void 0, that.length));
      var search = toString10(searchString);
      return nativeStartsWith ? nativeStartsWith(that, search, index) : stringSlice5(that, index, index + search.length) === search;
    }
  });

  // node_modules/core-js/modules/es.string.ends-with.js
  var $72 = require_export();
  var uncurryThis12 = require_function_uncurry_this_clause();
  var getOwnPropertyDescriptor4 = require_object_get_own_property_descriptor().f;
  var toLength5 = require_to_length();
  var toString11 = require_to_string();
  var notARegExp2 = require_not_a_regexp();
  var requireObjectCoercible6 = require_require_object_coercible();
  var correctIsRegExpLogic2 = require_correct_is_regexp_logic();
  var IS_PURE3 = require_is_pure();
  var nativeEndsWith = uncurryThis12("".endsWith);
  var slice2 = uncurryThis12("".slice);
  var min5 = Math.min;
  var CORRECT_IS_REGEXP_LOGIC2 = correctIsRegExpLogic2("endsWith");
  var MDN_POLYFILL_BUG2 = !IS_PURE3 && !CORRECT_IS_REGEXP_LOGIC2 && !!function() {
    var descriptor = getOwnPropertyDescriptor4(String.prototype, "endsWith");
    return descriptor && !descriptor.writable;
  }();
  $72({ target: "String", proto: true, forced: !MDN_POLYFILL_BUG2 && !CORRECT_IS_REGEXP_LOGIC2 }, {
    endsWith: function endsWith(searchString) {
      var that = toString11(requireObjectCoercible6(this));
      notARegExp2(searchString);
      var endPosition = arguments.length > 1 ? arguments[1] : void 0;
      var len = that.length;
      var end = endPosition === void 0 ? len : min5(toLength5(endPosition), len);
      var search = toString11(searchString);
      return nativeEndsWith ? nativeEndsWith(that, search, end) : slice2(that, end - search.length, end) === search;
    }
  });

  // node_modules/core-js/modules/es.array.fill.js
  var $73 = require_export();
  var fill = require_array_fill();
  var addToUnscopables3 = require_add_to_unscopables();
  $73({ target: "Array", proto: true }, {
    fill: fill
  });
  addToUnscopables3("fill");

  // node_modules/lit-html/lit-html.js
  var _t$litHtmlVersions;
  function _inherits22(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf22(subClass, superClass);
  }
  function _setPrototypeOf22(o4, p3) {
    _setPrototypeOf22 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf22(o4, p3);
  }
  function _createSuper22(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct22();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf22(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf22(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn22(this, result);
    };
  }
  function _possibleConstructorReturn22(self2, call8) {
    if (call8 && (_typeof33(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized22(self2);
  }
  function _assertThisInitialized22(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct22() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf22(o4) {
    _getPrototypeOf22 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf22(o4);
  }
  function _createForOfIteratorHelper4(o4, allowArrayLike) {
    var it = typeof Symbol !== "undefined" && o4[Symbol.iterator] || o4["@@iterator"];
    if (!it) {
      if (Array.isArray(o4) || (it = _unsupportedIterableToArray4(o4)) || allowArrayLike && o4 && typeof o4.length === "number") {
        if (it)
          o4 = it;
        var i5 = 0;
        var F = function F2() {
        };
        return { s: F, n: function n4() {
          if (i5 >= o4.length)
            return { done: true };
          return { done: false, value: o4[i5++] };
        }, e: function e4(_e4) {
          throw _e4;
        }, f: F };
      }
      throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }
    var normalCompletion = true, didErr = false, err;
    return { s: function s4() {
      it = it.call(o4);
    }, n: function n4() {
      var step = it.next();
      normalCompletion = step.done;
      return step;
    }, e: function e4(_e5) {
      didErr = true;
      err = _e5;
    }, f: function f4() {
      try {
        if (!normalCompletion && it.return != null)
          it.return();
      } finally {
        if (didErr)
          throw err;
      }
    } };
  }
  function _toConsumableArray2(arr) {
    return _arrayWithoutHoles2(arr) || _iterableToArray2(arr) || _unsupportedIterableToArray4(arr) || _nonIterableSpread2();
  }
  function _nonIterableSpread2() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _iterableToArray2(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles2(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray4(arr);
  }
  function _slicedToArray3(arr, i5) {
    return _arrayWithHoles3(arr) || _iterableToArrayLimit3(arr, i5) || _unsupportedIterableToArray4(arr, i5) || _nonIterableRest3();
  }
  function _nonIterableRest3() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray4(o4, minLen) {
    if (!o4)
      return;
    if (typeof o4 === "string")
      return _arrayLikeToArray4(o4, minLen);
    var n4 = Object.prototype.toString.call(o4).slice(8, -1);
    if (n4 === "Object" && o4.constructor)
      n4 = o4.constructor.name;
    if (n4 === "Map" || n4 === "Set")
      return Array.from(o4);
    if (n4 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n4))
      return _arrayLikeToArray4(o4, minLen);
  }
  function _arrayLikeToArray4(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i5 = 0, arr2 = new Array(len); i5 < len; i5++)
      arr2[i5] = arr[i5];
    return arr2;
  }
  function _iterableToArrayLimit3(arr, i5) {
    var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
    if (null != _i) {
      var _s, _e, _x, _r, _arr = [], _n = true, _d = false;
      try {
        if (_x = (_i = _i.call(arr)).next, 0 === i5) {
          if (Object(_i) !== _i)
            return;
          _n = false;
        } else
          for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i5); _n = true)
            ;
      } catch (err) {
        _d = true, _e = err;
      } finally {
        try {
          if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r))
            return;
        } finally {
          if (_d)
            throw _e;
        }
      }
      return _arr;
    }
  }
  function _arrayWithHoles3(arr) {
    if (Array.isArray(arr))
      return arr;
  }
  function _classCallCheck30(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties30(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey31(descriptor.key), descriptor);
    }
  }
  function _createClass30(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties30(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties30(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey31(arg) {
    var key = _toPrimitive31(arg, "string");
    return _typeof33(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive31(input, hint) {
    if (_typeof33(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof33(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _typeof33(obj) {
    "@babel/helpers - typeof";
    return _typeof33 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof33(obj);
  }
  var t2 = globalThis;
  var i4 = t2.trustedTypes;
  var s2 = i4 ? i4.createPolicy("lit-html", {
    createHTML: function createHTML(t3) {
      return t3;
    }
  }) : void 0;
  var e3 = "$lit$";
  var h2 = "lit$".concat((Math.random() + "").slice(9), "$");
  var o3 = "?" + h2;
  var n3 = "<".concat(o3, ">");
  var r4 = document;
  var l2 = function l3() {
    return r4.createComment("");
  };
  var c3 = function c4(t3) {
    return null === t3 || "object" != _typeof33(t3) && "function" != typeof t3;
  };
  var a2 = Array.isArray;
  var u2 = function u3(t3) {
    return a2(t3) || "function" == typeof (t3 === null || t3 === void 0 ? void 0 : t3[Symbol.iterator]);
  };
  var d3 = "[ 	\n\f\r]";
  var f3 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g;
  var v = /-->/g;
  var _ = />/g;
  var m = RegExp(">|".concat(d3, "(?:([^\\s\"'>=/]+)(").concat(d3, "*=").concat(d3, "*(?:[^ 	\n\f\r\"'`<>=]|(\"|')|))|$)"), "g");
  var p2 = /'/g;
  var g = /"/g;
  var $74 = /^(?:script|style|textarea|title)$/i;
  var y2 = function y3(t3) {
    return function(i5) {
      for (var _len = arguments.length, s4 = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
        s4[_key - 1] = arguments[_key];
      }
      return {
        _$litType$: t3,
        strings: i5,
        values: s4
      };
    };
  };
  var x = y2(1);
  var b2 = y2(2);
  var w = Symbol.for("lit-noChange");
  var T = Symbol.for("lit-nothing");
  var A = /* @__PURE__ */ new WeakMap();
  var E = r4.createTreeWalker(r4, 129);
  function C(t3, i5) {
    if (!Array.isArray(t3) || !t3.hasOwnProperty("raw"))
      throw Error("invalid template strings array");
    return void 0 !== s2 ? s2.createHTML(i5) : i5;
  }
  var P = function P2(t3, i5) {
    var s4 = t3.length - 1, o4 = [];
    var r6, l4 = 2 === i5 ? "<svg>" : "", c5 = f3;
    for (var _i = 0; _i < s4; _i++) {
      var _s = t3[_i];
      var _a = void 0, _u = void 0, _d = -1, _y = 0;
      for (; _y < _s.length && (c5.lastIndex = _y, _u = c5.exec(_s), null !== _u); ) {
        var _r;
        _y = c5.lastIndex, c5 === f3 ? "!--" === _u[1] ? c5 = v : void 0 !== _u[1] ? c5 = _ : void 0 !== _u[2] ? ($74.test(_u[2]) && (r6 = RegExp("</" + _u[2], "g")), c5 = m) : void 0 !== _u[3] && (c5 = m) : c5 === m ? ">" === _u[0] ? (c5 = (_r = r6) !== null && _r !== void 0 ? _r : f3, _d = -1) : void 0 === _u[1] ? _d = -2 : (_d = c5.lastIndex - _u[2].length, _a = _u[1], c5 = void 0 === _u[3] ? m : '"' === _u[3] ? g : p2) : c5 === g || c5 === p2 ? c5 = m : c5 === v || c5 === _ ? c5 = f3 : (c5 = m, r6 = void 0);
      }
      var _x = c5 === m && t3[_i + 1].startsWith("/>") ? " " : "";
      l4 += c5 === f3 ? _s + n3 : _d >= 0 ? (o4.push(_a), _s.slice(0, _d) + e3 + _s.slice(_d) + h2 + _x) : _s + h2 + (-2 === _d ? _i : _x);
    }
    return [C(t3, l4 + (t3[s4] || "<?>") + (2 === i5 ? "</svg>" : "")), o4];
  };
  var V = /* @__PURE__ */ function() {
    function V2(_ref, n4) {
      var t3 = _ref.strings, s4 = _ref._$litType$;
      _classCallCheck30(this, V2);
      var r6;
      this.parts = [];
      var c5 = 0, a3 = 0;
      var u4 = t3.length - 1, d4 = this.parts, _P = P(t3, s4), _P2 = _slicedToArray3(_P, 2), f4 = _P2[0], v2 = _P2[1];
      if (this.el = V2.createElement(f4, n4), E.currentNode = this.el.content, 2 === s4) {
        var _t = this.el.content.firstChild;
        _t.replaceWith.apply(_t, _toConsumableArray2(_t.childNodes));
      }
      for (; null !== (r6 = E.nextNode()) && d4.length < u4; ) {
        if (1 === r6.nodeType) {
          if (r6.hasAttributes()) {
            var _iterator = _createForOfIteratorHelper4(r6.getAttributeNames()), _step;
            try {
              for (_iterator.s(); !(_step = _iterator.n()).done; ) {
                var _t2 = _step.value;
                if (_t2.endsWith(e3)) {
                  var _i2 = v2[a3++], _s2 = r6.getAttribute(_t2).split(h2), _e2 = /([.?@])?(.*)/.exec(_i2);
                  d4.push({
                    type: 1,
                    index: c5,
                    name: _e2[2],
                    strings: _s2,
                    ctor: "." === _e2[1] ? k : "?" === _e2[1] ? H : "@" === _e2[1] ? I : R
                  }), r6.removeAttribute(_t2);
                } else
                  _t2.startsWith(h2) && (d4.push({
                    type: 6,
                    index: c5
                  }), r6.removeAttribute(_t2));
              }
            } catch (err) {
              _iterator.e(err);
            } finally {
              _iterator.f();
            }
          }
          if ($74.test(r6.tagName)) {
            var _t3 = r6.textContent.split(h2), _s3 = _t3.length - 1;
            if (_s3 > 0) {
              r6.textContent = i4 ? i4.emptyScript : "";
              for (var _i3 = 0; _i3 < _s3; _i3++)
                r6.append(_t3[_i3], l2()), E.nextNode(), d4.push({
                  type: 2,
                  index: ++c5
                });
              r6.append(_t3[_s3], l2());
            }
          }
        } else if (8 === r6.nodeType)
          if (r6.data === o3)
            d4.push({
              type: 2,
              index: c5
            });
          else {
            var _t4 = -1;
            for (; -1 !== (_t4 = r6.data.indexOf(h2, _t4 + 1)); )
              d4.push({
                type: 7,
                index: c5
              }), _t4 += h2.length - 1;
          }
        c5++;
      }
    }
    _createClass30(V2, null, [{
      key: "createElement",
      value: function createElement(t3, i5) {
        var s4 = r4.createElement("template");
        return s4.innerHTML = t3, s4;
      }
    }]);
    return V2;
  }();
  function N(t3, i5) {
    var _s$_$Co, _h, _h2, _h2$_$AO, _s$_$Co2;
    var s4 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : t3;
    var e4 = arguments.length > 3 ? arguments[3] : void 0;
    if (i5 === w)
      return i5;
    var h3 = void 0 !== e4 ? (_s$_$Co = s4._$Co) === null || _s$_$Co === void 0 ? void 0 : _s$_$Co[e4] : s4._$Cl;
    var o4 = c3(i5) ? void 0 : i5._$litDirective$;
    return ((_h = h3) === null || _h === void 0 ? void 0 : _h.constructor) !== o4 && ((_h2 = h3) !== null && _h2 !== void 0 && (_h2$_$AO = _h2._$AO) !== null && _h2$_$AO !== void 0 && _h2$_$AO.call(_h2, false), void 0 === o4 ? h3 = void 0 : (h3 = new o4(t3), h3._$AT(t3, s4, e4)), void 0 !== e4 ? ((_s$_$Co2 = s4._$Co) !== null && _s$_$Co2 !== void 0 ? _s$_$Co2 : s4._$Co = [])[e4] = h3 : s4._$Cl = h3), void 0 !== h3 && (i5 = N(t3, h3._$AS(t3, i5.values), h3, e4)), i5;
  }
  var S3 = /* @__PURE__ */ function() {
    function S4(t3, i5) {
      _classCallCheck30(this, S4);
      this._$AV = [], this._$AN = void 0, this._$AD = t3, this._$AM = i5;
    }
    _createClass30(S4, [{
      key: "parentNode",
      get: function get3() {
        return this._$AM.parentNode;
      }
    }, {
      key: "_$AU",
      get: function get3() {
        return this._$AM._$AU;
      }
    }, {
      key: "u",
      value: function u4(t3) {
        var _t$creationScope;
        var _this$_$AD = this._$AD, i5 = _this$_$AD.el.content, s4 = _this$_$AD.parts, e4 = ((_t$creationScope = t3 === null || t3 === void 0 ? void 0 : t3.creationScope) !== null && _t$creationScope !== void 0 ? _t$creationScope : r4).importNode(i5, true);
        E.currentNode = e4;
        var h3 = E.nextNode(), o4 = 0, n4 = 0, l4 = s4[0];
        for (; void 0 !== l4; ) {
          var _l;
          if (o4 === l4.index) {
            var _i4 = void 0;
            2 === l4.type ? _i4 = new M(h3, h3.nextSibling, this, t3) : 1 === l4.type ? _i4 = new l4.ctor(h3, l4.name, l4.strings, this, t3) : 6 === l4.type && (_i4 = new L(h3, this, t3)), this._$AV.push(_i4), l4 = s4[++n4];
          }
          o4 !== ((_l = l4) === null || _l === void 0 ? void 0 : _l.index) && (h3 = E.nextNode(), o4++);
        }
        return E.currentNode = r4, e4;
      }
    }, {
      key: "p",
      value: function p3(t3) {
        var i5 = 0;
        var _iterator2 = _createForOfIteratorHelper4(this._$AV), _step2;
        try {
          for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
            var _s4 = _step2.value;
            void 0 !== _s4 && (void 0 !== _s4.strings ? (_s4._$AI(t3, _s4, i5), i5 += _s4.strings.length - 2) : _s4._$AI(t3[i5])), i5++;
          }
        } catch (err) {
          _iterator2.e(err);
        } finally {
          _iterator2.f();
        }
      }
    }]);
    return S4;
  }();
  var M = /* @__PURE__ */ function() {
    function M2(t3, i5, s4, e4) {
      var _e$isConnected;
      _classCallCheck30(this, M2);
      this.type = 2, this._$AH = T, this._$AN = void 0, this._$AA = t3, this._$AB = i5, this._$AM = s4, this.options = e4, this._$Cv = (_e$isConnected = e4 === null || e4 === void 0 ? void 0 : e4.isConnected) !== null && _e$isConnected !== void 0 ? _e$isConnected : true;
    }
    _createClass30(M2, [{
      key: "_$AU",
      get: function get3() {
        var _this$_$AM$_$AU, _this$_$AM;
        return (_this$_$AM$_$AU = (_this$_$AM = this._$AM) === null || _this$_$AM === void 0 ? void 0 : _this$_$AM._$AU) !== null && _this$_$AM$_$AU !== void 0 ? _this$_$AM$_$AU : this._$Cv;
      }
    }, {
      key: "parentNode",
      get: function get3() {
        var _t5;
        var t3 = this._$AA.parentNode;
        var i5 = this._$AM;
        return void 0 !== i5 && 11 === ((_t5 = t3) === null || _t5 === void 0 ? void 0 : _t5.nodeType) && (t3 = i5.parentNode), t3;
      }
    }, {
      key: "startNode",
      get: function get3() {
        return this._$AA;
      }
    }, {
      key: "endNode",
      get: function get3() {
        return this._$AB;
      }
    }, {
      key: "_$AI",
      value: function _$AI(t3) {
        var i5 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this;
        t3 = N(this, t3, i5), c3(t3) ? t3 === T || null == t3 || "" === t3 ? (this._$AH !== T && this._$AR(), this._$AH = T) : t3 !== this._$AH && t3 !== w && this._(t3) : void 0 !== t3._$litType$ ? this.g(t3) : void 0 !== t3.nodeType ? this.$(t3) : u2(t3) ? this.T(t3) : this._(t3);
      }
    }, {
      key: "k",
      value: function k2(t3) {
        return this._$AA.parentNode.insertBefore(t3, this._$AB);
      }
    }, {
      key: "$",
      value: function $88(t3) {
        this._$AH !== t3 && (this._$AR(), this._$AH = this.k(t3));
      }
    }, {
      key: "_",
      value: function _2(t3) {
        this._$AH !== T && c3(this._$AH) ? this._$AA.nextSibling.data = t3 : this.$(r4.createTextNode(t3)), this._$AH = t3;
      }
    }, {
      key: "g",
      value: function g2(t3) {
        var _this$_$AH;
        var i5 = t3.values, s4 = t3._$litType$, e4 = "number" == typeof s4 ? this._$AC(t3) : (void 0 === s4.el && (s4.el = V.createElement(C(s4.h, s4.h[0]), this.options)), s4);
        if (((_this$_$AH = this._$AH) === null || _this$_$AH === void 0 ? void 0 : _this$_$AH._$AD) === e4)
          this._$AH.p(i5);
        else {
          var _t6 = new S3(e4, this), _s5 = _t6.u(this.options);
          _t6.p(i5), this.$(_s5), this._$AH = _t6;
        }
      }
    }, {
      key: "_$AC",
      value: function _$AC(t3) {
        var i5 = A.get(t3.strings);
        return void 0 === i5 && A.set(t3.strings, i5 = new V(t3)), i5;
      }
    }, {
      key: "T",
      value: function T2(t3) {
        a2(this._$AH) || (this._$AH = [], this._$AR());
        var i5 = this._$AH;
        var s4, e4 = 0;
        var _iterator3 = _createForOfIteratorHelper4(t3), _step3;
        try {
          for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
            var _h3 = _step3.value;
            e4 === i5.length ? i5.push(s4 = new M2(this.k(l2()), this.k(l2()), this, this.options)) : s4 = i5[e4], s4._$AI(_h3), e4++;
          }
        } catch (err) {
          _iterator3.e(err);
        } finally {
          _iterator3.f();
        }
        e4 < i5.length && (this._$AR(s4 && s4._$AB.nextSibling, e4), i5.length = e4);
      }
    }, {
      key: "_$AR",
      value: function _$AR() {
        var t3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this._$AA.nextSibling;
        var i5 = arguments.length > 1 ? arguments[1] : void 0;
        for ((_this$_$AP = this._$AP) === null || _this$_$AP === void 0 ? void 0 : _this$_$AP.call(this, false, true, i5); t3 && t3 !== this._$AB; ) {
          var _this$_$AP;
          var _i5 = t3.nextSibling;
          t3.remove(), t3 = _i5;
        }
      }
    }, {
      key: "setConnected",
      value: function setConnected(t3) {
        var _this$_$AP2;
        void 0 === this._$AM && (this._$Cv = t3, (_this$_$AP2 = this._$AP) === null || _this$_$AP2 === void 0 ? void 0 : _this$_$AP2.call(this, t3));
      }
    }]);
    return M2;
  }();
  var R = /* @__PURE__ */ function() {
    function R2(t3, i5, s4, e4, h3) {
      _classCallCheck30(this, R2);
      this.type = 1, this._$AH = T, this._$AN = void 0, this.element = t3, this.name = i5, this._$AM = e4, this.options = h3, s4.length > 2 || "" !== s4[0] || "" !== s4[1] ? (this._$AH = Array(s4.length - 1).fill(new String()), this.strings = s4) : this._$AH = T;
    }
    _createClass30(R2, [{
      key: "tagName",
      get: function get3() {
        return this.element.tagName;
      }
    }, {
      key: "_$AU",
      get: function get3() {
        return this._$AM._$AU;
      }
    }, {
      key: "_$AI",
      value: function _$AI(t3) {
        var i5 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this;
        var s4 = arguments.length > 2 ? arguments[2] : void 0;
        var e4 = arguments.length > 3 ? arguments[3] : void 0;
        var h3 = this.strings;
        var o4 = false;
        if (void 0 === h3)
          t3 = N(this, t3, i5, 0), o4 = !c3(t3) || t3 !== this._$AH && t3 !== w, o4 && (this._$AH = t3);
        else {
          var _e3 = t3;
          var _n2, _r2;
          for (t3 = h3[0], _n2 = 0; _n2 < h3.length - 1; _n2++) {
            var _r3;
            _r2 = N(this, _e3[s4 + _n2], i5, _n2), _r2 === w && (_r2 = this._$AH[_n2]), o4 || (o4 = !c3(_r2) || _r2 !== this._$AH[_n2]), _r2 === T ? t3 = T : t3 !== T && (t3 += ((_r3 = _r2) !== null && _r3 !== void 0 ? _r3 : "") + h3[_n2 + 1]), this._$AH[_n2] = _r2;
          }
        }
        o4 && !e4 && this.j(t3);
      }
    }, {
      key: "j",
      value: function j3(t3) {
        t3 === T ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t3 !== null && t3 !== void 0 ? t3 : "");
      }
    }]);
    return R2;
  }();
  var k = /* @__PURE__ */ function(_R) {
    _inherits22(k2, _R);
    var _super = _createSuper22(k2);
    function k2() {
      var _this;
      _classCallCheck30(this, k2);
      _this = _super.apply(this, arguments), _this.type = 3;
      return _this;
    }
    _createClass30(k2, [{
      key: "j",
      value: function j3(t3) {
        this.element[this.name] = t3 === T ? void 0 : t3;
      }
    }]);
    return k2;
  }(R);
  var H = /* @__PURE__ */ function(_R2) {
    _inherits22(H2, _R2);
    var _super2 = _createSuper22(H2);
    function H2() {
      var _this2;
      _classCallCheck30(this, H2);
      _this2 = _super2.apply(this, arguments), _this2.type = 4;
      return _this2;
    }
    _createClass30(H2, [{
      key: "j",
      value: function j3(t3) {
        this.element.toggleAttribute(this.name, !!t3 && t3 !== T);
      }
    }]);
    return H2;
  }(R);
  var I = /* @__PURE__ */ function(_R3) {
    _inherits22(I2, _R3);
    var _super3 = _createSuper22(I2);
    function I2(t3, i5, s4, e4, h3) {
      var _this3;
      _classCallCheck30(this, I2);
      _this3 = _super3.call(this, t3, i5, s4, e4, h3), _this3.type = 5;
      return _this3;
    }
    _createClass30(I2, [{
      key: "_$AI",
      value: function _$AI(t3) {
        var _N;
        var i5 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this;
        if ((t3 = (_N = N(this, t3, i5, 0)) !== null && _N !== void 0 ? _N : T) === w)
          return;
        var s4 = this._$AH, e4 = t3 === T && s4 !== T || t3.capture !== s4.capture || t3.once !== s4.once || t3.passive !== s4.passive, h3 = t3 !== T && (s4 === T || e4);
        e4 && this.element.removeEventListener(this.name, this, s4), h3 && this.element.addEventListener(this.name, this, t3), this._$AH = t3;
      }
    }, {
      key: "handleEvent",
      value: function handleEvent(t3) {
        var _this$options$host, _this$options;
        "function" == typeof this._$AH ? this._$AH.call((_this$options$host = (_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.host) !== null && _this$options$host !== void 0 ? _this$options$host : this.element, t3) : this._$AH.handleEvent(t3);
      }
    }]);
    return I2;
  }(R);
  var L = /* @__PURE__ */ function() {
    function L2(t3, i5, s4) {
      _classCallCheck30(this, L2);
      this.element = t3, this.type = 6, this._$AN = void 0, this._$AM = i5, this.options = s4;
    }
    _createClass30(L2, [{
      key: "_$AU",
      get: function get3() {
        return this._$AM._$AU;
      }
    }, {
      key: "_$AI",
      value: function _$AI(t3) {
        N(this, t3);
      }
    }]);
    return L2;
  }();
  var Z = t2.litHtmlPolyfillSupport;
  Z !== null && Z !== void 0 && Z(V, M), ((_t$litHtmlVersions = t2.litHtmlVersions) !== null && _t$litHtmlVersions !== void 0 ? _t$litHtmlVersions : t2.litHtmlVersions = []).push("3.0.0");
  var j = function j2(t3, i5, s4) {
    var _s$renderBefore;
    var e4 = (_s$renderBefore = s4 === null || s4 === void 0 ? void 0 : s4.renderBefore) !== null && _s$renderBefore !== void 0 ? _s$renderBefore : i5;
    var h3 = e4._$litPart$;
    if (void 0 === h3) {
      var _s$renderBefore2;
      var _t7 = (_s$renderBefore2 = s4 === null || s4 === void 0 ? void 0 : s4.renderBefore) !== null && _s$renderBefore2 !== void 0 ? _s$renderBefore2 : null;
      e4._$litPart$ = h3 = new M(i5.insertBefore(l2(), _t7), _t7, void 0, s4 !== null && s4 !== void 0 ? s4 : {});
    }
    return h3._$AI(t3), h3;
  };

  // node_modules/lit-element/lit-element.js
  var import_es_array_iterator34 = __toESM(require_es_array_iterator(), 1);
  function _typeof34(obj) {
    "@babel/helpers - typeof";
    return _typeof34 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof34(obj);
  }
  var _globalThis$litElemen;
  var _globalThis$litElemen2;
  function _classCallCheck31(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties31(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey32(descriptor.key), descriptor);
    }
  }
  function _createClass31(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties31(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties31(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _toPropertyKey32(arg) {
    var key = _toPrimitive32(arg, "string");
    return _typeof34(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive32(input, hint) {
    if (_typeof34(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof34(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _get2() {
    if (typeof Reflect !== "undefined" && Reflect.get) {
      _get2 = Reflect.get.bind();
    } else {
      _get2 = function _get3(target, property, receiver) {
        var base = _superPropBase2(target, property);
        if (!base)
          return;
        var desc = Object.getOwnPropertyDescriptor(base, property);
        if (desc.get) {
          return desc.get.call(arguments.length < 3 ? target : receiver);
        }
        return desc.value;
      };
    }
    return _get2.apply(this, arguments);
  }
  function _superPropBase2(object, property) {
    while (!Object.prototype.hasOwnProperty.call(object, property)) {
      object = _getPrototypeOf23(object);
      if (object === null)
        break;
    }
    return object;
  }
  function _inherits23(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf23(subClass, superClass);
  }
  function _setPrototypeOf23(o4, p3) {
    _setPrototypeOf23 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf23(o4, p3);
  }
  function _createSuper23(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct23();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf23(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf23(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn23(this, result);
    };
  }
  function _possibleConstructorReturn23(self2, call8) {
    if (call8 && (_typeof34(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized23(self2);
  }
  function _assertThisInitialized23(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct23() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf23(o4) {
    _getPrototypeOf23 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf23(o4);
  }
  var s3 = /* @__PURE__ */ function(_t) {
    _inherits23(s4, _t);
    var _super = _createSuper23(s4);
    function s4() {
      var _this;
      _classCallCheck31(this, s4);
      _this = _super.apply(this, arguments), _this.renderOptions = {
        host: _assertThisInitialized23(_this)
      }, _this._$Do = void 0;
      return _this;
    }
    _createClass31(s4, [{
      key: "createRenderRoot",
      value: function createRenderRoot() {
        var _this$renderOptions, _this$renderOptions$r;
        var t3 = _get2(_getPrototypeOf23(s4.prototype), "createRenderRoot", this).call(this);
        return (_this$renderOptions$r = (_this$renderOptions = this.renderOptions).renderBefore) !== null && _this$renderOptions$r !== void 0 ? _this$renderOptions$r : _this$renderOptions.renderBefore = t3.firstChild, t3;
      }
    }, {
      key: "update",
      value: function update(t3) {
        var i5 = this.render();
        this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), _get2(_getPrototypeOf23(s4.prototype), "update", this).call(this, t3), this._$Do = j(i5, this.renderRoot, this.renderOptions);
      }
    }, {
      key: "connectedCallback",
      value: function connectedCallback() {
        var _this$_$Do;
        _get2(_getPrototypeOf23(s4.prototype), "connectedCallback", this).call(this), (_this$_$Do = this._$Do) === null || _this$_$Do === void 0 ? void 0 : _this$_$Do.setConnected(true);
      }
    }, {
      key: "disconnectedCallback",
      value: function disconnectedCallback() {
        var _this$_$Do2;
        _get2(_getPrototypeOf23(s4.prototype), "disconnectedCallback", this).call(this), (_this$_$Do2 = this._$Do) === null || _this$_$Do2 === void 0 ? void 0 : _this$_$Do2.setConnected(false);
      }
    }, {
      key: "render",
      value: function render() {
        return w;
      }
    }]);
    return s4;
  }(b);
  s3._$litElement$ = true, s3["finalized", "finalized"] = true, (_globalThis$litElemen = globalThis.litElementHydrateSupport) === null || _globalThis$litElemen === void 0 ? void 0 : _globalThis$litElemen.call(globalThis, {
    LitElement: s3
  });
  var r5 = globalThis.litElementPolyfillSupport;
  r5 === null || r5 === void 0 ? void 0 : r5({
    LitElement: s3
  });
  ((_globalThis$litElemen2 = globalThis.litElementVersions) !== null && _globalThis$litElemen2 !== void 0 ? _globalThis$litElemen2 : globalThis.litElementVersions = []).push("4.0.0");

  // srcts/src/shiny/error.ts
  var import_es_array_iterator35 = __toESM(require_es_array_iterator());
  function _typeof35(obj) {
    "@babel/helpers - typeof";
    return _typeof35 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof35(obj);
  }
  function _defineProperties32(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey33(descriptor.key), descriptor);
    }
  }
  function _createClass32(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties32(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties32(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _classCallCheck32(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _inherits24(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf24(subClass, superClass);
  }
  function _createSuper24(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct24();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf24(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf24(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn24(this, result);
    };
  }
  function _possibleConstructorReturn24(self2, call8) {
    if (call8 && (_typeof35(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized24(self2);
  }
  function _assertThisInitialized24(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _wrapNativeSuper2(Class) {
    var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
    _wrapNativeSuper2 = function _wrapNativeSuper4(Class2) {
      if (Class2 === null || !_isNativeFunction2(Class2))
        return Class2;
      if (typeof Class2 !== "function") {
        throw new TypeError("Super expression must either be null or a function");
      }
      if (typeof _cache !== "undefined") {
        if (_cache.has(Class2))
          return _cache.get(Class2);
        _cache.set(Class2, Wrapper);
      }
      function Wrapper() {
        return _construct2(Class2, arguments, _getPrototypeOf24(this).constructor);
      }
      Wrapper.prototype = Object.create(Class2.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } });
      return _setPrototypeOf24(Wrapper, Class2);
    };
    return _wrapNativeSuper2(Class);
  }
  function _construct2(Parent, args, Class) {
    if (_isNativeReflectConstruct24()) {
      _construct2 = Reflect.construct.bind();
    } else {
      _construct2 = function _construct4(Parent2, args2, Class2) {
        var a3 = [null];
        a3.push.apply(a3, args2);
        var Constructor = Function.bind.apply(Parent2, a3);
        var instance = new Constructor();
        if (Class2)
          _setPrototypeOf24(instance, Class2.prototype);
        return instance;
      };
    }
    return _construct2.apply(null, arguments);
  }
  function _isNativeReflectConstruct24() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _isNativeFunction2(fn) {
    return Function.toString.call(fn).indexOf("[native code]") !== -1;
  }
  function _setPrototypeOf24(o4, p3) {
    _setPrototypeOf24 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf24(o4, p3);
  }
  function _getPrototypeOf24(o4) {
    _getPrototypeOf24 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf24(o4);
  }
  function _defineProperty10(obj, key, value) {
    key = _toPropertyKey33(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey33(arg) {
    var key = _toPrimitive33(arg, "string");
    return _typeof35(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive33(input, hint) {
    if (_typeof35(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof35(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  var ShinyClientError = /* @__PURE__ */ function(_Error) {
    _inherits24(ShinyClientError2, _Error);
    var _super = _createSuper24(ShinyClientError2);
    function ShinyClientError2(_ref) {
      var _this;
      var headline = _ref.headline, message = _ref.message;
      _classCallCheck32(this, ShinyClientError2);
      _this = _super.call(this, message);
      _defineProperty10(_assertThisInitialized24(_this), "headline", void 0);
      _this.name = "ShinyClientError";
      _this.headline = headline;
      return _this;
    }
    return _createClass32(ShinyClientError2);
  }(/* @__PURE__ */ _wrapNativeSuper2(Error));

  // srcts/src/components/errorConsole.ts
  function _typeof36(obj) {
    "@babel/helpers - typeof";
    return _typeof36 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof36(obj);
  }
  var _templateObject;
  var _templateObject2;
  var _templateObject3;
  var _templateObject4;
  var _templateObject5;
  function _wrapNativeSuper3(Class) {
    var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
    _wrapNativeSuper3 = function _wrapNativeSuper4(Class2) {
      if (Class2 === null || !_isNativeFunction3(Class2))
        return Class2;
      if (typeof Class2 !== "function") {
        throw new TypeError("Super expression must either be null or a function");
      }
      if (typeof _cache !== "undefined") {
        if (_cache.has(Class2))
          return _cache.get(Class2);
        _cache.set(Class2, Wrapper);
      }
      function Wrapper() {
        return _construct3(Class2, arguments, _getPrototypeOf25(this).constructor);
      }
      Wrapper.prototype = Object.create(Class2.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } });
      return _setPrototypeOf25(Wrapper, Class2);
    };
    return _wrapNativeSuper3(Class);
  }
  function _construct3(Parent, args, Class) {
    if (_isNativeReflectConstruct25()) {
      _construct3 = Reflect.construct.bind();
    } else {
      _construct3 = function _construct4(Parent2, args2, Class2) {
        var a3 = [null];
        a3.push.apply(a3, args2);
        var Constructor = Function.bind.apply(Parent2, a3);
        var instance = new Constructor();
        if (Class2)
          _setPrototypeOf25(instance, Class2.prototype);
        return instance;
      };
    }
    return _construct3.apply(null, arguments);
  }
  function _isNativeFunction3(fn) {
    return Function.toString.call(fn).indexOf("[native code]") !== -1;
  }
  function _regeneratorRuntime6() {
    "use strict";
    _regeneratorRuntime6 = function _regeneratorRuntime15() {
      return exports;
    };
    var exports = {}, Op = Object.prototype, hasOwn5 = Op.hasOwnProperty, defineProperty3 = Object.defineProperty || function(obj, key, desc) {
      obj[key] = desc.value;
    }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
    function define(obj, key, value) {
      return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }), obj[key];
    }
    try {
      define({}, "");
    } catch (err) {
      define = function define2(obj, key, value) {
        return obj[key] = value;
      };
    }
    function wrap(innerFn, outerFn, self2, tryLocsList) {
      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []);
      return defineProperty3(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) }), generator;
    }
    function tryCatch(fn, obj, arg) {
      try {
        return { type: "normal", arg: fn.call(obj, arg) };
      } catch (err) {
        return { type: "throw", arg: err };
      }
    }
    exports.wrap = wrap;
    var ContinueSentinel = {};
    function Generator() {
    }
    function GeneratorFunction() {
    }
    function GeneratorFunctionPrototype() {
    }
    var IteratorPrototype = {};
    define(IteratorPrototype, iteratorSymbol, function() {
      return this;
    });
    var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values2([])));
    NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn5.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
    var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
    function defineIteratorMethods(prototype) {
      ["next", "throw", "return"].forEach(function(method) {
        define(prototype, method, function(arg) {
          return this._invoke(method, arg);
        });
      });
    }
    function AsyncIterator(generator, PromiseImpl) {
      function invoke(method, arg, resolve, reject) {
        var record = tryCatch(generator[method], generator, arg);
        if ("throw" !== record.type) {
          var result = record.arg, value = result.value;
          return value && "object" == _typeof36(value) && hasOwn5.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
            invoke("next", value2, resolve, reject);
          }, function(err) {
            invoke("throw", err, resolve, reject);
          }) : PromiseImpl.resolve(value).then(function(unwrapped) {
            result.value = unwrapped, resolve(result);
          }, function(error) {
            return invoke("throw", error, resolve, reject);
          });
        }
        reject(record.arg);
      }
      var previousPromise;
      defineProperty3(this, "_invoke", { value: function value(method, arg) {
        function callInvokeWithMethodAndArg() {
          return new PromiseImpl(function(resolve, reject) {
            invoke(method, arg, resolve, reject);
          });
        }
        return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
      } });
    }
    function makeInvokeMethod(innerFn, self2, context) {
      var state = "suspendedStart";
      return function(method, arg) {
        if ("executing" === state)
          throw new Error("Generator is already running");
        if ("completed" === state) {
          if ("throw" === method)
            throw arg;
          return doneResult();
        }
        for (context.method = method, context.arg = arg; ; ) {
          var delegate = context.delegate;
          if (delegate) {
            var delegateResult = maybeInvokeDelegate(delegate, context);
            if (delegateResult) {
              if (delegateResult === ContinueSentinel)
                continue;
              return delegateResult;
            }
          }
          if ("next" === context.method)
            context.sent = context._sent = context.arg;
          else if ("throw" === context.method) {
            if ("suspendedStart" === state)
              throw state = "completed", context.arg;
            context.dispatchException(context.arg);
          } else
            "return" === context.method && context.abrupt("return", context.arg);
          state = "executing";
          var record = tryCatch(innerFn, self2, context);
          if ("normal" === record.type) {
            if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel)
              continue;
            return { value: record.arg, done: context.done };
          }
          "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
        }
      };
    }
    function maybeInvokeDelegate(delegate, context) {
      var methodName = context.method, method = delegate.iterator[methodName];
      if (void 0 === method)
        return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
      var record = tryCatch(method, delegate.iterator, context.arg);
      if ("throw" === record.type)
        return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
      var info = record.arg;
      return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
    }
    function pushTryEntry(locs) {
      var entry = { tryLoc: locs[0] };
      1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
    }
    function resetTryEntry(entry) {
      var record = entry.completion || {};
      record.type = "normal", delete record.arg, entry.completion = record;
    }
    function Context(tryLocsList) {
      this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(true);
    }
    function values2(iterable) {
      if (iterable) {
        var iteratorMethod = iterable[iteratorSymbol];
        if (iteratorMethod)
          return iteratorMethod.call(iterable);
        if ("function" == typeof iterable.next)
          return iterable;
        if (!isNaN(iterable.length)) {
          var i5 = -1, next2 = function next3() {
            for (; ++i5 < iterable.length; )
              if (hasOwn5.call(iterable, i5))
                return next3.value = iterable[i5], next3.done = false, next3;
            return next3.value = void 0, next3.done = true, next3;
          };
          return next2.next = next2;
        }
      }
      return { next: doneResult };
    }
    function doneResult() {
      return { value: void 0, done: true };
    }
    return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty3(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }), defineProperty3(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) {
      var ctor = "function" == typeof genFun && genFun.constructor;
      return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
    }, exports.mark = function(genFun) {
      return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
    }, exports.awrap = function(arg) {
      return { __await: arg };
    }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
      return this;
    }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
      void 0 === PromiseImpl && (PromiseImpl = Promise);
      var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl);
      return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
        return result.done ? result.value : iter.next();
      });
    }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() {
      return this;
    }), define(Gp, "toString", function() {
      return "[object Generator]";
    }), exports.keys = function(val) {
      var object = Object(val), keys2 = [];
      for (var key in object)
        keys2.push(key);
      return keys2.reverse(), function next2() {
        for (; keys2.length; ) {
          var key2 = keys2.pop();
          if (key2 in object)
            return next2.value = key2, next2.done = false, next2;
        }
        return next2.done = true, next2;
      };
    }, exports.values = values2, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) {
      if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
        for (var name in this)
          "t" === name.charAt(0) && hasOwn5.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
    }, stop: function stop() {
      this.done = true;
      var rootRecord = this.tryEntries[0].completion;
      if ("throw" === rootRecord.type)
        throw rootRecord.arg;
      return this.rval;
    }, dispatchException: function dispatchException(exception) {
      if (this.done)
        throw exception;
      var context = this;
      function handle(loc, caught) {
        return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;
      }
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5], record = entry.completion;
        if ("root" === entry.tryLoc)
          return handle("end");
        if (entry.tryLoc <= this.prev) {
          var hasCatch = hasOwn5.call(entry, "catchLoc"), hasFinally = hasOwn5.call(entry, "finallyLoc");
          if (hasCatch && hasFinally) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          } else if (hasCatch) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
          } else {
            if (!hasFinally)
              throw new Error("try statement without catch or finally");
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          }
        }
      }
    }, abrupt: function abrupt(type, arg) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc <= this.prev && hasOwn5.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
          var finallyEntry = entry;
          break;
        }
      }
      finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
      var record = finallyEntry ? finallyEntry.completion : {};
      return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
    }, complete: function complete(record, afterLoc) {
      if ("throw" === record.type)
        throw record.arg;
      return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
    }, finish: function finish(finallyLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.finallyLoc === finallyLoc)
          return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
      }
    }, catch: function _catch(tryLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc === tryLoc) {
          var record = entry.completion;
          if ("throw" === record.type) {
            var thrown = record.arg;
            resetTryEntry(entry);
          }
          return thrown;
        }
      }
      throw new Error("illegal catch attempt");
    }, delegateYield: function delegateYield(iterable, resultName, nextLoc) {
      return this.delegate = { iterator: values2(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = void 0), ContinueSentinel;
    } }, exports;
  }
  function asyncGeneratorStep6(gen, resolve, reject, _next, _throw, key, arg) {
    try {
      var info = gen[key](arg);
      var value = info.value;
    } catch (error) {
      reject(error);
      return;
    }
    if (info.done) {
      resolve(value);
    } else {
      Promise.resolve(value).then(_next, _throw);
    }
  }
  function _asyncToGenerator6(fn) {
    return function() {
      var self2 = this, args = arguments;
      return new Promise(function(resolve, reject) {
        var gen = fn.apply(self2, args);
        function _next(value) {
          asyncGeneratorStep6(gen, resolve, reject, _next, _throw, "next", value);
        }
        function _throw(err) {
          asyncGeneratorStep6(gen, resolve, reject, _next, _throw, "throw", err);
        }
        _next(void 0);
      });
    };
  }
  function _classCallCheck33(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties33(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey34(descriptor.key), descriptor);
    }
  }
  function _createClass33(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties33(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties33(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _inherits25(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf25(subClass, superClass);
  }
  function _setPrototypeOf25(o4, p3) {
    _setPrototypeOf25 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf26(o5, p4) {
      o5.__proto__ = p4;
      return o5;
    };
    return _setPrototypeOf25(o4, p3);
  }
  function _createSuper25(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct25();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf25(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf25(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn25(this, result);
    };
  }
  function _possibleConstructorReturn25(self2, call8) {
    if (call8 && (_typeof36(call8) === "object" || typeof call8 === "function")) {
      return call8;
    } else if (call8 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized25(self2);
  }
  function _assertThisInitialized25(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct25() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e4) {
      return false;
    }
  }
  function _getPrototypeOf25(o4) {
    _getPrototypeOf25 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf26(o5) {
      return o5.__proto__ || Object.getPrototypeOf(o5);
    };
    return _getPrototypeOf25(o4);
  }
  function _defineProperty11(obj, key, value) {
    key = _toPropertyKey34(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey34(arg) {
    var key = _toPrimitive34(arg, "string");
    return _typeof36(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive34(input, hint) {
    if (_typeof36(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof36(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _taggedTemplateLiteral(strings, raw) {
    if (!raw) {
      raw = strings.slice(0);
    }
    return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } }));
  }
  var buttonStyles = i(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n  button {\n    background-color: transparent;\n    outline: none;\n    border-style: none;\n    padding: var(--space-3);\n    border-radius: var(--space-1);\n    font-size: var(--font-lg);\n    background-color: inherit;\n    display: block;\n  }\n\n  button > svg {\n    display: block;\n  }\n"])));
  var ShinyErrorConsole = /* @__PURE__ */ function(_LitElement) {
    _inherits25(ShinyErrorConsole2, _LitElement);
    var _super = _createSuper25(ShinyErrorConsole2);
    function ShinyErrorConsole2() {
      _classCallCheck33(this, ShinyErrorConsole2);
      return _super.apply(this, arguments);
    }
    _createClass33(ShinyErrorConsole2, [{
      key: "toggleCollapsed",
      value: function toggleCollapsed() {
        var _this$querySelector;
        this.classList.toggle("collapsed");
        (_this$querySelector = this.querySelector(".toggle-button")) === null || _this$querySelector === void 0 ? void 0 : _this$querySelector.blur();
      }
    }, {
      key: "handleDismissAll",
      value: function handleDismissAll() {
        var _this = this;
        this.classList.add("leaving");
        this.addEventListener("animationend", function() {
          _this.remove();
        });
      }
    }, {
      key: "render",
      value: function render() {
        return x(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral([' <div class="header">\n        <span class="title"> Shiny Client Errors </span>\n        <button\n          class="close-button"\n          @click=', '\n          title="Dismiss all console messages and close console"\n        >\n          <svg\n            xmlns="http://www.w3.org/2000/svg"\n            fill="none"\n            viewBox="0 0 24 24"\n            stroke-width="1.5"\n            height="1em"\n            width="1em"\n            stroke="currentColor"\n            class="close-icon"\n          >\n            <path\n              stroke-linecap="round"\n              stroke-linejoin="round"\n              d="M6 18L18 6M6 6l12 12"\n            />\n          </svg>\n          Dismiss all\n        </button>\n        <button class="toggle-button" @click=', '>\n          <svg\n            xmlns="http://www.w3.org/2000/svg"\n            fill="none"\n            viewBox="0 0 24 24"\n            stroke-width="1.5"\n            height="1em"\n            width="1em"\n            stroke="currentColor"\n            class="toggle-icon"\n          >\n            <path\n              class="collapse"\n              stroke-linecap="round"\n              stroke-linejoin="round"\n              d="M4.5 19.5l15-15m0 0H8.25m11.25 0v11.25"\n            />\n          </svg>\n        </button>\n      </div>\n      <slot class="content"></slot>'])), this.handleDismissAll, this.toggleCollapsed);
      }
    }]);
    return ShinyErrorConsole2;
  }(s3);
  _defineProperty11(ShinyErrorConsole, "styles", [i(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n      :host {\n        /* We declare hard pixel values here to avoid body font size changes\n        messing up the size of the console. This was an issue with bslib setting\n        the body font-size at 16px relative to base shiny's 14px. */\n        --font-md: 14px;\n        --font-lg: 16px;\n        --font-xl: 18px;\n\n        /* These are all taken from open-props */\n        --space-1: 6px;\n        --space-2: calc(var(--space-1) * 2);\n        --space-3: calc(var(--space-1) * 3);\n        --space-4: calc(var(--space-1) * 4);\n        --space-8: calc(var(--space-1) * 8);\n\n        --red-2: #ffc9c9;\n        --red-6: #fa5252;\n        --red-7: #f03e3e;\n        --red-8: #e03131;\n        --red-10: #b02525;\n        --red-11: #962020;\n        --red-12: #7d1a1a;\n\n        --gray-1: #f8f9fa;\n        --gray-2: #e9ecef;\n        --gray-3: #dee2e6;\n        --gray-4: #ced4da;\n        --gray-6: #868e96;\n        --gray-8: #6c757d;\n\n        --green-8: #51cf66;\n\n        --shadow-color: 220 3% 15%;\n        --shadow-strength: 1%;\n        --shadow-3: 0 -1px 3px 0 hsl(var(--shadow-color) /\n                calc(var(--shadow-strength) + 2%)),\n          0 1px 2px -5px hsl(var(--shadow-color) /\n                calc(var(--shadow-strength) + 2%)),\n          0 2px 5px -5px hsl(var(--shadow-color) /\n                calc(var(--shadow-strength) + 4%)),\n          0 4px 12px -5px hsl(var(--shadow-color) /\n                calc(var(--shadow-strength) + 5%)),\n          0 12px 15px -5px hsl(var(--shadow-color) /\n                calc(var(--shadow-strength) + 7%));\n\n        --ring-shadow: 0 0 0 1px var(--gray-2);\n\n        /* How fast should the message pop in and out of the screen? */\n        --animation-speed: 500ms;\n\n        /* Taken from open-props */\n        --ease-3: cubic-bezier(0.25, 0, 0.3, 1);\n        --animation-slide-in-left: slide-in-left var(--animation-speed)\n          var(--ease-3);\n\n        --animation-slide-out-left: slide-out-left var(--animation-speed)\n          var(--ease-3);\n        --modal-bg-color: white;\n\n        position: fixed;\n        top: var(--space-1);\n        right: var(--space-1);\n        z-index: 1000;\n\n        display: flex;\n        flex-direction: column;\n\n        background-color: var(--modal-bg-color);\n        border-radius: var(--space-1);\n\n        animation: var(--animation-slide-in-left);\n        box-shadow: var(--shadow-3), var(--ring-shadow);\n\n        /* Dont let the error console burst out of the viewport */\n        max-height: calc(100vh - 2 * var(--space-1));\n      }\n\n      @keyframes slide-in-left {\n        from {\n          transform: translateX(100%);\n        }\n      }\n      @keyframes slide-out-left {\n        to {\n          transform: translateX(100%);\n        }\n      }\n\n      :host(.leaving) {\n        animation: var(--animation-slide-out-left);\n      }\n\n      .header {\n        display: flex;\n        justify-content: flex-end;\n        align-items: flex-start;\n        gap: var(--space-2);\n      }\n\n      .title {\n        font-size: var(--font-xl);\n        margin-right: auto;\n        padding: var(--space-3);\n        line-height: 1;\n        font-weight: 600;\n        color: var(--red-12);\n      }\n\n      ", "\n\n      button:hover {\n        background-color: var(--gray-2);\n      }\n\n      .toggle-button {\n        width: fit-content;\n        border: none;\n        aspect-ratio: 1;\n        border-color: var(--gray-4);\n      }\n\n      .close-button {\n        display: flex;\n        align-items: center;\n        color: var(--red-11);\n      }\n\n      .close-button > svg {\n        margin-right: 3px;\n      }\n\n      .toggle-button:focus {\n        outline: 1px solid black;\n      }\n\n      .toggle-icon {\n        transition: transform var(--animation-speed) ease-in-out;\n      }\n\n      :host(.collapsed) .toggle-icon {\n        transform: scaleX(-1) scaleY(-1);\n      }\n\n      :host(.collapsed) .close-button {\n        display: none;\n      }\n\n      .content {\n        display: block;\n        padding-inline: var(--space-4);\n        padding-block-start: 0;\n        padding-block-end: var(--space-4);\n        max-height: 100%;\n        overflow: auto;\n      }\n\n      :host(.collapsed) .content {\n        display: none;\n      }\n    "])), buttonStyles)]);
  customElements.define("shiny-error-console", ShinyErrorConsole);
  var ShinyErrorMessage = /* @__PURE__ */ function(_LitElement2) {
    _inherits25(ShinyErrorMessage2, _LitElement2);
    var _super2 = _createSuper25(ShinyErrorMessage2);
    function ShinyErrorMessage2() {
      var _this2;
      _classCallCheck33(this, ShinyErrorMessage2);
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      _this2 = _super2.call.apply(_super2, [this].concat(args));
      _defineProperty11(_assertThisInitialized25(_this2), "headline", "");
      _defineProperty11(_assertThisInitialized25(_this2), "message", "");
      return _this2;
    }
    _createClass33(ShinyErrorMessage2, [{
      key: "copyErrorToClipboard",
      value: function() {
        var _copyErrorToClipboard = _asyncToGenerator6(/* @__PURE__ */ _regeneratorRuntime6().mark(function _callee() {
          var _this3 = this;
          return _regeneratorRuntime6().wrap(function _callee$(_context) {
            while (1)
              switch (_context.prev = _context.next) {
                case 0:
                  _context.next = 2;
                  return navigator.clipboard.writeText(this.message);
                case 2:
                  this.classList.add("copy-success");
                  setTimeout(function() {
                    _this3.classList.remove("copy-success");
                  }, 1e3);
                case 4:
                case "end":
                  return _context.stop();
              }
          }, _callee, this);
        }));
        function copyErrorToClipboard() {
          return _copyErrorToClipboard.apply(this, arguments);
        }
        return copyErrorToClipboard;
      }()
    }, {
      key: "render",
      value: function render() {
        return x(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(['\n      <div class="container">\n        <div class="decoration-container">\n          <div class="vertical-line"></div>\n          <div class="dot"></div>\n        </div>\n        <div class="contents">\n          <h3>', '</h3>\n          <pre class="error-message">', '</pre>\n        </div>\n\n        <div class="actions">\n          <button\n            class="copy-button"\n            @click=', '\n            title="Copy error to clipboard"\n          >\n            <div class="copy-button-inner">\n              <svg\n                class="front"\n                xmlns="http://www.w3.org/2000/svg"\n                fill="none"\n                viewBox="0 0 24 24"\n                stroke-width="1.5"\n                stroke="currentColor"\n                height="1em"\n                width="1em"\n              >\n                <path\n                  stroke-linecap="round"\n                  stroke-linejoin="round"\n                  d="M15.666 3.888A2.25 2.25 0 0013.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 01-.75.75H9a.75.75 0 01-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 01-2.25 2.25H6.75A2.25 2.25 0 014.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 011.927-.184"\n                />\n              </svg>\n\n              <svg\n                class="back"\n                xmlns="http://www.w3.org/2000/svg"\n                fill="none"\n                viewBox="0 0 24 24"\n                stroke-width="1.5"\n                stroke="currentColor"\n                height="1em"\n                width="1em"\n              >\n                <path\n                  stroke-linecap="round"\n                  stroke-linejoin="round"\n                  d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"\n                />\n              </svg>\n            </div>\n          </button>\n        </div>\n      </div>\n    '])), this.headline, this.message, this.copyErrorToClipboard);
      }
    }]);
    return ShinyErrorMessage2;
  }(s3);
  _defineProperty11(ShinyErrorMessage, "properties", {
    headline: {},
    message: {}
  });
  _defineProperty11(ShinyErrorMessage, "styles", [i(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(['\n      :host {\n        color: var(--red-11);\n        display: block;\n        font-size: var(--font-md);\n\n        position: relative;\n        --icon-size: var(--font-lg)\n\n        /* Reset box sizing */\n        box-sizing: border-box;\n      }\n\n      .container {\n        display: flex;\n        gap: var(--space-2);\n      }\n\n      .contents {\n        width: 40ch;\n        display: flex;\n        flex-direction: column;\n        gap: var(--space-1);\n        padding-block-start: 0;\n        padding-block-end: var(--space-3);\n        overflow: auto;\n      }\n\n      :host(:last-of-type) .contents {\n\n        padding-block-end: var(--space-1);\n      }\n\n      .contents > h3 {\n        font-size: 1em;\n        font-weight: 500;\n        color: var(--red-12);\n      }\n\n      .contents > * {\n        margin-block: 0;\n      }\n\n      .error-message {\n        font-family: "Courier New", Courier, monospace;\n        white-space: pre-wrap;\n      }\n\n      .decoration-container {\n        flex-shrink: 0;\n        position: relative;\n\n        --line-w: 2px;\n        --dot-size: 11px;\n      }\n\n      :host(:hover) .decoration-container {\n        --scale: 1.25;\n      }\n\n      .vertical-line {\n        margin-inline: auto;\n        width: var(--line-w);\n        height: 100%;\n\n        background-color: var(--red-10);\n      }\n\n      :host(:first-of-type) .vertical-line {\n        height: calc(100% - var(--dot-size));\n        margin-top: var(--dot-size);\n      }\n\n      .dot {\n        position: absolute;\n        width: var(--dot-size);\n        height: var(--dot-size);\n        top: calc(-1px +  var(--dot-size) / 2);\n        left: calc(50% - var(--dot-size) / 2);\n        border-radius: 100%;\n        transform: scale(var(--scale, 1));\n\n        color: var(--red-6);\n        background-color: var(--red-10);\n      }\n\n      .actions {\n        transform: scaleX(0);\n        transition: transform calc(var(--animation-speed) / 2) ease-in-out;\n        display: flex;\n        justify-content: center;\n        flex-direction: column;\n      }\n\n      /* Delay transition on mouseout so the buttons don\'t jump away if the user\n      overshoots them with their mouse */\n      :host(:not(:hover)) .actions {\n        transition-delay: 0.15s;\n      }\n\n      :host(:hover) .actions {\n        transform: scaleX(1);\n      }\n\n      ', "\n\n      .copy-button {\n        padding: 0;\n        width: var(--space-8);\n        height: var(--space-8);\n        position: relative;\n        --pad: var(--space-2);\n      }\n\n      .copy-button-inner {\n        position: relative;\n        width: 100%;\n        height: 100%;\n        border-radius: inherit;\n        transition: transform 0.5s;\n        transform-style: preserve-3d;\n      }\n\n      /* Animate flipping to the other side when the .copy-success class is\n      added to the host */\n      :host(.copy-success) .copy-button-inner {\n        transform: rotateY(180deg);\n      }\n\n      /* Position the front and back side */\n      .copy-button .front,\n      .copy-button .back {\n        --side: calc(100% - 2 * var(--pad));\n        position: absolute;\n        inset: var(--pad);\n        height: var(--side);\n        width: var(--side);\n        -webkit-backface-visibility: hidden; /* Safari */\n        backface-visibility: hidden;\n      }\n\n      .copy-button:hover .copy-button-inner {\n        background-color: var(--gray-2);\n      }\n\n      /* Style the back side */\n      .copy-button .back {\n        --pad: var(--space-1);\n        color: var(--green-8);\n        transform: rotateY(180deg);\n      }\n    "])), buttonStyles)]);
  customElements.define("shiny-error-message", ShinyErrorMessage);
  function showShinyClientMessage(_ref) {
    var _ref$headline = _ref.headline, headline = _ref$headline === void 0 ? "" : _ref$headline, message = _ref.message, _ref$status = _ref.status, status = _ref$status === void 0 ? "warning" : _ref$status;
    var consoleMessage = "[shiny] ".concat(headline).concat(headline ? " - " : "").concat(message);
    switch (status) {
      case "error":
        console.error(consoleMessage);
        break;
      case "warning":
        console.warn(consoleMessage);
        break;
      default:
        console.log(consoleMessage);
        break;
    }
    if (!Shiny.inDevMode()) {
      return;
    }
    var errorConsoleContainer = document.querySelector("shiny-error-console");
    if (!errorConsoleContainer) {
      errorConsoleContainer = document.createElement("shiny-error-console");
      document.body.appendChild(errorConsoleContainer);
    }
    var errorConsole = document.createElement("shiny-error-message");
    errorConsole.setAttribute("headline", headline);
    errorConsole.setAttribute("message", message);
    errorConsoleContainer.appendChild(errorConsole);
  }
  function showErrorInClientConsole(e4) {
    var errorMsg = null;
    var headline = "Error on client while running Shiny app";
    if (typeof e4 === "string") {
      errorMsg = e4;
    } else if (e4 instanceof ShinyClientError) {
      errorMsg = e4.message;
      headline = e4.headline;
    } else if (e4 instanceof Error) {
      errorMsg = e4.message;
    } else {
      errorMsg = "Unknown error";
    }
    showShinyClientMessage({
      headline: headline,
      message: errorMsg,
      status: "error"
    });
  }
  var ShinyClientMessageEvent = /* @__PURE__ */ function(_CustomEvent) {
    _inherits25(ShinyClientMessageEvent2, _CustomEvent);
    var _super3 = _createSuper25(ShinyClientMessageEvent2);
    function ShinyClientMessageEvent2(detail) {
      _classCallCheck33(this, ShinyClientMessageEvent2);
      return _super3.call(this, "shiny:client-message", {
        detail: detail,
        bubbles: true,
        cancelable: true
      });
    }
    return _createClass33(ShinyClientMessageEvent2);
  }(/* @__PURE__ */ _wrapNativeSuper3(CustomEvent));
  window.addEventListener("shiny:client-message", function(ev) {
    if (!(ev instanceof CustomEvent)) {
      throw new Error("[shiny] shiny:client-message expected a CustomEvent");
    }
    var _ev$detail = ev.detail, headline = _ev$detail.headline, message = _ev$detail.message, status = _ev$detail.status;
    if (!message) {
      throw new Error("[shiny] shiny:client-message expected a `message` property in `event.detail`.");
    }
    showShinyClientMessage({
      headline: headline,
      message: message,
      status: status
    });
  });

  // srcts/src/imageutils/resetBrush.ts
  function resetBrush(brushId) {
    shinySetInputValue(brushId, null);
    imageOutputBinding.find(document.documentElement).trigger("shiny-internal:brushed", {
      brushId: brushId,
      outputId: null
    });
  }

  // srcts/src/inputPolicies/inputBatchSender.ts
  var import_es_array_iterator37 = __toESM(require_es_array_iterator());
  function _typeof37(obj) {
    "@babel/helpers - typeof";
    return _typeof37 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof37(obj);
  }
  function _classCallCheck34(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties34(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey35(descriptor.key), descriptor);
    }
  }
  function _createClass34(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties34(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties34(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _defineProperty12(obj, key, value) {
    key = _toPropertyKey35(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey35(arg) {
    var key = _toPrimitive35(arg, "string");
    return _typeof37(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive35(input, hint) {
    if (_typeof37(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof37(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  var InputBatchSender = /* @__PURE__ */ function() {
    function InputBatchSender2(shinyapp) {
      _classCallCheck34(this, InputBatchSender2);
      _defineProperty12(this, "target", void 0);
      _defineProperty12(this, "shinyapp", void 0);
      _defineProperty12(this, "pendingData", {});
      _defineProperty12(this, "reentrant", false);
      _defineProperty12(this, "sendIsEnqueued", false);
      _defineProperty12(this, "lastChanceCallback", []);
      this.shinyapp = shinyapp;
    }
    _createClass34(InputBatchSender2, [{
      key: "setInput",
      value: function setInput(nameType, value, opts) {
        var _this = this;
        this.pendingData[nameType] = value;
        if (!this.reentrant) {
          if (opts.priority === "event") {
            this._sendNow();
          } else if (!this.sendIsEnqueued) {
            this.shinyapp.taskQueue.enqueue(function() {
              _this.sendIsEnqueued = false;
              _this._sendNow();
            });
          }
        }
      }
    }, {
      key: "_sendNow",
      value: function _sendNow() {
        if (this.reentrant) {
          console.trace("Unexpected reentrancy in InputBatchSender!");
        }
        this.reentrant = true;
        try {
          this.lastChanceCallback.forEach(function(callback) {
            return callback();
          });
          var currentData = this.pendingData;
          this.pendingData = {};
          this.shinyapp.sendInput(currentData);
        } finally {
          this.reentrant = false;
        }
      }
    }]);
    return InputBatchSender2;
  }();

  // srcts/src/inputPolicies/inputDeferDecorator.ts
  var import_es_regexp_exec12 = __toESM(require_es_regexp_exec());
  var import_es_array_iterator38 = __toESM(require_es_array_iterator());
  function _typeof38(obj) {
    "@babel/helpers - typeof";
    return _typeof38 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof38(obj);
  }
  function _classCallCheck35(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties35(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey36(descriptor.key), descriptor);
    }
  }
  function _createClass35(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties35(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties35(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _defineProperty13(obj, key, value) {
    key = _toPropertyKey36(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey36(arg) {
    var key = _toPrimitive36(arg, "string");
    return _typeof38(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive36(input, hint) {
    if (_typeof38(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof38(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  var InputDeferDecorator = /* @__PURE__ */ function() {
    function InputDeferDecorator2(target) {
      _classCallCheck35(this, InputDeferDecorator2);
      _defineProperty13(this, "pendingInput", {});
      _defineProperty13(this, "target", void 0);
      this.target = target;
    }
    _createClass35(InputDeferDecorator2, [{
      key: "setInput",
      value: function setInput(nameType, value, opts) {
        if (/^\./.test(nameType))
          this.target.setInput(nameType, value, opts);
        else
          this.pendingInput[nameType] = {
            value: value,
            opts: opts
          };
      }
    }, {
      key: "submit",
      value: function submit() {
        for (var nameType in this.pendingInput) {
          if (hasDefinedProperty(this.pendingInput, nameType)) {
            var _this$pendingInput$na = this.pendingInput[nameType], value = _this$pendingInput$na.value, opts = _this$pendingInput$na.opts;
            this.target.setInput(nameType, value, opts);
          }
        }
      }
    }]);
    return InputDeferDecorator2;
  }();

  // srcts/src/inputPolicies/inputEventDecorator.ts
  var import_es_array_iterator39 = __toESM(require_es_array_iterator());
  var import_jquery33 = __toESM(require_jquery());

  // srcts/src/inputPolicies/splitInputNameType.ts
  function splitInputNameType(nameType) {
    var name2 = nameType.split(":");
    return {
      name: name2[0],
      inputType: name2.length > 1 ? name2[1] : ""
    };
  }

  // srcts/src/inputPolicies/inputEventDecorator.ts
  function _typeof39(obj) {
    "@babel/helpers - typeof";
    return _typeof39 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof39(obj);
  }
  function _classCallCheck36(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties36(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey37(descriptor.key), descriptor);
    }
  }
  function _createClass36(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties36(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties36(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _defineProperty14(obj, key, value) {
    key = _toPropertyKey37(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey37(arg) {
    var key = _toPrimitive37(arg, "string");
    return _typeof39(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive37(input, hint) {
    if (_typeof39(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof39(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  var InputEventDecorator = /* @__PURE__ */ function() {
    function InputEventDecorator2(target) {
      _classCallCheck36(this, InputEventDecorator2);
      _defineProperty14(this, "target", void 0);
      this.target = target;
    }
    _createClass36(InputEventDecorator2, [{
      key: "setInput",
      value: function setInput(nameType, value, opts) {
        var evt = import_jquery33.default.Event("shiny:inputchanged");
        var input = splitInputNameType(nameType);
        evt.name = input.name;
        evt.inputType = input.inputType;
        evt.value = value;
        evt.binding = opts.binding || null;
        evt.el = opts.el || null;
        evt.priority = opts.priority;
        (0, import_jquery33.default)(opts.el || window.document).trigger(evt);
        if (!evt.isDefaultPrevented()) {
          var name = evt.name;
          if (evt.inputType !== "")
            name += ":" + evt.inputType;
          this.target.setInput(name, evt.value, {
            priority: opts.priority
          });
        }
      }
    }]);
    return InputEventDecorator2;
  }();

  // srcts/src/inputPolicies/inputNoResendDecorator.ts
  var import_es_json_stringify3 = __toESM(require_es_json_stringify());
  var import_es_array_iterator40 = __toESM(require_es_array_iterator());
  function _typeof40(obj) {
    "@babel/helpers - typeof";
    return _typeof40 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof40(obj);
  }
  function _classCallCheck37(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties37(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey38(descriptor.key), descriptor);
    }
  }
  function _createClass37(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties37(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties37(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _defineProperty15(obj, key, value) {
    key = _toPropertyKey38(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey38(arg) {
    var key = _toPrimitive38(arg, "string");
    return _typeof40(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive38(input, hint) {
    if (_typeof40(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof40(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  var InputNoResendDecorator = /* @__PURE__ */ function() {
    function InputNoResendDecorator2(target) {
      var initialValues = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      _classCallCheck37(this, InputNoResendDecorator2);
      _defineProperty15(this, "target", void 0);
      _defineProperty15(this, "lastSentValues", {});
      this.target = target;
      this.reset(initialValues);
    }
    _createClass37(InputNoResendDecorator2, [{
      key: "setInput",
      value: function setInput(nameType, value, opts) {
        var _splitInputNameType = splitInputNameType(nameType), inputName = _splitInputNameType.name, inputType = _splitInputNameType.inputType;
        var jsonValue = JSON.stringify(value);
        if (opts.priority !== "event" && this.lastSentValues[inputName] && this.lastSentValues[inputName].jsonValue === jsonValue && this.lastSentValues[inputName].inputType === inputType) {
          return;
        }
        this.lastSentValues[inputName] = {
          jsonValue: jsonValue,
          inputType: inputType
        };
        this.target.setInput(nameType, value, opts);
      }
    }, {
      key: "reset",
      value: function reset() {
        var values2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
        var cacheValues = {};
        for (var inputName in values2) {
          if (hasDefinedProperty(values2, inputName)) {
            var _splitInputNameType2 = splitInputNameType(inputName), name = _splitInputNameType2.name, inputType = _splitInputNameType2.inputType;
            cacheValues[name] = {
              jsonValue: JSON.stringify(values2[inputName]),
              inputType: inputType
            };
          }
        }
        this.lastSentValues = cacheValues;
      }
    }, {
      key: "forget",
      value: function forget(name) {
        delete this.lastSentValues[name];
      }
    }]);
    return InputNoResendDecorator2;
  }();

  // srcts/src/inputPolicies/inputRateDecorator.ts
  var import_es_array_iterator41 = __toESM(require_es_array_iterator());
  function _typeof41(obj) {
    "@babel/helpers - typeof";
    return _typeof41 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof41(obj);
  }
  function _classCallCheck38(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties38(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey39(descriptor.key), descriptor);
    }
  }
  function _createClass38(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties38(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties38(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _defineProperty16(obj, key, value) {
    key = _toPropertyKey39(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey39(arg) {
    var key = _toPrimitive39(arg, "string");
    return _typeof41(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive39(input, hint) {
    if (_typeof41(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof41(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  var InputRateDecorator = /* @__PURE__ */ function() {
    function InputRateDecorator2(target) {
      _classCallCheck38(this, InputRateDecorator2);
      _defineProperty16(this, "target", void 0);
      _defineProperty16(this, "inputRatePolicies", {});
      this.target = target;
    }
    _createClass38(InputRateDecorator2, [{
      key: "setInput",
      value: function setInput(nameType, value, opts) {
        var _splitInputNameType = splitInputNameType(nameType), inputName = _splitInputNameType.name;
        this._ensureInit(inputName);
        if (opts.priority !== "deferred")
          this.inputRatePolicies[inputName].immediateCall(nameType, value, opts);
        else
          this.inputRatePolicies[inputName].normalCall(nameType, value, opts);
      }
    }, {
      key: "setRatePolicy",
      value: function setRatePolicy(nameType, mode, millis) {
        var _splitInputNameType2 = splitInputNameType(nameType), inputName = _splitInputNameType2.name;
        if (mode === "direct") {
          this.inputRatePolicies[inputName] = new Invoker(this, this._doSetInput);
        } else if (mode === "debounce") {
          this.inputRatePolicies[inputName] = new Debouncer(this, this._doSetInput, millis);
        } else if (mode === "throttle") {
          this.inputRatePolicies[inputName] = new Throttler(this, this._doSetInput, millis);
        }
      }
    }, {
      key: "_ensureInit",
      value: function _ensureInit(name) {
        if (!(name in this.inputRatePolicies))
          this.setRatePolicy(name, "direct");
      }
    }, {
      key: "_doSetInput",
      value: function _doSetInput(nameType, value, opts) {
        this.target.setInput(nameType, value, opts);
      }
    }]);
    return InputRateDecorator2;
  }();

  // srcts/src/inputPolicies/inputValidateDecorator.ts
  var import_es_array_iterator42 = __toESM(require_es_array_iterator());
  function _typeof42(obj) {
    "@babel/helpers - typeof";
    return _typeof42 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof42(obj);
  }
  function _classCallCheck39(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties39(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey40(descriptor.key), descriptor);
    }
  }
  function _createClass39(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties39(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties39(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function ownKeys3(object, enumerableOnly) {
    var keys2 = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys2.push.apply(keys2, symbols);
    }
    return keys2;
  }
  function _objectSpread2(target) {
    for (var i5 = 1; i5 < arguments.length; i5++) {
      var source = null != arguments[i5] ? arguments[i5] : {};
      i5 % 2 ? ownKeys3(Object(source), true).forEach(function(key) {
        _defineProperty17(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys3(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty17(obj, key, value) {
    key = _toPropertyKey40(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey40(arg) {
    var key = _toPrimitive40(arg, "string");
    return _typeof42(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive40(input, hint) {
    if (_typeof42(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof42(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function addDefaultInputOpts(opts) {
    var newOpts = _objectSpread2({
      priority: "immediate"
    }, opts);
    switch (newOpts.priority) {
      case "deferred":
      case "immediate":
      case "event":
        break;
      default:
        throw new Error("Unexpected input value mode: '" + newOpts.priority + "'");
    }
    return newOpts;
  }
  var InputValidateDecorator = /* @__PURE__ */ function() {
    function InputValidateDecorator2(target) {
      _classCallCheck39(this, InputValidateDecorator2);
      _defineProperty17(this, "target", void 0);
      this.target = target;
    }
    _createClass39(InputValidateDecorator2, [{
      key: "setInput",
      value: function setInput(nameType, value) {
        var opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
        if (!nameType)
          throw "Can't set input with empty name.";
        var newOpts = addDefaultInputOpts(opts);
        this.target.setInput(nameType, value, newOpts);
      }
    }]);
    return InputValidateDecorator2;
  }();

  // node_modules/core-js/modules/es.promise.finally.js
  var $76 = require_export();
  var IS_PURE4 = require_is_pure();
  var NativePromiseConstructor = require_promise_native_constructor();
  var fails14 = require_fails();
  var getBuiltIn3 = require_get_built_in();
  var isCallable4 = require_is_callable();
  var speciesConstructor2 = require_species_constructor();
  var promiseResolve = require_promise_resolve();
  var defineBuiltIn5 = require_define_built_in();
  var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
  var NON_GENERIC = !!NativePromiseConstructor && fails14(function() {
    NativePromisePrototype["finally"].call({ then: function() {
    } }, function() {
    });
  });
  $76({ target: "Promise", proto: true, real: true, forced: NON_GENERIC }, {
    "finally": function(onFinally) {
      var C2 = speciesConstructor2(this, getBuiltIn3("Promise"));
      var isFunction = isCallable4(onFinally);
      return this.then(
        isFunction ? function(x2) {
          return promiseResolve(C2, onFinally()).then(function() {
            return x2;
          });
        } : onFinally,
        isFunction ? function(e4) {
          return promiseResolve(C2, onFinally()).then(function() {
            throw e4;
          });
        } : onFinally
      );
    }
  });
  if (!IS_PURE4 && isCallable4(NativePromiseConstructor)) {
    method = getBuiltIn3("Promise").prototype["finally"];
    if (NativePromisePrototype["finally"] !== method) {
      defineBuiltIn5(NativePromisePrototype, "finally", method, { unsafe: true });
    }
  }
  var method;

  // srcts/src/utils/promise.ts
  var import_es_array_iterator43 = __toESM(require_es_array_iterator());
  function _typeof43(obj) {
    "@babel/helpers - typeof";
    return _typeof43 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof43(obj);
  }
  function _defineProperty18(obj, key, value) {
    key = _toPropertyKey41(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey41(arg) {
    var key = _toPrimitive41(arg, "string");
    return _typeof43(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive41(input, hint) {
    if (_typeof43(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof43(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function promiseWithResolvers() {
    var resolve;
    var reject;
    var promise = new Promise(function(res, rej) {
      resolve = res;
      reject = rej;
    });
    return {
      promise: promise,
      resolve: resolve,
      reject: reject
    };
  }
  function createInitStatus() {
    var _ref;
    var _promiseWithResolvers = promiseWithResolvers(), promise = _promiseWithResolvers.promise, resolve = _promiseWithResolvers.resolve;
    var _resolved = false;
    return _ref = {
      promise: promise,
      resolve: function(_resolve) {
        function resolve2(_x) {
          return _resolve.apply(this, arguments);
        }
        resolve2.toString = function() {
          return _resolve.toString();
        };
        return resolve2;
      }(function(x2) {
        _resolved = true;
        resolve(x2);
      }),
      then: promise.then.bind(promise),
      catch: promise.catch.bind(promise),
      finally: promise.finally.bind(promise)
    }, _defineProperty18(_ref, Symbol.toStringTag, "InitStatus"), _defineProperty18(_ref, "resolved", function resolved() {
      return _resolved;
    }), _ref;
  }

  // srcts/src/shiny/bind.ts
  var import_es_array_iterator45 = __toESM(require_es_array_iterator());
  var import_es_regexp_exec13 = __toESM(require_es_regexp_exec());
  var import_jquery34 = __toESM(require_jquery());

  // srcts/src/bindings/outputAdapter.ts
  var import_es_array_iterator44 = __toESM(require_es_array_iterator());
  function _typeof44(obj) {
    "@babel/helpers - typeof";
    return _typeof44 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof44(obj);
  }
  function _regeneratorRuntime7() {
    "use strict";
    _regeneratorRuntime7 = function _regeneratorRuntime15() {
      return exports;
    };
    var exports = {}, Op = Object.prototype, hasOwn5 = Op.hasOwnProperty, defineProperty3 = Object.defineProperty || function(obj, key, desc) {
      obj[key] = desc.value;
    }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
    function define(obj, key, value) {
      return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }), obj[key];
    }
    try {
      define({}, "");
    } catch (err) {
      define = function define2(obj, key, value) {
        return obj[key] = value;
      };
    }
    function wrap(innerFn, outerFn, self2, tryLocsList) {
      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []);
      return defineProperty3(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) }), generator;
    }
    function tryCatch(fn, obj, arg) {
      try {
        return { type: "normal", arg: fn.call(obj, arg) };
      } catch (err) {
        return { type: "throw", arg: err };
      }
    }
    exports.wrap = wrap;
    var ContinueSentinel = {};
    function Generator() {
    }
    function GeneratorFunction() {
    }
    function GeneratorFunctionPrototype() {
    }
    var IteratorPrototype = {};
    define(IteratorPrototype, iteratorSymbol, function() {
      return this;
    });
    var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values2([])));
    NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn5.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
    var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
    function defineIteratorMethods(prototype) {
      ["next", "throw", "return"].forEach(function(method) {
        define(prototype, method, function(arg) {
          return this._invoke(method, arg);
        });
      });
    }
    function AsyncIterator(generator, PromiseImpl) {
      function invoke(method, arg, resolve, reject) {
        var record = tryCatch(generator[method], generator, arg);
        if ("throw" !== record.type) {
          var result = record.arg, value = result.value;
          return value && "object" == _typeof44(value) && hasOwn5.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
            invoke("next", value2, resolve, reject);
          }, function(err) {
            invoke("throw", err, resolve, reject);
          }) : PromiseImpl.resolve(value).then(function(unwrapped) {
            result.value = unwrapped, resolve(result);
          }, function(error) {
            return invoke("throw", error, resolve, reject);
          });
        }
        reject(record.arg);
      }
      var previousPromise;
      defineProperty3(this, "_invoke", { value: function value(method, arg) {
        function callInvokeWithMethodAndArg() {
          return new PromiseImpl(function(resolve, reject) {
            invoke(method, arg, resolve, reject);
          });
        }
        return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
      } });
    }
    function makeInvokeMethod(innerFn, self2, context) {
      var state = "suspendedStart";
      return function(method, arg) {
        if ("executing" === state)
          throw new Error("Generator is already running");
        if ("completed" === state) {
          if ("throw" === method)
            throw arg;
          return doneResult();
        }
        for (context.method = method, context.arg = arg; ; ) {
          var delegate = context.delegate;
          if (delegate) {
            var delegateResult = maybeInvokeDelegate(delegate, context);
            if (delegateResult) {
              if (delegateResult === ContinueSentinel)
                continue;
              return delegateResult;
            }
          }
          if ("next" === context.method)
            context.sent = context._sent = context.arg;
          else if ("throw" === context.method) {
            if ("suspendedStart" === state)
              throw state = "completed", context.arg;
            context.dispatchException(context.arg);
          } else
            "return" === context.method && context.abrupt("return", context.arg);
          state = "executing";
          var record = tryCatch(innerFn, self2, context);
          if ("normal" === record.type) {
            if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel)
              continue;
            return { value: record.arg, done: context.done };
          }
          "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
        }
      };
    }
    function maybeInvokeDelegate(delegate, context) {
      var methodName = context.method, method = delegate.iterator[methodName];
      if (void 0 === method)
        return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
      var record = tryCatch(method, delegate.iterator, context.arg);
      if ("throw" === record.type)
        return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
      var info = record.arg;
      return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
    }
    function pushTryEntry(locs) {
      var entry = { tryLoc: locs[0] };
      1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
    }
    function resetTryEntry(entry) {
      var record = entry.completion || {};
      record.type = "normal", delete record.arg, entry.completion = record;
    }
    function Context(tryLocsList) {
      this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(true);
    }
    function values2(iterable) {
      if (iterable) {
        var iteratorMethod = iterable[iteratorSymbol];
        if (iteratorMethod)
          return iteratorMethod.call(iterable);
        if ("function" == typeof iterable.next)
          return iterable;
        if (!isNaN(iterable.length)) {
          var i5 = -1, next2 = function next3() {
            for (; ++i5 < iterable.length; )
              if (hasOwn5.call(iterable, i5))
                return next3.value = iterable[i5], next3.done = false, next3;
            return next3.value = void 0, next3.done = true, next3;
          };
          return next2.next = next2;
        }
      }
      return { next: doneResult };
    }
    function doneResult() {
      return { value: void 0, done: true };
    }
    return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty3(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }), defineProperty3(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) {
      var ctor = "function" == typeof genFun && genFun.constructor;
      return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
    }, exports.mark = function(genFun) {
      return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
    }, exports.awrap = function(arg) {
      return { __await: arg };
    }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
      return this;
    }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
      void 0 === PromiseImpl && (PromiseImpl = Promise);
      var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl);
      return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
        return result.done ? result.value : iter.next();
      });
    }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() {
      return this;
    }), define(Gp, "toString", function() {
      return "[object Generator]";
    }), exports.keys = function(val) {
      var object = Object(val), keys2 = [];
      for (var key in object)
        keys2.push(key);
      return keys2.reverse(), function next2() {
        for (; keys2.length; ) {
          var key2 = keys2.pop();
          if (key2 in object)
            return next2.value = key2, next2.done = false, next2;
        }
        return next2.done = true, next2;
      };
    }, exports.values = values2, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) {
      if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
        for (var name in this)
          "t" === name.charAt(0) && hasOwn5.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
    }, stop: function stop() {
      this.done = true;
      var rootRecord = this.tryEntries[0].completion;
      if ("throw" === rootRecord.type)
        throw rootRecord.arg;
      return this.rval;
    }, dispatchException: function dispatchException(exception) {
      if (this.done)
        throw exception;
      var context = this;
      function handle(loc, caught) {
        return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;
      }
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5], record = entry.completion;
        if ("root" === entry.tryLoc)
          return handle("end");
        if (entry.tryLoc <= this.prev) {
          var hasCatch = hasOwn5.call(entry, "catchLoc"), hasFinally = hasOwn5.call(entry, "finallyLoc");
          if (hasCatch && hasFinally) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          } else if (hasCatch) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
          } else {
            if (!hasFinally)
              throw new Error("try statement without catch or finally");
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          }
        }
      }
    }, abrupt: function abrupt(type, arg) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc <= this.prev && hasOwn5.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
          var finallyEntry = entry;
          break;
        }
      }
      finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
      var record = finallyEntry ? finallyEntry.completion : {};
      return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
    }, complete: function complete(record, afterLoc) {
      if ("throw" === record.type)
        throw record.arg;
      return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
    }, finish: function finish(finallyLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.finallyLoc === finallyLoc)
          return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
      }
    }, catch: function _catch(tryLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc === tryLoc) {
          var record = entry.completion;
          if ("throw" === record.type) {
            var thrown = record.arg;
            resetTryEntry(entry);
          }
          return thrown;
        }
      }
      throw new Error("illegal catch attempt");
    }, delegateYield: function delegateYield(iterable, resultName, nextLoc) {
      return this.delegate = { iterator: values2(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = void 0), ContinueSentinel;
    } }, exports;
  }
  function asyncGeneratorStep7(gen, resolve, reject, _next, _throw, key, arg) {
    try {
      var info = gen[key](arg);
      var value = info.value;
    } catch (error) {
      reject(error);
      return;
    }
    if (info.done) {
      resolve(value);
    } else {
      Promise.resolve(value).then(_next, _throw);
    }
  }
  function _asyncToGenerator7(fn) {
    return function() {
      var self2 = this, args = arguments;
      return new Promise(function(resolve, reject) {
        var gen = fn.apply(self2, args);
        function _next(value) {
          asyncGeneratorStep7(gen, resolve, reject, _next, _throw, "next", value);
        }
        function _throw(err) {
          asyncGeneratorStep7(gen, resolve, reject, _next, _throw, "throw", err);
        }
        _next(void 0);
      });
    };
  }
  function _classCallCheck40(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties40(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey42(descriptor.key), descriptor);
    }
  }
  function _createClass40(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties40(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties40(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _defineProperty19(obj, key, value) {
    key = _toPropertyKey42(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey42(arg) {
    var key = _toPrimitive42(arg, "string");
    return _typeof44(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive42(input, hint) {
    if (_typeof44(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof44(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  var OutputBindingAdapter = /* @__PURE__ */ function() {
    function OutputBindingAdapter2(el, binding) {
      _classCallCheck40(this, OutputBindingAdapter2);
      _defineProperty19(this, "el", void 0);
      _defineProperty19(this, "binding", void 0);
      this.el = el;
      this.binding = binding;
      if (binding.resize) {
        this.onResize = makeResizeFilter(el, function(width, height) {
          binding.resize(el, width, height);
        });
      }
    }
    _createClass40(OutputBindingAdapter2, [{
      key: "getId",
      value: function getId() {
        return this.binding.getId(this.el);
      }
    }, {
      key: "onValueChange",
      value: function() {
        var _onValueChange = _asyncToGenerator7(/* @__PURE__ */ _regeneratorRuntime7().mark(function _callee(data) {
          return _regeneratorRuntime7().wrap(function _callee$(_context) {
            while (1)
              switch (_context.prev = _context.next) {
                case 0:
                  _context.next = 2;
                  return this.binding.onValueChange(this.el, data);
                case 2:
                case "end":
                  return _context.stop();
              }
          }, _callee, this);
        }));
        function onValueChange(_x) {
          return _onValueChange.apply(this, arguments);
        }
        return onValueChange;
      }()
    }, {
      key: "onValueError",
      value: function onValueError(err) {
        this.binding.onValueError(this.el, err);
      }
    }, {
      key: "showProgress",
      value: function showProgress(show3) {
        this.binding.showProgress(this.el, show3);
      }
    }, {
      key: "onResize",
      value: function onResize() {
      }
    }]);
    return OutputBindingAdapter2;
  }();

  // srcts/src/shiny/bind.ts
  function _typeof45(obj) {
    "@babel/helpers - typeof";
    return _typeof45 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof45(obj);
  }
  function _regeneratorRuntime8() {
    "use strict";
    _regeneratorRuntime8 = function _regeneratorRuntime15() {
      return exports;
    };
    var exports = {}, Op = Object.prototype, hasOwn5 = Op.hasOwnProperty, defineProperty3 = Object.defineProperty || function(obj, key, desc) {
      obj[key] = desc.value;
    }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
    function define(obj, key, value) {
      return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }), obj[key];
    }
    try {
      define({}, "");
    } catch (err) {
      define = function define2(obj, key, value) {
        return obj[key] = value;
      };
    }
    function wrap(innerFn, outerFn, self2, tryLocsList) {
      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []);
      return defineProperty3(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) }), generator;
    }
    function tryCatch(fn, obj, arg) {
      try {
        return { type: "normal", arg: fn.call(obj, arg) };
      } catch (err) {
        return { type: "throw", arg: err };
      }
    }
    exports.wrap = wrap;
    var ContinueSentinel = {};
    function Generator() {
    }
    function GeneratorFunction() {
    }
    function GeneratorFunctionPrototype() {
    }
    var IteratorPrototype = {};
    define(IteratorPrototype, iteratorSymbol, function() {
      return this;
    });
    var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values2([])));
    NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn5.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
    var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
    function defineIteratorMethods(prototype) {
      ["next", "throw", "return"].forEach(function(method) {
        define(prototype, method, function(arg) {
          return this._invoke(method, arg);
        });
      });
    }
    function AsyncIterator(generator, PromiseImpl) {
      function invoke(method, arg, resolve, reject) {
        var record = tryCatch(generator[method], generator, arg);
        if ("throw" !== record.type) {
          var result = record.arg, value = result.value;
          return value && "object" == _typeof45(value) && hasOwn5.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
            invoke("next", value2, resolve, reject);
          }, function(err) {
            invoke("throw", err, resolve, reject);
          }) : PromiseImpl.resolve(value).then(function(unwrapped) {
            result.value = unwrapped, resolve(result);
          }, function(error) {
            return invoke("throw", error, resolve, reject);
          });
        }
        reject(record.arg);
      }
      var previousPromise;
      defineProperty3(this, "_invoke", { value: function value(method, arg) {
        function callInvokeWithMethodAndArg() {
          return new PromiseImpl(function(resolve, reject) {
            invoke(method, arg, resolve, reject);
          });
        }
        return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
      } });
    }
    function makeInvokeMethod(innerFn, self2, context) {
      var state = "suspendedStart";
      return function(method, arg) {
        if ("executing" === state)
          throw new Error("Generator is already running");
        if ("completed" === state) {
          if ("throw" === method)
            throw arg;
          return doneResult();
        }
        for (context.method = method, context.arg = arg; ; ) {
          var delegate = context.delegate;
          if (delegate) {
            var delegateResult = maybeInvokeDelegate(delegate, context);
            if (delegateResult) {
              if (delegateResult === ContinueSentinel)
                continue;
              return delegateResult;
            }
          }
          if ("next" === context.method)
            context.sent = context._sent = context.arg;
          else if ("throw" === context.method) {
            if ("suspendedStart" === state)
              throw state = "completed", context.arg;
            context.dispatchException(context.arg);
          } else
            "return" === context.method && context.abrupt("return", context.arg);
          state = "executing";
          var record = tryCatch(innerFn, self2, context);
          if ("normal" === record.type) {
            if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel)
              continue;
            return { value: record.arg, done: context.done };
          }
          "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
        }
      };
    }
    function maybeInvokeDelegate(delegate, context) {
      var methodName = context.method, method = delegate.iterator[methodName];
      if (void 0 === method)
        return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
      var record = tryCatch(method, delegate.iterator, context.arg);
      if ("throw" === record.type)
        return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
      var info = record.arg;
      return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
    }
    function pushTryEntry(locs) {
      var entry = { tryLoc: locs[0] };
      1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
    }
    function resetTryEntry(entry) {
      var record = entry.completion || {};
      record.type = "normal", delete record.arg, entry.completion = record;
    }
    function Context(tryLocsList) {
      this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(true);
    }
    function values2(iterable) {
      if (iterable) {
        var iteratorMethod = iterable[iteratorSymbol];
        if (iteratorMethod)
          return iteratorMethod.call(iterable);
        if ("function" == typeof iterable.next)
          return iterable;
        if (!isNaN(iterable.length)) {
          var i5 = -1, next2 = function next3() {
            for (; ++i5 < iterable.length; )
              if (hasOwn5.call(iterable, i5))
                return next3.value = iterable[i5], next3.done = false, next3;
            return next3.value = void 0, next3.done = true, next3;
          };
          return next2.next = next2;
        }
      }
      return { next: doneResult };
    }
    function doneResult() {
      return { value: void 0, done: true };
    }
    return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty3(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }), defineProperty3(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) {
      var ctor = "function" == typeof genFun && genFun.constructor;
      return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
    }, exports.mark = function(genFun) {
      return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
    }, exports.awrap = function(arg) {
      return { __await: arg };
    }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
      return this;
    }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
      void 0 === PromiseImpl && (PromiseImpl = Promise);
      var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl);
      return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
        return result.done ? result.value : iter.next();
      });
    }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() {
      return this;
    }), define(Gp, "toString", function() {
      return "[object Generator]";
    }), exports.keys = function(val) {
      var object = Object(val), keys2 = [];
      for (var key in object)
        keys2.push(key);
      return keys2.reverse(), function next2() {
        for (; keys2.length; ) {
          var key2 = keys2.pop();
          if (key2 in object)
            return next2.value = key2, next2.done = false, next2;
        }
        return next2.done = true, next2;
      };
    }, exports.values = values2, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) {
      if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
        for (var name in this)
          "t" === name.charAt(0) && hasOwn5.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
    }, stop: function stop() {
      this.done = true;
      var rootRecord = this.tryEntries[0].completion;
      if ("throw" === rootRecord.type)
        throw rootRecord.arg;
      return this.rval;
    }, dispatchException: function dispatchException(exception) {
      if (this.done)
        throw exception;
      var context = this;
      function handle(loc, caught) {
        return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;
      }
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5], record = entry.completion;
        if ("root" === entry.tryLoc)
          return handle("end");
        if (entry.tryLoc <= this.prev) {
          var hasCatch = hasOwn5.call(entry, "catchLoc"), hasFinally = hasOwn5.call(entry, "finallyLoc");
          if (hasCatch && hasFinally) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          } else if (hasCatch) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
          } else {
            if (!hasFinally)
              throw new Error("try statement without catch or finally");
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          }
        }
      }
    }, abrupt: function abrupt(type, arg) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc <= this.prev && hasOwn5.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
          var finallyEntry = entry;
          break;
        }
      }
      finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
      var record = finallyEntry ? finallyEntry.completion : {};
      return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
    }, complete: function complete(record, afterLoc) {
      if ("throw" === record.type)
        throw record.arg;
      return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
    }, finish: function finish(finallyLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.finallyLoc === finallyLoc)
          return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
      }
    }, catch: function _catch(tryLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc === tryLoc) {
          var record = entry.completion;
          if ("throw" === record.type) {
            var thrown = record.arg;
            resetTryEntry(entry);
          }
          return thrown;
        }
      }
      throw new Error("illegal catch attempt");
    }, delegateYield: function delegateYield(iterable, resultName, nextLoc) {
      return this.delegate = { iterator: values2(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = void 0), ContinueSentinel;
    } }, exports;
  }
  function asyncGeneratorStep8(gen, resolve, reject, _next, _throw, key, arg) {
    try {
      var info = gen[key](arg);
      var value = info.value;
    } catch (error) {
      reject(error);
      return;
    }
    if (info.done) {
      resolve(value);
    } else {
      Promise.resolve(value).then(_next, _throw);
    }
  }
  function _asyncToGenerator8(fn) {
    return function() {
      var self2 = this, args = arguments;
      return new Promise(function(resolve, reject) {
        var gen = fn.apply(self2, args);
        function _next(value) {
          asyncGeneratorStep8(gen, resolve, reject, _next, _throw, "next", value);
        }
        function _throw(err) {
          asyncGeneratorStep8(gen, resolve, reject, _next, _throw, "throw", err);
        }
        _next(void 0);
      });
    };
  }
  function _slicedToArray4(arr, i5) {
    return _arrayWithHoles4(arr) || _iterableToArrayLimit4(arr, i5) || _unsupportedIterableToArray5(arr, i5) || _nonIterableRest4();
  }
  function _nonIterableRest4() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray5(o4, minLen) {
    if (!o4)
      return;
    if (typeof o4 === "string")
      return _arrayLikeToArray5(o4, minLen);
    var n4 = Object.prototype.toString.call(o4).slice(8, -1);
    if (n4 === "Object" && o4.constructor)
      n4 = o4.constructor.name;
    if (n4 === "Map" || n4 === "Set")
      return Array.from(o4);
    if (n4 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n4))
      return _arrayLikeToArray5(o4, minLen);
  }
  function _arrayLikeToArray5(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i5 = 0, arr2 = new Array(len); i5 < len; i5++)
      arr2[i5] = arr[i5];
    return arr2;
  }
  function _iterableToArrayLimit4(arr, i5) {
    var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
    if (null != _i) {
      var _s, _e, _x, _r, _arr = [], _n = true, _d = false;
      try {
        if (_x = (_i = _i.call(arr)).next, 0 === i5) {
          if (Object(_i) !== _i)
            return;
          _n = false;
        } else
          for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i5); _n = true)
            ;
      } catch (err) {
        _d = true, _e = err;
      } finally {
        try {
          if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r))
            return;
        } finally {
          if (_d)
            throw _e;
        }
      }
      return _arr;
    }
  }
  function _arrayWithHoles4(arr) {
    if (Array.isArray(arr))
      return arr;
  }
  function valueChangeCallback(inputs, binding, el, allowDeferred) {
    var id = binding.getId(el);
    if (id) {
      var value = binding.getValue(el);
      var type = binding.getType(el);
      if (type)
        id = id + ":" + type;
      var opts = {
        priority: allowDeferred ? "deferred" : "immediate",
        binding: binding,
        el: el
      };
      inputs.setInput(id, value, opts);
    }
  }
  var bindingsRegistry = function() {
    var bindings = /* @__PURE__ */ new Map();
    function checkValidity(scope) {
      var duplicateIds = /* @__PURE__ */ new Map();
      var problems = /* @__PURE__ */ new Set();
      bindings.forEach(function(idTypes, id) {
        var counts = {
          input: 0,
          output: 0
        };
        idTypes.forEach(function(type) {
          return counts[type] += 1;
        });
        if (counts.input + counts.output < 2) {
          return;
        }
        duplicateIds.set(id, counts);
        if (counts.input > 1) {
          problems.add("input");
        }
        if (counts.output > 1) {
          problems.add("output");
        }
        if (counts.input >= 1 && counts.output >= 1) {
          problems.add("shared");
        }
      });
      if (duplicateIds.size === 0)
        return;
      var duplicateIdMsg = Array.from(duplicateIds.entries()).map(function(_ref) {
        var _ref2 = _slicedToArray4(_ref, 2), id = _ref2[0], counts = _ref2[1];
        var messages = [pluralize(counts.input, "input"), pluralize(counts.output, "output")].filter(function(msg) {
          return msg !== "";
        }).join(" and ");
        return '- "'.concat(id, '": ').concat(messages);
      }).join("\n");
      var txtVerb = "Duplicate";
      var txtNoun = "input/output";
      if (problems.has("input") && problems.has("output")) {
      } else if (problems.has("input")) {
        txtNoun = "input";
      } else if (problems.has("output")) {
        txtNoun = "output";
      } else if (problems.has("shared")) {
        txtVerb = "Shared";
      }
      var txtIdsWere = duplicateIds.size == 1 ? "ID was" : "IDs were";
      var headline = "".concat(txtVerb, " ").concat(txtNoun, " ").concat(txtIdsWere, " found");
      var message = "The following ".concat(txtIdsWere, " used for more than one ").concat(problems.has("shared") ? "input/output" : txtNoun, ":\n").concat(duplicateIdMsg);
      var event = new ShinyClientMessageEvent({
        headline: headline,
        message: message
      });
      var scopeElement = scope instanceof HTMLElement ? scope : scope.get(0);
      (scopeElement || window).dispatchEvent(event);
    }
    function addBinding(id, bindingType) {
      var existingBinding = bindings.get(id);
      if (existingBinding) {
        existingBinding.push(bindingType);
      } else {
        bindings.set(id, [bindingType]);
      }
    }
    function removeBinding(id, bindingType) {
      var existingBinding = bindings.get(id);
      if (existingBinding) {
        var index = existingBinding.indexOf(bindingType);
        if (index > -1) {
          existingBinding.splice(index, 1);
        }
      }
      if ((existingBinding === null || existingBinding === void 0 ? void 0 : existingBinding.length) === 0) {
        bindings.delete(id);
      }
    }
    return {
      addBinding: addBinding,
      removeBinding: removeBinding,
      checkValidity: checkValidity
    };
  }();
  function pluralize(num, word) {
    if (num === 0)
      return "";
    if (num === 1)
      return "".concat(num, " ").concat(word);
    return "".concat(num, " ").concat(word, "s");
  }
  function bindInputs(shinyCtx) {
    var scope = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : document.documentElement;
    var inputs = shinyCtx.inputs, inputsRate = shinyCtx.inputsRate, inputBindings = shinyCtx.inputBindings;
    var bindings = inputBindings.getBindings();
    var inputItems = {};
    var _loop = function _loop2() {
      var binding = bindings[i5].binding;
      var matches = binding.find(scope) || [];
      var _loop22 = function _loop23() {
        var el = matches[j3];
        if (el.hasAttribute("data-shiny-no-bind-input"))
          return "continue";
        var id = binding.getId(el);
        if (!id || (0, import_jquery34.default)(el).hasClass("shiny-bound-input"))
          return "continue";
        var type = binding.getType(el);
        var effectiveId = type ? id + ":" + type : id;
        inputItems[effectiveId] = {
          value: binding.getValue(el),
          opts: {
            immediate: true,
            binding: binding,
            el: el
          }
        };
        var thisCallback = function() {
          var thisBinding = binding;
          var thisEl = el;
          return function(allowDeferred) {
            valueChangeCallback(inputs, thisBinding, thisEl, allowDeferred);
          };
        }();
        binding.subscribe(el, thisCallback);
        (0, import_jquery34.default)(el).data("shiny-input-binding", binding);
        (0, import_jquery34.default)(el).addClass("shiny-bound-input");
        var ratePolicy = binding.getRatePolicy(el);
        if (ratePolicy !== null) {
          inputsRate.setRatePolicy(effectiveId, ratePolicy.policy, ratePolicy.delay);
        }
        bindingsRegistry.addBinding(id, "input");
        (0, import_jquery34.default)(el).trigger({
          type: "shiny:bound",
          binding: binding,
          bindingType: "input"
        });
      };
      for (var j3 = 0; j3 < matches.length; j3++) {
        var _ret = _loop22();
        if (_ret === "continue")
          continue;
      }
    };
    for (var i5 = 0; i5 < bindings.length; i5++) {
      _loop();
    }
    return inputItems;
  }
  function bindOutputs(_x2) {
    return _bindOutputs.apply(this, arguments);
  }
  function _bindOutputs() {
    _bindOutputs = _asyncToGenerator8(/* @__PURE__ */ _regeneratorRuntime8().mark(function _callee(_ref3) {
      var sendOutputHiddenState, maybeAddThemeObserver, outputBindings, scope, $scope, bindings, i5, binding, matches, j3, _Shiny$shinyapp, _el2, id, $el, bindingAdapter, _args = arguments;
      return _regeneratorRuntime8().wrap(function _callee$(_context) {
        while (1)
          switch (_context.prev = _context.next) {
            case 0:
              sendOutputHiddenState = _ref3.sendOutputHiddenState, maybeAddThemeObserver = _ref3.maybeAddThemeObserver, outputBindings = _ref3.outputBindings;
              scope = _args.length > 1 && _args[1] !== void 0 ? _args[1] : document.documentElement;
              $scope = (0, import_jquery34.default)(scope);
              bindings = outputBindings.getBindings();
              i5 = 0;
            case 5:
              if (!(i5 < bindings.length)) {
                _context.next = 35;
                break;
              }
              binding = bindings[i5].binding;
              matches = binding.find($scope) || [];
              j3 = 0;
            case 9:
              if (!(j3 < matches.length)) {
                _context.next = 32;
                break;
              }
              _el2 = matches[j3];
              id = binding.getId(_el2);
              if (id) {
                _context.next = 14;
                break;
              }
              return _context.abrupt("continue", 29);
            case 14:
              if (import_jquery34.default.contains(document.documentElement, _el2)) {
                _context.next = 16;
                break;
              }
              return _context.abrupt("continue", 29);
            case 16:
              $el = (0, import_jquery34.default)(_el2);
              if (!$el.hasClass("shiny-bound-output")) {
                _context.next = 19;
                break;
              }
              return _context.abrupt("continue", 29);
            case 19:
              maybeAddThemeObserver(_el2);
              bindingAdapter = new OutputBindingAdapter(_el2, binding);
              _context.next = 23;
              return shinyAppBindOutput(id, bindingAdapter);
            case 23:
              $el.data("shiny-output-binding", bindingAdapter);
              $el.addClass("shiny-bound-output");
              if (!$el.attr("aria-live"))
                $el.attr("aria-live", "polite");
              if ((_Shiny$shinyapp = Shiny.shinyapp) !== null && _Shiny$shinyapp !== void 0 && _Shiny$shinyapp.$outputProgress.isRecalculating(id)) {
                bindingAdapter.showProgress(true);
              }
              bindingsRegistry.addBinding(id, "output");
              $el.trigger({
                type: "shiny:bound",
                binding: binding,
                bindingType: "output"
              });
            case 29:
              j3++;
              _context.next = 9;
              break;
            case 32:
              i5++;
              _context.next = 5;
              break;
            case 35:
              setTimeout(sendImageSizeFns.regular, 0);
              setTimeout(sendOutputHiddenState, 0);
            case 37:
            case "end":
              return _context.stop();
          }
      }, _callee);
    }));
    return _bindOutputs.apply(this, arguments);
  }
  function unbindInputs() {
    var scope = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document.documentElement;
    var includeSelf = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
    var inputs = (0, import_jquery34.default)(scope).find(".shiny-bound-input").toArray();
    if (includeSelf && (0, import_jquery34.default)(scope).hasClass("shiny-bound-input")) {
      inputs.push(scope);
    }
    for (var i5 = 0; i5 < inputs.length; i5++) {
      var _el = inputs[i5];
      var binding = (0, import_jquery34.default)(_el).data("shiny-input-binding");
      if (!binding)
        continue;
      var id = binding.getId(_el);
      (0, import_jquery34.default)(_el).removeClass("shiny-bound-input");
      bindingsRegistry.removeBinding(id, "input");
      binding.unsubscribe(_el);
      (0, import_jquery34.default)(_el).trigger({
        type: "shiny:unbound",
        binding: binding,
        bindingType: "input"
      });
    }
  }
  function unbindOutputs(_ref4) {
    var sendOutputHiddenState = _ref4.sendOutputHiddenState;
    var scope = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : document.documentElement;
    var includeSelf = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
    var outputs = (0, import_jquery34.default)(scope).find(".shiny-bound-output").toArray();
    if (includeSelf && (0, import_jquery34.default)(scope).hasClass("shiny-bound-output")) {
      outputs.push(scope);
    }
    for (var i5 = 0; i5 < outputs.length; i5++) {
      var $el = (0, import_jquery34.default)(outputs[i5]);
      var bindingAdapter = $el.data("shiny-output-binding");
      if (!bindingAdapter)
        continue;
      var id = bindingAdapter.binding.getId(outputs[i5]);
      shinyAppUnbindOutput(id, bindingAdapter);
      bindingsRegistry.removeBinding(id, "output");
      $el.removeClass("shiny-bound-output");
      $el.removeData("shiny-output-binding");
      $el.trigger({
        type: "shiny:unbound",
        binding: bindingAdapter.binding,
        bindingType: "output"
      });
    }
    setTimeout(sendImageSizeFns.regular, 0);
    setTimeout(sendOutputHiddenState, 0);
  }
  function _bindAll(_x3, _x4) {
    return _bindAll2.apply(this, arguments);
  }
  function _bindAll2() {
    _bindAll2 = _asyncToGenerator8(/* @__PURE__ */ _regeneratorRuntime8().mark(function _callee2(shinyCtx, scope) {
      var currentInputs;
      return _regeneratorRuntime8().wrap(function _callee2$(_context2) {
        while (1)
          switch (_context2.prev = _context2.next) {
            case 0:
              _context2.next = 2;
              return bindOutputs(shinyCtx, scope);
            case 2:
              currentInputs = bindInputs(shinyCtx, scope);
              bindingsRegistry.checkValidity(scope);
              return _context2.abrupt("return", currentInputs);
            case 5:
            case "end":
              return _context2.stop();
          }
      }, _callee2);
    }));
    return _bindAll2.apply(this, arguments);
  }
  function unbindAll(shinyCtx, scope) {
    var includeSelf = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
    unbindInputs(scope, includeSelf);
    unbindOutputs(shinyCtx, scope, includeSelf);
  }
  function bindAll(_x5, _x6) {
    return _bindAll3.apply(this, arguments);
  }
  function _bindAll3() {
    _bindAll3 = _asyncToGenerator8(/* @__PURE__ */ _regeneratorRuntime8().mark(function _callee3(shinyCtx, scope) {
      var currentInputItems, inputs;
      return _regeneratorRuntime8().wrap(function _callee3$(_context3) {
        while (1)
          switch (_context3.prev = _context3.next) {
            case 0:
              _context3.next = 2;
              return _bindAll(shinyCtx, scope);
            case 2:
              currentInputItems = _context3.sent;
              inputs = shinyCtx.inputs;
              import_jquery34.default.each(currentInputItems, function(name, item) {
                inputs.setInput(name, item.value, item.opts);
              });
              shinyCtx.initDeferredIframes();
            case 6:
            case "end":
              return _context3.stop();
          }
      }, _callee3);
    }));
    return _bindAll3.apply(this, arguments);
  }

  // srcts/src/shiny/modal.ts
  var import_es_array_iterator46 = __toESM(require_es_array_iterator());
  var import_jquery35 = __toESM(require_jquery());
  function _typeof46(obj) {
    "@babel/helpers - typeof";
    return _typeof46 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof46(obj);
  }
  function _regeneratorRuntime9() {
    "use strict";
    _regeneratorRuntime9 = function _regeneratorRuntime15() {
      return exports;
    };
    var exports = {}, Op = Object.prototype, hasOwn5 = Op.hasOwnProperty, defineProperty3 = Object.defineProperty || function(obj, key, desc) {
      obj[key] = desc.value;
    }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
    function define(obj, key, value) {
      return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }), obj[key];
    }
    try {
      define({}, "");
    } catch (err) {
      define = function define2(obj, key, value) {
        return obj[key] = value;
      };
    }
    function wrap(innerFn, outerFn, self2, tryLocsList) {
      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []);
      return defineProperty3(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) }), generator;
    }
    function tryCatch(fn, obj, arg) {
      try {
        return { type: "normal", arg: fn.call(obj, arg) };
      } catch (err) {
        return { type: "throw", arg: err };
      }
    }
    exports.wrap = wrap;
    var ContinueSentinel = {};
    function Generator() {
    }
    function GeneratorFunction() {
    }
    function GeneratorFunctionPrototype() {
    }
    var IteratorPrototype = {};
    define(IteratorPrototype, iteratorSymbol, function() {
      return this;
    });
    var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values2([])));
    NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn5.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
    var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
    function defineIteratorMethods(prototype) {
      ["next", "throw", "return"].forEach(function(method) {
        define(prototype, method, function(arg) {
          return this._invoke(method, arg);
        });
      });
    }
    function AsyncIterator(generator, PromiseImpl) {
      function invoke(method, arg, resolve, reject) {
        var record = tryCatch(generator[method], generator, arg);
        if ("throw" !== record.type) {
          var result = record.arg, value = result.value;
          return value && "object" == _typeof46(value) && hasOwn5.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
            invoke("next", value2, resolve, reject);
          }, function(err) {
            invoke("throw", err, resolve, reject);
          }) : PromiseImpl.resolve(value).then(function(unwrapped) {
            result.value = unwrapped, resolve(result);
          }, function(error) {
            return invoke("throw", error, resolve, reject);
          });
        }
        reject(record.arg);
      }
      var previousPromise;
      defineProperty3(this, "_invoke", { value: function value(method, arg) {
        function callInvokeWithMethodAndArg() {
          return new PromiseImpl(function(resolve, reject) {
            invoke(method, arg, resolve, reject);
          });
        }
        return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
      } });
    }
    function makeInvokeMethod(innerFn, self2, context) {
      var state = "suspendedStart";
      return function(method, arg) {
        if ("executing" === state)
          throw new Error("Generator is already running");
        if ("completed" === state) {
          if ("throw" === method)
            throw arg;
          return doneResult();
        }
        for (context.method = method, context.arg = arg; ; ) {
          var delegate = context.delegate;
          if (delegate) {
            var delegateResult = maybeInvokeDelegate(delegate, context);
            if (delegateResult) {
              if (delegateResult === ContinueSentinel)
                continue;
              return delegateResult;
            }
          }
          if ("next" === context.method)
            context.sent = context._sent = context.arg;
          else if ("throw" === context.method) {
            if ("suspendedStart" === state)
              throw state = "completed", context.arg;
            context.dispatchException(context.arg);
          } else
            "return" === context.method && context.abrupt("return", context.arg);
          state = "executing";
          var record = tryCatch(innerFn, self2, context);
          if ("normal" === record.type) {
            if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel)
              continue;
            return { value: record.arg, done: context.done };
          }
          "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
        }
      };
    }
    function maybeInvokeDelegate(delegate, context) {
      var methodName = context.method, method = delegate.iterator[methodName];
      if (void 0 === method)
        return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
      var record = tryCatch(method, delegate.iterator, context.arg);
      if ("throw" === record.type)
        return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
      var info = record.arg;
      return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
    }
    function pushTryEntry(locs) {
      var entry = { tryLoc: locs[0] };
      1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
    }
    function resetTryEntry(entry) {
      var record = entry.completion || {};
      record.type = "normal", delete record.arg, entry.completion = record;
    }
    function Context(tryLocsList) {
      this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(true);
    }
    function values2(iterable) {
      if (iterable) {
        var iteratorMethod = iterable[iteratorSymbol];
        if (iteratorMethod)
          return iteratorMethod.call(iterable);
        if ("function" == typeof iterable.next)
          return iterable;
        if (!isNaN(iterable.length)) {
          var i5 = -1, next2 = function next3() {
            for (; ++i5 < iterable.length; )
              if (hasOwn5.call(iterable, i5))
                return next3.value = iterable[i5], next3.done = false, next3;
            return next3.value = void 0, next3.done = true, next3;
          };
          return next2.next = next2;
        }
      }
      return { next: doneResult };
    }
    function doneResult() {
      return { value: void 0, done: true };
    }
    return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty3(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }), defineProperty3(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) {
      var ctor = "function" == typeof genFun && genFun.constructor;
      return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
    }, exports.mark = function(genFun) {
      return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
    }, exports.awrap = function(arg) {
      return { __await: arg };
    }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
      return this;
    }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
      void 0 === PromiseImpl && (PromiseImpl = Promise);
      var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl);
      return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
        return result.done ? result.value : iter.next();
      });
    }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() {
      return this;
    }), define(Gp, "toString", function() {
      return "[object Generator]";
    }), exports.keys = function(val) {
      var object = Object(val), keys2 = [];
      for (var key in object)
        keys2.push(key);
      return keys2.reverse(), function next2() {
        for (; keys2.length; ) {
          var key2 = keys2.pop();
          if (key2 in object)
            return next2.value = key2, next2.done = false, next2;
        }
        return next2.done = true, next2;
      };
    }, exports.values = values2, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) {
      if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
        for (var name in this)
          "t" === name.charAt(0) && hasOwn5.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
    }, stop: function stop() {
      this.done = true;
      var rootRecord = this.tryEntries[0].completion;
      if ("throw" === rootRecord.type)
        throw rootRecord.arg;
      return this.rval;
    }, dispatchException: function dispatchException(exception) {
      if (this.done)
        throw exception;
      var context = this;
      function handle(loc, caught) {
        return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;
      }
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5], record = entry.completion;
        if ("root" === entry.tryLoc)
          return handle("end");
        if (entry.tryLoc <= this.prev) {
          var hasCatch = hasOwn5.call(entry, "catchLoc"), hasFinally = hasOwn5.call(entry, "finallyLoc");
          if (hasCatch && hasFinally) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          } else if (hasCatch) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
          } else {
            if (!hasFinally)
              throw new Error("try statement without catch or finally");
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          }
        }
      }
    }, abrupt: function abrupt(type, arg) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc <= this.prev && hasOwn5.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
          var finallyEntry = entry;
          break;
        }
      }
      finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
      var record = finallyEntry ? finallyEntry.completion : {};
      return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
    }, complete: function complete(record, afterLoc) {
      if ("throw" === record.type)
        throw record.arg;
      return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
    }, finish: function finish(finallyLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.finallyLoc === finallyLoc)
          return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
      }
    }, catch: function _catch(tryLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc === tryLoc) {
          var record = entry.completion;
          if ("throw" === record.type) {
            var thrown = record.arg;
            resetTryEntry(entry);
          }
          return thrown;
        }
      }
      throw new Error("illegal catch attempt");
    }, delegateYield: function delegateYield(iterable, resultName, nextLoc) {
      return this.delegate = { iterator: values2(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = void 0), ContinueSentinel;
    } }, exports;
  }
  function asyncGeneratorStep9(gen, resolve, reject, _next, _throw, key, arg) {
    try {
      var info = gen[key](arg);
      var value = info.value;
    } catch (error) {
      reject(error);
      return;
    }
    if (info.done) {
      resolve(value);
    } else {
      Promise.resolve(value).then(_next, _throw);
    }
  }
  function _asyncToGenerator9(fn) {
    return function() {
      var self2 = this, args = arguments;
      return new Promise(function(resolve, reject) {
        var gen = fn.apply(self2, args);
        function _next(value) {
          asyncGeneratorStep9(gen, resolve, reject, _next, _throw, "next", value);
        }
        function _throw(err) {
          asyncGeneratorStep9(gen, resolve, reject, _next, _throw, "throw", err);
        }
        _next(void 0);
      });
    };
  }
  function show() {
    return _show.apply(this, arguments);
  }
  function _show() {
    _show = _asyncToGenerator9(/* @__PURE__ */ _regeneratorRuntime9().mark(function _callee() {
      var _ref, _ref$html, html, _ref$deps, deps, $modal, _args = arguments;
      return _regeneratorRuntime9().wrap(function _callee$(_context) {
        while (1)
          switch (_context.prev = _context.next) {
            case 0:
              _ref = _args.length > 0 && _args[0] !== void 0 ? _args[0] : {}, _ref$html = _ref.html, html = _ref$html === void 0 ? "" : _ref$html, _ref$deps = _ref.deps, deps = _ref$deps === void 0 ? [] : _ref$deps;
              _context.next = 3;
              return renderDependenciesAsync(deps);
            case 3:
              (0, import_jquery35.default)(".modal-backdrop").remove();
              $modal = (0, import_jquery35.default)("#shiny-modal-wrapper");
              if ($modal.length === 0) {
                $modal = (0, import_jquery35.default)('<div id="shiny-modal-wrapper"></div>');
                (0, import_jquery35.default)(document.body).append($modal);
                $modal.on("hidden.bs.modal", function(e4) {
                  if (e4.target === (0, import_jquery35.default)("#shiny-modal")[0]) {
                    shinyUnbindAll($modal);
                    $modal.remove();
                  }
                });
              }
              $modal.on("keydown.shinymodal", function(e4) {
                if ((0, import_jquery35.default)("#shiny-modal").data("keyboard") === false)
                  return;
                if (e4.keyCode === 27) {
                  e4.stopPropagation();
                  e4.preventDefault();
                }
              });
              _context.next = 9;
              return renderContentAsync($modal, {
                html: html
              });
            case 9:
            case "end":
              return _context.stop();
          }
      }, _callee);
    }));
    return _show.apply(this, arguments);
  }
  function remove() {
    var $modal = (0, import_jquery35.default)("#shiny-modal-wrapper");
    $modal.off("keydown.shinymodal");
    if ($modal.find(".modal").length > 0) {
      $modal.find(".modal").modal("hide");
    } else {
      shinyUnbindAll($modal);
      $modal.remove();
    }
  }

  // srcts/src/shiny/notifications.ts
  var import_es_regexp_exec14 = __toESM(require_es_regexp_exec());
  var import_es_array_iterator47 = __toESM(require_es_array_iterator());
  var import_jquery36 = __toESM(require_jquery());
  function _typeof47(obj) {
    "@babel/helpers - typeof";
    return _typeof47 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof47(obj);
  }
  function _regeneratorRuntime10() {
    "use strict";
    _regeneratorRuntime10 = function _regeneratorRuntime15() {
      return exports;
    };
    var exports = {}, Op = Object.prototype, hasOwn5 = Op.hasOwnProperty, defineProperty3 = Object.defineProperty || function(obj, key, desc) {
      obj[key] = desc.value;
    }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
    function define(obj, key, value) {
      return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }), obj[key];
    }
    try {
      define({}, "");
    } catch (err) {
      define = function define2(obj, key, value) {
        return obj[key] = value;
      };
    }
    function wrap(innerFn, outerFn, self2, tryLocsList) {
      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []);
      return defineProperty3(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) }), generator;
    }
    function tryCatch(fn, obj, arg) {
      try {
        return { type: "normal", arg: fn.call(obj, arg) };
      } catch (err) {
        return { type: "throw", arg: err };
      }
    }
    exports.wrap = wrap;
    var ContinueSentinel = {};
    function Generator() {
    }
    function GeneratorFunction() {
    }
    function GeneratorFunctionPrototype() {
    }
    var IteratorPrototype = {};
    define(IteratorPrototype, iteratorSymbol, function() {
      return this;
    });
    var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values2([])));
    NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn5.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
    var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
    function defineIteratorMethods(prototype) {
      ["next", "throw", "return"].forEach(function(method) {
        define(prototype, method, function(arg) {
          return this._invoke(method, arg);
        });
      });
    }
    function AsyncIterator(generator, PromiseImpl) {
      function invoke(method, arg, resolve, reject) {
        var record = tryCatch(generator[method], generator, arg);
        if ("throw" !== record.type) {
          var result = record.arg, value = result.value;
          return value && "object" == _typeof47(value) && hasOwn5.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
            invoke("next", value2, resolve, reject);
          }, function(err) {
            invoke("throw", err, resolve, reject);
          }) : PromiseImpl.resolve(value).then(function(unwrapped) {
            result.value = unwrapped, resolve(result);
          }, function(error) {
            return invoke("throw", error, resolve, reject);
          });
        }
        reject(record.arg);
      }
      var previousPromise;
      defineProperty3(this, "_invoke", { value: function value(method, arg) {
        function callInvokeWithMethodAndArg() {
          return new PromiseImpl(function(resolve, reject) {
            invoke(method, arg, resolve, reject);
          });
        }
        return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
      } });
    }
    function makeInvokeMethod(innerFn, self2, context) {
      var state = "suspendedStart";
      return function(method, arg) {
        if ("executing" === state)
          throw new Error("Generator is already running");
        if ("completed" === state) {
          if ("throw" === method)
            throw arg;
          return doneResult();
        }
        for (context.method = method, context.arg = arg; ; ) {
          var delegate = context.delegate;
          if (delegate) {
            var delegateResult = maybeInvokeDelegate(delegate, context);
            if (delegateResult) {
              if (delegateResult === ContinueSentinel)
                continue;
              return delegateResult;
            }
          }
          if ("next" === context.method)
            context.sent = context._sent = context.arg;
          else if ("throw" === context.method) {
            if ("suspendedStart" === state)
              throw state = "completed", context.arg;
            context.dispatchException(context.arg);
          } else
            "return" === context.method && context.abrupt("return", context.arg);
          state = "executing";
          var record = tryCatch(innerFn, self2, context);
          if ("normal" === record.type) {
            if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel)
              continue;
            return { value: record.arg, done: context.done };
          }
          "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
        }
      };
    }
    function maybeInvokeDelegate(delegate, context) {
      var methodName = context.method, method = delegate.iterator[methodName];
      if (void 0 === method)
        return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
      var record = tryCatch(method, delegate.iterator, context.arg);
      if ("throw" === record.type)
        return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
      var info = record.arg;
      return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
    }
    function pushTryEntry(locs) {
      var entry = { tryLoc: locs[0] };
      1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
    }
    function resetTryEntry(entry) {
      var record = entry.completion || {};
      record.type = "normal", delete record.arg, entry.completion = record;
    }
    function Context(tryLocsList) {
      this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(true);
    }
    function values2(iterable) {
      if (iterable) {
        var iteratorMethod = iterable[iteratorSymbol];
        if (iteratorMethod)
          return iteratorMethod.call(iterable);
        if ("function" == typeof iterable.next)
          return iterable;
        if (!isNaN(iterable.length)) {
          var i5 = -1, next2 = function next3() {
            for (; ++i5 < iterable.length; )
              if (hasOwn5.call(iterable, i5))
                return next3.value = iterable[i5], next3.done = false, next3;
            return next3.value = void 0, next3.done = true, next3;
          };
          return next2.next = next2;
        }
      }
      return { next: doneResult };
    }
    function doneResult() {
      return { value: void 0, done: true };
    }
    return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty3(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }), defineProperty3(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) {
      var ctor = "function" == typeof genFun && genFun.constructor;
      return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
    }, exports.mark = function(genFun) {
      return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
    }, exports.awrap = function(arg) {
      return { __await: arg };
    }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
      return this;
    }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
      void 0 === PromiseImpl && (PromiseImpl = Promise);
      var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl);
      return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
        return result.done ? result.value : iter.next();
      });
    }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() {
      return this;
    }), define(Gp, "toString", function() {
      return "[object Generator]";
    }), exports.keys = function(val) {
      var object = Object(val), keys2 = [];
      for (var key in object)
        keys2.push(key);
      return keys2.reverse(), function next2() {
        for (; keys2.length; ) {
          var key2 = keys2.pop();
          if (key2 in object)
            return next2.value = key2, next2.done = false, next2;
        }
        return next2.done = true, next2;
      };
    }, exports.values = values2, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) {
      if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
        for (var name in this)
          "t" === name.charAt(0) && hasOwn5.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
    }, stop: function stop() {
      this.done = true;
      var rootRecord = this.tryEntries[0].completion;
      if ("throw" === rootRecord.type)
        throw rootRecord.arg;
      return this.rval;
    }, dispatchException: function dispatchException(exception) {
      if (this.done)
        throw exception;
      var context = this;
      function handle(loc, caught) {
        return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;
      }
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5], record = entry.completion;
        if ("root" === entry.tryLoc)
          return handle("end");
        if (entry.tryLoc <= this.prev) {
          var hasCatch = hasOwn5.call(entry, "catchLoc"), hasFinally = hasOwn5.call(entry, "finallyLoc");
          if (hasCatch && hasFinally) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          } else if (hasCatch) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
          } else {
            if (!hasFinally)
              throw new Error("try statement without catch or finally");
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          }
        }
      }
    }, abrupt: function abrupt(type, arg) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc <= this.prev && hasOwn5.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
          var finallyEntry = entry;
          break;
        }
      }
      finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
      var record = finallyEntry ? finallyEntry.completion : {};
      return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
    }, complete: function complete(record, afterLoc) {
      if ("throw" === record.type)
        throw record.arg;
      return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
    }, finish: function finish(finallyLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.finallyLoc === finallyLoc)
          return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
      }
    }, catch: function _catch(tryLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc === tryLoc) {
          var record = entry.completion;
          if ("throw" === record.type) {
            var thrown = record.arg;
            resetTryEntry(entry);
          }
          return thrown;
        }
      }
      throw new Error("illegal catch attempt");
    }, delegateYield: function delegateYield(iterable, resultName, nextLoc) {
      return this.delegate = { iterator: values2(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = void 0), ContinueSentinel;
    } }, exports;
  }
  function asyncGeneratorStep10(gen, resolve, reject, _next, _throw, key, arg) {
    try {
      var info = gen[key](arg);
      var value = info.value;
    } catch (error) {
      reject(error);
      return;
    }
    if (info.done) {
      resolve(value);
    } else {
      Promise.resolve(value).then(_next, _throw);
    }
  }
  function _asyncToGenerator10(fn) {
    return function() {
      var self2 = this, args = arguments;
      return new Promise(function(resolve, reject) {
        var gen = fn.apply(self2, args);
        function _next(value) {
          asyncGeneratorStep10(gen, resolve, reject, _next, _throw, "next", value);
        }
        function _throw(err) {
          asyncGeneratorStep10(gen, resolve, reject, _next, _throw, "throw", err);
        }
        _next(void 0);
      });
    };
  }
  var fadeDuration = 250;
  function show2() {
    return _show2.apply(this, arguments);
  }
  function _show2() {
    _show2 = _asyncToGenerator10(/* @__PURE__ */ _regeneratorRuntime10().mark(function _callee() {
      var _$notificationInit;
      var _ref, _ref$html, html, _ref$action, action, _ref$deps, deps, _ref$duration, duration, _ref$id, id, _ref$closeButton, closeButton, _ref$type, type, $notificationInit, $notification, newHtml, $content, classes, classVal, $close, _args = arguments;
      return _regeneratorRuntime10().wrap(function _callee$(_context) {
        while (1)
          switch (_context.prev = _context.next) {
            case 0:
              _ref = _args.length > 0 && _args[0] !== void 0 ? _args[0] : {}, _ref$html = _ref.html, html = _ref$html === void 0 ? "" : _ref$html, _ref$action = _ref.action, action = _ref$action === void 0 ? "" : _ref$action, _ref$deps = _ref.deps, deps = _ref$deps === void 0 ? [] : _ref$deps, _ref$duration = _ref.duration, duration = _ref$duration === void 0 ? 5e3 : _ref$duration, _ref$id = _ref.id, id = _ref$id === void 0 ? null : _ref$id, _ref$closeButton = _ref.closeButton, closeButton = _ref$closeButton === void 0 ? true : _ref$closeButton, _ref$type = _ref.type, type = _ref$type === void 0 ? null : _ref$type;
              if (!id)
                id = randomId();
              _context.next = 4;
              return renderDependenciesAsync(deps);
            case 4:
              createPanel();
              $notificationInit = get2(id);
              if (((_$notificationInit = $notificationInit) === null || _$notificationInit === void 0 ? void 0 : _$notificationInit.length) === 0)
                $notificationInit = create2(id);
              $notification = $notificationInit;
              newHtml = '<div class="shiny-notification-content-text">'.concat(html, "</div>") + '<div class="shiny-notification-content-action">'.concat(action, "</div>");
              $content = $notification.find(".shiny-notification-content");
              _context.next = 12;
              return renderContentAsync($content, {
                html: newHtml
              });
            case 12:
              classes = $notification === null || $notification === void 0 ? void 0 : $notification.attr("class");
              if (classes) {
                classVal = classes.split(/\s+/).filter(function(cls) {
                  return cls.match(/^shiny-notification-/);
                }).join(" ");
                $notification.removeClass(classVal);
              }
              if (type && type !== "default")
                $notification.addClass("shiny-notification-" + type);
              $close = $notification.find(".shiny-notification-close");
              if (closeButton && $close.length === 0) {
                $notification.append('<div class="shiny-notification-close">&times;</div>');
              } else if (!closeButton && $close.length !== 0) {
                $close.remove();
              }
              if (duration)
                addRemovalCallback(id, duration);
              else
                clearRemovalCallback(id);
              return _context.abrupt("return", id);
            case 19:
            case "end":
              return _context.stop();
          }
      }, _callee);
    }));
    return _show2.apply(this, arguments);
  }
  function remove2(id) {
    var _get3;
    (_get3 = get2(id)) === null || _get3 === void 0 ? void 0 : _get3.fadeOut(fadeDuration, function() {
      shinyUnbindAll(this);
      (0, import_jquery36.default)(this).remove();
      if (ids().length === 0) {
        getPanel().remove();
      }
    });
  }
  function get2(id) {
    if (!id)
      return null;
    return getPanel().find("#shiny-notification-" + $escape(id));
  }
  function ids() {
    return getPanel().find(".shiny-notification").map(function() {
      return this.id.replace(/shiny-notification-/, "");
    }).get();
  }
  function getPanel() {
    return (0, import_jquery36.default)("#shiny-notification-panel");
  }
  function createPanel() {
    var $panel = getPanel();
    if ($panel.length > 0)
      return $panel;
    (0, import_jquery36.default)(document.body).append('<div id="shiny-notification-panel">');
    return $panel;
  }
  function create2(id) {
    var _$notification;
    var $notification = get2(id);
    if (((_$notification = $notification) === null || _$notification === void 0 ? void 0 : _$notification.length) === 0) {
      $notification = (0, import_jquery36.default)('<div id="shiny-notification-'.concat(id, '" class="shiny-notification">') + '<div class="shiny-notification-close">&times;</div><div class="shiny-notification-content"></div></div>');
      $notification.find(".shiny-notification-close").on("click", function(e4) {
        e4.preventDefault();
        e4.stopPropagation();
        remove2(id);
      });
      getPanel().append($notification);
    }
    return $notification;
  }
  function addRemovalCallback(id, delay) {
    var _get22;
    clearRemovalCallback(id);
    var removalCallback = setTimeout(function() {
      remove2(id);
    }, delay);
    (_get22 = get2(id)) === null || _get22 === void 0 ? void 0 : _get22.data("removalCallback", removalCallback);
  }
  function clearRemovalCallback(id) {
    var $notification = get2(id);
    var oldRemovalCallback = $notification === null || $notification === void 0 ? void 0 : $notification.data("removalCallback");
    if (oldRemovalCallback) {
      clearTimeout(oldRemovalCallback);
    }
  }

  // srcts/src/shiny/reconnectDialog.ts
  var import_es_array_iterator48 = __toESM(require_es_array_iterator());
  var import_jquery37 = __toESM(require_jquery());
  function _typeof48(obj) {
    "@babel/helpers - typeof";
    return _typeof48 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof48(obj);
  }
  function _regeneratorRuntime11() {
    "use strict";
    _regeneratorRuntime11 = function _regeneratorRuntime15() {
      return exports;
    };
    var exports = {}, Op = Object.prototype, hasOwn5 = Op.hasOwnProperty, defineProperty3 = Object.defineProperty || function(obj, key, desc) {
      obj[key] = desc.value;
    }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
    function define(obj, key, value) {
      return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }), obj[key];
    }
    try {
      define({}, "");
    } catch (err) {
      define = function define2(obj, key, value) {
        return obj[key] = value;
      };
    }
    function wrap(innerFn, outerFn, self2, tryLocsList) {
      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []);
      return defineProperty3(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) }), generator;
    }
    function tryCatch(fn, obj, arg) {
      try {
        return { type: "normal", arg: fn.call(obj, arg) };
      } catch (err) {
        return { type: "throw", arg: err };
      }
    }
    exports.wrap = wrap;
    var ContinueSentinel = {};
    function Generator() {
    }
    function GeneratorFunction() {
    }
    function GeneratorFunctionPrototype() {
    }
    var IteratorPrototype = {};
    define(IteratorPrototype, iteratorSymbol, function() {
      return this;
    });
    var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values2([])));
    NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn5.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
    var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
    function defineIteratorMethods(prototype) {
      ["next", "throw", "return"].forEach(function(method) {
        define(prototype, method, function(arg) {
          return this._invoke(method, arg);
        });
      });
    }
    function AsyncIterator(generator, PromiseImpl) {
      function invoke(method, arg, resolve, reject) {
        var record = tryCatch(generator[method], generator, arg);
        if ("throw" !== record.type) {
          var result = record.arg, value = result.value;
          return value && "object" == _typeof48(value) && hasOwn5.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
            invoke("next", value2, resolve, reject);
          }, function(err) {
            invoke("throw", err, resolve, reject);
          }) : PromiseImpl.resolve(value).then(function(unwrapped) {
            result.value = unwrapped, resolve(result);
          }, function(error) {
            return invoke("throw", error, resolve, reject);
          });
        }
        reject(record.arg);
      }
      var previousPromise;
      defineProperty3(this, "_invoke", { value: function value(method, arg) {
        function callInvokeWithMethodAndArg() {
          return new PromiseImpl(function(resolve, reject) {
            invoke(method, arg, resolve, reject);
          });
        }
        return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
      } });
    }
    function makeInvokeMethod(innerFn, self2, context) {
      var state = "suspendedStart";
      return function(method, arg) {
        if ("executing" === state)
          throw new Error("Generator is already running");
        if ("completed" === state) {
          if ("throw" === method)
            throw arg;
          return doneResult();
        }
        for (context.method = method, context.arg = arg; ; ) {
          var delegate = context.delegate;
          if (delegate) {
            var delegateResult = maybeInvokeDelegate(delegate, context);
            if (delegateResult) {
              if (delegateResult === ContinueSentinel)
                continue;
              return delegateResult;
            }
          }
          if ("next" === context.method)
            context.sent = context._sent = context.arg;
          else if ("throw" === context.method) {
            if ("suspendedStart" === state)
              throw state = "completed", context.arg;
            context.dispatchException(context.arg);
          } else
            "return" === context.method && context.abrupt("return", context.arg);
          state = "executing";
          var record = tryCatch(innerFn, self2, context);
          if ("normal" === record.type) {
            if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel)
              continue;
            return { value: record.arg, done: context.done };
          }
          "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
        }
      };
    }
    function maybeInvokeDelegate(delegate, context) {
      var methodName = context.method, method = delegate.iterator[methodName];
      if (void 0 === method)
        return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
      var record = tryCatch(method, delegate.iterator, context.arg);
      if ("throw" === record.type)
        return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
      var info = record.arg;
      return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
    }
    function pushTryEntry(locs) {
      var entry = { tryLoc: locs[0] };
      1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
    }
    function resetTryEntry(entry) {
      var record = entry.completion || {};
      record.type = "normal", delete record.arg, entry.completion = record;
    }
    function Context(tryLocsList) {
      this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(true);
    }
    function values2(iterable) {
      if (iterable) {
        var iteratorMethod = iterable[iteratorSymbol];
        if (iteratorMethod)
          return iteratorMethod.call(iterable);
        if ("function" == typeof iterable.next)
          return iterable;
        if (!isNaN(iterable.length)) {
          var i5 = -1, next2 = function next3() {
            for (; ++i5 < iterable.length; )
              if (hasOwn5.call(iterable, i5))
                return next3.value = iterable[i5], next3.done = false, next3;
            return next3.value = void 0, next3.done = true, next3;
          };
          return next2.next = next2;
        }
      }
      return { next: doneResult };
    }
    function doneResult() {
      return { value: void 0, done: true };
    }
    return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty3(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }), defineProperty3(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) {
      var ctor = "function" == typeof genFun && genFun.constructor;
      return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
    }, exports.mark = function(genFun) {
      return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
    }, exports.awrap = function(arg) {
      return { __await: arg };
    }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
      return this;
    }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
      void 0 === PromiseImpl && (PromiseImpl = Promise);
      var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl);
      return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
        return result.done ? result.value : iter.next();
      });
    }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() {
      return this;
    }), define(Gp, "toString", function() {
      return "[object Generator]";
    }), exports.keys = function(val) {
      var object = Object(val), keys2 = [];
      for (var key in object)
        keys2.push(key);
      return keys2.reverse(), function next2() {
        for (; keys2.length; ) {
          var key2 = keys2.pop();
          if (key2 in object)
            return next2.value = key2, next2.done = false, next2;
        }
        return next2.done = true, next2;
      };
    }, exports.values = values2, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) {
      if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
        for (var name in this)
          "t" === name.charAt(0) && hasOwn5.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
    }, stop: function stop() {
      this.done = true;
      var rootRecord = this.tryEntries[0].completion;
      if ("throw" === rootRecord.type)
        throw rootRecord.arg;
      return this.rval;
    }, dispatchException: function dispatchException(exception) {
      if (this.done)
        throw exception;
      var context = this;
      function handle(loc, caught) {
        return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;
      }
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5], record = entry.completion;
        if ("root" === entry.tryLoc)
          return handle("end");
        if (entry.tryLoc <= this.prev) {
          var hasCatch = hasOwn5.call(entry, "catchLoc"), hasFinally = hasOwn5.call(entry, "finallyLoc");
          if (hasCatch && hasFinally) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          } else if (hasCatch) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
          } else {
            if (!hasFinally)
              throw new Error("try statement without catch or finally");
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          }
        }
      }
    }, abrupt: function abrupt(type, arg) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc <= this.prev && hasOwn5.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
          var finallyEntry = entry;
          break;
        }
      }
      finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
      var record = finallyEntry ? finallyEntry.completion : {};
      return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
    }, complete: function complete(record, afterLoc) {
      if ("throw" === record.type)
        throw record.arg;
      return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
    }, finish: function finish(finallyLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.finallyLoc === finallyLoc)
          return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
      }
    }, catch: function _catch(tryLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc === tryLoc) {
          var record = entry.completion;
          if ("throw" === record.type) {
            var thrown = record.arg;
            resetTryEntry(entry);
          }
          return thrown;
        }
      }
      throw new Error("illegal catch attempt");
    }, delegateYield: function delegateYield(iterable, resultName, nextLoc) {
      return this.delegate = { iterator: values2(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = void 0), ContinueSentinel;
    } }, exports;
  }
  function asyncGeneratorStep11(gen, resolve, reject, _next, _throw, key, arg) {
    try {
      var info = gen[key](arg);
      var value = info.value;
    } catch (error) {
      reject(error);
      return;
    }
    if (info.done) {
      resolve(value);
    } else {
      Promise.resolve(value).then(_next, _throw);
    }
  }
  function _asyncToGenerator11(fn) {
    return function() {
      var self2 = this, args = arguments;
      return new Promise(function(resolve, reject) {
        var gen = fn.apply(self2, args);
        function _next(value) {
          asyncGeneratorStep11(gen, resolve, reject, _next, _throw, "next", value);
        }
        function _throw(err) {
          asyncGeneratorStep11(gen, resolve, reject, _next, _throw, "throw", err);
        }
        _next(void 0);
      });
    };
  }
  function updateTime(reconnectTime) {
    var $time = (0, import_jquery37.default)("#shiny-reconnect-time");
    if ($time.length === 0)
      return;
    var seconds = Math.floor((reconnectTime - new Date().getTime()) / 1e3);
    if (seconds > 0) {
      $time.text(" in " + seconds + "s");
    } else {
      $time.text("...");
    }
    setTimeout(function() {
      updateTime(reconnectTime);
    }, 1e3);
  }
  function showReconnectDialog(_x) {
    return _showReconnectDialog.apply(this, arguments);
  }
  function _showReconnectDialog() {
    _showReconnectDialog = _asyncToGenerator11(/* @__PURE__ */ _regeneratorRuntime11().mark(function _callee(delay) {
      var reconnectTime, html, action;
      return _regeneratorRuntime11().wrap(function _callee$(_context) {
        while (1)
          switch (_context.prev = _context.next) {
            case 0:
              reconnectTime = new Date().getTime() + delay;
              if (!((0, import_jquery37.default)("#shiny-reconnect-text").length > 0)) {
                _context.next = 3;
                break;
              }
              return _context.abrupt("return");
            case 3:
              html = '<span id="shiny-reconnect-text">Attempting to reconnect</span><span id="shiny-reconnect-time"></span>';
              action = '<a id="shiny-reconnect-now" href="#" onclick="Shiny.shinyapp.reconnect();">Try now</a>';
              _context.next = 7;
              return show2({
                id: "reconnect",
                html: html,
                action: action,
                duration: null,
                closeButton: false,
                type: "warning"
              });
            case 7:
              updateTime(reconnectTime);
            case 8:
            case "end":
              return _context.stop();
          }
      }, _callee);
    }));
    return _showReconnectDialog.apply(this, arguments);
  }
  function hideReconnectDialog() {
    remove2("reconnect");
  }

  // srcts/src/shiny/shinyapp.ts
  var import_es_regexp_exec16 = __toESM(require_es_regexp_exec());
  var import_es_json_stringify4 = __toESM(require_es_json_stringify());

  // node_modules/core-js/modules/es.array-buffer.constructor.js
  var $81 = require_export();
  var global10 = require_global();
  var arrayBufferModule = require_array_buffer();
  var setSpecies2 = require_set_species();
  var ARRAY_BUFFER = "ArrayBuffer";
  var ArrayBuffer2 = arrayBufferModule[ARRAY_BUFFER];
  var NativeArrayBuffer = global10[ARRAY_BUFFER];
  $81({ global: true, constructor: true, forced: NativeArrayBuffer !== ArrayBuffer2 }, {
    ArrayBuffer: ArrayBuffer2
  });
  setSpecies2(ARRAY_BUFFER);

  // node_modules/core-js/modules/es.array-buffer.slice.js
  var $82 = require_export();
  var uncurryThis13 = require_function_uncurry_this_clause();
  var fails15 = require_fails();
  var ArrayBufferModule = require_array_buffer();
  var anObject9 = require_an_object();
  var toAbsoluteIndex3 = require_to_absolute_index();
  var toLength6 = require_to_length();
  var speciesConstructor3 = require_species_constructor();
  var ArrayBuffer3 = ArrayBufferModule.ArrayBuffer;
  var DataView2 = ArrayBufferModule.DataView;
  var DataViewPrototype = DataView2.prototype;
  var nativeArrayBufferSlice = uncurryThis13(ArrayBuffer3.prototype.slice);
  var getUint8 = uncurryThis13(DataViewPrototype.getUint8);
  var setUint8 = uncurryThis13(DataViewPrototype.setUint8);
  var INCORRECT_SLICE = fails15(function() {
    return !new ArrayBuffer3(2).slice(1, void 0).byteLength;
  });
  $82({ target: "ArrayBuffer", proto: true, unsafe: true, forced: INCORRECT_SLICE }, {
    slice: function slice3(start, end) {
      if (nativeArrayBufferSlice && end === void 0) {
        return nativeArrayBufferSlice(anObject9(this), start);
      }
      var length = anObject9(this).byteLength;
      var first = toAbsoluteIndex3(start, length);
      var fin = toAbsoluteIndex3(end === void 0 ? length : end, length);
      var result = new (speciesConstructor3(this, ArrayBuffer3))(toLength6(fin - first));
      var viewSource = new DataView2(this);
      var viewTarget = new DataView2(result);
      var index = 0;
      while (first < fin) {
        setUint8(viewTarget, index++, getUint8(viewSource, first++));
      }
      return result;
    }
  });

  // node_modules/core-js/modules/es.data-view.js
  require_es_data_view_constructor();

  // srcts/src/shiny/shinyapp.ts
  var import_es_array_iterator51 = __toESM(require_es_array_iterator());
  var import_jquery38 = __toESM(require_jquery());

  // srcts/src/utils/asyncQueue.ts
  var import_es_array_iterator49 = __toESM(require_es_array_iterator());
  function _typeof49(obj) {
    "@babel/helpers - typeof";
    return _typeof49 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof49(obj);
  }
  function _regeneratorRuntime12() {
    "use strict";
    _regeneratorRuntime12 = function _regeneratorRuntime15() {
      return exports;
    };
    var exports = {}, Op = Object.prototype, hasOwn5 = Op.hasOwnProperty, defineProperty3 = Object.defineProperty || function(obj, key, desc) {
      obj[key] = desc.value;
    }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
    function define(obj, key, value) {
      return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }), obj[key];
    }
    try {
      define({}, "");
    } catch (err) {
      define = function define2(obj, key, value) {
        return obj[key] = value;
      };
    }
    function wrap(innerFn, outerFn, self2, tryLocsList) {
      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []);
      return defineProperty3(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) }), generator;
    }
    function tryCatch(fn, obj, arg) {
      try {
        return { type: "normal", arg: fn.call(obj, arg) };
      } catch (err) {
        return { type: "throw", arg: err };
      }
    }
    exports.wrap = wrap;
    var ContinueSentinel = {};
    function Generator() {
    }
    function GeneratorFunction() {
    }
    function GeneratorFunctionPrototype() {
    }
    var IteratorPrototype = {};
    define(IteratorPrototype, iteratorSymbol, function() {
      return this;
    });
    var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values2([])));
    NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn5.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
    var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
    function defineIteratorMethods(prototype) {
      ["next", "throw", "return"].forEach(function(method) {
        define(prototype, method, function(arg) {
          return this._invoke(method, arg);
        });
      });
    }
    function AsyncIterator(generator, PromiseImpl) {
      function invoke(method, arg, resolve, reject) {
        var record = tryCatch(generator[method], generator, arg);
        if ("throw" !== record.type) {
          var result = record.arg, value = result.value;
          return value && "object" == _typeof49(value) && hasOwn5.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
            invoke("next", value2, resolve, reject);
          }, function(err) {
            invoke("throw", err, resolve, reject);
          }) : PromiseImpl.resolve(value).then(function(unwrapped) {
            result.value = unwrapped, resolve(result);
          }, function(error) {
            return invoke("throw", error, resolve, reject);
          });
        }
        reject(record.arg);
      }
      var previousPromise;
      defineProperty3(this, "_invoke", { value: function value(method, arg) {
        function callInvokeWithMethodAndArg() {
          return new PromiseImpl(function(resolve, reject) {
            invoke(method, arg, resolve, reject);
          });
        }
        return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
      } });
    }
    function makeInvokeMethod(innerFn, self2, context) {
      var state = "suspendedStart";
      return function(method, arg) {
        if ("executing" === state)
          throw new Error("Generator is already running");
        if ("completed" === state) {
          if ("throw" === method)
            throw arg;
          return doneResult();
        }
        for (context.method = method, context.arg = arg; ; ) {
          var delegate = context.delegate;
          if (delegate) {
            var delegateResult = maybeInvokeDelegate(delegate, context);
            if (delegateResult) {
              if (delegateResult === ContinueSentinel)
                continue;
              return delegateResult;
            }
          }
          if ("next" === context.method)
            context.sent = context._sent = context.arg;
          else if ("throw" === context.method) {
            if ("suspendedStart" === state)
              throw state = "completed", context.arg;
            context.dispatchException(context.arg);
          } else
            "return" === context.method && context.abrupt("return", context.arg);
          state = "executing";
          var record = tryCatch(innerFn, self2, context);
          if ("normal" === record.type) {
            if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel)
              continue;
            return { value: record.arg, done: context.done };
          }
          "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
        }
      };
    }
    function maybeInvokeDelegate(delegate, context) {
      var methodName = context.method, method = delegate.iterator[methodName];
      if (void 0 === method)
        return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
      var record = tryCatch(method, delegate.iterator, context.arg);
      if ("throw" === record.type)
        return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
      var info = record.arg;
      return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
    }
    function pushTryEntry(locs) {
      var entry = { tryLoc: locs[0] };
      1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
    }
    function resetTryEntry(entry) {
      var record = entry.completion || {};
      record.type = "normal", delete record.arg, entry.completion = record;
    }
    function Context(tryLocsList) {
      this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(true);
    }
    function values2(iterable) {
      if (iterable) {
        var iteratorMethod = iterable[iteratorSymbol];
        if (iteratorMethod)
          return iteratorMethod.call(iterable);
        if ("function" == typeof iterable.next)
          return iterable;
        if (!isNaN(iterable.length)) {
          var i5 = -1, next2 = function next3() {
            for (; ++i5 < iterable.length; )
              if (hasOwn5.call(iterable, i5))
                return next3.value = iterable[i5], next3.done = false, next3;
            return next3.value = void 0, next3.done = true, next3;
          };
          return next2.next = next2;
        }
      }
      return { next: doneResult };
    }
    function doneResult() {
      return { value: void 0, done: true };
    }
    return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty3(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }), defineProperty3(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) {
      var ctor = "function" == typeof genFun && genFun.constructor;
      return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
    }, exports.mark = function(genFun) {
      return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
    }, exports.awrap = function(arg) {
      return { __await: arg };
    }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
      return this;
    }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
      void 0 === PromiseImpl && (PromiseImpl = Promise);
      var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl);
      return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
        return result.done ? result.value : iter.next();
      });
    }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() {
      return this;
    }), define(Gp, "toString", function() {
      return "[object Generator]";
    }), exports.keys = function(val) {
      var object = Object(val), keys2 = [];
      for (var key in object)
        keys2.push(key);
      return keys2.reverse(), function next2() {
        for (; keys2.length; ) {
          var key2 = keys2.pop();
          if (key2 in object)
            return next2.value = key2, next2.done = false, next2;
        }
        return next2.done = true, next2;
      };
    }, exports.values = values2, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) {
      if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
        for (var name in this)
          "t" === name.charAt(0) && hasOwn5.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
    }, stop: function stop() {
      this.done = true;
      var rootRecord = this.tryEntries[0].completion;
      if ("throw" === rootRecord.type)
        throw rootRecord.arg;
      return this.rval;
    }, dispatchException: function dispatchException(exception) {
      if (this.done)
        throw exception;
      var context = this;
      function handle(loc, caught) {
        return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;
      }
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5], record = entry.completion;
        if ("root" === entry.tryLoc)
          return handle("end");
        if (entry.tryLoc <= this.prev) {
          var hasCatch = hasOwn5.call(entry, "catchLoc"), hasFinally = hasOwn5.call(entry, "finallyLoc");
          if (hasCatch && hasFinally) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          } else if (hasCatch) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
          } else {
            if (!hasFinally)
              throw new Error("try statement without catch or finally");
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          }
        }
      }
    }, abrupt: function abrupt(type, arg) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc <= this.prev && hasOwn5.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
          var finallyEntry = entry;
          break;
        }
      }
      finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
      var record = finallyEntry ? finallyEntry.completion : {};
      return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
    }, complete: function complete(record, afterLoc) {
      if ("throw" === record.type)
        throw record.arg;
      return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
    }, finish: function finish(finallyLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.finallyLoc === finallyLoc)
          return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
      }
    }, catch: function _catch(tryLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc === tryLoc) {
          var record = entry.completion;
          if ("throw" === record.type) {
            var thrown = record.arg;
            resetTryEntry(entry);
          }
          return thrown;
        }
      }
      throw new Error("illegal catch attempt");
    }, delegateYield: function delegateYield(iterable, resultName, nextLoc) {
      return this.delegate = { iterator: values2(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = void 0), ContinueSentinel;
    } }, exports;
  }
  function asyncGeneratorStep12(gen, resolve, reject, _next, _throw, key, arg) {
    try {
      var info = gen[key](arg);
      var value = info.value;
    } catch (error) {
      reject(error);
      return;
    }
    if (info.done) {
      resolve(value);
    } else {
      Promise.resolve(value).then(_next, _throw);
    }
  }
  function _asyncToGenerator12(fn) {
    return function() {
      var self2 = this, args = arguments;
      return new Promise(function(resolve, reject) {
        var gen = fn.apply(self2, args);
        function _next(value) {
          asyncGeneratorStep12(gen, resolve, reject, _next, _throw, "next", value);
        }
        function _throw(err) {
          asyncGeneratorStep12(gen, resolve, reject, _next, _throw, "throw", err);
        }
        _next(void 0);
      });
    };
  }
  function _classCallCheck41(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties41(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey43(descriptor.key), descriptor);
    }
  }
  function _createClass41(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties41(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties41(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _defineProperty20(obj, key, value) {
    key = _toPropertyKey43(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey43(arg) {
    var key = _toPrimitive43(arg, "string");
    return _typeof49(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive43(input, hint) {
    if (_typeof49(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof49(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  var AsyncQueue = /* @__PURE__ */ function() {
    function AsyncQueue2() {
      _classCallCheck41(this, AsyncQueue2);
      _defineProperty20(this, "$promises", []);
      _defineProperty20(this, "$resolvers", []);
    }
    _createClass41(AsyncQueue2, [{
      key: "_add",
      value: function _add() {
        var _this = this;
        var p3 = new Promise(function(resolve) {
          _this.$resolvers.push(resolve);
        });
        this.$promises.push(p3);
      }
    }, {
      key: "enqueue",
      value: function enqueue(x2) {
        if (!this.$resolvers.length)
          this._add();
        var resolve = this.$resolvers.shift();
        resolve(x2);
      }
    }, {
      key: "dequeue",
      value: function() {
        var _dequeue = _asyncToGenerator12(/* @__PURE__ */ _regeneratorRuntime12().mark(function _callee() {
          var promise;
          return _regeneratorRuntime12().wrap(function _callee$(_context) {
            while (1)
              switch (_context.prev = _context.next) {
                case 0:
                  if (!this.$promises.length)
                    this._add();
                  promise = this.$promises.shift();
                  return _context.abrupt("return", promise);
                case 3:
                case "end":
                  return _context.stop();
              }
          }, _callee, this);
        }));
        function dequeue() {
          return _dequeue.apply(this, arguments);
        }
        return dequeue;
      }()
    }, {
      key: "isEmpty",
      value: function isEmpty() {
        return !this.$promises.length;
      }
    }, {
      key: "isBlocked",
      value: function isBlocked() {
        return !!this.$resolvers.length;
      }
    }, {
      key: "length",
      get: function get3() {
        return this.$promises.length - this.$resolvers.length;
      }
    }]);
    return AsyncQueue2;
  }();

  // srcts/src/shiny/outputProgress.ts
  var import_es_array_iterator50 = __toESM(require_es_array_iterator());

  // node_modules/core-js/modules/es.array.includes.js
  var $83 = require_export();
  var $includes = require_array_includes().includes;
  var fails16 = require_fails();
  var addToUnscopables4 = require_add_to_unscopables();
  var BROKEN_ON_SPARSE = fails16(function() {
    return !Array(1).includes();
  });
  $83({ target: "Array", proto: true, forced: BROKEN_ON_SPARSE }, {
    includes: function includes(el) {
      return $includes(this, el, arguments.length > 1 ? arguments[1] : void 0);
    }
  });
  addToUnscopables4("includes");

  // node_modules/core-js/modules/es.string.includes.js
  var $84 = require_export();
  var uncurryThis14 = require_function_uncurry_this();
  var notARegExp3 = require_not_a_regexp();
  var requireObjectCoercible7 = require_require_object_coercible();
  var toString12 = require_to_string();
  var correctIsRegExpLogic3 = require_correct_is_regexp_logic();
  var stringIndexOf3 = uncurryThis14("".indexOf);
  $84({ target: "String", proto: true, forced: !correctIsRegExpLogic3("includes") }, {
    includes: function includes2(searchString) {
      return !!~stringIndexOf3(
        toString12(requireObjectCoercible7(this)),
        toString12(notARegExp3(searchString)),
        arguments.length > 1 ? arguments[1] : void 0
      );
    }
  });

  // node_modules/core-js/modules/es.weak-set.js
  require_es_weak_set_constructor();

  // srcts/src/shiny/outputProgress.ts
  var import_es_regexp_exec15 = __toESM(require_es_regexp_exec());
  function _typeof50(obj) {
    "@babel/helpers - typeof";
    return _typeof50 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof50(obj);
  }
  function _slicedToArray5(arr, i5) {
    return _arrayWithHoles5(arr) || _iterableToArrayLimit5(arr, i5) || _unsupportedIterableToArray6(arr, i5) || _nonIterableRest5();
  }
  function _nonIterableRest5() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _iterableToArrayLimit5(arr, i5) {
    var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
    if (null != _i) {
      var _s, _e, _x, _r, _arr = [], _n = true, _d = false;
      try {
        if (_x = (_i = _i.call(arr)).next, 0 === i5) {
          if (Object(_i) !== _i)
            return;
          _n = false;
        } else
          for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i5); _n = true)
            ;
      } catch (err) {
        _d = true, _e = err;
      } finally {
        try {
          if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r))
            return;
        } finally {
          if (_d)
            throw _e;
        }
      }
      return _arr;
    }
  }
  function _arrayWithHoles5(arr) {
    if (Array.isArray(arr))
      return arr;
  }
  function _createForOfIteratorHelper5(o4, allowArrayLike) {
    var it = typeof Symbol !== "undefined" && o4[Symbol.iterator] || o4["@@iterator"];
    if (!it) {
      if (Array.isArray(o4) || (it = _unsupportedIterableToArray6(o4)) || allowArrayLike && o4 && typeof o4.length === "number") {
        if (it)
          o4 = it;
        var i5 = 0;
        var F = function F2() {
        };
        return { s: F, n: function n4() {
          if (i5 >= o4.length)
            return { done: true };
          return { done: false, value: o4[i5++] };
        }, e: function e4(_e2) {
          throw _e2;
        }, f: F };
      }
      throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }
    var normalCompletion = true, didErr = false, err;
    return { s: function s4() {
      it = it.call(o4);
    }, n: function n4() {
      var step = it.next();
      normalCompletion = step.done;
      return step;
    }, e: function e4(_e3) {
      didErr = true;
      err = _e3;
    }, f: function f4() {
      try {
        if (!normalCompletion && it.return != null)
          it.return();
      } finally {
        if (didErr)
          throw err;
      }
    } };
  }
  function _unsupportedIterableToArray6(o4, minLen) {
    if (!o4)
      return;
    if (typeof o4 === "string")
      return _arrayLikeToArray6(o4, minLen);
    var n4 = Object.prototype.toString.call(o4).slice(8, -1);
    if (n4 === "Object" && o4.constructor)
      n4 = o4.constructor.name;
    if (n4 === "Map" || n4 === "Set")
      return Array.from(o4);
    if (n4 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n4))
      return _arrayLikeToArray6(o4, minLen);
  }
  function _arrayLikeToArray6(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i5 = 0, arr2 = new Array(len); i5 < len; i5++)
      arr2[i5] = arr[i5];
    return arr2;
  }
  function _classCallCheck42(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties42(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey44(descriptor.key), descriptor);
    }
  }
  function _createClass42(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties42(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties42(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _classPrivateMethodInitSpec(obj, privateSet) {
    _checkPrivateRedeclaration(obj, privateSet);
    privateSet.add(obj);
  }
  function _checkPrivateRedeclaration(obj, privateCollection) {
    if (privateCollection.has(obj)) {
      throw new TypeError("Cannot initialize the same private elements twice on an object");
    }
  }
  function _defineProperty21(obj, key, value) {
    key = _toPropertyKey44(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey44(arg) {
    var key = _toPrimitive44(arg, "string");
    return _typeof50(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive44(input, hint) {
    if (_typeof50(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof50(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _classPrivateMethodGet(receiver, privateSet, fn) {
    if (!privateSet.has(receiver)) {
      throw new TypeError("attempted to get private field on non-instance");
    }
    return fn;
  }
  var OutputStates;
  (function(OutputStates2) {
    OutputStates2["Initial"] = "initial";
    OutputStates2["Running"] = "running";
    OutputStates2["Idle"] = "idle";
    OutputStates2["Value"] = "value";
    OutputStates2["Error"] = "error";
    OutputStates2["Cancel"] = "cancel";
    OutputStates2["Persistent"] = "persistent";
    OutputStates2["Invalidated"] = "invalidated";
  })(OutputStates || (OutputStates = {}));
  var _updateStateFromRecalculating = /* @__PURE__ */ new WeakSet();
  var _updateStateFromFlush = /* @__PURE__ */ new WeakSet();
  var _updateStateFromProgress = /* @__PURE__ */ new WeakSet();
  var _updateStateFromValueOrError = /* @__PURE__ */ new WeakSet();
  var _getState = /* @__PURE__ */ new WeakSet();
  var _setState = /* @__PURE__ */ new WeakSet();
  var OutputProgressReporter = /* @__PURE__ */ function() {
    function OutputProgressReporter2() {
      _classCallCheck42(this, OutputProgressReporter2);
      _classPrivateMethodInitSpec(this, _setState);
      _classPrivateMethodInitSpec(this, _getState);
      _classPrivateMethodInitSpec(this, _updateStateFromValueOrError);
      _classPrivateMethodInitSpec(this, _updateStateFromProgress);
      _classPrivateMethodInitSpec(this, _updateStateFromFlush);
      _classPrivateMethodInitSpec(this, _updateStateFromRecalculating);
      _defineProperty21(this, "outputStates", /* @__PURE__ */ new Map());
      _defineProperty21(this, "changedOutputs", /* @__PURE__ */ new Map());
    }
    _createClass42(OutputProgressReporter2, [{
      key: "takeChanges",
      value: function takeChanges() {
        var result = this.changedOutputs;
        this.changedOutputs = /* @__PURE__ */ new Map();
        return result;
      }
    }, {
      key: "isRecalculating",
      value: function isRecalculating(name) {
        var state = _classPrivateMethodGet(this, _getState, _getState2).call(this, name);
        var recalculatingStates = [OutputStates.Initial, OutputStates.Running, OutputStates.Idle, OutputStates.Persistent, OutputStates.Invalidated];
        return recalculatingStates.includes(state);
      }
    }, {
      key: "updateStateFromMessage",
      value: function updateStateFromMessage(message) {
        if (isRecalculatingMessage(message)) {
          _classPrivateMethodGet(this, _updateStateFromRecalculating, _updateStateFromRecalculating2).call(this, message);
        }
        if (isFlushMessage(message)) {
          _classPrivateMethodGet(this, _updateStateFromFlush, _updateStateFromFlush2).call(this, message);
        }
        if (isProgressMessage(message)) {
          _classPrivateMethodGet(this, _updateStateFromProgress, _updateStateFromProgress2).call(this, message);
        }
      }
    }]);
    return OutputProgressReporter2;
  }();
  function _updateStateFromRecalculating2(message) {
    var _message$recalculatin = message.recalculating, name = _message$recalculatin.name, status = _message$recalculatin.status;
    var state = _classPrivateMethodGet(this, _getState, _getState2).call(this, name);
    if (status === "recalculating") {
      switch (state) {
        case OutputStates.Initial:
        case OutputStates.Invalidated:
          _classPrivateMethodGet(this, _setState, _setState2).call(this, name, OutputStates.Running);
          break;
        default:
          throw new Error("Shiny server sent a message that the output '".concat(name, "' is recalculating,\n            but the output is in an unexpected state of: '").concat(state, "'."));
      }
    }
    if (status === "recalculated") {
      switch (state) {
        case OutputStates.Running:
          _classPrivateMethodGet(this, _setState, _setState2).call(this, name, OutputStates.Idle);
          break;
        default:
          throw new Error("Shiny server sent a message that the output '".concat(name, "' has been recalculated,\n            but the output is in an unexpected state of: '").concat(state, "'."));
      }
    }
  }
  function _updateStateFromFlush2(message) {
    for (var name in message.values) {
      _classPrivateMethodGet(this, _updateStateFromValueOrError, _updateStateFromValueOrError2).call(this, name, OutputStates.Value);
    }
    for (var _name in message.errors) {
      _classPrivateMethodGet(this, _updateStateFromValueOrError, _updateStateFromValueOrError2).call(this, _name, OutputStates.Error);
    }
    var _iterator = _createForOfIteratorHelper5(this.outputStates), _step;
    try {
      for (_iterator.s(); !(_step = _iterator.n()).done; ) {
        var _step$value = _slicedToArray5(_step.value, 2), _name2 = _step$value[0], state = _step$value[1];
        switch (state) {
          case OutputStates.Idle:
            _classPrivateMethodGet(this, _setState, _setState2).call(this, _name2, OutputStates.Cancel);
            break;
          case OutputStates.Value:
          case OutputStates.Error:
          case OutputStates.Cancel:
          case OutputStates.Persistent:
          case OutputStates.Invalidated:
            break;
          default:
            throw new Error("Shiny server sent a flush message, and after processing the values and errors,\n            the output '".concat(_name2, "' has an unexpected ending state of: '").concat(state, "'."));
        }
      }
    } catch (err) {
      _iterator.e(err);
    } finally {
      _iterator.f();
    }
  }
  function _updateStateFromProgress2(message) {
    var _message$progress$mes = message.progress.message, id = _message$progress$mes.id, persistent = _message$progress$mes.persistent;
    var state = _classPrivateMethodGet(this, _getState, _getState2).call(this, id);
    if (persistent) {
      switch (state) {
        case OutputStates.Running:
          _classPrivateMethodGet(this, _setState, _setState2).call(this, id, OutputStates.Persistent);
          break;
        default:
          throw new Error("Shiny server has sent a 'persistent progress' message for ".concat(id, ",\n            but the output is in an unexpected state of: ").concat(state));
      }
    } else {
      switch (state) {
        case OutputStates.Value:
        case OutputStates.Error:
        case OutputStates.Cancel:
        case OutputStates.Persistent:
        case OutputStates.Idle:
          _classPrivateMethodGet(this, _setState, _setState2).call(this, id, OutputStates.Invalidated);
          break;
        default:
          throw new Error("Shiny server has sent a progress message for ".concat(id, ",\n            but the output is in an unexpected state of: ").concat(state));
      }
    }
  }
  function _updateStateFromValueOrError2(name, type) {
    var state = _classPrivateMethodGet(this, _getState, _getState2).call(this, name);
    switch (state) {
      case OutputStates.Idle:
        _classPrivateMethodGet(this, _setState, _setState2).call(this, name, type);
        break;
      default:
        throw new Error("Shiny server has sent a ".concat(type, " for the output '").concat(name, "',\n          but the output is in an unexpected state of: '").concat(state, "'."));
    }
  }
  function _getState2(name) {
    var _this$outputStates$ge;
    return (_this$outputStates$ge = this.outputStates.get(name)) !== null && _this$outputStates$ge !== void 0 ? _this$outputStates$ge : OutputStates.Initial;
  }
  function _setState2(name, state) {
    var oldRecalc = this.isRecalculating(name);
    this.outputStates.set(name, state);
    var newRecalc = this.isRecalculating(name);
    if (oldRecalc !== newRecalc) {
      this.changedOutputs.set(name, newRecalc);
    }
  }
  function isRecalculatingMessage(x2) {
    var m2 = x2;
    return m2.recalculating !== void 0;
  }
  function isFlushMessage(x2) {
    var m2 = x2;
    return m2.values !== void 0 && m2.errors !== void 0;
  }
  function isProgressMessage(x2) {
    var m2 = x2;
    return m2.progress !== void 0 && m2.progress.type === "binding";
  }

  // srcts/src/shiny/shinyapp.ts
  function _typeof51(obj) {
    "@babel/helpers - typeof";
    return _typeof51 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof51(obj);
  }
  function _slicedToArray6(arr, i5) {
    return _arrayWithHoles6(arr) || _iterableToArrayLimit6(arr, i5) || _unsupportedIterableToArray7(arr, i5) || _nonIterableRest6();
  }
  function _nonIterableRest6() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _iterableToArrayLimit6(arr, i5) {
    var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
    if (null != _i) {
      var _s, _e, _x, _r, _arr = [], _n = true, _d = false;
      try {
        if (_x = (_i = _i.call(arr)).next, 0 === i5) {
          if (Object(_i) !== _i)
            return;
          _n = false;
        } else
          for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i5); _n = true)
            ;
      } catch (err) {
        _d = true, _e = err;
      } finally {
        try {
          if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r))
            return;
        } finally {
          if (_d)
            throw _e;
        }
      }
      return _arr;
    }
  }
  function _arrayWithHoles6(arr) {
    if (Array.isArray(arr))
      return arr;
  }
  function _createForOfIteratorHelper6(o4, allowArrayLike) {
    var it = typeof Symbol !== "undefined" && o4[Symbol.iterator] || o4["@@iterator"];
    if (!it) {
      if (Array.isArray(o4) || (it = _unsupportedIterableToArray7(o4)) || allowArrayLike && o4 && typeof o4.length === "number") {
        if (it)
          o4 = it;
        var i5 = 0;
        var F = function F2() {
        };
        return { s: F, n: function n4() {
          if (i5 >= o4.length)
            return { done: true };
          return { done: false, value: o4[i5++] };
        }, e: function e4(_e2) {
          throw _e2;
        }, f: F };
      }
      throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }
    var normalCompletion = true, didErr = false, err;
    return { s: function s4() {
      it = it.call(o4);
    }, n: function n4() {
      var step = it.next();
      normalCompletion = step.done;
      return step;
    }, e: function e4(_e3) {
      didErr = true;
      err = _e3;
    }, f: function f4() {
      try {
        if (!normalCompletion && it.return != null)
          it.return();
      } finally {
        if (didErr)
          throw err;
      }
    } };
  }
  function _unsupportedIterableToArray7(o4, minLen) {
    if (!o4)
      return;
    if (typeof o4 === "string")
      return _arrayLikeToArray7(o4, minLen);
    var n4 = Object.prototype.toString.call(o4).slice(8, -1);
    if (n4 === "Object" && o4.constructor)
      n4 = o4.constructor.name;
    if (n4 === "Map" || n4 === "Set")
      return Array.from(o4);
    if (n4 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n4))
      return _arrayLikeToArray7(o4, minLen);
  }
  function _arrayLikeToArray7(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i5 = 0, arr2 = new Array(len); i5 < len; i5++)
      arr2[i5] = arr[i5];
    return arr2;
  }
  function _regeneratorRuntime13() {
    "use strict";
    _regeneratorRuntime13 = function _regeneratorRuntime15() {
      return exports;
    };
    var exports = {}, Op = Object.prototype, hasOwn5 = Op.hasOwnProperty, defineProperty3 = Object.defineProperty || function(obj, key, desc) {
      obj[key] = desc.value;
    }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
    function define(obj, key, value) {
      return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }), obj[key];
    }
    try {
      define({}, "");
    } catch (err) {
      define = function define2(obj, key, value) {
        return obj[key] = value;
      };
    }
    function wrap(innerFn, outerFn, self2, tryLocsList) {
      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []);
      return defineProperty3(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) }), generator;
    }
    function tryCatch(fn, obj, arg) {
      try {
        return { type: "normal", arg: fn.call(obj, arg) };
      } catch (err) {
        return { type: "throw", arg: err };
      }
    }
    exports.wrap = wrap;
    var ContinueSentinel = {};
    function Generator() {
    }
    function GeneratorFunction() {
    }
    function GeneratorFunctionPrototype() {
    }
    var IteratorPrototype = {};
    define(IteratorPrototype, iteratorSymbol, function() {
      return this;
    });
    var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values2([])));
    NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn5.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
    var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
    function defineIteratorMethods(prototype) {
      ["next", "throw", "return"].forEach(function(method) {
        define(prototype, method, function(arg) {
          return this._invoke(method, arg);
        });
      });
    }
    function AsyncIterator(generator, PromiseImpl) {
      function invoke(method, arg, resolve, reject) {
        var record = tryCatch(generator[method], generator, arg);
        if ("throw" !== record.type) {
          var result = record.arg, value = result.value;
          return value && "object" == _typeof51(value) && hasOwn5.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
            invoke("next", value2, resolve, reject);
          }, function(err) {
            invoke("throw", err, resolve, reject);
          }) : PromiseImpl.resolve(value).then(function(unwrapped) {
            result.value = unwrapped, resolve(result);
          }, function(error) {
            return invoke("throw", error, resolve, reject);
          });
        }
        reject(record.arg);
      }
      var previousPromise;
      defineProperty3(this, "_invoke", { value: function value(method, arg) {
        function callInvokeWithMethodAndArg() {
          return new PromiseImpl(function(resolve, reject) {
            invoke(method, arg, resolve, reject);
          });
        }
        return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
      } });
    }
    function makeInvokeMethod(innerFn, self2, context) {
      var state = "suspendedStart";
      return function(method, arg) {
        if ("executing" === state)
          throw new Error("Generator is already running");
        if ("completed" === state) {
          if ("throw" === method)
            throw arg;
          return doneResult();
        }
        for (context.method = method, context.arg = arg; ; ) {
          var delegate = context.delegate;
          if (delegate) {
            var delegateResult = maybeInvokeDelegate(delegate, context);
            if (delegateResult) {
              if (delegateResult === ContinueSentinel)
                continue;
              return delegateResult;
            }
          }
          if ("next" === context.method)
            context.sent = context._sent = context.arg;
          else if ("throw" === context.method) {
            if ("suspendedStart" === state)
              throw state = "completed", context.arg;
            context.dispatchException(context.arg);
          } else
            "return" === context.method && context.abrupt("return", context.arg);
          state = "executing";
          var record = tryCatch(innerFn, self2, context);
          if ("normal" === record.type) {
            if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel)
              continue;
            return { value: record.arg, done: context.done };
          }
          "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
        }
      };
    }
    function maybeInvokeDelegate(delegate, context) {
      var methodName = context.method, method = delegate.iterator[methodName];
      if (void 0 === method)
        return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
      var record = tryCatch(method, delegate.iterator, context.arg);
      if ("throw" === record.type)
        return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
      var info = record.arg;
      return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
    }
    function pushTryEntry(locs) {
      var entry = { tryLoc: locs[0] };
      1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
    }
    function resetTryEntry(entry) {
      var record = entry.completion || {};
      record.type = "normal", delete record.arg, entry.completion = record;
    }
    function Context(tryLocsList) {
      this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(true);
    }
    function values2(iterable) {
      if (iterable) {
        var iteratorMethod = iterable[iteratorSymbol];
        if (iteratorMethod)
          return iteratorMethod.call(iterable);
        if ("function" == typeof iterable.next)
          return iterable;
        if (!isNaN(iterable.length)) {
          var i5 = -1, next2 = function next3() {
            for (; ++i5 < iterable.length; )
              if (hasOwn5.call(iterable, i5))
                return next3.value = iterable[i5], next3.done = false, next3;
            return next3.value = void 0, next3.done = true, next3;
          };
          return next2.next = next2;
        }
      }
      return { next: doneResult };
    }
    function doneResult() {
      return { value: void 0, done: true };
    }
    return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty3(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }), defineProperty3(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) {
      var ctor = "function" == typeof genFun && genFun.constructor;
      return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
    }, exports.mark = function(genFun) {
      return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
    }, exports.awrap = function(arg) {
      return { __await: arg };
    }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
      return this;
    }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
      void 0 === PromiseImpl && (PromiseImpl = Promise);
      var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl);
      return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
        return result.done ? result.value : iter.next();
      });
    }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() {
      return this;
    }), define(Gp, "toString", function() {
      return "[object Generator]";
    }), exports.keys = function(val) {
      var object = Object(val), keys2 = [];
      for (var key in object)
        keys2.push(key);
      return keys2.reverse(), function next2() {
        for (; keys2.length; ) {
          var key2 = keys2.pop();
          if (key2 in object)
            return next2.value = key2, next2.done = false, next2;
        }
        return next2.done = true, next2;
      };
    }, exports.values = values2, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) {
      if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
        for (var name in this)
          "t" === name.charAt(0) && hasOwn5.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
    }, stop: function stop() {
      this.done = true;
      var rootRecord = this.tryEntries[0].completion;
      if ("throw" === rootRecord.type)
        throw rootRecord.arg;
      return this.rval;
    }, dispatchException: function dispatchException(exception) {
      if (this.done)
        throw exception;
      var context = this;
      function handle(loc, caught) {
        return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;
      }
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5], record = entry.completion;
        if ("root" === entry.tryLoc)
          return handle("end");
        if (entry.tryLoc <= this.prev) {
          var hasCatch = hasOwn5.call(entry, "catchLoc"), hasFinally = hasOwn5.call(entry, "finallyLoc");
          if (hasCatch && hasFinally) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          } else if (hasCatch) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
          } else {
            if (!hasFinally)
              throw new Error("try statement without catch or finally");
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          }
        }
      }
    }, abrupt: function abrupt(type, arg) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc <= this.prev && hasOwn5.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
          var finallyEntry = entry;
          break;
        }
      }
      finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
      var record = finallyEntry ? finallyEntry.completion : {};
      return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
    }, complete: function complete(record, afterLoc) {
      if ("throw" === record.type)
        throw record.arg;
      return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
    }, finish: function finish(finallyLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.finallyLoc === finallyLoc)
          return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
      }
    }, catch: function _catch(tryLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc === tryLoc) {
          var record = entry.completion;
          if ("throw" === record.type) {
            var thrown = record.arg;
            resetTryEntry(entry);
          }
          return thrown;
        }
      }
      throw new Error("illegal catch attempt");
    }, delegateYield: function delegateYield(iterable, resultName, nextLoc) {
      return this.delegate = { iterator: values2(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = void 0), ContinueSentinel;
    } }, exports;
  }
  function asyncGeneratorStep13(gen, resolve, reject, _next, _throw, key, arg) {
    try {
      var info = gen[key](arg);
      var value = info.value;
    } catch (error) {
      reject(error);
      return;
    }
    if (info.done) {
      resolve(value);
    } else {
      Promise.resolve(value).then(_next, _throw);
    }
  }
  function _asyncToGenerator13(fn) {
    return function() {
      var self2 = this, args = arguments;
      return new Promise(function(resolve, reject) {
        var gen = fn.apply(self2, args);
        function _next(value) {
          asyncGeneratorStep13(gen, resolve, reject, _next, _throw, "next", value);
        }
        function _throw(err) {
          asyncGeneratorStep13(gen, resolve, reject, _next, _throw, "throw", err);
        }
        _next(void 0);
      });
    };
  }
  function _classCallCheck43(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties43(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey45(descriptor.key), descriptor);
    }
  }
  function _createClass43(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties43(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties43(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _defineProperty22(obj, key, value) {
    key = _toPropertyKey45(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey45(arg) {
    var key = _toPrimitive45(arg, "string");
    return _typeof51(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive45(input, hint) {
    if (_typeof51(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof51(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  var messageHandlerOrder = [];
  var messageHandlers = {};
  var customMessageHandlerOrder = [];
  var customMessageHandlers = {};
  function addMessageHandler(type, handler) {
    if (messageHandlers[type]) {
      throw 'handler for message of type "' + type + '" already added.';
    }
    if (typeof handler !== "function") {
      throw "handler must be a function.";
    }
    if (handler.length !== 1) {
      throw "handler must be a function that takes one argument.";
    }
    messageHandlerOrder.push(type);
    messageHandlers[type] = handler;
  }
  function addCustomMessageHandler(type, handler) {
    if (customMessageHandlers[type]) {
      var typeIdx = customMessageHandlerOrder.indexOf(type);
      if (typeIdx !== -1) {
        customMessageHandlerOrder.splice(typeIdx, 1);
        delete customMessageHandlers[type];
      }
    }
    if (typeof handler !== "function") {
      throw "handler must be a function.";
    }
    if (handler.length !== 1) {
      throw "handler must be a function that takes one argument.";
    }
    customMessageHandlerOrder.push(type);
    customMessageHandlers[type] = handler;
  }
  var ShinyApp = /* @__PURE__ */ function() {
    function ShinyApp2() {
      _classCallCheck43(this, ShinyApp2);
      _defineProperty22(this, "$socket", null);
      _defineProperty22(this, "taskQueue", new AsyncQueue());
      _defineProperty22(this, "config", null);
      _defineProperty22(this, "$inputValues", {});
      _defineProperty22(this, "$initialInput", null);
      _defineProperty22(this, "$bindings", {});
      _defineProperty22(this, "$outputProgress", new OutputProgressReporter());
      _defineProperty22(this, "$values", {});
      _defineProperty22(this, "$errors", {});
      _defineProperty22(this, "$conditionals", {});
      _defineProperty22(this, "$pendingMessages", []);
      _defineProperty22(this, "$activeRequests", {});
      _defineProperty22(this, "$nextRequestId", 0);
      _defineProperty22(this, "$allowReconnect", false);
      _defineProperty22(this, "scheduledReconnect", void 0);
      _defineProperty22(this, "reconnectDelay", function() {
        var attempts = 0;
        var delays = [1500, 1500, 2500, 2500, 5500, 5500, 10500];
        return {
          next: function next2() {
            var i5 = attempts;
            if (i5 >= delays.length) {
              i5 = delays.length - 1;
            }
            attempts++;
            return delays[i5];
          },
          reset: function reset() {
            attempts = 0;
          }
        };
      }());
      _defineProperty22(this, "progressHandlers", {
        binding: function binding(message) {
          var key = message.id;
          var binding2 = this.$bindings[key];
          if (binding2) {
            (0, import_jquery38.default)(binding2.el).trigger({
              type: "shiny:outputinvalidated",
              binding: binding2,
              name: key
            });
          }
          this._updateProgress();
        },
        open: function() {
          var _open = _asyncToGenerator13(/* @__PURE__ */ _regeneratorRuntime13().mark(function _callee(message) {
            var $container, depth, $progress, $progressBar, $progressText;
            return _regeneratorRuntime13().wrap(function _callee$(_context) {
              while (1)
                switch (_context.prev = _context.next) {
                  case 0:
                    if (!(message.style === "notification")) {
                      _context.next = 5;
                      break;
                    }
                    _context.next = 3;
                    return show2({
                      html: '<div id="shiny-progress-'.concat(message.id, '" class="shiny-progress-notification">') + '<div class="progress active" style="display: none;"><div class="progress-bar"></div></div><div class="progress-text"><span class="progress-message">message</span> <span class="progress-detail"></span></div></div>',
                      id: message.id,
                      duration: null
                    });
                  case 3:
                    _context.next = 6;
                    break;
                  case 5:
                    if (message.style === "old") {
                      $container = (0, import_jquery38.default)(".shiny-progress-container");
                      if ($container.length === 0) {
                        $container = (0, import_jquery38.default)('<div class="shiny-progress-container"></div>');
                        (0, import_jquery38.default)(document.body).append($container);
                      }
                      depth = (0, import_jquery38.default)(".shiny-progress.open").length;
                      $progress = (0, import_jquery38.default)('<div class="shiny-progress open"><div class="progress active"><div class="progress-bar bar"></div></div><div class="progress-text"><span class="progress-message">message</span><span class="progress-detail"></span></div></div>');
                      $progress.attr("id", message.id);
                      $container.append($progress);
                      $progressBar = $progress.find(".progress");
                      if ($progressBar) {
                        $progressBar.css("top", depth * $progressBar.height() + "px");
                        $progressText = $progress.find(".progress-text");
                        $progressText.css("top", 3 * $progressBar.height() + depth * $progressText.outerHeight() + "px");
                        $progress.hide();
                      }
                    }
                  case 6:
                  case "end":
                    return _context.stop();
                }
            }, _callee);
          }));
          function open(_x) {
            return _open.apply(this, arguments);
          }
          return open;
        }(),
        update: function update(message) {
          if (message.style === "notification") {
            var $progress = (0, import_jquery38.default)("#shiny-progress-" + message.id);
            if ($progress.length === 0)
              return;
            if (typeof message.message !== "undefined") {
              $progress.find(".progress-message").text(message.message);
            }
            if (typeof message.detail !== "undefined") {
              $progress.find(".progress-detail").text(message.detail);
            }
            if (typeof message.value !== "undefined" && message.value !== null) {
              $progress.find(".progress").show();
              $progress.find(".progress-bar").width(message.value * 100 + "%");
            }
          } else if (message.style === "old") {
            var _$progress = (0, import_jquery38.default)("#" + message.id + ".shiny-progress");
            if (typeof message.message !== "undefined") {
              _$progress.find(".progress-message").text(message.message);
            }
            if (typeof message.detail !== "undefined") {
              _$progress.find(".progress-detail").text(message.detail);
            }
            if (typeof message.value !== "undefined" && message.value !== null) {
              _$progress.find(".progress").show();
              _$progress.find(".bar").width(message.value * 100 + "%");
            }
            _$progress.fadeIn();
          }
        },
        close: function close(message) {
          if (message.style === "notification") {
            remove2(message.id);
          } else if (message.style === "old") {
            var $progress = (0, import_jquery38.default)("#" + message.id + ".shiny-progress");
            $progress.removeClass("open");
            $progress.fadeOut({
              complete: function complete() {
                $progress.remove();
                if ((0, import_jquery38.default)(".shiny-progress").length === 0)
                  (0, import_jquery38.default)(".shiny-progress-container").remove();
              }
            });
          }
        }
      });
      this._init();
    }
    _createClass43(ShinyApp2, [{
      key: "connect",
      value: function connect(initialInput) {
        if (this.$socket)
          throw "Connect was already called on this application object";
        this.$socket = this.createSocket();
        this.$initialInput = initialInput;
        import_jquery38.default.extend(this.$inputValues, initialInput);
        this.$updateConditionals();
      }
    }, {
      key: "isConnected",
      value: function isConnected() {
        return !!this.$socket;
      }
    }, {
      key: "reconnect",
      value: function reconnect() {
        clearTimeout(this.scheduledReconnect);
        if (this.isConnected())
          throw "Attempted to reconnect, but already connected.";
        this.$socket = this.createSocket();
        this.$initialInput = import_jquery38.default.extend({}, this.$inputValues);
        this.$updateConditionals();
      }
    }, {
      key: "createSocket",
      value: function createSocket() {
        var _this = this;
        var createSocketFunc = getShinyCreateWebsocket() || function() {
          var protocol = "ws:";
          if (window.location.protocol === "https:")
            protocol = "wss:";
          var defaultPath = window.location.pathname;
          if (!/^([$#!&-;=?-[\]_a-z~]|%[0-9a-fA-F]{2})+$/.test(defaultPath)) {
            defaultPath = encodeURI(defaultPath);
            if (isQt()) {
              defaultPath = encodeURI(defaultPath);
            }
          }
          if (!/\/$/.test(defaultPath))
            defaultPath += "/";
          defaultPath += "websocket/";
          var ws = new WebSocket(protocol + "//" + window.location.host + defaultPath);
          ws.binaryType = "arraybuffer";
          return ws;
        };
        var socket = createSocketFunc();
        var hasOpened = false;
        socket.onopen = function() {
          hasOpened = true;
          (0, import_jquery38.default)(document).trigger({
            type: "shiny:connected",
            socket: socket
          });
          _this.onConnected();
          socket.send(JSON.stringify({
            method: "init",
            data: _this.$initialInput
          }));
          while (_this.$pendingMessages.length) {
            var msg = _this.$pendingMessages.shift();
            socket.send(msg);
          }
          _this.startActionQueueLoop();
        };
        socket.onmessage = function(e4) {
          _this.taskQueue.enqueue(/* @__PURE__ */ _asyncToGenerator13(/* @__PURE__ */ _regeneratorRuntime13().mark(function _callee2() {
            return _regeneratorRuntime13().wrap(function _callee2$(_context2) {
              while (1)
                switch (_context2.prev = _context2.next) {
                  case 0:
                    _context2.next = 2;
                    return _this.dispatchMessage(e4.data);
                  case 2:
                    return _context2.abrupt("return", _context2.sent);
                  case 3:
                  case "end":
                    return _context2.stop();
                }
            }, _callee2);
          })));
        };
        socket.onclose = function(e4) {
          var restarting = e4.code === 1012;
          if (hasOpened) {
            (0, import_jquery38.default)(document).trigger({
              type: "shiny:disconnected",
              socket: socket
            });
            _this.$notifyDisconnected();
          }
          _this.onDisconnected(restarting);
          _this.$removeSocket();
        };
        return socket;
      }
    }, {
      key: "startActionQueueLoop",
      value: function() {
        var _startActionQueueLoop = _asyncToGenerator13(/* @__PURE__ */ _regeneratorRuntime13().mark(function _callee3() {
          var action;
          return _regeneratorRuntime13().wrap(function _callee3$(_context3) {
            while (1)
              switch (_context3.prev = _context3.next) {
                case 0:
                  if (false) {
                    _context3.next = 15;
                    break;
                  }
                  _context3.prev = 1;
                  _context3.next = 4;
                  return this.taskQueue.dequeue();
                case 4:
                  action = _context3.sent;
                  _context3.next = 7;
                  return action();
                case 7:
                  _context3.next = 13;
                  break;
                case 9:
                  _context3.prev = 9;
                  _context3.t0 = _context3["catch"](1);
                  showErrorInClientConsole(_context3.t0);
                  console.error(_context3.t0);
                case 13:
                  _context3.next = 0;
                  break;
                case 15:
                case "end":
                  return _context3.stop();
              }
          }, _callee3, this, [[1, 9]]);
        }));
        function startActionQueueLoop() {
          return _startActionQueueLoop.apply(this, arguments);
        }
        return startActionQueueLoop;
      }()
    }, {
      key: "sendInput",
      value: function sendInput(values2) {
        var msg = JSON.stringify({
          method: "update",
          data: values2
        });
        this.$sendMsg(msg);
        import_jquery38.default.extend(this.$inputValues, values2);
        this.$updateConditionals();
      }
    }, {
      key: "$notifyDisconnected",
      value: function $notifyDisconnected() {
        if (window.parent) {
          window.parent.postMessage("disconnected", "*");
        }
      }
    }, {
      key: "$removeSocket",
      value: function $removeSocket() {
        this.$socket = null;
      }
    }, {
      key: "$scheduleReconnect",
      value: function $scheduleReconnect(delay) {
        var _this2 = this;
        this.scheduledReconnect = window.setTimeout(function() {
          _this2.reconnect();
        }, delay);
      }
    }, {
      key: "onDisconnected",
      value: function onDisconnected() {
        var reloading = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
        if ((0, import_jquery38.default)("#shiny-disconnected-overlay").length === 0) {
          (0, import_jquery38.default)(document.body).append('<div id="shiny-disconnected-overlay"></div>');
        }
        (0, import_jquery38.default)("#shiny-disconnected-overlay").toggleClass("reloading", reloading);
        if (this.$allowReconnect === true && this.$socket.allowReconnect === true || this.$allowReconnect === "force") {
          var delay = this.reconnectDelay.next();
          showReconnectDialog(delay);
          this.$scheduleReconnect(delay);
        }
      }
    }, {
      key: "onConnected",
      value: function onConnected() {
        (0, import_jquery38.default)("#shiny-disconnected-overlay").remove();
        hideReconnectDialog();
        this.reconnectDelay.reset();
      }
    }, {
      key: "makeRequest",
      value: function makeRequest(method, args, onSuccess, onError, blobs) {
        var requestId = this.$nextRequestId;
        while (this.$activeRequests[requestId]) {
          requestId = (requestId + 1) % 1e9;
        }
        this.$nextRequestId = requestId + 1;
        this.$activeRequests[requestId] = {
          onSuccess: onSuccess,
          onError: onError
        };
        var msg = JSON.stringify({
          method: method,
          args: args,
          tag: requestId
        });
        if (blobs) {
          var uint32ToBuf = function uint32ToBuf2(val) {
            var buffer = new ArrayBuffer(4);
            var view = new DataView(buffer);
            view.setUint32(0, val, true);
            return buffer;
          };
          var payload = [];
          payload.push(uint32ToBuf(16908802));
          var jsonBuf = new Blob([msg]);
          payload.push(uint32ToBuf(jsonBuf.size));
          payload.push(jsonBuf);
          for (var i5 = 0; i5 < blobs.length; i5++) {
            var _blob = blobs[i5];
            payload.push(uint32ToBuf(_blob.byteLength || _blob.size || 0));
            payload.push(_blob);
          }
          var blob = new Blob(payload);
          msg = blob;
        }
        this.$sendMsg(msg);
      }
    }, {
      key: "$sendMsg",
      value: function $sendMsg(msg) {
        if (this.$socket && this.$socket.readyState) {
          this.$socket.send(msg);
        } else {
          this.$pendingMessages.push(msg);
        }
      }
    }, {
      key: "receiveError",
      value: function receiveError(name, error) {
        if (this.$errors[name] === error)
          return;
        this.$errors[name] = error;
        delete this.$values[name];
        var binding = this.$bindings[name];
        var evt = import_jquery38.default.Event("shiny:error");
        evt.name = name;
        evt.error = error;
        evt.binding = binding;
        (0, import_jquery38.default)(binding ? binding.el : document).trigger(evt);
        if (!evt.isDefaultPrevented() && binding && binding.onValueError) {
          binding.onValueError(evt.error);
        }
      }
    }, {
      key: "receiveOutput",
      value: function() {
        var _receiveOutput = _asyncToGenerator13(/* @__PURE__ */ _regeneratorRuntime13().mark(function _callee4(name, value) {
          var binding, evt;
          return _regeneratorRuntime13().wrap(function _callee4$(_context4) {
            while (1)
              switch (_context4.prev = _context4.next) {
                case 0:
                  binding = this.$bindings[name];
                  evt = import_jquery38.default.Event("shiny:value");
                  evt.name = name;
                  evt.value = value;
                  evt.binding = binding;
                  if (!(this.$values[name] === value)) {
                    _context4.next = 8;
                    break;
                  }
                  (0, import_jquery38.default)(binding ? binding.el : document).trigger(evt);
                  return _context4.abrupt("return", void 0);
                case 8:
                  this.$values[name] = value;
                  delete this.$errors[name];
                  (0, import_jquery38.default)(binding ? binding.el : document).trigger(evt);
                  if (!(!evt.isDefaultPrevented() && binding)) {
                    _context4.next = 14;
                    break;
                  }
                  _context4.next = 14;
                  return binding.onValueChange(evt.value);
                case 14:
                  return _context4.abrupt("return", value);
                case 15:
                case "end":
                  return _context4.stop();
              }
          }, _callee4, this);
        }));
        function receiveOutput(_x2, _x3) {
          return _receiveOutput.apply(this, arguments);
        }
        return receiveOutput;
      }()
    }, {
      key: "bindOutput",
      value: function() {
        var _bindOutput = _asyncToGenerator13(/* @__PURE__ */ _regeneratorRuntime13().mark(function _callee5(id, binding) {
          return _regeneratorRuntime13().wrap(function _callee5$(_context5) {
            while (1)
              switch (_context5.prev = _context5.next) {
                case 0:
                  if (id) {
                    _context5.next = 2;
                    break;
                  }
                  throw new Error("Can't bind an element with no ID");
                case 2:
                  this.$bindings[id] = binding;
                  if (!(this.$values[id] !== void 0)) {
                    _context5.next = 8;
                    break;
                  }
                  _context5.next = 6;
                  return binding.onValueChange(this.$values[id]);
                case 6:
                  _context5.next = 9;
                  break;
                case 8:
                  if (this.$errors[id] !== void 0)
                    binding.onValueError(this.$errors[id]);
                case 9:
                  return _context5.abrupt("return", binding);
                case 10:
                case "end":
                  return _context5.stop();
              }
          }, _callee5, this);
        }));
        function bindOutput(_x4, _x5) {
          return _bindOutput.apply(this, arguments);
        }
        return bindOutput;
      }()
    }, {
      key: "unbindOutput",
      value: function unbindOutput(id, binding) {
        if (this.$bindings[id] === binding) {
          delete this.$bindings[id];
          return true;
        } else {
          return false;
        }
      }
    }, {
      key: "_narrowScopeComponent",
      value: function _narrowScopeComponent(scopeComponent, nsPrefix) {
        return Object.keys(scopeComponent).filter(function(k2) {
          return k2.indexOf(nsPrefix) === 0;
        }).map(function(k2) {
          return _defineProperty22({}, k2.substring(nsPrefix.length), scopeComponent[k2]);
        }).reduce(function(obj, pair) {
          return import_jquery38.default.extend(obj, pair);
        }, {});
      }
    }, {
      key: "_narrowScope",
      value: function _narrowScope(scope, nsPrefix) {
        if (nsPrefix) {
          return {
            input: this._narrowScopeComponent(scope.input, nsPrefix),
            output: this._narrowScopeComponent(scope.output, nsPrefix)
          };
        }
        return scope;
      }
    }, {
      key: "$updateConditionals",
      value: function $updateConditionals() {
        (0, import_jquery38.default)(document).trigger({
          type: "shiny:conditional"
        });
        var inputs = {};
        for (var name in this.$inputValues) {
          if (hasOwnProperty(this.$inputValues, name)) {
            var shortName = name.replace(/:.*/, "");
            inputs[shortName] = this.$inputValues[name];
          }
        }
        var scope = {
          input: inputs,
          output: this.$values
        };
        var conditionals = (0, import_jquery38.default)(document).find("[data-display-if]");
        for (var i5 = 0; i5 < conditionals.length; i5++) {
          var el = (0, import_jquery38.default)(conditionals[i5]);
          var condFunc = el.data("data-display-if-func");
          if (!condFunc) {
            var condExpr = el.attr("data-display-if");
            condFunc = scopeExprToFunc(condExpr);
            el.data("data-display-if-func", condFunc);
          }
          var nsPrefix = el.attr("data-ns-prefix");
          var nsScope = this._narrowScope(scope, nsPrefix);
          var show3 = Boolean(condFunc(nsScope));
          var showing = el.css("display") !== "none";
          if (show3 !== showing) {
            if (show3) {
              el.trigger("show");
              el.show();
              el.trigger("shown");
            } else {
              el.trigger("hide");
              el.hide();
              el.trigger("hidden");
            }
          }
        }
      }
    }, {
      key: "dispatchMessage",
      value: function() {
        var _dispatchMessage = _asyncToGenerator13(/* @__PURE__ */ _regeneratorRuntime13().mark(function _callee6(data) {
          var msgObj, len, typedv, typebuf, i5, type, evt;
          return _regeneratorRuntime13().wrap(function _callee6$(_context6) {
            while (1)
              switch (_context6.prev = _context6.next) {
                case 0:
                  msgObj = {};
                  if (typeof data === "string") {
                    msgObj = JSON.parse(data);
                  } else {
                    len = new DataView(data, 0, 1).getUint8(0);
                    typedv = new DataView(data, 1, len);
                    typebuf = [];
                    for (i5 = 0; i5 < len; i5++) {
                      typebuf.push(String.fromCharCode(typedv.getUint8(i5)));
                    }
                    type = typebuf.join("");
                    data = data.slice(len + 1);
                    msgObj.custom = {};
                    msgObj.custom[type] = data;
                  }
                  evt = import_jquery38.default.Event("shiny:message");
                  evt.message = msgObj;
                  (0, import_jquery38.default)(document).trigger(evt);
                  if (!evt.isDefaultPrevented()) {
                    _context6.next = 7;
                    break;
                  }
                  return _context6.abrupt("return");
                case 7:
                  this.$outputProgress.updateStateFromMessage(evt.message);
                  _context6.next = 10;
                  return this._sendMessagesToHandlers(evt.message, messageHandlers, messageHandlerOrder);
                case 10:
                  this.$updateConditionals();
                case 11:
                case "end":
                  return _context6.stop();
              }
          }, _callee6, this);
        }));
        function dispatchMessage(_x6) {
          return _dispatchMessage.apply(this, arguments);
        }
        return dispatchMessage;
      }()
    }, {
      key: "_sendMessagesToHandlers",
      value: function() {
        var _sendMessagesToHandlers2 = _asyncToGenerator13(/* @__PURE__ */ _regeneratorRuntime13().mark(function _callee7(msgObj, handlers, handlerOrder) {
          var i5, msgType;
          return _regeneratorRuntime13().wrap(function _callee7$(_context7) {
            while (1)
              switch (_context7.prev = _context7.next) {
                case 0:
                  i5 = 0;
                case 1:
                  if (!(i5 < handlerOrder.length)) {
                    _context7.next = 9;
                    break;
                  }
                  msgType = handlerOrder[i5];
                  if (!hasOwnProperty(msgObj, msgType)) {
                    _context7.next = 6;
                    break;
                  }
                  _context7.next = 6;
                  return handlers[msgType].call(this, msgObj[msgType]);
                case 6:
                  i5++;
                  _context7.next = 1;
                  break;
                case 9:
                case "end":
                  return _context7.stop();
              }
          }, _callee7, this);
        }));
        function _sendMessagesToHandlers(_x7, _x8, _x9) {
          return _sendMessagesToHandlers2.apply(this, arguments);
        }
        return _sendMessagesToHandlers;
      }()
    }, {
      key: "_updateProgress",
      value: function _updateProgress() {
        var changed = this.$outputProgress.takeChanges();
        var _iterator = _createForOfIteratorHelper6(changed.entries()), _step;
        try {
          for (_iterator.s(); !(_step = _iterator.n()).done; ) {
            var _step$value = _slicedToArray6(_step.value, 2), name = _step$value[0], recalculating = _step$value[1];
            if (hasOwnProperty(this.$bindings, name)) {
              this.$bindings[name].showProgress(recalculating);
            }
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }
      }
    }, {
      key: "_init",
      value: function _init() {
        var _this3 = this;
        addMessageHandler("values", /* @__PURE__ */ function() {
          var _ref3 = _asyncToGenerator13(/* @__PURE__ */ _regeneratorRuntime13().mark(function _callee8(message) {
            var _key;
            return _regeneratorRuntime13().wrap(function _callee8$(_context8) {
              while (1)
                switch (_context8.prev = _context8.next) {
                  case 0:
                    _this3._updateProgress();
                    _context8.t0 = _regeneratorRuntime13().keys(message);
                  case 2:
                    if ((_context8.t1 = _context8.t0()).done) {
                      _context8.next = 9;
                      break;
                    }
                    _key = _context8.t1.value;
                    if (!hasOwnProperty(message, _key)) {
                      _context8.next = 7;
                      break;
                    }
                    _context8.next = 7;
                    return _this3.receiveOutput(_key, message[_key]);
                  case 7:
                    _context8.next = 2;
                    break;
                  case 9:
                  case "end":
                    return _context8.stop();
                }
            }, _callee8);
          }));
          return function(_x10) {
            return _ref3.apply(this, arguments);
          };
        }());
        addMessageHandler("errors", function(message) {
          for (var _key2 in message) {
            if (hasOwnProperty(message, _key2)) {
              _this3.receiveError(_key2, message[_key2]);
            }
          }
        });
        addMessageHandler("inputMessages", /* @__PURE__ */ function() {
          var _ref4 = _asyncToGenerator13(/* @__PURE__ */ _regeneratorRuntime13().mark(function _callee9(message) {
            var i5, $obj, inputBinding, el, evt;
            return _regeneratorRuntime13().wrap(function _callee9$(_context9) {
              while (1)
                switch (_context9.prev = _context9.next) {
                  case 0:
                    i5 = 0;
                  case 1:
                    if (!(i5 < message.length)) {
                      _context9.next = 23;
                      break;
                    }
                    $obj = (0, import_jquery38.default)(".shiny-bound-input#" + $escape(message[i5].id));
                    inputBinding = $obj.data("shiny-input-binding");
                    if (!($obj.length > 0)) {
                      _context9.next = 20;
                      break;
                    }
                    if (!$obj.attr("aria-live"))
                      $obj.attr("aria-live", "polite");
                    el = $obj[0];
                    evt = import_jquery38.default.Event("shiny:updateinput");
                    evt.message = message[i5].message;
                    evt.binding = inputBinding;
                    (0, import_jquery38.default)(el).trigger(evt);
                    if (evt.isDefaultPrevented()) {
                      _context9.next = 20;
                      break;
                    }
                    _context9.prev = 12;
                    _context9.next = 15;
                    return inputBinding.receiveMessage(el, evt.message);
                  case 15:
                    _context9.next = 20;
                    break;
                  case 17:
                    _context9.prev = 17;
                    _context9.t0 = _context9["catch"](12);
                    console.error("[shiny] Error in inputBinding.receiveMessage()", {
                      error: _context9.t0,
                      binding: inputBinding,
                      message: evt.message
                    });
                  case 20:
                    i5++;
                    _context9.next = 1;
                    break;
                  case 23:
                  case "end":
                    return _context9.stop();
                }
            }, _callee9, null, [[12, 17]]);
          }));
          return function(_x11) {
            return _ref4.apply(this, arguments);
          };
        }());
        addMessageHandler("javascript", function(message) {
          indirectEval(message);
        });
        addMessageHandler("console", function(message) {
          for (var i5 = 0; i5 < message.length; i5++) {
            if (console.log)
              console.log(message[i5]);
          }
        });
        addMessageHandler("progress", /* @__PURE__ */ function() {
          var _ref5 = _asyncToGenerator13(/* @__PURE__ */ _regeneratorRuntime13().mark(function _callee10(message) {
            var handler;
            return _regeneratorRuntime13().wrap(function _callee10$(_context10) {
              while (1)
                switch (_context10.prev = _context10.next) {
                  case 0:
                    if (!(message.type && message.message)) {
                      _context10.next = 5;
                      break;
                    }
                    _context10.next = 3;
                    return _this3.progressHandlers[message.type];
                  case 3:
                    handler = _context10.sent;
                    if (handler)
                      handler.call(_this3, message.message);
                  case 5:
                  case "end":
                    return _context10.stop();
                }
            }, _callee10);
          }));
          return function(_x12) {
            return _ref5.apply(this, arguments);
          };
        }());
        addMessageHandler("notification", /* @__PURE__ */ function() {
          var _ref6 = _asyncToGenerator13(/* @__PURE__ */ _regeneratorRuntime13().mark(function _callee11(message) {
            return _regeneratorRuntime13().wrap(function _callee11$(_context11) {
              while (1)
                switch (_context11.prev = _context11.next) {
                  case 0:
                    if (!(message.type === "show")) {
                      _context11.next = 5;
                      break;
                    }
                    _context11.next = 3;
                    return show2(message.message);
                  case 3:
                    _context11.next = 10;
                    break;
                  case 5:
                    if (!(message.type === "remove")) {
                      _context11.next = 9;
                      break;
                    }
                    remove2(message.message);
                    _context11.next = 10;
                    break;
                  case 9:
                    throw "Unkown notification type: " + message.type;
                  case 10:
                  case "end":
                    return _context11.stop();
                }
            }, _callee11);
          }));
          return function(_x13) {
            return _ref6.apply(this, arguments);
          };
        }());
        addMessageHandler("modal", /* @__PURE__ */ function() {
          var _ref7 = _asyncToGenerator13(/* @__PURE__ */ _regeneratorRuntime13().mark(function _callee12(message) {
            return _regeneratorRuntime13().wrap(function _callee12$(_context12) {
              while (1)
                switch (_context12.prev = _context12.next) {
                  case 0:
                    if (!(message.type === "show")) {
                      _context12.next = 5;
                      break;
                    }
                    _context12.next = 3;
                    return show(message.message);
                  case 3:
                    _context12.next = 10;
                    break;
                  case 5:
                    if (!(message.type === "remove")) {
                      _context12.next = 9;
                      break;
                    }
                    remove();
                    _context12.next = 10;
                    break;
                  case 9:
                    throw "Unkown modal type: " + message.type;
                  case 10:
                  case "end":
                    return _context12.stop();
                }
            }, _callee12);
          }));
          return function(_x14) {
            return _ref7.apply(this, arguments);
          };
        }());
        addMessageHandler("response", function(message) {
          var requestId = message.tag;
          var request = _this3.$activeRequests[requestId];
          if (request) {
            delete _this3.$activeRequests[requestId];
            if ("value" in message)
              request.onSuccess(message.value);
            else
              request.onError(message.error);
          }
        });
        addMessageHandler("allowReconnect", function(message) {
          switch (message) {
            case true:
            case false:
            case "force":
              _this3.$allowReconnect = message;
              break;
            default:
              throw "Invalid value for allowReconnect: " + message;
          }
        });
        addMessageHandler("custom", /* @__PURE__ */ function() {
          var _ref8 = _asyncToGenerator13(/* @__PURE__ */ _regeneratorRuntime13().mark(function _callee13(message) {
            var shinyOnCustomMessage;
            return _regeneratorRuntime13().wrap(function _callee13$(_context13) {
              while (1)
                switch (_context13.prev = _context13.next) {
                  case 0:
                    shinyOnCustomMessage = getShinyOnCustomMessage();
                    if (!shinyOnCustomMessage) {
                      _context13.next = 4;
                      break;
                    }
                    _context13.next = 4;
                    return shinyOnCustomMessage(message);
                  case 4:
                    _context13.next = 6;
                    return _this3._sendMessagesToHandlers(message, customMessageHandlers, customMessageHandlerOrder);
                  case 6:
                  case "end":
                    return _context13.stop();
                }
            }, _callee13);
          }));
          return function(_x15) {
            return _ref8.apply(this, arguments);
          };
        }());
        addMessageHandler("config", function(message) {
          _this3.config = {
            workerId: message.workerId,
            sessionId: message.sessionId
          };
          if (message.user)
            setShinyUser(message.user);
          (0, import_jquery38.default)(document).trigger("shiny:sessioninitialized");
        });
        addMessageHandler("busy", function(message) {
          if (message === "busy") {
            (0, import_jquery38.default)(document.documentElement).addClass("shiny-busy");
            (0, import_jquery38.default)(document).trigger("shiny:busy");
          } else if (message === "idle") {
            (0, import_jquery38.default)(document.documentElement).removeClass("shiny-busy");
            (0, import_jquery38.default)(document).trigger("shiny:idle");
          }
        });
        addMessageHandler("recalculating", function(message) {
          if (hasOwnProperty(message, "name") && hasOwnProperty(message, "status")) {
            var binding = _this3.$bindings[message.name];
            if (binding) {
              (0, import_jquery38.default)(binding.el).trigger("shiny:" + message.status);
            } else {
              (0, import_jquery38.default)().trigger("shiny:" + message.status);
            }
          }
        });
        addMessageHandler("reload", function(message) {
          window.location.reload();
          return;
          message;
        });
        addMessageHandler("shiny-insert-ui", /* @__PURE__ */ function() {
          var _ref9 = _asyncToGenerator13(/* @__PURE__ */ _regeneratorRuntime13().mark(function _callee14(message) {
            var targets, _iterator2, _step2, target;
            return _regeneratorRuntime13().wrap(function _callee14$(_context14) {
              while (1)
                switch (_context14.prev = _context14.next) {
                  case 0:
                    targets = (0, import_jquery38.default)(message.selector);
                    if (!(targets.length === 0)) {
                      _context14.next = 7;
                      break;
                    }
                    console.warn('The selector you chose ("' + message.selector + '") could not be found in the DOM.');
                    _context14.next = 5;
                    return renderHtmlAsync(message.content.html, (0, import_jquery38.default)([]), message.content.deps);
                  case 5:
                    _context14.next = 26;
                    break;
                  case 7:
                    _iterator2 = _createForOfIteratorHelper6(targets);
                    _context14.prev = 8;
                    _iterator2.s();
                  case 10:
                    if ((_step2 = _iterator2.n()).done) {
                      _context14.next = 18;
                      break;
                    }
                    target = _step2.value;
                    _context14.next = 14;
                    return renderContentAsync(target, message.content, message.where);
                  case 14:
                    if (!(message.multiple === false)) {
                      _context14.next = 16;
                      break;
                    }
                    return _context14.abrupt("break", 18);
                  case 16:
                    _context14.next = 10;
                    break;
                  case 18:
                    _context14.next = 23;
                    break;
                  case 20:
                    _context14.prev = 20;
                    _context14.t0 = _context14["catch"](8);
                    _iterator2.e(_context14.t0);
                  case 23:
                    _context14.prev = 23;
                    _iterator2.f();
                    return _context14.finish(23);
                  case 26:
                  case "end":
                    return _context14.stop();
                }
            }, _callee14, null, [[8, 20, 23, 26]]);
          }));
          return function(_x16) {
            return _ref9.apply(this, arguments);
          };
        }());
        addMessageHandler("shiny-remove-ui", function(message) {
          var els = (0, import_jquery38.default)(message.selector);
          els.each(function(i5, el) {
            shinyUnbindAll(el, true);
            (0, import_jquery38.default)(el).remove();
            return message.multiple === false ? false : void 0;
          });
        });
        addMessageHandler("frozen", function(message) {
          for (var i5 = 0; i5 < message.ids.length; i5++) {
            shinyForgetLastInputValue(message.ids[i5]);
          }
        });
        function getTabset(id) {
          var $tabset = (0, import_jquery38.default)("#" + $escape(id));
          if ($tabset.length === 0)
            throw "There is no tabsetPanel (or navbarPage or navlistPanel) with id equal to '" + id + "'";
          return $tabset;
        }
        function getTabContent($tabset) {
          var tabsetId = $tabset.attr("data-tabsetid");
          var $tabContent = (0, import_jquery38.default)("div.tab-content[data-tabsetid='" + $escape(tabsetId) + "']");
          return $tabContent;
        }
        function getTargetTabs($tabset, $tabContent, target) {
          var dataValue = "[data-value='" + $escape(target) + "']";
          var $aTag = $tabset.find("a" + dataValue);
          var $liTag = $aTag.parent();
          if ($liTag.length === 0) {
            throw "There is no tabPanel (or navbarMenu) with value (or menuName) equal to '" + target + "'";
          }
          var $liTags = [];
          var $divTags = [];
          if ($aTag.attr("data-toggle") === "dropdown") {
            var $dropdownTabset = $aTag.find("+ ul.dropdown-menu");
            var dropdownId = $dropdownTabset.attr("data-tabsetid");
            var $dropdownLiTags = $dropdownTabset.find("a[data-toggle='tab']").parent("li");
            $dropdownLiTags.each(function(i5, el) {
              $liTags.push((0, import_jquery38.default)(el));
            });
            var selector = "div.tab-pane[id^='tab-" + $escape(dropdownId) + "']";
            var $dropdownDivs = $tabContent.find(selector);
            $dropdownDivs.each(function(i5, el) {
              $divTags.push((0, import_jquery38.default)(el));
            });
          } else {
            $divTags.push($tabContent.find("div" + dataValue));
          }
          return {
            $liTag: $liTag,
            $liTags: $liTags,
            $divTags: $divTags
          };
        }
        addMessageHandler("shiny-insert-tab", /* @__PURE__ */ function() {
          var _ref10 = _asyncToGenerator13(/* @__PURE__ */ _regeneratorRuntime13().mark(function _callee15(message) {
            var $parentTabset, $tabset, $tabContent, tabsetId, $divTag, $liTag, $aTag, $targetLiTag, targetInfo, dropdown, index, tabId, _iterator3, _step3, el, getTabIndex, getDropdown;
            return _regeneratorRuntime13().wrap(function _callee15$(_context15) {
              while (1)
                switch (_context15.prev = _context15.next) {
                  case 0:
                    getDropdown = function _getDropdown() {
                      if (message.menuName !== null) {
                        var $dropdownATag = (0, import_jquery38.default)("a.dropdown-toggle[data-value='" + $escape(message.menuName) + "']");
                        if ($dropdownATag.length === 0) {
                          throw "There is no navbarMenu with menuName equal to '" + message.menuName + "'";
                        }
                        var $dropdownTabset = $dropdownATag.find("+ ul.dropdown-menu");
                        var dropdownId = $dropdownTabset.attr("data-tabsetid");
                        return {
                          $tabset: $dropdownTabset,
                          id: dropdownId
                        };
                      } else if (message.target !== null && $targetLiTag !== null) {
                        var $uncleTabset = $targetLiTag.parent("ul");
                        if ($uncleTabset.hasClass("dropdown-menu")) {
                          var uncleId = $uncleTabset.attr("data-tabsetid");
                          return {
                            $tabset: $uncleTabset,
                            id: uncleId
                          };
                        }
                      }
                      return null;
                    };
                    getTabIndex = function _getTabIndex($tabset2, tabsetId2) {
                      var existingTabIds = [0];
                      $tabset2.find("> li").each(function() {
                        var $tab = (0, import_jquery38.default)(this).find("> a[data-toggle='tab']");
                        if ($tab.length > 0) {
                          var href = $tab.attr("href").replace(/.*(?=#[^\s]+$)/, "");
                          var _index = href.replace("#tab-" + tabsetId2 + "-", "");
                          existingTabIds.push(Number(_index));
                        }
                      });
                      return Math.max.apply(null, existingTabIds) + 1;
                    };
                    $parentTabset = getTabset(message.inputId);
                    $tabset = $parentTabset;
                    $tabContent = getTabContent($tabset);
                    tabsetId = $parentTabset.attr("data-tabsetid");
                    $divTag = (0, import_jquery38.default)(message.divTag.html);
                    $liTag = (0, import_jquery38.default)(message.liTag.html);
                    $aTag = $liTag.find("> a");
                    $targetLiTag = null;
                    if (message.target !== null) {
                      targetInfo = getTargetTabs($tabset, $tabContent, message.target);
                      $targetLiTag = targetInfo.$liTag;
                    }
                    dropdown = getDropdown();
                    if (!(dropdown !== null)) {
                      _context15.next = 18;
                      break;
                    }
                    if (!($aTag.attr("data-toggle") === "dropdown")) {
                      _context15.next = 15;
                      break;
                    }
                    throw "Cannot insert a navbarMenu inside another one";
                  case 15:
                    $tabset = dropdown.$tabset;
                    tabsetId = dropdown.id;
                    $liTag.removeClass("nav-item").find(".nav-link").removeClass("nav-link").addClass("dropdown-item");
                  case 18:
                    if ($aTag.attr("data-toggle") === "tab") {
                      index = getTabIndex($tabset, tabsetId);
                      tabId = "tab-" + tabsetId + "-" + index;
                      $liTag.find("> a").attr("href", "#" + tabId);
                      $divTag.attr("id", tabId);
                    }
                    if (message.position === "before") {
                      if ($targetLiTag) {
                        $targetLiTag.before($liTag);
                      } else {
                        $tabset.prepend($liTag);
                      }
                    } else if (message.position === "after") {
                      if ($targetLiTag) {
                        $targetLiTag.after($liTag);
                      } else {
                        $tabset.append($liTag);
                      }
                    }
                    _context15.next = 22;
                    return renderContentAsync($liTag[0], {
                      html: $liTag.html(),
                      deps: message.liTag.deps
                    });
                  case 22:
                    _context15.next = 24;
                    return renderContentAsync(
                      $tabContent[0],
                      {
                        html: "",
                        deps: message.divTag.deps
                      },
                      "beforeend"
                    );
                  case 24:
                    _iterator3 = _createForOfIteratorHelper6($divTag.get());
                    _context15.prev = 25;
                    _iterator3.s();
                  case 27:
                    if ((_step3 = _iterator3.n()).done) {
                      _context15.next = 34;
                      break;
                    }
                    el = _step3.value;
                    $tabContent[0].appendChild(el);
                    _context15.next = 32;
                    return renderContentAsync(el, el.innerHTML || el.textContent);
                  case 32:
                    _context15.next = 27;
                    break;
                  case 34:
                    _context15.next = 39;
                    break;
                  case 36:
                    _context15.prev = 36;
                    _context15.t0 = _context15["catch"](25);
                    _iterator3.e(_context15.t0);
                  case 39:
                    _context15.prev = 39;
                    _iterator3.f();
                    return _context15.finish(39);
                  case 42:
                    if (message.select) {
                      $liTag.find("a").tab("show");
                    }
                  case 43:
                  case "end":
                    return _context15.stop();
                }
            }, _callee15, null, [[25, 36, 39, 42]]);
          }));
          return function(_x17) {
            return _ref10.apply(this, arguments);
          };
        }());
        function ensureTabsetHasVisibleTab($tabset) {
          var inputBinding = $tabset.data("shiny-input-binding");
          if (!inputBinding.getValue($tabset)) {
            var destTabValue = getFirstTab($tabset);
            var evt = import_jquery38.default.Event("shiny:updateinput");
            evt.binding = inputBinding;
            $tabset.trigger(evt);
            inputBinding.setValue($tabset[0], destTabValue);
          }
        }
        function getFirstTab($ul) {
          return $ul.find("li:visible a[data-toggle='tab']").first().attr("data-value") || null;
        }
        function tabApplyFunction(target, func) {
          var liTags = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
          import_jquery38.default.each(target, function(key, el) {
            if (key === "$liTag") {
              func(el);
            } else if (key === "$divTags") {
              import_jquery38.default.each(el, function(i5, div) {
                func(div);
              });
            } else if (liTags && key === "$liTags") {
              import_jquery38.default.each(el, function(i5, div) {
                func(div);
              });
            }
          });
        }
        addMessageHandler("shiny-remove-tab", function(message) {
          var $tabset = getTabset(message.inputId);
          var $tabContent = getTabContent($tabset);
          var target = getTargetTabs($tabset, $tabContent, message.target);
          tabApplyFunction(target, removeEl);
          ensureTabsetHasVisibleTab($tabset);
          function removeEl($el) {
            shinyUnbindAll($el, true);
            $el.remove();
          }
        });
        addMessageHandler("shiny-change-tab-visibility", function(message) {
          var $tabset = getTabset(message.inputId);
          var $tabContent = getTabContent($tabset);
          var target = getTargetTabs($tabset, $tabContent, message.target);
          tabApplyFunction(target, changeVisibility, true);
          ensureTabsetHasVisibleTab($tabset);
          function changeVisibility($el) {
            if (message.type === "show")
              $el.css("display", "");
            else if (message.type === "hide") {
              $el.hide();
              $el.removeClass("active");
            }
          }
        });
        addMessageHandler("updateQueryString", function(message) {
          if (message.mode === "replace") {
            window.history.replaceState(null, null, message.queryString);
            return;
          }
          var what = null;
          if (message.queryString.charAt(0) === "#")
            what = "hash";
          else if (message.queryString.charAt(0) === "?")
            what = "query";
          else
            throw "The 'query' string must start with either '?' (to update the query string) or with '#' (to update the hash).";
          var path2 = window.location.pathname;
          var oldQS = window.location.search;
          var oldHash = window.location.hash;
          var relURL = path2;
          if (what === "query")
            relURL += message.queryString;
          else
            relURL += oldQS + message.queryString;
          window.history.pushState(null, null, relURL);
          if (message.queryString.indexOf("#") !== -1)
            what = "hash";
          if (window.location.hash !== oldHash)
            what = "hash";
          if (what === "hash")
            (0, import_jquery38.default)(document).trigger("hashchange");
        });
        addMessageHandler("resetBrush", function(message) {
          resetBrush(message.brushId);
        });
      }
    }, {
      key: "getTestSnapshotBaseUrl",
      value: function getTestSnapshotBaseUrl() {
        var _ref11 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref11$fullUrl = _ref11.fullUrl, fullUrl = _ref11$fullUrl === void 0 ? true : _ref11$fullUrl;
        var loc = window.location;
        var url = "";
        if (fullUrl) {
          url = loc.origin + loc.pathname.replace(/\/[^/]*$/, "");
        }
        url += "/session/" + encodeURIComponent(this.config.sessionId) + "/dataobj/shinytest?w=" + encodeURIComponent(this.config.workerId) + "&nonce=" + randomId();
        return url;
      }
    }]);
    return ShinyApp2;
  }();

  // srcts/src/shiny/index.ts
  function _typeof52(obj) {
    "@babel/helpers - typeof";
    return _typeof52 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof52(obj);
  }
  function _regeneratorRuntime14() {
    "use strict";
    _regeneratorRuntime14 = function _regeneratorRuntime15() {
      return exports;
    };
    var exports = {}, Op = Object.prototype, hasOwn5 = Op.hasOwnProperty, defineProperty3 = Object.defineProperty || function(obj, key, desc) {
      obj[key] = desc.value;
    }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
    function define(obj, key, value) {
      return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }), obj[key];
    }
    try {
      define({}, "");
    } catch (err) {
      define = function define2(obj, key, value) {
        return obj[key] = value;
      };
    }
    function wrap(innerFn, outerFn, self2, tryLocsList) {
      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []);
      return defineProperty3(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) }), generator;
    }
    function tryCatch(fn, obj, arg) {
      try {
        return { type: "normal", arg: fn.call(obj, arg) };
      } catch (err) {
        return { type: "throw", arg: err };
      }
    }
    exports.wrap = wrap;
    var ContinueSentinel = {};
    function Generator() {
    }
    function GeneratorFunction() {
    }
    function GeneratorFunctionPrototype() {
    }
    var IteratorPrototype = {};
    define(IteratorPrototype, iteratorSymbol, function() {
      return this;
    });
    var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values2([])));
    NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn5.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
    var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
    function defineIteratorMethods(prototype) {
      ["next", "throw", "return"].forEach(function(method) {
        define(prototype, method, function(arg) {
          return this._invoke(method, arg);
        });
      });
    }
    function AsyncIterator(generator, PromiseImpl) {
      function invoke(method, arg, resolve, reject) {
        var record = tryCatch(generator[method], generator, arg);
        if ("throw" !== record.type) {
          var result = record.arg, value = result.value;
          return value && "object" == _typeof52(value) && hasOwn5.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
            invoke("next", value2, resolve, reject);
          }, function(err) {
            invoke("throw", err, resolve, reject);
          }) : PromiseImpl.resolve(value).then(function(unwrapped) {
            result.value = unwrapped, resolve(result);
          }, function(error) {
            return invoke("throw", error, resolve, reject);
          });
        }
        reject(record.arg);
      }
      var previousPromise;
      defineProperty3(this, "_invoke", { value: function value(method, arg) {
        function callInvokeWithMethodAndArg() {
          return new PromiseImpl(function(resolve, reject) {
            invoke(method, arg, resolve, reject);
          });
        }
        return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
      } });
    }
    function makeInvokeMethod(innerFn, self2, context) {
      var state = "suspendedStart";
      return function(method, arg) {
        if ("executing" === state)
          throw new Error("Generator is already running");
        if ("completed" === state) {
          if ("throw" === method)
            throw arg;
          return doneResult();
        }
        for (context.method = method, context.arg = arg; ; ) {
          var delegate = context.delegate;
          if (delegate) {
            var delegateResult = maybeInvokeDelegate(delegate, context);
            if (delegateResult) {
              if (delegateResult === ContinueSentinel)
                continue;
              return delegateResult;
            }
          }
          if ("next" === context.method)
            context.sent = context._sent = context.arg;
          else if ("throw" === context.method) {
            if ("suspendedStart" === state)
              throw state = "completed", context.arg;
            context.dispatchException(context.arg);
          } else
            "return" === context.method && context.abrupt("return", context.arg);
          state = "executing";
          var record = tryCatch(innerFn, self2, context);
          if ("normal" === record.type) {
            if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel)
              continue;
            return { value: record.arg, done: context.done };
          }
          "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
        }
      };
    }
    function maybeInvokeDelegate(delegate, context) {
      var methodName = context.method, method = delegate.iterator[methodName];
      if (void 0 === method)
        return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
      var record = tryCatch(method, delegate.iterator, context.arg);
      if ("throw" === record.type)
        return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
      var info = record.arg;
      return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
    }
    function pushTryEntry(locs) {
      var entry = { tryLoc: locs[0] };
      1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
    }
    function resetTryEntry(entry) {
      var record = entry.completion || {};
      record.type = "normal", delete record.arg, entry.completion = record;
    }
    function Context(tryLocsList) {
      this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(true);
    }
    function values2(iterable) {
      if (iterable) {
        var iteratorMethod = iterable[iteratorSymbol];
        if (iteratorMethod)
          return iteratorMethod.call(iterable);
        if ("function" == typeof iterable.next)
          return iterable;
        if (!isNaN(iterable.length)) {
          var i5 = -1, next2 = function next3() {
            for (; ++i5 < iterable.length; )
              if (hasOwn5.call(iterable, i5))
                return next3.value = iterable[i5], next3.done = false, next3;
            return next3.value = void 0, next3.done = true, next3;
          };
          return next2.next = next2;
        }
      }
      return { next: doneResult };
    }
    function doneResult() {
      return { value: void 0, done: true };
    }
    return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty3(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }), defineProperty3(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) {
      var ctor = "function" == typeof genFun && genFun.constructor;
      return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
    }, exports.mark = function(genFun) {
      return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
    }, exports.awrap = function(arg) {
      return { __await: arg };
    }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
      return this;
    }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
      void 0 === PromiseImpl && (PromiseImpl = Promise);
      var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl);
      return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
        return result.done ? result.value : iter.next();
      });
    }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() {
      return this;
    }), define(Gp, "toString", function() {
      return "[object Generator]";
    }), exports.keys = function(val) {
      var object = Object(val), keys2 = [];
      for (var key in object)
        keys2.push(key);
      return keys2.reverse(), function next2() {
        for (; keys2.length; ) {
          var key2 = keys2.pop();
          if (key2 in object)
            return next2.value = key2, next2.done = false, next2;
        }
        return next2.done = true, next2;
      };
    }, exports.values = values2, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) {
      if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
        for (var name in this)
          "t" === name.charAt(0) && hasOwn5.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
    }, stop: function stop() {
      this.done = true;
      var rootRecord = this.tryEntries[0].completion;
      if ("throw" === rootRecord.type)
        throw rootRecord.arg;
      return this.rval;
    }, dispatchException: function dispatchException(exception) {
      if (this.done)
        throw exception;
      var context = this;
      function handle(loc, caught) {
        return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;
      }
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5], record = entry.completion;
        if ("root" === entry.tryLoc)
          return handle("end");
        if (entry.tryLoc <= this.prev) {
          var hasCatch = hasOwn5.call(entry, "catchLoc"), hasFinally = hasOwn5.call(entry, "finallyLoc");
          if (hasCatch && hasFinally) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          } else if (hasCatch) {
            if (this.prev < entry.catchLoc)
              return handle(entry.catchLoc, true);
          } else {
            if (!hasFinally)
              throw new Error("try statement without catch or finally");
            if (this.prev < entry.finallyLoc)
              return handle(entry.finallyLoc);
          }
        }
      }
    }, abrupt: function abrupt(type, arg) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc <= this.prev && hasOwn5.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
          var finallyEntry = entry;
          break;
        }
      }
      finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
      var record = finallyEntry ? finallyEntry.completion : {};
      return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
    }, complete: function complete(record, afterLoc) {
      if ("throw" === record.type)
        throw record.arg;
      return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
    }, finish: function finish(finallyLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.finallyLoc === finallyLoc)
          return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
      }
    }, catch: function _catch(tryLoc) {
      for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
        var entry = this.tryEntries[i5];
        if (entry.tryLoc === tryLoc) {
          var record = entry.completion;
          if ("throw" === record.type) {
            var thrown = record.arg;
            resetTryEntry(entry);
          }
          return thrown;
        }
      }
      throw new Error("illegal catch attempt");
    }, delegateYield: function delegateYield(iterable, resultName, nextLoc) {
      return this.delegate = { iterator: values2(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = void 0), ContinueSentinel;
    } }, exports;
  }
  function asyncGeneratorStep14(gen, resolve, reject, _next, _throw, key, arg) {
    try {
      var info = gen[key](arg);
      var value = info.value;
    } catch (error) {
      reject(error);
      return;
    }
    if (info.done) {
      resolve(value);
    } else {
      Promise.resolve(value).then(_next, _throw);
    }
  }
  function _asyncToGenerator14(fn) {
    return function() {
      var self2 = this, args = arguments;
      return new Promise(function(resolve, reject) {
        var gen = fn.apply(self2, args);
        function _next(value) {
          asyncGeneratorStep14(gen, resolve, reject, _next, _throw, "next", value);
        }
        function _throw(err) {
          asyncGeneratorStep14(gen, resolve, reject, _next, _throw, "throw", err);
        }
        _next(void 0);
      });
    };
  }
  function _classCallCheck44(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties44(target, props) {
    for (var i5 = 0; i5 < props.length; i5++) {
      var descriptor = props[i5];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey46(descriptor.key), descriptor);
    }
  }
  function _createClass44(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties44(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties44(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _defineProperty23(obj, key, value) {
    key = _toPropertyKey46(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey46(arg) {
    var key = _toPrimitive46(arg, "string");
    return _typeof52(key) === "symbol" ? key : String(key);
  }
  function _toPrimitive46(input, hint) {
    if (_typeof52(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (_typeof52(res) !== "object")
        return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  var ShinyClass = /* @__PURE__ */ function() {
    function ShinyClass2() {
      var _this = this;
      _classCallCheck44(this, ShinyClass2);
      _defineProperty23(this, "version", void 0);
      _defineProperty23(this, "$escape", void 0);
      _defineProperty23(this, "compareVersion", void 0);
      _defineProperty23(this, "inputBindings", void 0);
      _defineProperty23(this, "InputBinding", void 0);
      _defineProperty23(this, "outputBindings", void 0);
      _defineProperty23(this, "OutputBinding", void 0);
      _defineProperty23(this, "resetBrush", void 0);
      _defineProperty23(this, "notifications", void 0);
      _defineProperty23(this, "modal", void 0);
      _defineProperty23(this, "showReconnectDialog", void 0);
      _defineProperty23(this, "hideReconnectDialog", void 0);
      _defineProperty23(this, "renderDependenciesAsync", void 0);
      _defineProperty23(this, "renderDependencies", void 0);
      _defineProperty23(this, "renderContentAsync", void 0);
      _defineProperty23(this, "renderContent", void 0);
      _defineProperty23(this, "renderHtmlAsync", void 0);
      _defineProperty23(this, "renderHtml", void 0);
      _defineProperty23(this, "addCustomMessageHandler", void 0);
      _defineProperty23(this, "createSocket", void 0);
      _defineProperty23(this, "user", void 0);
      _defineProperty23(this, "progressHandlers", void 0);
      _defineProperty23(this, "shinyapp", void 0);
      _defineProperty23(this, "setInputValue", void 0);
      _defineProperty23(this, "onInputChange", void 0);
      _defineProperty23(this, "forgetLastInputValue", void 0);
      _defineProperty23(this, "bindAll", void 0);
      _defineProperty23(this, "unbindAll", void 0);
      _defineProperty23(this, "initializeInputs", void 0);
      _defineProperty23(this, "initializedPromise", void 0);
      _defineProperty23(this, "oncustommessage", void 0);
      this.version = "1.10.0";
      var _initInputBindings = initInputBindings(), inputBindings = _initInputBindings.inputBindings, fileInputBinding2 = _initInputBindings.fileInputBinding;
      var _initOutputBindings = initOutputBindings(), outputBindings = _initOutputBindings.outputBindings;
      setFileInputBinding(fileInputBinding2);
      this.$escape = $escape;
      this.compareVersion = compareVersion;
      this.inputBindings = inputBindings;
      this.InputBinding = InputBinding;
      this.outputBindings = outputBindings;
      this.OutputBinding = OutputBinding;
      this.resetBrush = resetBrush;
      this.notifications = {
        show: show2,
        remove: remove2
      };
      this.modal = {
        show: show,
        remove: remove
      };
      this.addCustomMessageHandler = addCustomMessageHandler;
      this.showReconnectDialog = showReconnectDialog;
      this.hideReconnectDialog = hideReconnectDialog;
      this.renderDependenciesAsync = renderDependenciesAsync;
      this.renderDependencies = renderDependencies;
      this.renderContentAsync = renderContentAsync;
      this.renderContent = renderContent;
      this.renderHtmlAsync = renderHtmlAsync;
      this.renderHtml = renderHtml2;
      this.initializedPromise = createInitStatus();
      (0, import_jquery39.default)(function() {
        setTimeout(/* @__PURE__ */ _asyncToGenerator14(/* @__PURE__ */ _regeneratorRuntime14().mark(function _callee() {
          return _regeneratorRuntime14().wrap(function _callee$(_context) {
            while (1)
              switch (_context.prev = _context.next) {
                case 0:
                  _context.prev = 0;
                  _context.next = 3;
                  return _this.initialize();
                case 3:
                  _context.next = 9;
                  break;
                case 5:
                  _context.prev = 5;
                  _context.t0 = _context["catch"](0);
                  showErrorInClientConsole(_context.t0);
                  throw _context.t0;
                case 9:
                case "end":
                  return _context.stop();
              }
          }, _callee, null, [[0, 5]]);
        })), 1);
      });
    }
    _createClass44(ShinyClass2, [{
      key: "inDevMode",
      value: function inDevMode() {
        if ("__SHINY_DEV_MODE__" in window)
          return Boolean(window.__SHINY_DEV_MODE__);
        return false;
      }
    }, {
      key: "initialize",
      value: function() {
        var _initialize = _asyncToGenerator14(/* @__PURE__ */ _regeneratorRuntime14().mark(function _callee3() {
          var _this2 = this;
          var shinyapp, inputBatchSender, inputsNoResend, inputsEvent, inputsRate, inputsDefer, target, inputs, inputBindings, outputBindings, shinyBindCtx, initializeInputs, getIdFromEl, initialValues, getComputedBgColor, getComputedFont, maybeAddThemeObserver, doSendTheme, doSendImageSize, isHidden, lastKnownVisibleOutputs, doSendOutputHiddenState, sendOutputHiddenStateDebouncer, sendOutputHiddenState, filterEventsByNamespace, bs3classes, singletonText, dependencyText;
          return _regeneratorRuntime14().wrap(function _callee3$(_context3) {
            while (1)
              switch (_context3.prev = _context3.next) {
                case 0:
                  filterEventsByNamespace = function _filterEventsByNamesp(namespace, handler) {
                    for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
                      args[_key - 2] = arguments[_key];
                    }
                    var namespaceArr = namespace.split(".");
                    return function(e4) {
                      var _e$namespace$split, _e$namespace;
                      var eventNamespace = (_e$namespace$split = (_e$namespace = e4.namespace) === null || _e$namespace === void 0 ? void 0 : _e$namespace.split(".")) !== null && _e$namespace$split !== void 0 ? _e$namespace$split : [];
                      for (var i5 = 0; i5 < namespaceArr.length; i5++) {
                        if (eventNamespace.indexOf(namespaceArr[i5]) === -1)
                          return;
                      }
                      handler.apply(this, [namespaceArr, handler].concat(args));
                    };
                  };
                  sendOutputHiddenState = function _sendOutputHiddenStat() {
                    sendOutputHiddenStateDebouncer.normalCall();
                  };
                  doSendOutputHiddenState = function _doSendOutputHiddenSt() {
                    var visibleOutputs = {};
                    (0, import_jquery39.default)(".shiny-bound-output").each(function() {
                      var id = getIdFromEl(this);
                      delete lastKnownVisibleOutputs[id];
                      var hidden = isHidden(this), evt = {
                        type: "shiny:visualchange",
                        visible: !hidden
                      };
                      if (hidden) {
                        inputs.setInput(".clientdata_output_" + id + "_hidden", true);
                      } else {
                        visibleOutputs[id] = true;
                        inputs.setInput(".clientdata_output_" + id + "_hidden", false);
                      }
                      var $this = (0, import_jquery39.default)(this);
                      evt.binding = $this.data("shiny-output-binding");
                      $this.trigger(evt);
                    });
                    for (var name in lastKnownVisibleOutputs) {
                      if (hasDefinedProperty(lastKnownVisibleOutputs, name))
                        inputs.setInput(".clientdata_output_" + name + "_hidden", true);
                    }
                    lastKnownVisibleOutputs = visibleOutputs;
                  };
                  isHidden = function _isHidden(obj) {
                    if (obj === null || obj.offsetWidth !== 0 || obj.offsetHeight !== 0) {
                      return false;
                    } else if (getStyle(obj, "display") === "none") {
                      return true;
                    } else {
                      return isHidden(obj.parentNode);
                    }
                  };
                  doSendImageSize = function _doSendImageSize() {
                    (0, import_jquery39.default)(".shiny-image-output, .shiny-plot-output, .shiny-report-size").each(function() {
                      var id = getIdFromEl(this), rect = getBoundingClientSizeBeforeZoom(this);
                      if (rect.width !== 0 || rect.height !== 0) {
                        inputs.setInput(".clientdata_output_" + id + "_width", rect.width);
                        inputs.setInput(".clientdata_output_" + id + "_height", rect.height);
                      }
                    });
                    (0, import_jquery39.default)(".shiny-image-output, .shiny-plot-output, .shiny-report-theme").each(function() {
                      doSendTheme(this);
                    });
                    (0, import_jquery39.default)(".shiny-bound-output").each(function() {
                      var $this = (0, import_jquery39.default)(this), binding = $this.data("shiny-output-binding");
                      $this.trigger({
                        type: "shiny:visualchange",
                        visible: !isHidden(this),
                        binding: binding
                      });
                      binding.onResize();
                    });
                  };
                  doSendTheme = function _doSendTheme(el) {
                    if (el.classList.contains("shiny-output-error")) {
                      return;
                    }
                    var id = getIdFromEl(el);
                    inputs.setInput(".clientdata_output_" + id + "_bg", getComputedBgColor(el));
                    inputs.setInput(".clientdata_output_" + id + "_fg", getStyle(el, "color"));
                    inputs.setInput(".clientdata_output_" + id + "_accent", getComputedLinkColor(el));
                    inputs.setInput(".clientdata_output_" + id + "_font", getComputedFont(el));
                  };
                  maybeAddThemeObserver = function _maybeAddThemeObserve(el) {
                    if (!window.MutationObserver) {
                      return;
                    }
                    var cl = el.classList;
                    var reportTheme = cl.contains("shiny-image-output") || cl.contains("shiny-plot-output") || cl.contains("shiny-report-theme");
                    if (!reportTheme) {
                      return;
                    }
                    var $el = (0, import_jquery39.default)(el);
                    if ($el.data("shiny-theme-observer")) {
                      return;
                    }
                    var observerCallback = new Debouncer(null, function() {
                      return doSendTheme(el);
                    }, 100);
                    var observer = new MutationObserver(function() {
                      return observerCallback.normalCall();
                    });
                    var config = {
                      attributes: true,
                      attributeFilter: ["style", "class"]
                    };
                    observer.observe(el, config);
                    $el.data("shiny-theme-observer", observer);
                  };
                  getComputedFont = function _getComputedFont(el) {
                    var fontFamily = getStyle(el, "font-family");
                    var fontSize = getStyle(el, "font-size");
                    return {
                      families: fontFamily === null || fontFamily === void 0 ? void 0 : fontFamily.replace(/"/g, "").split(", "),
                      size: fontSize
                    };
                  };
                  getComputedBgColor = function _getComputedBgColor(el) {
                    if (!el) {
                      return null;
                    }
                    var bgColor = getStyle(el, "background-color");
                    if (!bgColor)
                      return bgColor;
                    var m2 = bgColor.match(/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/);
                    if (bgColor === "transparent" || m2 && parseFloat(m2[4]) === 0) {
                      var bgImage = getStyle(el, "background-image");
                      if (bgImage && bgImage !== "none") {
                        return null;
                      } else {
                        return getComputedBgColor(el.parentElement);
                      }
                    }
                    return bgColor;
                  };
                  getIdFromEl = function _getIdFromEl(el) {
                    var $el = (0, import_jquery39.default)(el);
                    var bindingAdapter = $el.data("shiny-output-binding");
                    if (!bindingAdapter)
                      return null;
                    else
                      return bindingAdapter.getId();
                  };
                  initializeInputs = function _initializeInputs() {
                    var scope = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document.documentElement;
                    var bindings = inputBindings.getBindings();
                    for (var i5 = 0; i5 < bindings.length; i5++) {
                      var binding = bindings[i5].binding;
                      var inputObjects = binding.find(scope);
                      if (inputObjects) {
                        for (var j3 = 0; j3 < inputObjects.length; j3++) {
                          var $inputObjectJ = (0, import_jquery39.default)(inputObjects[j3]);
                          if (!$inputObjectJ.data("_shiny_initialized")) {
                            $inputObjectJ.data("_shiny_initialized", true);
                            binding.initialize(inputObjects[j3]);
                          }
                        }
                      }
                    }
                  };
                  shinyBindCtx = function _shinyBindCtx() {
                    return {
                      inputs: inputs,
                      inputsRate: inputsRate,
                      sendOutputHiddenState: sendOutputHiddenState,
                      maybeAddThemeObserver: maybeAddThemeObserver,
                      inputBindings: inputBindings,
                      outputBindings: outputBindings,
                      initDeferredIframes: initDeferredIframes
                    };
                  };
                  setShinyObj(this);
                  this.shinyapp = new ShinyApp();
                  shinyapp = this.shinyapp;
                  this.progressHandlers = shinyapp.progressHandlers;
                  inputBatchSender = new InputBatchSender(shinyapp);
                  inputsNoResend = new InputNoResendDecorator(inputBatchSender);
                  inputsEvent = new InputEventDecorator(inputsNoResend);
                  inputsRate = new InputRateDecorator(inputsEvent);
                  inputsDefer = new InputDeferDecorator(inputsEvent);
                  if ((0, import_jquery39.default)('input[type="submit"], button[type="submit"]').length > 0) {
                    target = inputsDefer;
                    (0, import_jquery39.default)('input[type="submit"], button[type="submit"]').each(function() {
                      (0, import_jquery39.default)(this).click(function(event) {
                        event.preventDefault();
                        inputsDefer.submit();
                      });
                    });
                  } else {
                    target = inputsRate;
                  }
                  inputs = new InputValidateDecorator(target);
                  this.setInputValue = this.onInputChange = function(name, value) {
                    var opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
                    var newOpts = addDefaultInputOpts(opts);
                    inputs.setInput(name, value, newOpts);
                  };
                  this.forgetLastInputValue = function(name) {
                    inputsNoResend.forget(name);
                  };
                  inputBindings = this.inputBindings;
                  outputBindings = this.outputBindings;
                  this.bindAll = /* @__PURE__ */ function() {
                    var _ref2 = _asyncToGenerator14(/* @__PURE__ */ _regeneratorRuntime14().mark(function _callee2(scope) {
                      return _regeneratorRuntime14().wrap(function _callee2$(_context2) {
                        while (1)
                          switch (_context2.prev = _context2.next) {
                            case 0:
                              _context2.next = 2;
                              return bindAll(shinyBindCtx(), scope);
                            case 2:
                            case "end":
                              return _context2.stop();
                          }
                      }, _callee2);
                    }));
                    return function(_x) {
                      return _ref2.apply(this, arguments);
                    };
                  }();
                  this.unbindAll = function(scope) {
                    var includeSelf = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
                    unbindAll(shinyBindCtx(), scope, includeSelf);
                  };
                  this.initializeInputs = initializeInputs;
                  initializeInputs(document.documentElement);
                  _context3.t0 = mapValues;
                  _context3.next = 34;
                  return _bindAll(shinyBindCtx(), document.documentElement);
                case 34:
                  _context3.t1 = _context3.sent;
                  _context3.t2 = function(x2) {
                    return x2.value;
                  };
                  initialValues = (0, _context3.t0)(_context3.t1, _context3.t2);
                  (0, import_jquery39.default)(".shiny-image-output, .shiny-plot-output, .shiny-report-size").each(function() {
                    var id = getIdFromEl(this), rect = getBoundingClientSizeBeforeZoom(this);
                    if (rect.width !== 0 || rect.height !== 0) {
                      initialValues[".clientdata_output_" + id + "_width"] = rect.width;
                      initialValues[".clientdata_output_" + id + "_height"] = rect.height;
                    }
                  });
                  (0, import_jquery39.default)(".shiny-image-output, .shiny-plot-output, .shiny-report-theme").each(function() {
                    var el = this;
                    var id = getIdFromEl(el);
                    initialValues[".clientdata_output_" + id + "_bg"] = getComputedBgColor(el);
                    initialValues[".clientdata_output_" + id + "_fg"] = getStyle(el, "color");
                    initialValues[".clientdata_output_" + id + "_accent"] = getComputedLinkColor(el);
                    initialValues[".clientdata_output_" + id + "_font"] = getComputedFont(el);
                    maybeAddThemeObserver(el);
                  });
                  sendImageSizeFns.setImageSend(inputBatchSender, doSendImageSize);
                  lastKnownVisibleOutputs = {};
                  (0, import_jquery39.default)(".shiny-bound-output").each(function() {
                    var id = getIdFromEl(this);
                    if (isHidden(this)) {
                      initialValues[".clientdata_output_" + id + "_hidden"] = true;
                    } else {
                      lastKnownVisibleOutputs[id] = true;
                      initialValues[".clientdata_output_" + id + "_hidden"] = false;
                    }
                  });
                  sendOutputHiddenStateDebouncer = new Debouncer(null, doSendOutputHiddenState, 0);
                  inputBatchSender.lastChanceCallback.push(function() {
                    if (sendOutputHiddenStateDebouncer.isPending())
                      sendOutputHiddenStateDebouncer.immediateCall();
                  });
                  (0, import_jquery39.default)(window).resize(debounce(500, sendImageSizeFns.regular));
                  bs3classes = ["modal", "dropdown", "tab", "tooltip", "popover", "collapse"];
                  import_jquery39.default.each(bs3classes, function(idx, classname) {
                    (0, import_jquery39.default)(document.body).on("shown.bs." + classname + ".sendImageSize", "*", filterEventsByNamespace("bs", sendImageSizeFns.regular));
                    (0, import_jquery39.default)(document.body).on("shown.bs." + classname + ".sendOutputHiddenState hidden.bs." + classname + ".sendOutputHiddenState", "*", filterEventsByNamespace("bs", sendOutputHiddenState));
                  });
                  (0, import_jquery39.default)(document.body).on("shown.sendImageSize", "*", sendImageSizeFns.regular);
                  (0, import_jquery39.default)(document.body).on("shown.sendOutputHiddenState hidden.sendOutputHiddenState", "*", sendOutputHiddenState);
                  initialValues[".clientdata_pixelratio"] = pixelRatio();
                  (0, import_jquery39.default)(window).resize(function() {
                    inputs.setInput(".clientdata_pixelratio", pixelRatio());
                  });
                  initialValues[".clientdata_url_protocol"] = window.location.protocol;
                  initialValues[".clientdata_url_hostname"] = window.location.hostname;
                  initialValues[".clientdata_url_port"] = window.location.port;
                  initialValues[".clientdata_url_pathname"] = window.location.pathname;
                  initialValues[".clientdata_url_search"] = window.location.search;
                  (0, import_jquery39.default)(window).on("pushstate", function(e4) {
                    inputs.setInput(".clientdata_url_search", window.location.search);
                    return;
                    e4;
                  });
                  (0, import_jquery39.default)(window).on("popstate", function(e4) {
                    inputs.setInput(".clientdata_url_search", window.location.search);
                    return;
                    e4;
                  });
                  initialValues[".clientdata_url_hash_initial"] = window.location.hash;
                  initialValues[".clientdata_url_hash"] = window.location.hash;
                  (0, import_jquery39.default)(window).on("hashchange", function(e4) {
                    inputs.setInput(".clientdata_url_hash", window.location.hash);
                    return;
                    e4;
                  });
                  singletonText = initialValues[".clientdata_singletons"] = (0, import_jquery39.default)('script[type="application/shiny-singletons"]').text();
                  registerNames(singletonText.split(/,/));
                  dependencyText = (0, import_jquery39.default)('script[type="application/html-dependencies"]').text();
                  import_jquery39.default.each(dependencyText.split(/;/), function(i5, depStr) {
                    var match = /\s*^(.+)\[(.+)\]\s*$/.exec(depStr);
                    if (match) {
                      registerDependency(match[1], match[2]);
                    }
                  });
                  inputsNoResend.reset(initialValues);
                  shinyapp.connect(initialValues);
                  (0, import_jquery39.default)(document).one("shiny:connected", function() {
                    initDeferredIframes();
                  });
                  (0, import_jquery39.default)(document).one("shiny:sessioninitialized", function() {
                    _this2.initializedPromise.resolve();
                  });
                case 69:
                case "end":
                  return _context3.stop();
              }
          }, _callee3, this);
        }));
        function initialize() {
          return _initialize.apply(this, arguments);
        }
        return initialize;
      }()
    }]);
    return ShinyClass2;
  }();
  function initDeferredIframes() {
    if (!window.Shiny || !window.Shiny.shinyapp || !window.Shiny.shinyapp.isConnected()) {
      return;
    }
    (0, import_jquery39.default)(".shiny-frame-deferred").each(function(i5, el) {
      var $el = (0, import_jquery39.default)(el);
      $el.removeClass("shiny-frame-deferred");
      $el.attr("src", $el.attr("data-deferred-src"));
      $el.attr("data-deferred-src", null);
    });
  }

  // srcts/src/window/userAgent.ts
  function windowUserAgent() {
    return window.navigator.userAgent;
  }

  // srcts/src/shiny/reactlog.ts
  var import_jquery40 = __toESM(require_jquery());
  function shinyAppConfig() {
    return shinyShinyApp().config;
  }
  function initReactlog() {
    (0, import_jquery40.default)(document).on("keydown", function(e4) {
      if (e4.which !== 114 || !e4.ctrlKey && !e4.metaKey || e4.shiftKey || e4.altKey)
        return;
      var url = "reactlog?w=" + window.escape(shinyAppConfig().workerId) + "&s=" + window.escape(shinyAppConfig().sessionId);
      window.open(url);
      e4.preventDefault();
    });
    (0, import_jquery40.default)(document).on("keydown", function(e4) {
      if (!(e4.which === 115 && (e4.ctrlKey || e4.metaKey) && !e4.shiftKey && !e4.altKey || e4.which === 114 && (e4.ctrlKey || e4.metaKey) && e4.shiftKey && !e4.altKey)) {
        return;
      }
      var url = "reactlog/mark?w=" + window.escape(shinyAppConfig().workerId) + "&s=" + window.escape(shinyAppConfig().sessionId);
      import_jquery40.default.get(url, function(result) {
        if (result !== "marked")
          return;
        var html = '<span id="shiny-reactlog-mark-text">Marked time point in reactlog</span>';
        show2({
          html: html,
          closeButton: true
        });
      }).fail(function() {
        window.open(url);
      });
      e4.preventDefault();
    });
  }

  // srcts/src/initialize/index.ts
  var Shiny;
  function init() {
    if (window.Shiny) {
      throw new Error("Trying to create window.Shiny, but it already exists!");
    }
    Shiny = window.Shiny = new ShinyClass();
    setUserAgent(windowUserAgent());
    determineBrowserInfo();
    trackHistory();
    disableFormSubmission();
    initReactlog();
  }

  // srcts/src/index.ts
  init();
})();
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
/**
 * @license
 * Copyright 2022 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
//# sourceMappingURL=shiny.js.map
