diff --git a/R/update-input.R b/R/update-input.R index 24c5911684..d36b0e908e 100644 --- a/R/update-input.R +++ b/R/update-input.R @@ -37,7 +37,11 @@ updateTextInput <- function(session = getDefaultReactiveDomain(), inputId, label = NULL, value = NULL, placeholder = NULL) { validate_session_object(session) - message <- dropNulls(list(label=label, value=value, placeholder=placeholder)) + message <- dropNulls(list( + label = processDeps(label, session), + value = value, + placeholder = placeholder + )) session$sendInputMessage(inputId, message) } @@ -111,7 +115,10 @@ updateTextAreaInput <- updateTextInput updateCheckboxInput <- function(session = getDefaultReactiveDomain(), inputId, label = NULL, value = NULL) { validate_session_object(session) - message <- dropNulls(list(label=label, value=value)) + message <- dropNulls(list( + label = processDeps(label, session), + value = value + )) session$sendInputMessage(inputId, message) } @@ -175,13 +182,17 @@ updateActionButton <- function(session = getDefaultReactiveDomain(), inputId, la validate_session_object(session) if (!is.null(icon)) icon <- as.character(validateIcon(icon)) - message <- dropNulls(list(label=label, icon=icon, disabled=disabled)) + message <- dropNulls(list( + label = processDeps(label, session), + icon = icon, + disabled = disabled + )) session$sendInputMessage(inputId, message) } #' @rdname updateActionButton #' @export updateActionLink <- function(session = getDefaultReactiveDomain(), inputId, label = NULL, icon = NULL) { - updateActionButton(session, inputId=inputId, label=label, icon=icon) + updateActionButton(session, inputId = inputId, label = processDeps(label, session), icon = icon) } @@ -225,7 +236,12 @@ updateDateInput <- function(session = getDefaultReactiveDomain(), inputId, label min <- dateYMD(min, "min") max <- dateYMD(max, "max") - message <- dropNulls(list(label=label, value=value, min=min, max=max)) + message <- dropNulls(list( + label = processDeps(label, session), + value = value, + min = min, + max = max + )) session$sendInputMessage(inputId, message) } @@ -275,7 +291,7 @@ updateDateRangeInput <- function(session = getDefaultReactiveDomain(), inputId, max <- dateYMD(max, "max") message <- dropNulls(list( - label = label, + label = processDeps(label, session), value = dropNulls(list(start = start, end = end)), min = min, max = max @@ -374,13 +390,16 @@ updateNavlistPanel <- updateTabsetPanel #' } #' @export updateNumericInput <- function(session = getDefaultReactiveDomain(), inputId, label = NULL, value = NULL, - min = NULL, max = NULL, step = NULL) { + min = NULL, max = NULL, step = NULL) { validate_session_object(session) message <- dropNulls(list( - label = label, value = formatNoSci(value), - min = formatNoSci(min), max = formatNoSci(max), step = formatNoSci(step) + label = processDeps(label, session), + value = formatNoSci(value), + min = formatNoSci(min), + max = formatNoSci(max), + step = formatNoSci(step) )) session$sendInputMessage(inputId, message) } @@ -460,7 +479,7 @@ updateSliderInput <- function(session = getDefaultReactiveDomain(), inputId, lab } message <- dropNulls(list( - label = label, + label = processDeps(label, session), value = formatNoSci(value), min = formatNoSci(min), max = formatNoSci(max), @@ -491,7 +510,11 @@ updateInputOptions <- function(session, inputId, label = NULL, choices = NULL, )) } - message <- dropNulls(list(label = label, options = options, value = selected)) + message <- dropNulls(list( + label = processDeps(label, session), + options = options, + value = selected + )) session$sendInputMessage(inputId, message) } @@ -644,7 +667,11 @@ updateSelectInput <- function(session = getDefaultReactiveDomain(), inputId, lab choices <- if (!is.null(choices)) choicesWithNames(choices) if (!is.null(selected)) selected <- as.character(selected) options <- if (!is.null(choices)) selectOptions(choices, selected, inputId, FALSE) - message <- dropNulls(list(label = label, options = options, value = selected)) + message <- dropNulls(list( + label = processDeps(label, session), + options = options, + value = selected + )) session$sendInputMessage(inputId, message) } diff --git a/inst/www/shared/shiny.js b/inst/www/shared/shiny.js index e6d20b2484..a43431ac80 100644 --- a/inst/www/shared/shiny.js +++ b/inst/www/shared/shiny.js @@ -4240,64 +4240,36 @@ } }); - // 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"; + // 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 uncurryThis14 = 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 = uncurryThis14([].concat); - var join2 = uncurryThis14([].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); + var objectKeys = require_object_keys(); + var toIndexedObject5 = require_to_indexed_object(); + var $propertyIsEnumerable = require_object_property_is_enumerable().f; + var propertyIsEnumerable = uncurryThis14($propertyIsEnumerable); + var push4 = uncurryThis14([].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; }; - 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 fails15 = require_fails(); - var whitespaces = require_whitespaces(); - var non = "\u200B\x85\u180E"; - module.exports = function(METHOD_NAME) { - return fails15(function() { - return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() !== non || PROPER_FUNCTION_NAME2 && whitespaces[METHOD_NAME].name !== METHOD_NAME; - }); }; - } - }); - - // 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")); + module.exports = { + entries: createMethod(true), + values: createMethod(false) }; } }); @@ -4365,45 +4337,73 @@ } }); - // 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/function-bind.js + var require_function_bind = __commonJS({ + "node_modules/core-js/internals/function-bind.js": function(exports, module) { + "use strict"; + var uncurryThis14 = 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 = uncurryThis14([].concat); + var join2 = uncurryThis14([].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/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 uncurryThis14 = 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 = uncurryThis14($propertyIsEnumerable); - var push4 = uncurryThis14([].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; - }; + // 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 fails15 = require_fails(); + var whitespaces = require_whitespaces(); + var non = "\u200B\x85\u180E"; + module.exports = function(METHOD_NAME) { + return fails15(function() { + return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() !== non || PROPER_FUNCTION_NAME2 && whitespaces[METHOD_NAME].name !== METHOD_NAME; + }); }; - module.exports = { - entries: createMethod(true), - values: createMethod(false) + } + }); + + // 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/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; }; } }); @@ -5899,7 +5899,7 @@ defineWellKnownSymbol("iterator"); // srcts/src/shiny/index.ts - var import_es_array_iterator51 = __toESM(require_es_array_iterator()); + 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; @@ -6237,10 +6237,10 @@ copyConstructorProperties2(path[NUMBER], NativeNumber); // srcts/src/bindings/registry.ts - var import_es_array_iterator = __toESM(require_es_array_iterator()); + var import_es_array_iterator8 = __toESM(require_es_array_iterator()); // srcts/src/utils/index.ts - var import_es_regexp_exec2 = __toESM(require_es_regexp_exec()); + var import_es_regexp_exec4 = __toESM(require_es_regexp_exec()); // node_modules/core-js/modules/es.string.replace.js var apply = require_function_apply(); @@ -6532,7 +6532,8 @@ }); // srcts/src/utils/index.ts - var import_jquery4 = __toESM(require_jquery()); + var import_es_array_iterator7 = __toESM(require_es_array_iterator()); + var import_jquery6 = __toESM(require_jquery()); // srcts/src/window/pixelRatio.ts function windowDevicePixelRatio() { @@ -6552,399 +6553,2576 @@ return value; } - // srcts/src/utils/index.ts - function escapeHTML(str) { - var escaped = { - "&": "&", - "<": "<", - ">": ">", - '"': """, - "'": "'", - "/": "/" - }; - return str.replace(/[&<>'"/]/g, function(m2) { - return escaped[m2]; + // srcts/src/shiny/render.ts + var import_es_regexp_exec3 = __toESM(require_es_regexp_exec()); + + // node_modules/core-js/modules/es.array.find.js + var $20 = 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; }); - } - 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; + $20({ target: "Array", proto: true, forced: SKIPS_HOLES }, { + find: function find(callbackfn) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : 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); + }); + addToUnscopables(FIND); + + // node_modules/core-js/modules/es.array.map.js + var $21 = require_export(); + var $map = require_array_iteration().map; + var arrayMethodHasSpeciesSupport4 = require_array_method_has_species_support(); + var HAS_SPECIES_SUPPORT3 = arrayMethodHasSpeciesSupport4("map"); + $21({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT3 }, { + map: function map(callbackfn) { + return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0); } - 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, "/")); + }); + + // node_modules/core-js/modules/es.object.entries.js + var $22 = require_export(); + var $entries = require_object_to_array().entries; + $22({ target: "Object", stat: true }, { + entries: function entries(O) { + return $entries(O); } - return date; - } - function formatDateUTC(date) { - if (date instanceof Date) { - return date.getUTCFullYear() + "-" + padZeros(date.getUTCMonth() + 1, 2) + "-" + padZeros(date.getUTCDate(), 2); - } else { - return null; + }); + + // srcts/src/shiny/render.ts + var import_es_array_iterator6 = __toESM(require_es_array_iterator()); + + // node_modules/core-js/modules/es.promise.all-settled.js + var $23 = require_export(); + var call3 = 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(); + $23({ 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 promiseResolve = aCallable(C2.resolve); + var values2 = []; + var counter = 0; + var remaining = 1; + iterate(iterable, function(promise) { + var index = counter++; + var alreadyCalled = false; + remaining++; + call3(promiseResolve, 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; } + }); + + // node_modules/core-js/modules/es.array.from.js + var $24 = require_export(); + var from = require_array_from(); + var checkCorrectnessOfIteration = require_check_correctness_of_iteration(); + var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function(iterable) { + Array.from(iterable); + }); + $24({ target: "Array", stat: true, forced: INCORRECT_ITERATION }, { + from: from + }); + + // srcts/src/shiny/render.ts + var import_jquery5 = __toESM(require_jquery()); + + // srcts/src/shiny/initedMethods.ts + var import_es_array_iterator = __toESM(require_es_array_iterator()); + 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 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 _regeneratorRuntime() { + "use strict"; + _regeneratorRuntime = function _regeneratorRuntime25() { + return exports; }; - } - function pixelRatio() { - if (windowDevicePixelRatio()) { - return Math.round(windowDevicePixelRatio() * 100) / 100; - } else { - return 1; + 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]; } - } - 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; + define({}, ""); + } catch (err) { + define = function define2(obj, key, value) { + return obj[key] = value; + }; } - 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; + 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; } - 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); + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; } } - 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; + exports.wrap = wrap; + var ContinueSentinel = {}; + function Generator() { } - } - 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; + function GeneratorFunction() { } - return true; - } - var compareVersion = function compareVersion2(a3, op, b3) { - function versionParts(ver) { - return (ver + "").replace(/-/, ".").replace(/(\.0)+[^.]*$/, "").split("."); + function GeneratorFunctionPrototype() { } - 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 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); + }); + }); } - 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 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" == _typeof(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 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 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 _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 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 _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; + 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); } - 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."); + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal", delete record.arg, entry.completion = record; } - 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", {}); + function Context(tryLocsList) { + this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(true); } - _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; + 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; } } - }, { - 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"); + return { next: doneResult }; } - } - 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 doneResult() { + return { value: void 0, done: true }; } - } - 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); + 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/shiny/sendImageSize.ts + var import_es_array_iterator5 = __toESM(require_es_array_iterator()); + + // srcts/src/time/debounce.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 _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 _typeof2(key) === "symbol" ? key : String(key); + } + function _toPrimitive(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 Debouncer = /* @__PURE__ */ function() { + function Debouncer2(target, func, delayMs) { + _classCallCheck(this, Debouncer2); + _defineProperty(this, "target", void 0); + _defineProperty(this, "func", void 0); + _defineProperty(this, "delayMs", void 0); + _defineProperty(this, "timerId", void 0); + _defineProperty(this, "args", void 0); + this.target = target; + this.func = func; + this.delayMs = delayMs; + this.timerId = null; + this.args = null; + } + _createClass(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_iterator3 = __toESM(require_es_array_iterator()); + 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 _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 _typeof3(key) === "symbol" ? key : String(key); + } + function _toPrimitive2(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); + } + var Invoker = /* @__PURE__ */ function() { + function Invoker2(target, func) { + _classCallCheck2(this, Invoker2); + _defineProperty2(this, "target", void 0); + _defineProperty2(this, "func", void 0); + this.target = target; + this.func = func; + } + _createClass2(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_iterator4 = __toESM(require_es_array_iterator()); + 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 _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 _defineProperty3(obj, key, value) { + key = _toPropertyKey3(key); + if (key in obj) { + Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + function _toPropertyKey3(arg) { + var key = _toPrimitive3(arg, "string"); + return _typeof4(key) === "symbol" ? key : String(key); + } + function _toPrimitive3(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); + } + var Throttler = /* @__PURE__ */ function() { + function Throttler2(target, func, delayMs) { + _classCallCheck3(this, Throttler2); + _defineProperty3(this, "target", void 0); + _defineProperty3(this, "func", void 0); + _defineProperty3(this, "delayMs", void 0); + _defineProperty3(this, "timerId", void 0); + _defineProperty3(this, "args", void 0); + this.target = target; + this.func = func; + this.delayMs = delayMs; + this.timerId = null; + this.args = null; + } + _createClass3(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/shiny/sendImageSize.ts + 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 _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 _defineProperty4(obj, key, value) { + key = _toPropertyKey4(key); + if (key in obj) { + Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + function _toPropertyKey4(arg) { + var key = _toPrimitive4(arg, "string"); + return _typeof5(key) === "symbol" ? key : String(key); + } + function _toPrimitive4(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); + } + var SendImageSize = /* @__PURE__ */ function() { + function SendImageSize2() { + _classCallCheck4(this, SendImageSize2); + _defineProperty4(this, "regular", void 0); + _defineProperty4(this, "transitioned", void 0); + } + _createClass4(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_exec2 = __toESM(require_es_regexp_exec()); + + // node_modules/core-js/modules/es.array.join.js + var $25 = require_export(); + var uncurryThis8 = require_function_uncurry_this(); + var IndexedObject = require_indexed_object(); + var toIndexedObject2 = require_to_indexed_object(); + var arrayMethodIsStrict2 = require_array_method_is_strict(); + var nativeJoin = uncurryThis8([].join); + var ES3_STRINGS = IndexedObject != Object; + var FORCED5 = ES3_STRINGS || !arrayMethodIsStrict2("join", ","); + $25({ target: "Array", proto: true, forced: FORCED5 }, { + join: function join(separator) { + return nativeJoin(toIndexedObject2(this), separator === void 0 ? "," : separator); + } + }); + + // srcts/src/shiny/singletons.ts + var import_jquery4 = __toESM(require_jquery()); + var reSingleton = /([\s\S]*?)/; + var reHead = /]*)?>([\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_jquery4.default)(el).html(processed.html); + break; + case "beforebegin": + (0, import_jquery4.default)(el).before(processed.html); + break; + case "afterbegin": + (0, import_jquery4.default)(el).prepend(processed.html); + break; + case "beforeend": + (0, import_jquery4.default)(el).append(processed.html); + break; + case "afterend": + (0, import_jquery4.default)(el).after(processed.html); + break; + default: + throw new Error("Unknown where position: " + where); + } + return processed; + } + function register(s4) { + import_jquery4.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_jquery4.default)("
" + head + "
").get(0); + var $head = (0, import_jquery4.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 _regeneratorRuntime2() { + "use strict"; + _regeneratorRuntime2 = function _regeneratorRuntime25() { + 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" == _typeof6(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 _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 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 renderContentAsync(_x, _x2) { + return _renderContentAsync.apply(this, arguments); + } + function _renderContentAsync() { + _renderContentAsync = _asyncToGenerator2(/* @__PURE__ */ _regeneratorRuntime2().mark(function _callee(el, content) { + var where, html, dependencies, scope, $parent, $grandparent, _args = arguments; + return _regeneratorRuntime2().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 (_typeof6(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_jquery5.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 (_typeof6(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_jquery5.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 = _asyncToGenerator2(/* @__PURE__ */ _regeneratorRuntime2().mark(function _callee2(html, el, dependencies) { + var where, _args2 = arguments; + return _regeneratorRuntime2().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 = _asyncToGenerator2(/* @__PURE__ */ _regeneratorRuntime2().mark(function _callee3(dependencies) { + var _iterator2, _step2, dep; + return _regeneratorRuntime2().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_jquery5.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_jquery5.default)("