MediaWiki:Gadget-TextSpacing.js:修订间差异

删除的内容 添加的内容
鹿野耕云移动页面MediaWiki:Gadget-text-spacing.jsMediaWiki:Gadget-TextSpacing.js,不留重定向
无编辑摘要
 
第1行:
/**
* SPDX-License-Identifier: BSD-3-Clause
* This gadget automatically adjust spacing between Chinese with English,
* _addText: '{{Gadget Header|license=BSD}}'
* with symbols and with numbers.
*
* @base {@link https://github.com/diskdance/gadget-text-spacing}
* @author [[User:Diskdance]] <https://w.wiki/5F6e>
* @source {@link https://git.qiuwen.net.cn/InterfaceAdmin/QiuwenGadgets/src/branch/master/src/TextSpacing}
* @license BSD-3-Clause
* @seelicense BSD-3-Clause {@link https://github.com/diskdance/gadget-text-spacing/blob/main/LICENSE}
*/
// <nowiki>
(function () {
'use strict';
 
/**
const pendingActions = new WeakMap();
* BSD 3-Clause License
// Optimization: lazily execute pending actions once an element is visible
*
const observer = new IntersectionObserver(onIntersection);
* Copyright 2023 diskdance
function onIntersection(entries) {
*
for (const entry of entries) {
* Redistribution and use in source and binary forms, with or without
if (!entry.isIntersecting) {
* modification, are permitted provided that the following conditions are
continue;
* met:
}
*
const element = entry.target;
* 1. Redistributions of source code must retain the above copyright
observer.unobserve(element);
* notice, this list of conditions and the following disclaimer.
const callbacks = pendingActions.get(element);
*
if (callbacks === undefined) {
* 2. Redistributions in binary form must reproduce the above copyright
continue;
* notice, this list of conditions and the following disclaimer in
}
* the documentation and/or other materials provided with the
while (true) {
* distribution.
const callback = callbacks.shift(); // FIFO
*
if (callback === undefined) {
* 3. The name of the author may not be used to
break;
* endorse or promote products derived from this software without
}
* specific prior written permission.
callback(element);
*
}
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR “AS IS” AND ANY EXPRESS OR
}
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* +------------------------------------------------------------+
* | === WARNING: GLOBAL GADGET FILE === |
* +------------------------------------------------------------+
* | All changes should be made in the repository, |
* | otherwise they will be lost. |
* +------------------------------------------------------------+
* | Changes to this page may affect many users. |
* | Please discuss changes by opening an issue before editing. |
* +------------------------------------------------------------+
*/
/* <nowiki> */
 
(() => {
 
"use strict";
var __getOwnPropNames = Object.getOwnPropertyNames;
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/global-this.js
var require_global_this = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/global-this.js"(exports, module2) {
"use strict";
var check = function(it) {
return it && it.Math === Math && it;
};
module2.exports = // eslint-disable-next-line es/no-global-this -- safe
check(typeof globalThis == "object" && globalThis) || check(typeof window == "object" && window) || // eslint-disable-next-line no-restricted-globals -- safe
check(typeof self == "object" && self) || check(typeof global == "object" && global) || check(typeof exports == "object" && exports) || // eslint-disable-next-line no-new-func -- fallback
/* @__PURE__ */ (function() {
return this;
})() || Function("return this")();
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/fails.js
var require_fails = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/fails.js"(exports, module2) {
"use strict";
module2.exports = function(exec) {
try {
return !!exec();
} catch (error) {
return true;
}
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/descriptors.js
var require_descriptors = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/descriptors.js"(exports, module2) {
"use strict";
var fails = require_fails();
module2.exports = !fails(function() {
return Object.defineProperty({}, 1, { get: function() {
return 7;
} })[1] !== 7;
});
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/function-bind-native.js
var require_function_bind_native = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/function-bind-native.js"(exports, module2) {
"use strict";
var fails = require_fails();
module2.exports = !fails(function() {
var test = function() {
}.bind();
return typeof test != "function" || test.hasOwnProperty("prototype");
});
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/function-call.js
var require_function_call = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/function-call.js"(exports, module2) {
"use strict";
var NATIVE_BIND = require_function_bind_native();
var call = Function.prototype.call;
module2.exports = NATIVE_BIND ? call.bind(call) : function() {
return call.apply(call, arguments);
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/object-property-is-enumerable.js
var require_object_property_is_enumerable = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/object-property-is-enumerable.js"(exports) {
"use strict";
var $propertyIsEnumerable = {}.propertyIsEnumerable;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
var descriptor = getOwnPropertyDescriptor(this, V);
return !!descriptor && descriptor.enumerable;
} : $propertyIsEnumerable;
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/create-property-descriptor.js
var require_create_property_descriptor = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/create-property-descriptor.js"(exports, module2) {
"use strict";
module2.exports = function(bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value
};
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/function-uncurry-this.js
var require_function_uncurry_this = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/function-uncurry-this.js"(exports, module2) {
"use strict";
var NATIVE_BIND = require_function_bind_native();
var FunctionPrototype = Function.prototype;
var call = FunctionPrototype.call;
var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);
module2.exports = NATIVE_BIND ? uncurryThisWithBind : function(fn) {
return function() {
return call.apply(fn, arguments);
};
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/classof-raw.js
var require_classof_raw = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/classof-raw.js"(exports, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var toString = uncurryThis({}.toString);
var stringSlice = uncurryThis("".slice);
module2.exports = function(it) {
return stringSlice(toString(it), 8, -1);
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/indexed-object.js
var require_indexed_object = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/indexed-object.js"(exports, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var classof = require_classof_raw();
var $Object = Object;
var split = uncurryThis("".split);
module2.exports = fails(function() {
return !$Object("z").propertyIsEnumerable(0);
}) ? function(it) {
return classof(it) === "String" ? split(it, "") : $Object(it);
} : $Object;
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/is-null-or-undefined.js
var require_is_null_or_undefined = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/is-null-or-undefined.js"(exports, module2) {
"use strict";
module2.exports = function(it) {
return it === null || it === void 0;
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/require-object-coercible.js
var require_require_object_coercible = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/require-object-coercible.js"(exports, module2) {
"use strict";
var isNullOrUndefined = require_is_null_or_undefined();
var $TypeError = TypeError;
module2.exports = function(it) {
if (isNullOrUndefined(it)) throw new $TypeError("Can't call method on " + it);
return it;
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/to-indexed-object.js
var require_to_indexed_object = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/to-indexed-object.js"(exports, module2) {
"use strict";
var IndexedObject = require_indexed_object();
var requireObjectCoercible = require_require_object_coercible();
module2.exports = function(it) {
return IndexedObject(requireObjectCoercible(it));
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/is-callable.js
var require_is_callable = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/is-callable.js"(exports, module2) {
"use strict";
var documentAll = typeof document == "object" && document.all;
module2.exports = typeof documentAll == "undefined" && documentAll !== void 0 ? function(argument) {
return typeof argument == "function" || argument === documentAll;
} : function(argument) {
return typeof argument == "function";
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/is-object.js
var require_is_object = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/is-object.js"(exports, module2) {
"use strict";
var isCallable = require_is_callable();
module2.exports = function(it) {
return typeof it == "object" ? it !== null : isCallable(it);
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/get-built-in.js
var require_get_built_in = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/get-built-in.js"(exports, module2) {
"use strict";
var globalThis2 = require_global_this();
var isCallable = require_is_callable();
var aFunction = function(argument) {
return isCallable(argument) ? argument : void 0;
};
module2.exports = function(namespace, method) {
return arguments.length < 2 ? aFunction(globalThis2[namespace]) : globalThis2[namespace] && globalThis2[namespace][method];
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/object-is-prototype-of.js
var require_object_is_prototype_of = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/object-is-prototype-of.js"(exports, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
module2.exports = uncurryThis({}.isPrototypeOf);
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/environment-user-agent.js
var require_environment_user_agent = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/environment-user-agent.js"(exports, module2) {
"use strict";
var globalThis2 = require_global_this();
var navigator = globalThis2.navigator;
var userAgent = navigator && navigator.userAgent;
module2.exports = userAgent ? String(userAgent) : "";
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/environment-v8-version.js
var require_environment_v8_version = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/environment-v8-version.js"(exports, module2) {
"use strict";
var globalThis2 = require_global_this();
var userAgent = require_environment_user_agent();
var process = globalThis2.process;
var Deno = globalThis2.Deno;
var versions = process && process.versions || Deno && Deno.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 && userAgent) {
function queueDomMutation(element, callback) {
match = userAgent.match(/Edge\/(\d+)/);
var _a;
if (!pendingActions.has(element)match || match[1] >= 74) {
match = pendingActionsuserAgent.setmatch(element, []/Chrome\/(\d+)/);
}if (match) version = +match[1];
}
(_a = pendingActions.get(element)) === null || _a === void 0 ? void 0 : _a.push(callback);
observer.observe(element);
}
module2.exports = version;
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/symbol-constructor-detection.js
function isInlineHTMLElement(node) {
var require_symbol_constructor_detection = __commonJS({
return (node instanceof HTMLElement &&
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/symbol-constructor-detection.js"(exports, module2) {
window.getComputedStyle(node).display.includes('inline'));
}"use strict";
var V8_VERSION = require_environment_v8_version();
function isTextNode(node) {
var fails = require_fails();
return node.nodeType === Node.TEXT_NODE;
var globalThis2 = require_global_this();
}
var $String = globalThis2.String;
function isVisible(element) {
module2.exports = !!Object.getOwnPropertySymbols && !fails(function() {
const style = window.getComputedStyle(element);
var symbol = /* @__PURE__ */ Symbol("symbol detection");
return (style.display !== 'none' &&
return !$String(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
!['hidden', 'collapse'].includes(style.visibility) &&
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
Number.parseFloat(style.opacity) > 0);
});
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/use-symbol-as-uid.js
var require_use_symbol_as_uid = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/use-symbol-as-uid.js"(exports, module2) {
"use strict";
var NATIVE_SYMBOL = require_symbol_constructor_detection();
module2.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == "symbol";
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/is-symbol.js
var require_is_symbol = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/is-symbol.js"(exports, module2) {
"use strict";
var getBuiltIn = require_get_built_in();
var isCallable = require_is_callable();
var isPrototypeOf = require_object_is_prototype_of();
var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
var $Object = Object;
module2.exports = USE_SYMBOL_AS_UID ? function(it) {
return typeof it == "symbol";
} : function(it) {
var $Symbol = getBuiltIn("Symbol");
return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/try-to-string.js
var require_try_to_string = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/try-to-string.js"(exports, module2) {
"use strict";
var $String = String;
module2.exports = function(argument) {
try {
return $String(argument);
} catch (error) {
return "Object";
}
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/a-callable.js
var require_a_callable = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/a-callable.js"(exports, module2) {
"use strict";
var isCallable = require_is_callable();
var tryToString = require_try_to_string();
var $TypeError = TypeError;
module2.exports = function(argument) {
if (isCallable(argument)) return argument;
throw new $TypeError(tryToString(argument) + " is not a function");
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/get-method.js
var require_get_method = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/get-method.js"(exports, module2) {
"use strict";
var aCallable = require_a_callable();
var isNullOrUndefined = require_is_null_or_undefined();
module2.exports = function(V, P) {
var func = V[P];
return isNullOrUndefined(func) ? void 0 : aCallable(func);
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/ordinary-to-primitive.js
var require_ordinary_to_primitive = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/ordinary-to-primitive.js"(exports, module2) {
"use strict";
var call = require_function_call();
var isCallable = require_is_callable();
var isObject = require_is_object();
var $TypeError = TypeError;
module2.exports = function(input, pref) {
var fn, val;
if (pref === "string" && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
if (pref !== "string" && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
throw new $TypeError("Can't convert object to primitive value");
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/is-pure.js
var require_is_pure = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/is-pure.js"(exports, module2) {
"use strict";
module2.exports = false;
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/define-global-property.js
var require_define_global_property = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/define-global-property.js"(exports, module2) {
"use strict";
var globalThis2 = require_global_this();
var defineProperty = Object.defineProperty;
module2.exports = function(key, value) {
try {
defineProperty(globalThis2, key, { value, configurable: true, writable: true });
} catch (error) {
globalThis2[key] = value;
}
return value;
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/shared-store.js
var require_shared_store = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/shared-store.js"(exports, module2) {
"use strict";
var IS_PURE = require_is_pure();
var globalThis2 = require_global_this();
var defineGlobalProperty = require_define_global_property();
var SHARED = "__core-js_shared__";
var store = module2.exports = globalThis2[SHARED] || defineGlobalProperty(SHARED, {});
(store.versions || (store.versions = [])).push({
version: "3.49.0",
mode: IS_PURE ? "pure" : "global",
copyright: "© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",
license: "https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",
source: "https://github.com/zloirock/core-js"
});
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/shared.js
var require_shared = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/shared.js"(exports, module2) {
"use strict";
var store = require_shared_store();
module2.exports = function(key, value) {
return store[key] || (store[key] = value || {});
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/to-object.js
var require_to_object = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/to-object.js"(exports, module2) {
"use strict";
var requireObjectCoercible = require_require_object_coercible();
var $Object = Object;
module2.exports = function(argument) {
return $Object(requireObjectCoercible(argument));
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/has-own-property.js
var require_has_own_property = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/has-own-property.js"(exports, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var toObject = require_to_object();
var hasOwnProperty = uncurryThis({}.hasOwnProperty);
module2.exports = Object.hasOwn || function hasOwn(it, key) {
return hasOwnProperty(toObject(it), key);
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/uid.js
var require_uid = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/uid.js"(exports, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var id = 0;
var postfix = Math.random();
var toString = uncurryThis(1.1.toString);
module2.exports = function(key) {
return "Symbol(" + (key === void 0 ? "" : key) + ")_" + toString(++id + postfix, 36);
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/well-known-symbol.js
var require_well_known_symbol = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/well-known-symbol.js"(exports, module2) {
"use strict";
var globalThis2 = require_global_this();
var shared = require_shared();
var hasOwn = 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 = globalThis2.Symbol;
var WellKnownSymbolsStore = shared("wks");
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol2["for"] || Symbol2 : Symbol2 && Symbol2.withoutSetter || uid;
module2.exports = function(name) {
if (!hasOwn(WellKnownSymbolsStore, name)) {
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol2, name) ? Symbol2[name] : createWellKnownSymbol("Symbol." + name);
}
return WellKnownSymbolsStore[name];
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/to-primitive.js
var require_to_primitive = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/to-primitive.js"(exports, module2) {
"use strict";
var call = require_function_call();
var isObject = require_is_object();
var isSymbol = require_is_symbol();
var getMethod = require_get_method();
var ordinaryToPrimitive = require_ordinary_to_primitive();
var wellKnownSymbol = require_well_known_symbol();
var $TypeError = TypeError;
var TO_PRIMITIVE = wellKnownSymbol("toPrimitive");
module2.exports = function(input, pref) {
if (!isObject(input) || isSymbol(input)) return input;
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
var result;
if (exoticToPrim) {
if (pref === void 0) pref = "default";
result = call(exoticToPrim, input, pref);
if (!isObject(result) || isSymbol(result)) return result;
throw new $TypeError("Can't convert object to primitive value");
}
if (pref === void 0) pref = "number";
return ordinaryToPrimitive(input, pref);
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/to-property-key.js
var require_to_property_key = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/to-property-key.js"(exports, module2) {
"use strict";
var toPrimitive = require_to_primitive();
var isSymbol = require_is_symbol();
module2.exports = function(argument) {
var key = toPrimitive(argument, "string");
return isSymbol(key) ? key : key + "";
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/document-create-element.js
var require_document_create_element = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/document-create-element.js"(exports, module2) {
"use strict";
var globalThis2 = require_global_this();
var isObject = require_is_object();
var document2 = globalThis2.document;
var EXISTS = isObject(document2) && isObject(document2.createElement);
module2.exports = function(it) {
return EXISTS ? document2.createElement(it) : {};
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/ie8-dom-define.js
var require_ie8_dom_define = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/ie8-dom-define.js"(exports, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var fails = require_fails();
var createElement = require_document_create_element();
module2.exports = !DESCRIPTORS && !fails(function() {
return Object.defineProperty(createElement("div"), "a", {
get: function() {
return 7;
}
}).a !== 7;
});
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/object-get-own-property-descriptor.js
var require_object_get_own_property_descriptor = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/object-get-own-property-descriptor.js"(exports) {
"use strict";
var DESCRIPTORS = require_descriptors();
var call = require_function_call();
var propertyIsEnumerableModule = require_object_property_is_enumerable();
var createPropertyDescriptor = require_create_property_descriptor();
var toIndexedObject = require_to_indexed_object();
var toPropertyKey = require_to_property_key();
var hasOwn = require_has_own_property();
var IE8_DOM_DEFINE = require_ie8_dom_define();
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
O = toIndexedObject(O);
P = toPropertyKey(P);
if (IE8_DOM_DEFINE) try {
return $getOwnPropertyDescriptor(O, P);
} catch (error) {
}
if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/v8-prototype-define-bug.js
var require_v8_prototype_define_bug = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/v8-prototype-define-bug.js"(exports, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var fails = require_fails();
module2.exports = DESCRIPTORS && fails(function() {
return Object.defineProperty(function() {
}, "prototype", {
value: 42,
writable: false
}).prototype !== 42;
});
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/an-object.js
var require_an_object = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/an-object.js"(exports, module2) {
"use strict";
var isObject = require_is_object();
var $String = String;
var $TypeError = TypeError;
module2.exports = function(argument) {
if (isObject(argument)) return argument;
throw new $TypeError($String(argument) + " is not an object");
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/object-define-property.js
var require_object_define_property = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/object-define-property.js"(exports) {
"use strict";
var DESCRIPTORS = require_descriptors();
var IE8_DOM_DEFINE = require_ie8_dom_define();
var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug();
var anObject = require_an_object();
var toPropertyKey = require_to_property_key();
var $TypeError = TypeError;
var $defineProperty = Object.defineProperty;
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var ENUMERABLE = "enumerable";
var CONFIGURABLE = "configurable";
var WRITABLE = "writable";
exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
anObject(O);
P = toPropertyKey(P);
anObject(Attributes);
if (typeof O === "function" && P === "prototype" && "value" in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
var current = $getOwnPropertyDescriptor(O, P);
if (current && current[WRITABLE]) {
O[P] = Attributes.value;
Attributes = {
configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
writable: false
};
}
}
return $defineProperty(O, P, Attributes);
} : $defineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPropertyKey(P);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return $defineProperty(O, P, Attributes);
} catch (error) {
}
if ("get" in Attributes || "set" in Attributes) throw new $TypeError("Accessors not supported");
if ("value" in Attributes) O[P] = Attributes.value;
return O;
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/create-non-enumerable-property.js
var require_create_non_enumerable_property = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/create-non-enumerable-property.js"(exports, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var definePropertyModule = require_object_define_property();
var createPropertyDescriptor = require_create_property_descriptor();
module2.exports = DESCRIPTORS ? function(object, key, value) {
return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
} : function(object, key, value) {
object[key] = value;
return object;
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/function-name.js
var require_function_name = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/function-name.js"(exports, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var hasOwn = require_has_own_property();
var FunctionPrototype = Function.prototype;
var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
var EXISTS = hasOwn(FunctionPrototype, "name");
var PROPER = EXISTS && function something() {
}.name === "something";
var CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, "name").configurable);
module2.exports = {
EXISTS,
PROPER,
CONFIGURABLE
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/inspect-source.js
var require_inspect_source = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/inspect-source.js"(exports, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var isCallable = require_is_callable();
var store = require_shared_store();
var functionToString = uncurryThis(Function.toString);
if (!isCallable(store.inspectSource)) {
store.inspectSource = function(it) {
return functionToString(it);
};
}
module2.exports = store.inspectSource;
function getNodeText(node) {
}
return node instanceof HTMLElement ? node.innerText : node.data;
});
}
 
/**
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/weak-map-basic-detection.js
* Split a string before an array of indexes.
var require_weak_map_basic_detection = __commonJS({
*
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/weak-map-basic-detection.js"(exports, module2) {
* For example,
"use * ```strict";
var globalThis2 = require_global_this();
* splitAtIndexes('123456789', [3, 5, 7]);
var isCallable = require_is_callable();
* ```
var WeakMap2 = globalThis2.WeakMap;
* results in
module2.exports = isCallable(WeakMap2) && /native code/.test(String(WeakMap2));
* ```
}
* ['123', '45', '67', '89']
});
* ```
 
*
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/shared-key.js
* Note that empty string are included:
var require_shared_key = __commonJS({
* ```
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/shared-key.js"(exports, module2) {
* splitAtIndexes('123456789', [0, 9]);
"use * ```strict";
var shared = require_shared();
* results in
var *uid ```= require_uid();
var *keys ['',= '123456789', '']shared("keys");
module2.exports = function(key) {
* ```
return keys[key] || (keys[key] = uid(key));
*
};
* Indexes that are negative or greater than the length of the string are ignored.
*}
});
* @param str string to split
 
* @param indexes indexes
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/hidden-keys.js
* @returns splitted string fragments
var require_hidden_keys = __commonJS({
*/
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/hidden-keys.js"(exports, module2) {
function splitAtIndexes(str, indexes) {
"use strict";
const result = [];
module2.exports = {};
const normalizedIndexes = [
}
// Remove duplications and sort in ascending order
});
...new Set(indexes
 
.sort((a, b) => a - b)
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/internal-state.js
.filter((i) => i >= 0 && i <= str.length)),
var require_internal_state = __commonJS({
str.length,
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/internal-state.js"(exports, module2) {
];
"use strict";
for (let i = 0; i < normalizedIndexes.length; i++) {
var NATIVE_WEAK_MAP = require_weak_map_basic_detection();
const slice = str.slice(normalizedIndexes[i - 1], normalizedIndexes[i]);
var globalThis2 = result.pushrequire_global_this(slice);
var isObject = require_is_object();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var hasOwn = 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 TypeError2 = globalThis2.TypeError;
var WeakMap2 = globalThis2.WeakMap;
var set;
var get;
var has;
var enforce = function(it) {
return has(it) ? get(it) : set(it, {});
};
var getterFor = function(TYPE) {
return function(it) {
var state;
if (!isObject(it) || (state = get(it)).type !== TYPE) {
throw new TypeError2("Incompatible receiver, " + TYPE + " required");
}
return resultstate;
};
};
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 new TypeError2(OBJECT_ALREADY_INITIALIZED);
metadata.facade = it;
store.set(it, metadata);
return metadata;
};
get = 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 (hasOwn(it, STATE)) throw new TypeError2(OBJECT_ALREADY_INITIALIZED);
metadata.facade = it;
createNonEnumerableProperty(it, STATE, metadata);
return metadata;
};
get = function(it) {
return hasOwn(it, STATE) ? it[STATE] : {};
};
has = function(it) {
return hasOwn(it, STATE);
};
}
var store;
var STATE;
module2.exports = {
set,
get,
has,
enforce,
getterFor
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/make-built-in.js
const REGEX_RANGE_CHINESE = '(?:[\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u3005\\u3007\\u3021-\\u3029\\u3038-\\u303B\\u3400-\\u4DBF\\u4E00-\\u9FFF\\uF900-\\uFA6D\\uFA70-\\uFAD9]|\\uD81B[\\uDFE2\\uDFE3\\uDFF0\\uDFF1]|[\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883][\\uDC00-\\uDFFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF38\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A])';
var require_make_built_in = __commonJS({
const REGEX_RANGE_OTHER_LEFT = '[A-Za-z0-9@~%+=|±\\)}#$¥€£₤]';
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/make-built-in.js"(exports, module2) {
const REGEX_RANGE_OTHER_RIGHT = '[A-Za-z0-9@~%+=|±\\({#$¥€£₤]';
"use strict";
const REGEX_STR_INTER_SCRIPT = `(?:(${REGEX_RANGE_CHINESE})(?=${REGEX_RANGE_OTHER_RIGHT})|(${REGEX_RANGE_OTHER_LEFT})(?=${REGEX_RANGE_CHINESE}))`;
var uncurryThis = require_function_uncurry_this();
const SPACE = '\u200A';
constvar WRAPPER_CLASSfails = 'gadget-space'require_fails();
var isCallable = require_is_callable();
const SELECTOR_ALLOWED = [
var hasOwn = require_has_own_property();
'a', 'abbr', 'article', 'aside', 'b',
var DESCRIPTORS = require_descriptors();
'bdi', 'big', 'blockquote', 'button',
var CONFIGURABLE_FUNCTION_NAME = require_function_name().CONFIGURABLE;
'caption', 'center', 'cite', 'data',
var inspectSource = require_inspect_source();
'dd', 'del', 'details', 'dfn', 'div',
var InternalStateModule = require_internal_state();
'dt', 'em', 'figcaption', 'footer',
var enforceInternalState = InternalStateModule.enforce;
'h1', 'h2', 'h3', 'h4', 'h5', 'header',
var getInternalState = InternalStateModule.get;
'i', 'ins', 'label', 'legend', 'li',
var $String = String;
'main', 'mark', 'option', 'p', 'q',
var defineProperty = Object.defineProperty;
'ruby', 's', 'section', 'small', 'span',
var stringSlice = uncurryThis("".slice);
'strike', 'strong', 'sub', 'summary',
var replace = uncurryThis("".replace);
'sup', 'td', 'th', 'time', 'u',
var join = uncurryThis([].join);
var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function() {
return defineProperty(function() {
}, "length", { value: 8 }).length !== 8;
});
var TEMPLATE = String(String).split("String");
var makeBuiltIn = module2.exports = function(value, name, options) {
if (stringSlice($String(name), 0, 7) === "Symbol(") {
name = "[" + replace($String(name), /^Symbol\(([^)]*)\).*$/, "$1") + "]";
}
if (options && options.getter) name = "get " + name;
if (options && options.setter) name = "set " + name;
if (!hasOwn(value, "name") || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
if (DESCRIPTORS) defineProperty(value, "name", { value: name, configurable: true });
else value.name = name;
}
if (CONFIGURABLE_LENGTH && options && hasOwn(options, "arity") && value.length !== options.arity) {
defineProperty(value, "length", { value: options.arity });
}
try {
if (options && hasOwn(options, "constructor") && options.constructor) {
if (DESCRIPTORS) defineProperty(value, "prototype", { writable: false });
} else if (value.prototype) value.prototype = void 0;
} catch (error) {
}
var state = enforceInternalState(value);
if (!hasOwn(state, "source")) {
state.source = join(TEMPLATE, typeof name == "string" ? name : "");
}
return value;
};
Function.prototype.toString = makeBuiltIn(function toString() {
return isCallable(this) && getInternalState(this).source || inspectSource(this);
}, "toString");
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/define-built-in.js
var require_define_built_in = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/define-built-in.js"(exports, module2) {
"use strict";
var isCallable = require_is_callable();
var definePropertyModule = require_object_define_property();
var makeBuiltIn = require_make_built_in();
var defineGlobalProperty = require_define_global_property();
module2.exports = function(O, key, value, options) {
if (!options) options = {};
var simple = options.enumerable;
var name = options.name !== void 0 ? options.name : key;
if (isCallable(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,
enumerable: false,
configurable: !options.nonConfigurable,
writable: !options.nonWritable
});
}
return O;
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/math-trunc.js
var require_math_trunc = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/math-trunc.js"(exports, module2) {
"use strict";
var ceil = Math.ceil;
var floor = Math.floor;
module2.exports = Math.trunc || function trunc(x) {
var n = +x;
return (n > 0 ? floor : ceil)(n);
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/to-integer-or-infinity.js
var require_to_integer_or_infinity = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/to-integer-or-infinity.js"(exports, module2) {
"use strict";
var trunc = require_math_trunc();
module2.exports = function(argument) {
var number = +argument;
return number !== number || number === 0 ? 0 : trunc(number);
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/to-absolute-index.js
var require_to_absolute_index = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/to-absolute-index.js"(exports, module2) {
"use strict";
var toIntegerOrInfinity = require_to_integer_or_infinity();
var max = Math.max;
var min = Math.min;
module2.exports = function(index, length) {
var integer = toIntegerOrInfinity(index);
return integer < 0 ? max(integer + length, 0) : min(integer, length);
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/to-length.js
var require_to_length = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/to-length.js"(exports, module2) {
"use strict";
var toIntegerOrInfinity = require_to_integer_or_infinity();
var min = Math.min;
module2.exports = function(argument) {
var len = toIntegerOrInfinity(argument);
return len > 0 ? min(len, 9007199254740991) : 0;
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/length-of-array-like.js
var require_length_of_array_like = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/length-of-array-like.js"(exports, module2) {
"use strict";
var toLength = require_to_length();
module2.exports = function(obj) {
return toLength(obj.length);
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/array-includes.js
var require_array_includes = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/array-includes.js"(exports, module2) {
"use strict";
var toIndexedObject = require_to_indexed_object();
var toAbsoluteIndex = require_to_absolute_index();
var lengthOfArrayLike = require_length_of_array_like();
var createMethod = function(IS_INCLUDES) {
return function($this, el, fromIndex) {
var O = toIndexedObject($this);
var length = lengthOfArrayLike(O);
if (length === 0) return !IS_INCLUDES && -1;
var index = toAbsoluteIndex(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;
};
};
module2.exports = {
// `Array.prototype.includes` method
// https://tc39.es/ecma262/#sec-array.prototype.includes
includes: createMethod(true),
// `Array.prototype.indexOf` method
// https://tc39.es/ecma262/#sec-array.prototype.indexof
indexOf: createMethod(false)
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/object-keys-internal.js
var require_object_keys_internal = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/object-keys-internal.js"(exports, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var hasOwn = require_has_own_property();
var toIndexedObject = require_to_indexed_object();
var indexOf = require_array_includes().indexOf;
var hiddenKeys = require_hidden_keys();
var push = uncurryThis([].push);
module2.exports = function(object, names) {
var O = toIndexedObject(object);
var i = 0;
var result = [];
var key;
for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
while (names.length > i) if (hasOwn(O, key = names[i++])) {
~indexOf(result, key) || push(result, key);
}
return result;
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/enum-bug-keys.js
var require_enum_bug_keys = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/enum-bug-keys.js"(exports, module2) {
"use strict";
module2.exports = [
"constructor",
"hasOwnProperty",
"isPrototypeOf",
"propertyIsEnumerable",
"toLocaleString",
"toString",
"valueOf"
];
}
const SELECTOR_BLOCKED = [
});
'code', 'kbd', 'pre', 'rp', 'rt',
 
'samp', 'textarea', 'var',
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/object-get-own-property-names.js
// Elements with this class are excluded
var require_object_get_own_property_names = __commonJS({
'.gadget-nospace',
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/object-get-own-property-names.js"(exports) {
// Editable elements
"use strict";
'[contenteditable="true"]',
var internalObjectKeys = require_object_keys_internal();
// ACE editor content
var enumBugKeys = require_enum_bug_keys();
'.ace_editor',
var hiddenKeys = enumBugKeys.concat("length", "prototype");
// Visual Editor (and 2017 Wikitext Editor) content & diff
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
'.ve-ui-surface',
return internalObjectKeys(O, hiddenKeys);
'.ve-init-mw-diffPage-diff',
// Diff};
}
'.diff-context',
});
'.diff-addedline',
 
'.diff-deletedline',
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/object-get-own-property-symbols.js
// Diff (inline mode)
var require_object_get_own_property_symbols = __commonJS({
'.mw-diff-inline-added',
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/object-get-own-property-symbols.js"(exports) {
'.mw-diff-inline-deleted',
"use strict";
'.mw-diff-inline-moved',
exports.f = Object.getOwnPropertySymbols;
'.mw-diff-inline-changed',
}
'.mw-diff-inline-context',
});
];
 
// FIXME: Use :is() in the future once it has better browser compatibility
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/own-keys.js
const SELECTOR = SELECTOR_ALLOWED
var require_own_keys = __commonJS({
.map((allowed) => `${allowed}:not(${SELECTOR_BLOCKED
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/own-keys.js"(exports, module2) {
.flatMap((blocked) =>
"use strict";
// Not include itself if it is a tag selector
var getBuiltIn = require_get_built_in();
blocked[0].match(/[a-z]/i) ? `${blocked} *` : [blocked, `${blocked} *`])
var uncurryThis = require_function_uncurry_this();
.join(',')})`)
var getOwnPropertyNamesModule = require_object_get_own_property_names();
.join(',');
var getOwnPropertySymbolsModule = require_object_get_own_property_symbols();
function getLeafElements(parent) {
var anObject = require_an_object();
const candidates = parent.querySelectorAll(SELECTOR);
var const resultconcat = uncurryThis([].concat);
module2.exports = getBuiltIn("Reflect", "ownKeys") || function ownKeys(it) {
if (parent.matches(SELECTOR)) {
var keys = resultgetOwnPropertyNamesModule.pushf(anObject(parentit));
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/copy-constructor-properties.js
var require_copy_constructor_properties = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/copy-constructor-properties.js"(exports, module2) {
"use strict";
var hasOwn = require_has_own_property();
var ownKeys = require_own_keys();
var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
var definePropertyModule = require_object_define_property();
module2.exports = function(target, source, exceptions) {
var keys = ownKeys(source);
var defineProperty = definePropertyModule.f;
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
}
}
for (const candidate of candidates) {
};
for (const childNode of candidate.childNodes) {
}
if (isTextNode(childNode)) {
});
result.push(candidate);
 
break;
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/is-forced.js
}
var require_is_forced = __commonJS({
}
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/is-forced.js"(exports, module2) {
"use strict";
var fails = require_fails();
var isCallable = require_is_callable();
var replacement = /#|\.prototype\./;
var isForced = function(feature, detection) {
var value = data[normalize(feature)];
return value === POLYFILL ? true : value === NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection;
};
var normalize = isForced.normalize = function(string) {
return String(string).replace(replacement, ".").toLowerCase();
};
var data = isForced.data = {};
var NATIVE = isForced.NATIVE = "N";
var POLYFILL = isForced.POLYFILL = "P";
module2.exports = isForced;
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/export.js
var require_export = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/export.js"(exports, module2) {
"use strict";
var globalThis2 = require_global_this();
var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
var createNonEnumerableProperty = require_create_non_enumerable_property();
var defineBuiltIn = require_define_built_in();
var defineGlobalProperty = require_define_global_property();
var copyConstructorProperties = require_copy_constructor_properties();
var isForced = require_is_forced();
module2.exports = function(options, source) {
var TARGET = options.target;
var GLOBAL = options.global;
var STATIC = options.stat;
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
if (GLOBAL) {
target = globalThis2;
} else if (STATIC) {
target = globalThis2[TARGET] || defineGlobalProperty(TARGET, {});
} else {
target = globalThis2[TARGET] && globalThis2[TARGET].prototype;
}
if (target) for (key in source) {
sourceProperty = source[key];
if (options.dontCallGetSet) {
descriptor = getOwnPropertyDescriptor(target, key);
targetProperty = descriptor && descriptor.value;
} else targetProperty = target[key];
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced);
if (!FORCED && targetProperty !== void 0) {
if (typeof sourceProperty == typeof targetProperty) continue;
copyConstructorProperties(sourceProperty, targetProperty);
}
if (options.sham || targetProperty && targetProperty.sham) {
return result;
createNonEnumerableProperty(sourceProperty, "sham", true);
}
function getNextVisibleSibling(node) {
let currentNode = node;
// Use loops rather than recursion for better performance
while (true) {
const candidate = currentNode.nextSibling;
if (candidate === null) {
const parent = currentNode.parentElement;
if (parent === null) {
// Parent is Document, so no visible sibling
return null;
}
// Bubble up to its parent and get its sibling
currentNode = parent;
continue;
}
if (!(candidate instanceof HTMLElement || candidate instanceof Text)) {
// Comments, SVGs, etc.: get its sibling as result
currentNode = candidate;
continue;
}
if (candidate instanceof HTMLElement) {
if (!isVisible(candidate)) {
// Invisible: recursively get this element's next sibling
currentNode = candidate;
continue;
}
if (!isInlineHTMLElement(candidate)) {
// Next sibling is not inline (at next line), so no siblings
return null;
}
}
if (candidate instanceof Text && candidate.data.trim() === '') {
// Skip empty Text nodes (e.g. line breaks)
currentNode = candidate;
continue;
}
return candidate;
}
defineBuiltIn(target, key, sourceProperty, options);
}
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/map-helpers.js
var require_map_helpers = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/map-helpers.js"(exports, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var MapPrototype = Map.prototype;
module2.exports = {
// eslint-disable-next-line es/no-map -- safe
Map,
set: uncurryThis(MapPrototype.set),
get: uncurryThis(MapPrototype.get),
has: uncurryThis(MapPrototype.has),
remove: uncurryThis(MapPrototype["delete"]),
proto: MapPrototype
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/es.map.get-or-insert.js
var require_es_map_get_or_insert = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/es.map.get-or-insert.js"() {
"use strict";
var $2 = require_export();
var MapHelpers = require_map_helpers();
var IS_PURE = require_is_pure();
var get = MapHelpers.get;
var has = MapHelpers.has;
var set = MapHelpers.set;
$2({ target: "Map", proto: true, real: true, forced: IS_PURE }, {
getOrInsert: function getOrInsert(key, value) {
if (has(this, key)) return get(this, key);
set(this, key, value);
return value;
}
});
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/es.map.get-or-insert-computed.js
var require_es_map_get_or_insert_computed = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/es.map.get-or-insert-computed.js"() {
"use strict";
var $2 = require_export();
var aCallable = require_a_callable();
var MapHelpers = require_map_helpers();
var IS_PURE = require_is_pure();
var get = MapHelpers.get;
var has = MapHelpers.has;
var set = MapHelpers.set;
$2({ target: "Map", proto: true, real: true, forced: IS_PURE }, {
getOrInsertComputed: function getOrInsertComputed(key, callbackfn) {
var hasKey = has(this, key);
aCallable(callbackfn);
if (hasKey) return get(this, key);
if (key === 0 && 1 / key === -Infinity) key = 0;
var value = callbackfn(key);
set(this, key, value);
return value;
}
});
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/weak-map-helpers.js
var require_weak_map_helpers = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/weak-map-helpers.js"(exports, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var WeakMapPrototype = WeakMap.prototype;
module2.exports = {
// eslint-disable-next-line es/no-weak-map -- safe
WeakMap,
set: uncurryThis(WeakMapPrototype.set),
get: uncurryThis(WeakMapPrototype.get),
has: uncurryThis(WeakMapPrototype.has),
remove: uncurryThis(WeakMapPrototype["delete"])
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/es.weak-map.get-or-insert.js
var require_es_weak_map_get_or_insert = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/es.weak-map.get-or-insert.js"() {
"use strict";
var $2 = require_export();
var WeakMapHelpers = require_weak_map_helpers();
var IS_PURE = require_is_pure();
var get = WeakMapHelpers.get;
var has = WeakMapHelpers.has;
var set = WeakMapHelpers.set;
$2({ target: "WeakMap", proto: true, real: true, forced: IS_PURE }, {
getOrInsert: function getOrInsert(key, value) {
if (has(this, key)) return get(this, key);
set(this, key, value);
return value;
}
});
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/a-weak-map.js
var require_a_weak_map = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/a-weak-map.js"(exports, module2) {
"use strict";
var has = require_weak_map_helpers().has;
module2.exports = function(it) {
has(it);
return it;
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/a-weak-key.js
var require_a_weak_key = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/internals/a-weak-key.js"(exports, module2) {
"use strict";
var WeakMapHelpers = require_weak_map_helpers();
var weakmap = new WeakMapHelpers.WeakMap();
var set = WeakMapHelpers.set;
var remove = WeakMapHelpers.remove;
module2.exports = function(key) {
set(weakmap, key, 1);
remove(weakmap, key);
return key;
};
}
});
 
// node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/es.weak-map.get-or-insert-computed.js
var require_es_weak_map_get_or_insert_computed = __commonJS({
"node_modules/.pnpm/core-js@3.49.0/node_modules/core-js/modules/es.weak-map.get-or-insert-computed.js"() {
"use strict";
var $2 = require_export();
var aCallable = require_a_callable();
var aWeakMap = require_a_weak_map();
var aWeakKey = require_a_weak_key();
var WeakMapHelpers = require_weak_map_helpers();
var IS_PURE = require_is_pure();
var get = WeakMapHelpers.get;
var has = WeakMapHelpers.has;
var set = WeakMapHelpers.set;
var FORCED = IS_PURE || !(function() {
try {
if (WeakMap.prototype.getOrInsertComputed) (/* @__PURE__ */ new WeakMap()).getOrInsertComputed(1, function() {
throw 1;
});
} catch (error) {
return error instanceof TypeError;
}
})();
$2({ target: "WeakMap", proto: true, real: true, forced: FORCED }, {
getOrInsertComputed: function getOrInsertComputed(key, callbackfn) {
if (!IS_PURE) aWeakMap(this);
aWeakKey(key);
aCallable(callbackfn);
if (has(this, key)) return get(this, key);
var value = callbackfn(key);
set(this, key, value);
return value;
}
});
}
});
 
// dist/TextSpacing/TextSpacing.js
//! src/TextSpacing/modules/util.ts
require_es_map_get_or_insert();
require_es_map_get_or_insert_computed();
require_es_weak_map_get_or_insert();
require_es_weak_map_get_or_insert_computed();
var _templateObject;
var _templateObject2;
var _templateObject3;
function _taggedTemplateLiteral(e, t) {
return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } }));
}
function _createForOfIteratorHelper(r, e) {
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (!t) {
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
t && (r = t);
var n = 0, F = function() {
};
return { s: F, n: function() {
return n >= r.length ? { done: true } : { done: false, value: r[n++] };
}, e: function(r2) {
throw r2;
}, 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.");
function createSpacingWrapper(str) {
}
const span = document.createElement('span');
var o, a = true, span.classNameu = WRAPPER_CLASSfalse;
return { s: function() {
span.textContent = str.slice(-1);
t = return [strt.slicecall(0, -1r), span];
}, n: function() {
var r2 = t.next();
return a = r2.done, r2;
}, e: function(r2) {
u = true, o = r2;
}, f: function() {
try {
a || null == t.return || t.return();
} finally {
if (u) throw o;
}
} };
function adjustSpacing(element) {
}
var _a;
function _unsupportedIterableToArray(r, a) {
// Freeze NodeList in advance
if (r) {
const childNodes = [...element.childNodes];
if ("string" == typeof r) return _arrayLikeToArray(r, a);
const textSpacingPosMap = new Map();
var t = {}.toString.call(r).slice(8, -1);
for (const child of childNodes) {
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
if (!(child instanceof Text)) {
}
continue;
}
}
function _arrayLikeToArray(r, a) {
const nextSibling = getNextVisibleSibling(child);
(null == a || a > r.length) && let testString(a = getNodeText(childr.length);
for (var e = 0, n = Array(a); e < ifa; (nextSiblinge++) !==n[e] null)= {r[e];
return n;
// Append first character to detect script intersection
}
testString += (_a = getNodeText(nextSibling)[0]) !== null && _a !== void 0 ? _a : '';
var import_ext_gadget = require("ext.gadget.Util");
}
var isInlineHTMLElement = (node) => {
const indexes = [];
return node instanceof HTMLElement && window.getComputedStyle(node).display.includes("inline");
// Global regexps are stateful so do initialization in each loop
};
const regexTextNodeData = new RegExp(REGEX_STR_INTER_SCRIPT, 'g');
var isTextNode = (node) => {
while (true) {
return node.nodeType === Node.TEXT_NODE;
const match = regexTextNodeData.exec(testString);
};
if (match === null) {
var isVisible = (element) => {
break;
const style = window.getComputedStyle(element);
}
return style.display !== "none" && !["hidden", "collapse"].includes(style.visibility) && Number.parseFloat(style.opacity) > 0;
indexes.push(match.index + 1); // +1 to match script boundary
};
}
var getNodeText = (node) => {
if (indexes.length === 0) {
return node instanceof HTMLElement ? node.innerText : node.data;
// Optimization: skip further steps
};
// Also prevent unnecessary mutation, which will be detected by MutationObserver,
var splitAtIndexes = (str, indexes) => {
// resulting in infinite loops
const result = [];
continue;
const normalizedIndexes = [
}
// Remove duplications and sort in ascending order
textSpacingPosMap.set(child, indexes);
...(0, import_ext_gadget.uniqueArray)(
// Replace Set with uniqueArray, avoiding core-js polyfilling
indexes.sort((a, b) => {
return a - b;
}).filter((i) => {
return i >= 0 && i <= str.length;
})
),
str.length
];
for (let i = 0; i < normalizedIndexes.length; i++) {
const slice = str.slice(normalizedIndexes[i - 1], normalizedIndexes[i]);
result[result.length] = slice;
}
return result;
};
//! src/TextSpacing/modules/queue.ts
var pendingActions = /* @__PURE__ */ new WeakMap();
var onIntersection = (entries) => {
var _iterator = _createForOfIteratorHelper(entries), _step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done; ) {
const entry = _step.value;
if (!entry.isIntersecting) {
continue;
}
const element = entry.target;
observer.unobserve(element);
const callbacks = pendingActions.get(element);
if (!callbacks) {
continue;
}
while (true) {
const callback = callbacks.shift();
if (!callback) {
break;
}
callback(element);
// Schedule DOM mutation to prevent forced reflows
}
queueDomMutation(element, () => {
}
for (const [node, indexes] of textSpacingPosMap) {
} catch (err) {
const text = node.data;
_iterator.e(err);
const fragments = splitAtIndexes(text, indexes);
} finally {
const replacement = fragments
_iterator.slicef(0, -1);
}
.flatMap((fragment) => createSpacingWrapper(fragment));
};
replacement.push(fragments.slice(-1)[0]);
var observer = new IntersectionObserver(onIntersection);
// Optimization: prevent forced reflows
var queueDomMutation = (element, callback) => {
requestAnimationFrame(() => {
if (!pendingActions.has(element)) {
node.replaceWith(...replacement);
pendingActions.set(element, []);
});
}
if (pendingActions.get(element) !== void 0) {
pendingActions.get(element)[pendingActions.get(element).length] = callback;
}
observer.observe(element);
};
//! src/TextSpacing/modules/spacing.ts
var REGEX_RANGE_CHINESE = String.raw(_templateObject || (_templateObject = _taggedTemplateLiteral(["(?:[⺀-⺙⺛-⻳⼀-⿕々〇〡-〩〸-〻㐀-䶿一-鿿豈-舘並-龎]|\uD81B[\uDFE2\uDFE3\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])"], ["(?:[\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u3005\\u3007\\u3021-\\u3029\\u3038-\\u303B\\u3400-\\u4DBF\\u4E00-\\u9FFF\\uF900-\\uFA6D\\uFA70-\\uFAD9]|\\uD81B[\\uDFE2\\uDFE3\\uDFF0\\uDFF1]|[\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883][\\uDC00-\\uDFFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF38\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A])"])));
var REGEX_RANGE_OTHER_LEFT = String.raw(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["[A-Za-z0-9@~%+=|±)}#$¥€£₤]"], ["[A-Za-z0-9@~%+=|±\\)}#$¥€£₤]"])));
var REGEX_RANGE_OTHER_RIGHT = String.raw(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["[A-Za-z0-9@~%+=|±({#$¥€£₤]"], ["[A-Za-z0-9@~%+=|±\\({#$¥€£₤]"])));
var REGEX_STR_INTER_SCRIPT = "(?:(".concat(REGEX_RANGE_CHINESE, ")(?=").concat(REGEX_RANGE_OTHER_RIGHT, ")|(").concat(REGEX_RANGE_OTHER_LEFT, ")(?=").concat(REGEX_RANGE_CHINESE, "))");
var SPACE = " ";
var WRAPPER_CLASS = "gadget-text_spacing";
var SELECTOR_ALLOWED = ["a", "abbr", "article", "aside", "b", "bdi", "big", "blockquote", "button", "caption", "center", "cite", "data", "dd", "del", "details", "dfn", "div", "dt", "em", "figcaption", "footer", "h1", "h2", "h3", "h4", "h5", "header", "i", "ins", "label", "legend", "li", "main", "mark", "option", "p", "q", "ruby", "s", "section", "small", "span", "strike", "strong", "sub", "summary", "sup", "td", "th", "time", "u"];
var SELECTOR_BLOCKED = [
"code",
"kbd",
"pre",
"rp",
"rt",
"samp",
"textarea",
"var",
// Elements with this class are excluded
".gadget-nospace",
// Editable elements
'[contenteditable="true"]',
// ACE editor content
".ace_editor",
// Visual Editor (and 2017 Wikitext Editor) content & diff
".ve-ui-surface",
".ve-init-mw-diffPage-diff",
// Diff
".diff-context",
".diff-addedline",
".diff-deletedline",
// Diff (inline mode)
".mw-diff-inline-added",
".mw-diff-inline-deleted",
".mw-diff-inline-moved",
".mw-diff-inline-changed",
".mw-diff-inline-context"
];
var SELECTOR = SELECTOR_ALLOWED.map((allowed) => {
return "".concat(allowed, ":not(").concat(SELECTOR_BLOCKED.flatMap((blocked) => {
return blocked[0].match(/[a-z]/i) ? "".concat(blocked, " *") : [blocked, "".concat(blocked, " *")];
}).join(","), ")");
}).join(",");
var getLeafElements = (parent) => {
const candidates = parent.querySelectorAll(SELECTOR);
const result = [];
if (parent.matches(SELECTOR)) {
result[result.length] = parent;
}
var _iterator2 = _createForOfIteratorHelper(candidates), _step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
const candidate = _step2.value;
var _iterator3 = _createForOfIteratorHelper(candidate.childNodes), _step3;
try {
for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
const childNode = _step3.value;
if (isTextNode(childNode)) {
result[result.length] = candidate;
break;
}
}
} catch (err) {
_iterator3.e(err);
} finally {
_iterator3.f();
}
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
return result;
};
var getNextVisibleSibling = (node) => {
let currentNode = node;
while (true) {
const candidate = currentNode.nextSibling;
if (!candidate) {
const parent = currentNode.parentElement;
if (!parent) {
return null;
}
currentNode = parent;
continue;
}
if (!(candidate instanceof HTMLElement || candidate instanceof Text)) {
currentNode = candidate;
continue;
}
if (candidate instanceof HTMLElement) {
if (!isVisible(candidate)) {
currentNode = candidate;
continue;
}
if (!isInlineHTMLElement(candidate)) {
return null;
}
}
if (candidate instanceof Text && !candidate.data.trim()) {
currentNode = candidate;
continue;
}
return candidate;
}
};
var createSpacingWrapper = (str) => {
const span = document.createElement("span");
span.className = WRAPPER_CLASS;
span.textContent = str.slice(-1);
return [str.slice(0, -1), span];
};
var adjustSpacing = (element) => {
const childNodes = [...element.childNodes];
const textSpacingPosMap = /* @__PURE__ */ new Map();
for (var _i = 0, _childNodes = childNodes; _i < _childNodes.length; _i++) {
const child = _childNodes[_i];
if (!(child instanceof Text)) {
continue;
}
const nextSibling = getNextVisibleSibling(child);
let testString = getNodeText(child);
if (nextSibling) {
var _getNodeText$;
testString += (_getNodeText$ = getNodeText(nextSibling)[0]) !== null && _getNodeText$ !== void 0 ? _getNodeText$ : "";
}
const indexes = [];
const regexTextNodeData = new RegExp(REGEX_STR_INTER_SCRIPT, "g");
while (true) {
const match = regexTextNodeData.exec(testString);
if (!match) {
break;
}
indexes[indexes.length] = match.index + 1;
}
if (!indexes.length) {
continue;
}
textSpacingPosMap.set(child, indexes);
}
queueDomMutation(element, () => {
var _iterator4 = _createForOfIteratorHelper(textSpacingPosMap), _step4;
try {
for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
const [node, indexes] = _step4.value;
const text = node.data;
const fragments = splitAtIndexes(text, indexes);
const replacement = fragments.slice(0, -1).flatMap((fragment) => {
return createSpacingWrapper(fragment);
});
replacement[replacement.length] = fragments.at(-1);
requestAnimationFrame(() => {
node.replaceWith(...replacement);
});
}
} catch (err) {
_iterator4.e(err);
} finally {
_iterator4.f();
}
});
function addSpaceToString(str) {
};
const regex = new RegExp(REGEX_STR_INTER_SCRIPT, 'g');
var addSpaceToString = (str) => {
return str.replace(regex, `$1$2${SPACE}`);
const regex = new RegExp(REGEX_STR_INTER_SCRIPT, "g");
return str.replace(regex, "$1$2".concat(SPACE));
};
//! src/TextSpacing/modules/supportsTextAutospace.ts
var supportsTextAutospace = () => {
if (typeof CSS !== "undefined" && typeof CSS.supports === "function") {
if (CSS.supports("text-autospace", "normal")) {
return true;
}
return false;
 
}
function run(element) {
return false;
const leaves = getLeafElements(element);
};
for (const leaf of leaves) {
//! src/TextSpacing/TextSpacing.ts
adjustSpacing(leaf);
var run = (element) => {
}
const leaves = getLeafElements(element);
var _iterator5 = _createForOfIteratorHelper(leaves), _step5;
try {
for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) {
const leaf = _step5.value;
adjustSpacing(leaf);
}
} catch (err) {
const mutationObserver = new MutationObserver((records) => {
_iterator5.e(err);
for (const record of records) {
} finally {
if (record.type !== 'childList') {
_iterator5.f();
continue;
}
};
const nodes = [...record.addedNodes];
var mutationObserver = new MutationObserver((records) => {
// Exclude mutations caused by adjustSpacing() to prevent infinite loops
var _iterator6 = _createForOfIteratorHelper(records), _step6;
// Typically they will contain nodes with class WRAPPER_CLASS
try {
if (nodes.some((node) => node instanceof HTMLElement && node.classList.contains(WRAPPER_CLASS))) {
for (_iterator6.s(); !(_step6 = _iterator6.n()).done; ) {
continue;
const record = }_step6.value;
forif (const noderecord.type of!== nodes"childList") {
continue;
if (node instanceof HTMLElement) {
}
run(node);
const addedNodes = [...record.addedNodes];
}
else if (addedNodes.some((node) instanceof Text)=> {
return node instanceof HTMLElement && node.classList.contains(WRAPPER_CLASS);
const { parentElement } = node;
})) {
if (parentElement !== null) {
run(parentElement)continue;
}
for (var _i2 = 0, _addedNodes = addedNodes; _i2 < _addedNodes.length; _i2++) {
}
const node = }_addedNodes[_i2];
if (node instanceof HTMLElement) {
run(node);
} else if (node instanceof Text) {
const {
parentElement
} = node;
if (parentElement) {
run(parentElement);
}
}
});
function main() {
document.title = addSpaceToString(document.title);
// Watch for added nodes
mutationObserver.observe(document.body, { subtree: true, childList: true });
run(document.body);
}
} catch $(mainerr); {
_iterator6.e(err);
} finally {
_iterator6.f();
}
});
var main = () => {
document.title = addSpaceToString(document.title);
const output = document.querySelector(".mw-parser-output");
if (!output) {
return;
}
mutationObserver.observe(output, {
subtree: true,
childList: true
});
run(output);
};
if (supportsTextAutospace()) {
console.info("[TextSpacing] text-autospace is supported natively; no need to run the script.");
} else {
$(main);
}
 
})();
 
// </nowiki>
/* </nowiki> */